go-xcel-interpret 1.1.0

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.
Files changed (38) hide show
  1. package/dist/go-xcel-interpret.cjs +839 -0
  2. package/dist/go-xcel-interpret.css +59 -0
  3. package/dist/go-xcel-interpret.esm.mjs +63430 -0
  4. package/dist/go-xcel-interpret.umd.js +839 -0
  5. package/dist/src/components/BodyCssVar.d.ts +5 -0
  6. package/dist/src/components/GoXcelInterpret.d.ts +4 -0
  7. package/dist/src/components/constants.d.ts +1 -0
  8. package/dist/src/components/interpret/InterpretForm.d.ts +2 -0
  9. package/dist/src/components/interpret/InterpretTable.d.ts +2 -0
  10. package/dist/src/components/interpret/TabsInterpret.d.ts +24 -0
  11. package/dist/src/components/interpret/interpret.d.ts +14 -0
  12. package/dist/src/components/ui/Card.d.ts +7 -0
  13. package/dist/src/components/ui/Form.d.ts +23 -0
  14. package/dist/src/components/ui/FormOptions.d.ts +14 -0
  15. package/dist/src/components/ui/Layout.d.ts +19 -0
  16. package/dist/src/components/ui/Loading.d.ts +9 -0
  17. package/dist/src/components/ui/Tabs.d.ts +19 -0
  18. package/dist/src/components/ui/Typography.d.ts +25 -0
  19. package/dist/src/components/ui/form/Checkbox.d.ts +23 -0
  20. package/dist/src/components/ui/form/DatePicker.d.ts +15 -0
  21. package/dist/src/components/ui/form/Input.d.ts +21 -0
  22. package/dist/src/components/ui/form/InputNumber.d.ts +19 -0
  23. package/dist/src/components/ui/form/Radio.d.ts +30 -0
  24. package/dist/src/components/ui/form/Select.d.ts +18 -0
  25. package/dist/src/error.d.ts +5 -0
  26. package/dist/src/hook/useBounce.d.ts +1 -0
  27. package/dist/src/hook/useTemplateTabs.d.ts +12 -0
  28. package/dist/src/index.d.ts +2 -0
  29. package/dist/src/services.d.ts +11 -0
  30. package/dist/src/types/config.d.ts +62 -0
  31. package/dist/src/types/index.d.ts +3 -0
  32. package/dist/src/types/services.d.ts +6 -0
  33. package/dist/src/types/template.d.ts +75 -0
  34. package/dist/src/utils/base64.d.ts +7 -0
  35. package/dist/src/utils/theme.d.ts +8 -0
  36. package/dist/src/utils/websocket.d.ts +9 -0
  37. package/dist/vite.config.d.ts +2 -0
  38. package/package.json +63 -0
@@ -0,0 +1,839 @@
1
+ (function(an,ne){typeof exports=="object"&&typeof module<"u"?ne(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],ne):(an=typeof globalThis<"u"?globalThis:an||self,ne(an.GoXcelInterpret={},an.React,an.ReactDOM))})(this,function(an,ne,Ds){"use strict";var Jge=Object.defineProperty;var Qge=(an,ne,Ds)=>ne in an?Jge(an,ne,{enumerable:!0,configurable:!0,writable:!0,value:Ds}):an[ne]=Ds;var EB=(an,ne,Ds)=>Qge(an,typeof ne!="symbol"?ne+"":ne,Ds);var UM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zM(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Af={exports:{}},zc={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var YM;function _B(){if(YM)return zc;YM=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var a in i)a!=="key"&&(o[a]=i[a])}else o=i;return i=o.ref,{$$typeof:t,type:n,key:s,ref:i!==void 0?i:null,props:o}}return zc.Fragment=e,zc.jsx=r,zc.jsxs=r,zc}var Yc={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var GM;function MB(){return GM||(GM=1,process.env.NODE_ENV!=="production"&&function(){function t(z){if(z==null)return null;if(typeof z=="function")return z.$$typeof===A?null:z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case w:return"Fragment";case b:return"Profiler";case v:return"StrictMode";case T:return"Suspense";case M:return"SuspenseList";case j:return"Activity"}if(typeof z=="object")switch(typeof z.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),z.$$typeof){case g:return"Portal";case _:return(z.displayName||"Context")+".Provider";case p:return(z._context.displayName||"Context")+".Consumer";case O:var $=z.render;return z=z.displayName,z||(z=$.displayName||$.name||"",z=z!==""?"ForwardRef("+z+")":"ForwardRef"),z;case P:return $=z.displayName||null,$!==null?$:t(z.type)||"Memo";case G:$=z._payload,z=z._init;try{return t(z($))}catch{}}return null}function e(z){return""+z}function r(z){try{e(z);var $=!1}catch{$=!0}if($){$=console;var m=$.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&z[Symbol.toStringTag]||z.constructor.name||"Object";return m.call($,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),e(z)}}function n(z){if(z===w)return"<>";if(typeof z=="object"&&z!==null&&z.$$typeof===G)return"<...>";try{var $=t(z);return $?"<"+$+">":"<...>"}catch{return"<...>"}}function i(){var z=q.A;return z===null?null:z.getOwner()}function o(){return Error("react-stack-top-frame")}function s(z){if(Q.call(z,"key")){var $=Object.getOwnPropertyDescriptor(z,"key").get;if($&&$.isReactWarning)return!1}return z.key!==void 0}function a(z,$){function m(){Z||(Z=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",$))}m.isReactWarning=!0,Object.defineProperty(z,"key",{get:m,configurable:!0})}function l(){var z=t(this.type);return ie[z]||(ie[z]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),z=this.props.ref,z!==void 0?z:null}function u(z,$,m,C,y,I,x,N){return m=I.ref,z={$$typeof:f,type:z,key:$,props:I,_owner:y},(m!==void 0?m:null)!==null?Object.defineProperty(z,"ref",{enumerable:!1,get:l}):Object.defineProperty(z,"ref",{enumerable:!1,value:null}),z._store={},Object.defineProperty(z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(z,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(z,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:x}),Object.defineProperty(z,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:N}),Object.freeze&&(Object.freeze(z.props),Object.freeze(z)),z}function c(z,$,m,C,y,I,x,N){var B=$.children;if(B!==void 0)if(C)if(ue(B)){for(C=0;C<B.length;C++)h(B[C]);Object.freeze&&Object.freeze(B)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(B);if(Q.call($,"key")){B=t(z);var Y=Object.keys($).filter(function(E){return E!=="key"});C=0<Y.length?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}",ae[B+C]||(Y=0<Y.length?"{"+Y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ let props = %s;
19
+ <%s {...props} />
20
+ React keys must be passed directly to JSX without using spread:
21
+ let props = %s;
22
+ <%s key={someKey} {...props} />`,C,B,Y,B),ae[B+C]=!0)}if(B=null,m!==void 0&&(r(m),B=""+m),s($)&&(r($.key),B=""+$.key),"key"in $){m={};for(var R in $)R!=="key"&&(m[R]=$[R])}else m=$;return B&&a(m,typeof z=="function"?z.displayName||z.name||"Unknown":z),u(z,B,I,y,i(),m,x,N)}function h(z){typeof z=="object"&&z!==null&&z.$$typeof===f&&z._store&&(z._store.validated=1)}var d=ne,f=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),_=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),q=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=Object.prototype.hasOwnProperty,ue=Array.isArray,J=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(z){return z()}};var Z,ie={},ee=d["react-stack-bottom-frame"].bind(d,o)(),te=J(n(o)),ae={};Yc.Fragment=w,Yc.jsx=function(z,$,m,C,y){var I=1e4>q.recentlyCreatedOwnerStacks++;return c(z,$,m,!1,C,y,I?Error("react-stack-top-frame"):ee,I?J(n(z)):te)},Yc.jsxs=function(z,$,m,C,y){var I=1e4>q.recentlyCreatedOwnerStacks++;return c(z,$,m,!0,C,y,I?Error("react-stack-top-frame"):ee,I?J(n(z)):te)}}()),Yc}var qM;function PB(){return qM||(qM=1,process.env.NODE_ENV==="production"?Af.exports=_B():Af.exports=MB()),Af.exports}var he=PB(),rv={},In={},nv={},KM;function Ki(){return KM||(KM=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isEventSourceSupported=t.isReactNative=t.ReadyState=t.DEFAULT_HEARTBEAT=t.UNPARSABLE_JSON_OBJECT=t.DEFAULT_RECONNECT_INTERVAL_MS=t.DEFAULT_RECONNECT_LIMIT=t.SOCKET_IO_PING_CODE=t.SOCKET_IO_PATH=t.SOCKET_IO_PING_INTERVAL=t.DEFAULT_EVENT_SOURCE_OPTIONS=t.EMPTY_EVENT_HANDLERS=t.DEFAULT_OPTIONS=void 0;var e=1,r=1e3*e;t.DEFAULT_OPTIONS={},t.EMPTY_EVENT_HANDLERS={},t.DEFAULT_EVENT_SOURCE_OPTIONS={withCredentials:!1,events:t.EMPTY_EVENT_HANDLERS},t.SOCKET_IO_PING_INTERVAL=25*r,t.SOCKET_IO_PATH="/socket.io/?EIO=3&transport=websocket",t.SOCKET_IO_PING_CODE="2",t.DEFAULT_RECONNECT_LIMIT=20,t.DEFAULT_RECONNECT_INTERVAL_MS=5e3,t.UNPARSABLE_JSON_OBJECT={},t.DEFAULT_HEARTBEAT={message:"ping",timeout:6e4,interval:25e3};var n;(function(o){o[o.UNINSTANTIATED=-1]="UNINSTANTIATED",o[o.CONNECTING=0]="CONNECTING",o[o.OPEN=1]="OPEN",o[o.CLOSING=2]="CLOSING",o[o.CLOSED=3]="CLOSED"})(n||(t.ReadyState=n={}));var i=function(){try{return"EventSource"in globalThis}catch{return!1}};t.isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative",t.isEventSourceSupported=!t.isReactNative&&i()}(nv)),nv}var Gc={},iv={},XM;function ov(){return XM||(XM=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.resetWebSockets=t.sharedWebSockets=void 0,t.sharedWebSockets={};var e=function(r){if(r&&t.sharedWebSockets.hasOwnProperty(r))delete t.sharedWebSockets[r];else for(var n in t.sharedWebSockets)t.sharedWebSockets.hasOwnProperty(n)&&delete t.sharedWebSockets[n]};t.resetWebSockets=e}(iv)),iv}var Ia={},ko={},ZM;function sv(){if(ZM)return ko;ZM=1,Object.defineProperty(ko,"__esModule",{value:!0}),ko.setUpSocketIOPing=ko.appendQueryParams=ko.parseSocketIOUrl=void 0;var t=Ki(),e=function(i){if(i){var o=/^https|wss/.test(i),s=i.replace(/^(https?|wss?)(:\/\/)?/,""),a=s.replace(/\/$/,""),l=o?"wss":"ws";return"".concat(l,"://").concat(a).concat(t.SOCKET_IO_PATH)}else if(i===""){var o=/^https/.test(window.location.protocol),l=o?"wss":"ws",u=window.location.port?":".concat(window.location.port):"";return"".concat(l,"://").concat(window.location.hostname).concat(u).concat(t.SOCKET_IO_PATH)}return i};ko.parseSocketIOUrl=e;var r=function(i,o){o===void 0&&(o={});var s=/\?([\w]+=[\w]+)/,a=s.test(i),l="".concat(Object.entries(o).reduce(function(u,c){var h=c[0],d=c[1];return u+"".concat(h,"=").concat(d,"&")},"").slice(0,-1));return"".concat(i).concat(a?"&":"?").concat(l)};ko.appendQueryParams=r;var n=function(i,o){o===void 0&&(o=t.SOCKET_IO_PING_INTERVAL);var s=function(){return i(t.SOCKET_IO_PING_CODE)};return window.setInterval(s,o)};return ko.setUpSocketIOPing=n,ko}var Hf={},JM;function QM(){if(JM)return Hf;JM=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.heartbeat=r;var t=Ki();function e(n){return Array.isArray(n)?n.reduce(function(i,o){return i.current>o.current?i:o}).current:n.current}function r(n,i,o){var s=o||{},a=s.interval,l=a===void 0?t.DEFAULT_HEARTBEAT.interval:a,u=s.timeout,c=u===void 0?t.DEFAULT_HEARTBEAT.timeout:u,h=s.message,d=h===void 0?t.DEFAULT_HEARTBEAT.message:h,f=Math.max(100,l/10),g=Date.now(),w=setInterval(function(){var v=Date.now(),b=e(i);if(b+c<=v)console.warn("Heartbeat timed out, closing connection, last message received ".concat(v-b,"ms ago, last ping sent ").concat(v-g,"ms ago")),n.close();else if(b+l<=v&&g+l<=v)try{typeof d=="function"?n.send(d()):n.send(d),g=v}catch(p){console.error("Heartbeat failed, closing connection",p instanceof Error?p.message:p),n.close()}},f);return n.addEventListener("close",function(){clearInterval(w)}),function(){}}return Hf}var qc={},av={},eP;function lv(){return eP||(eP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.resetSubscribers=t.removeSubscriber=t.addSubscriber=t.hasSubscribers=t.getSubscribers=void 0;var e={},r=[],n=function(l){return(0,t.hasSubscribers)(l)?Array.from(e[l]):r};t.getSubscribers=n;var i=function(l){var u;return((u=e[l])===null||u===void 0?void 0:u.size)>0};t.hasSubscribers=i;var o=function(l,u){e[l]=e[l]||new Set,e[l].add(u)};t.addSubscriber=o;var s=function(l,u){e[l].delete(u)};t.removeSubscriber=s;var a=function(l){if(l&&e.hasOwnProperty(l))delete e[l];else for(var u in e)e.hasOwnProperty(u)&&delete e[u]};t.resetSubscribers=a}(av)),av}var tP;function uv(){if(tP)return qc;tP=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.assertIsWebSocket=r,qc.resetGlobalState=n;var t=ov(),e=lv();function r(i,o){if(!o&&!(i instanceof WebSocket))throw new Error("")}function n(i){(0,e.resetSubscribers)(i),(0,t.resetWebSockets)(i)}return qc}var rP;function IB(){if(rP)return Ia;rP=1;var t=Ia&&Ia.__assign||function(){return t=Object.assign||function(c){for(var h,d=1,f=arguments.length;d<f;d++){h=arguments[d];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&(c[g]=h[g])}return c},t.apply(this,arguments)};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.attachListeners=void 0;var e=sv(),r=QM(),n=Ki(),i=uv(),o=function(c,h,d,f){c.onmessage=function(g){var w;h.current.onMessage&&h.current.onMessage(g),typeof(f==null?void 0:f.current)=="number"&&(f.current=Date.now()),!(typeof h.current.filter=="function"&&h.current.filter(g)!==!0)&&(h.current.heartbeat&&typeof h.current.heartbeat!="boolean"&&((w=h.current.heartbeat)===null||w===void 0?void 0:w.returnMessage)===g.data||d(g))}},s=function(c,h,d,f,g){c.onopen=function(w){if(h.current.onOpen&&h.current.onOpen(w),f.current=0,d(n.ReadyState.OPEN),h.current.heartbeat&&c instanceof WebSocket){var v=typeof h.current.heartbeat=="boolean"?void 0:h.current.heartbeat;g.current=Date.now(),(0,r.heartbeat)(c,g,v)}}},a=function(c,h,d,f,g){if(n.isEventSourceSupported&&c instanceof EventSource)return function(){};(0,i.assertIsWebSocket)(c,h.current.skipAssert);var w;return c.onclose=function(v){var b;if(h.current.onClose&&h.current.onClose(v),d(n.ReadyState.CLOSED),h.current.shouldReconnect&&h.current.shouldReconnect(v)){var p=(b=h.current.reconnectAttempts)!==null&&b!==void 0?b:n.DEFAULT_RECONNECT_LIMIT;if(g.current<p){var _=typeof h.current.reconnectInterval=="function"?h.current.reconnectInterval(g.current):h.current.reconnectInterval;w=window.setTimeout(function(){g.current++,f()},_??n.DEFAULT_RECONNECT_INTERVAL_MS)}else h.current.onReconnectStop&&h.current.onReconnectStop(p),console.warn("Max reconnect attempts of ".concat(p," exceeded"))}},function(){return w&&window.clearTimeout(w)}},l=function(c,h,d,f,g){var w;return c.onerror=function(v){var b;if(h.current.onError&&h.current.onError(v),n.isEventSourceSupported&&c instanceof EventSource&&(h.current.onClose&&h.current.onClose(t(t({},v),{code:1006,reason:"An error occurred with the EventSource: ".concat(v),wasClean:!1})),d(n.ReadyState.CLOSED),c.close()),h.current.retryOnError)if(g.current<((b=h.current.reconnectAttempts)!==null&&b!==void 0?b:n.DEFAULT_RECONNECT_LIMIT)){var p=typeof h.current.reconnectInterval=="function"?h.current.reconnectInterval(g.current):h.current.reconnectInterval;w=window.setTimeout(function(){g.current++,f()},p??n.DEFAULT_RECONNECT_INTERVAL_MS)}else h.current.onReconnectStop&&h.current.onReconnectStop(h.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(h.current.reconnectAttempts," exceeded"))},function(){return w&&window.clearTimeout(w)}},u=function(c,h,d,f,g,w,v){var b=h.setLastMessage,p=h.setReadyState,_,O,T;return d.current.fromSocketIO&&(_=(0,e.setUpSocketIOPing)(v)),o(c,d,b,w),s(c,d,p,g,w),O=a(c,d,p,f,g),T=l(c,d,p,f,g),function(){p(n.ReadyState.CLOSING),O(),T(),c.close(),_&&clearInterval(_)}};return Ia.attachListeners=u,Ia}var Oa={},nP;function OB(){if(nP)return Oa;nP=1;var t=Oa&&Oa.__assign||function(){return t=Object.assign||function(h){for(var d,f=1,g=arguments.length;f<g;f++){d=arguments[f];for(var w in d)Object.prototype.hasOwnProperty.call(d,w)&&(h[w]=d[w])}return h},t.apply(this,arguments)};Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.attachSharedListeners=void 0;var e=ov(),r=Ki(),n=lv(),i=sv(),o=QM(),s=function(h,d,f){h.onmessage=function(g){(0,n.getSubscribers)(d).forEach(function(w){var v;w.optionsRef.current.onMessage&&w.optionsRef.current.onMessage(g),typeof((v=w==null?void 0:w.lastMessageTime)===null||v===void 0?void 0:v.current)=="number"&&(w.lastMessageTime.current=Date.now()),!(typeof w.optionsRef.current.filter=="function"&&w.optionsRef.current.filter(g)!==!0)&&(f&&typeof f!="boolean"&&(f==null?void 0:f.returnMessage)===g.data||w.setLastMessage(g))})}},a=function(h,d,f){h.onopen=function(g){var w=(0,n.getSubscribers)(d);w.forEach(function(v){v.reconnectCount.current=0,v.optionsRef.current.onOpen&&v.optionsRef.current.onOpen(g),v.setReadyState(r.ReadyState.OPEN),f&&h instanceof WebSocket&&(v.lastMessageTime.current=Date.now())}),f&&h instanceof WebSocket&&(0,o.heartbeat)(h,w.map(function(v){return v.lastMessageTime}),typeof f=="boolean"?void 0:f)}},l=function(h,d){h instanceof WebSocket&&(h.onclose=function(f){(0,n.getSubscribers)(d).forEach(function(g){g.optionsRef.current.onClose&&g.optionsRef.current.onClose(f),g.setReadyState(r.ReadyState.CLOSED)}),delete e.sharedWebSockets[d],(0,n.getSubscribers)(d).forEach(function(g){var w;if(g.optionsRef.current.shouldReconnect&&g.optionsRef.current.shouldReconnect(f)){var v=(w=g.optionsRef.current.reconnectAttempts)!==null&&w!==void 0?w:r.DEFAULT_RECONNECT_LIMIT;if(g.reconnectCount.current<v){var b=typeof g.optionsRef.current.reconnectInterval=="function"?g.optionsRef.current.reconnectInterval(g.reconnectCount.current):g.optionsRef.current.reconnectInterval;setTimeout(function(){g.reconnectCount.current++,g.reconnect.current()},b??r.DEFAULT_RECONNECT_INTERVAL_MS)}else g.optionsRef.current.onReconnectStop&&g.optionsRef.current.onReconnectStop(g.optionsRef.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(v," exceeded"))}})})},u=function(h,d){h.onerror=function(f){(0,n.getSubscribers)(d).forEach(function(g){g.optionsRef.current.onError&&g.optionsRef.current.onError(f),r.isEventSourceSupported&&h instanceof EventSource&&(g.optionsRef.current.onClose&&g.optionsRef.current.onClose(t(t({},f),{code:1006,reason:"An error occurred with the EventSource: ".concat(f),wasClean:!1})),g.setReadyState(r.ReadyState.CLOSED))}),r.isEventSourceSupported&&h instanceof EventSource&&h.close()}},c=function(h,d,f,g){var w;return f.current.fromSocketIO&&(w=(0,i.setUpSocketIOPing)(g)),s(h,d,f.current.heartbeat),l(h,d),a(h,d,f.current.heartbeat),u(h,d),function(){w&&clearInterval(w)}};return Oa.attachSharedListeners=c,Oa}var iP;function xB(){if(iP)return Gc;iP=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.createOrJoinSocket=void 0;var t=ov(),e=Ki(),r=IB(),n=OB(),i=lv(),o=function(a,l,u,c,h){return function(){if((0,i.removeSubscriber)(a,l),!(0,i.hasSubscribers)(a)){try{var d=t.sharedWebSockets[a];d instanceof WebSocket&&(d.onclose=function(f){u.current.onClose&&u.current.onClose(f),c(e.ReadyState.CLOSED)}),d.close()}catch{}h&&h(),delete t.sharedWebSockets[a]}}},s=function(a,l,u,c,h,d,f,g,w){if(!e.isEventSourceSupported&&c.current.eventSourceOptions)throw e.isReactNative?new Error("EventSource is not supported in ReactNative"):new Error("EventSource is not supported");if(c.current.share){var v=null;t.sharedWebSockets[l]===void 0?(t.sharedWebSockets[l]=c.current.eventSourceOptions?new EventSource(l,c.current.eventSourceOptions):new WebSocket(l,c.current.protocols),a.current=t.sharedWebSockets[l],u(e.ReadyState.CONNECTING),v=(0,n.attachSharedListeners)(t.sharedWebSockets[l],l,c,w)):(a.current=t.sharedWebSockets[l],u(t.sharedWebSockets[l].readyState));var b={setLastMessage:h,setReadyState:u,optionsRef:c,reconnectCount:f,lastMessageTime:g,reconnect:d};return(0,i.addSubscriber)(l,b),o(l,b,c,u,v)}else{if(a.current=c.current.eventSourceOptions?new EventSource(l,c.current.eventSourceOptions):new WebSocket(l,c.current.protocols),u(e.ReadyState.CONNECTING),!a.current)throw new Error("WebSocket failed to be created");return(0,r.attachListeners)(a.current,{setLastMessage:h,setReadyState:u},c,d.current,f,g,w)}};return Gc.createOrJoinSocket=s,Gc}var Lo={},oP;function AB(){return oP||(oP=1,function(t){var e=Lo&&Lo.__awaiter||function(l,u,c,h){function d(f){return f instanceof c?f:new c(function(g){g(f)})}return new(c||(c=Promise))(function(f,g){function w(p){try{b(h.next(p))}catch(_){g(_)}}function v(p){try{b(h.throw(p))}catch(_){g(_)}}function b(p){p.done?f(p.value):d(p.value).then(w,v)}b((h=h.apply(l,u||[])).next())})},r=Lo&&Lo.__generator||function(l,u){var c={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},h,d,f,g=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return g.next=w(0),g.throw=w(1),g.return=w(2),typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function w(b){return function(p){return v([b,p])}}function v(b){if(h)throw new TypeError("Generator is already executing.");for(;g&&(g=0,b[0]&&(c=0)),c;)try{if(h=1,d&&(f=b[0]&2?d.return:b[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,b[1])).done)return f;switch(d=0,f&&(b=[b[0]&2,f.value]),b[0]){case 0:case 1:f=b;break;case 4:return c.label++,{value:b[1],done:!1};case 5:c.label++,d=b[1],b=[0];continue;case 7:b=c.ops.pop(),c.trys.pop();continue;default:if(f=c.trys,!(f=f.length>0&&f[f.length-1])&&(b[0]===6||b[0]===2)){c=0;continue}if(b[0]===3&&(!f||b[1]>f[0]&&b[1]<f[3])){c.label=b[1];break}if(b[0]===6&&c.label<f[1]){c.label=f[1],f=b;break}if(f&&c.label<f[2]){c.label=f[2],c.ops.push(b);break}f[2]&&c.ops.pop(),c.trys.pop();continue}b=u.call(l,c)}catch(p){b=[6,p],d=0}finally{h=f=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},n=Lo&&Lo.__spreadArray||function(l,u,c){if(c||arguments.length===2)for(var h=0,d=u.length,f;h<d;h++)(f||!(h in u))&&(f||(f=Array.prototype.slice.call(u,0,h)),f[h]=u[h]);return l.concat(f||Array.prototype.slice.call(u))};Object.defineProperty(t,"__esModule",{value:!0}),t.getUrl=void 0;var i=sv(),o=Ki(),s=function(l){return new Promise(function(u){return window.setTimeout(u,l)})},a=function(l,u){for(var c=[],h=2;h<arguments.length;h++)c[h-2]=arguments[h];return e(void 0,n([l,u],c,!0),void 0,function(d,f,g){var w,v,b,p,_,O,T,M;return g===void 0&&(g=0),r(this,function(P){switch(P.label){case 0:if(typeof d!="function")return[3,10];P.label=1;case 1:return P.trys.push([1,3,,9]),[4,d()];case 2:return w=P.sent(),[3,9];case 3:return P.sent(),f.current.retryOnError?(v=(O=f.current.reconnectAttempts)!==null&&O!==void 0?O:o.DEFAULT_RECONNECT_LIMIT,g<v?(b=typeof f.current.reconnectInterval=="function"?f.current.reconnectInterval(g):f.current.reconnectInterval,[4,s(b??o.DEFAULT_RECONNECT_INTERVAL_MS)]):[3,5]):[3,7];case 4:return P.sent(),[2,(0,t.getUrl)(d,f,g+1)];case 5:return(M=(T=f.current).onReconnectStop)===null||M===void 0||M.call(T,g),[2,null];case 6:return[3,8];case 7:return[2,null];case 8:return[3,9];case 9:return[3,11];case 10:w=d,P.label=11;case 11:return p=f.current.fromSocketIO?(0,i.parseSocketIOUrl)(w):w,_=f.current.queryParams?(0,i.appendQueryParams)(p,f.current.queryParams):p,[2,_]}})})};t.getUrl=a}(Lo)),Lo}var cv={},sP;function HB(){return sP||(sP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.websocketWrapper=void 0;var e=function(r,n){return new Proxy(r,{get:function(i,o){var s=i[o];return o==="reconnect"?n:typeof s=="function"?(console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."),function(){}):s},set:function(i,o,s){return/^on/.test(o)?(console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."),!1):(i[o]=s,!0)}})};t.websocketWrapper=e,t.default=t.websocketWrapper}(cv)),cv}var aP;function hv(){if(aP)return In;aP=1;var t=In&&In.__assign||function(){return t=Object.assign||function(d){for(var f,g=1,w=arguments.length;g<w;g++){f=arguments[g];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(d[v]=f[v])}return d},t.apply(this,arguments)},e=In&&In.__awaiter||function(d,f,g,w){function v(b){return b instanceof g?b:new g(function(p){p(b)})}return new(g||(g=Promise))(function(b,p){function _(M){try{T(w.next(M))}catch(P){p(P)}}function O(M){try{T(w.throw(M))}catch(P){p(P)}}function T(M){M.done?b(M.value):v(M.value).then(_,O)}T((w=w.apply(d,f||[])).next())})},r=In&&In.__generator||function(d,f){var g={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},w,v,b,p=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return p.next=_(0),p.throw=_(1),p.return=_(2),typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function _(T){return function(M){return O([T,M])}}function O(T){if(w)throw new TypeError("Generator is already executing.");for(;p&&(p=0,T[0]&&(g=0)),g;)try{if(w=1,v&&(b=T[0]&2?v.return:T[0]?v.throw||((b=v.return)&&b.call(v),0):v.next)&&!(b=b.call(v,T[1])).done)return b;switch(v=0,b&&(T=[T[0]&2,b.value]),T[0]){case 0:case 1:b=T;break;case 4:return g.label++,{value:T[1],done:!1};case 5:g.label++,v=T[1],T=[0];continue;case 7:T=g.ops.pop(),g.trys.pop();continue;default:if(b=g.trys,!(b=b.length>0&&b[b.length-1])&&(T[0]===6||T[0]===2)){g=0;continue}if(T[0]===3&&(!b||T[1]>b[0]&&T[1]<b[3])){g.label=T[1];break}if(T[0]===6&&g.label<b[1]){g.label=b[1],b=T;break}if(b&&g.label<b[2]){g.label=b[2],g.ops.push(T);break}b[2]&&g.ops.pop(),g.trys.pop();continue}T=f.call(d,g)}catch(M){T=[6,M],v=0}finally{w=b=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},n=In&&In.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(In,"__esModule",{value:!0}),In.useWebSocket=void 0;var i=ne,o=Ds,s=Ki(),a=xB(),l=AB(),u=n(HB()),c=uv(),h=function(d,f,g){f===void 0&&(f=s.DEFAULT_OPTIONS),g===void 0&&(g=!0);var w=(0,i.useState)(null),v=w[0],b=w[1],p=(0,i.useState)({}),_=p[0],O=p[1],T=(0,i.useMemo)(function(){if(!f.disableJson&&v)try{return JSON.parse(v.data)}catch{return s.UNPARSABLE_JSON_OBJECT}return null},[v,f.disableJson]),M=(0,i.useRef)(null),P=(0,i.useRef)(null),G=(0,i.useRef)(function(){}),j=(0,i.useRef)(0),A=(0,i.useRef)(Date.now()),q=(0,i.useRef)([]),Q=(0,i.useRef)(null),ue=(0,i.useRef)(f);ue.current=f;var J=M.current&&_[M.current]!==void 0?_[M.current]:d!==null&&g===!0?s.ReadyState.CONNECTING:s.ReadyState.UNINSTANTIATED,Z=f.queryParams?JSON.stringify(f.queryParams):null,ie=(0,i.useCallback)(function(ae,z){var $;if(z===void 0&&(z=!0),s.isEventSourceSupported&&P.current instanceof EventSource){console.warn("Unable to send a message from an eventSource");return}(($=P.current)===null||$===void 0?void 0:$.readyState)===s.ReadyState.OPEN?((0,c.assertIsWebSocket)(P.current,ue.current.skipAssert),P.current.send(ae)):z&&q.current.push(ae)},[]),ee=(0,i.useCallback)(function(ae,z){z===void 0&&(z=!0),ie(JSON.stringify(ae),z)},[ie]),te=(0,i.useCallback)(function(){return ue.current.share!==!0||s.isEventSourceSupported&&P.current instanceof EventSource?P.current:(Q.current===null&&P.current&&((0,c.assertIsWebSocket)(P.current,ue.current.skipAssert),Q.current=(0,u.default)(P.current,G)),Q.current)},[]);return(0,i.useEffect)(function(){if(d!==null&&g===!0){var ae,z=!1,$=!0,m=function(){return e(void 0,void 0,void 0,function(){var C,y,I;return r(this,function(x){switch(x.label){case 0:return C=M,[4,(0,l.getUrl)(d,ue)];case 1:return C.current=x.sent(),M.current===null?(console.error("Failed to get a valid URL. WebSocket connection aborted."),M.current="ABORTED",(0,o.flushSync)(function(){return O(function(N){return t(t({},N),{ABORTED:s.ReadyState.CLOSED})})}),[2]):(y=function(N){z||(0,o.flushSync)(function(){return b(N)})},I=function(N){z||(0,o.flushSync)(function(){return O(function(B){var Y;return t(t({},B),M.current&&(Y={},Y[M.current]=N,Y))})})},$&&(ae=(0,a.createOrJoinSocket)(P,M.current,I,ue,y,G,j,A,ie)),[2])}})})};return G.current=function(){z||(Q.current&&(Q.current=null),ae==null||ae(),m())},m(),function(){z=!0,$=!1,Q.current&&(Q.current=null),ae==null||ae(),b(null)}}else(d===null||g===!1)&&(j.current=0,O(function(C){var y;return t(t({},C),M.current&&(y={},y[M.current]=s.ReadyState.CLOSED,y))}))},[d,g,Z,ie]),(0,i.useEffect)(function(){J===s.ReadyState.OPEN&&q.current.splice(0).forEach(function(ae){ie(ae)})},[J]),{sendMessage:ie,sendJsonMessage:ee,lastMessage:v,lastJsonMessage:T,readyState:J,getWebSocket:te}};return In.useWebSocket=h,In}var xa={},lP;function NB(){if(lP)return xa;lP=1;var t=xa&&xa.__assign||function(){return t=Object.assign||function(a){for(var l,u=1,c=arguments.length;u<c;u++){l=arguments[u];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(a[h]=l[h])}return a},t.apply(this,arguments)};Object.defineProperty(xa,"__esModule",{value:!0}),xa.useSocketIO=void 0;var e=ne,r=hv(),n=Ki(),i={type:"empty",payload:null},o=function(a){if(!a||!a.data)return i;var l=a.data.match(/\[.*]/);if(!l)return i;var u=JSON.parse(l);return!Array.isArray(u)||!u[1]?i:{type:u[0],payload:u[1]}},s=function(a,l,u){l===void 0&&(l=n.DEFAULT_OPTIONS),u===void 0&&(u=!0);var c=(0,e.useMemo)(function(){return t(t({},l),{fromSocketIO:!0})},[]),h=(0,r.useWebSocket)(a,c,u),d=h.sendMessage,f=h.sendJsonMessage,g=h.lastMessage,w=h.readyState,v=h.getWebSocket,b=(0,e.useMemo)(function(){return o(g)},[g]);return{sendMessage:d,sendJsonMessage:f,lastMessage:b,lastJsonMessage:b,readyState:w,getWebSocket:v}};return xa.useSocketIO=s,xa}var $o={},uP;function DB(){if(uP)return $o;uP=1;var t=$o&&$o.__assign||function(){return t=Object.assign||function(s){for(var a,l=1,u=arguments.length;l<u;l++){a=arguments[l];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(s[c]=a[c])}return s},t.apply(this,arguments)},e=$o&&$o.__rest||function(s,a){var l={};for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&a.indexOf(u)<0&&(l[u]=s[u]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,u=Object.getOwnPropertySymbols(s);c<u.length;c++)a.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(s,u[c])&&(l[u[c]]=s[u[c]]);return l};Object.defineProperty($o,"__esModule",{value:!0}),$o.useEventSource=void 0;var r=ne,n=hv(),i=Ki(),o=function(s,a,l){a===void 0&&(a=i.DEFAULT_EVENT_SOURCE_OPTIONS);var u=a.withCredentials,c=a.events,h=e(a,["withCredentials","events"]);l===void 0&&(l=!0);var d=t(t({},h),{eventSourceOptions:{withCredentials:u}}),f=(0,r.useRef)(i.EMPTY_EVENT_HANDLERS);c&&(f.current=c);var g=(0,n.useWebSocket)(s,d,l),w=g.lastMessage,v=g.readyState,b=g.getWebSocket;return(0,r.useEffect)(function(){w!=null&&w.type&&Object.entries(f.current).forEach(function(p){var _=p[0],O=p[1];_===w.type&&O(w)})},[w]),{lastEvent:w,readyState:v,getEventSource:b}};return $o.useEventSource=o,$o}var cP;function kB(){return cP||(cP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.resetGlobalState=t.useEventSource=t.ReadyState=t.useSocketIO=t.default=void 0;var e=hv();Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.useWebSocket}});var r=NB();Object.defineProperty(t,"useSocketIO",{enumerable:!0,get:function(){return r.useSocketIO}});var n=Ki();Object.defineProperty(t,"ReadyState",{enumerable:!0,get:function(){return n.ReadyState}});var i=DB();Object.defineProperty(t,"useEventSource",{enumerable:!0,get:function(){return i.useEventSource}});var o=uv();Object.defineProperty(t,"resetGlobalState",{enumerable:!0,get:function(){return o.resetGlobalState}})}(rv)),rv}var LB=kB();const $B=zM(LB);var Nr=function(){return Nr=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Nr.apply(this,arguments)};function ks(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;function FB(t){var e=Object.create(null);return function(r){return e[r]===void 0&&(e[r]=t(r)),e[r]}}var VB=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,WB=FB(function(t){return VB.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),Mt="-ms-",Kc="-moz-",ut="-webkit-",hP="comm",Nf="rule",dv="decl",BB="@import",dP="@keyframes",jB="@layer",fP=Math.abs,fv=String.fromCharCode,gv=Object.assign;function UB(t,e){return Er(t,0)^45?(((e<<2^Er(t,0))<<2^Er(t,1))<<2^Er(t,2))<<2^Er(t,3):0}function gP(t){return t.trim()}function Fo(t,e){return(t=e.exec(t))?t[0]:t}function Le(t,e,r){return t.replace(e,r)}function Df(t,e,r){return t.indexOf(e,r)}function Er(t,e){return t.charCodeAt(e)|0}function ou(t,e,r){return t.slice(e,r)}function Xi(t){return t.length}function mP(t){return t.length}function Xc(t,e){return e.push(t),t}function zB(t,e){return t.map(e).join("")}function pP(t,e){return t.filter(function(r){return!Fo(r,e)})}var kf=1,su=1,wP=0,Yn=0,ar=0,au="";function Lf(t,e,r,n,i,o,s,a){return{value:t,root:e,parent:r,type:n,props:i,children:o,line:kf,column:su,length:s,return:"",siblings:a}}function Ls(t,e){return gv(Lf("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function lu(t){for(;t.root;)t=Ls(t.root,{children:[t]});Xc(t,t.siblings)}function YB(){return ar}function GB(){return ar=Yn>0?Er(au,--Yn):0,su--,ar===10&&(su=1,kf--),ar}function vi(){return ar=Yn<wP?Er(au,Yn++):0,su++,ar===10&&(su=1,kf++),ar}function Aa(){return Er(au,Yn)}function $f(){return Yn}function Ff(t,e){return ou(au,t,e)}function mv(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function qB(t){return kf=su=1,wP=Xi(au=t),Yn=0,[]}function KB(t){return au="",t}function pv(t){return gP(Ff(Yn-1,wv(t===91?t+2:t===40?t+1:t)))}function XB(t){for(;(ar=Aa())&&ar<33;)vi();return mv(t)>2||mv(ar)>3?"":" "}function ZB(t,e){for(;--e&&vi()&&!(ar<48||ar>102||ar>57&&ar<65||ar>70&&ar<97););return Ff(t,$f()+(e<6&&Aa()==32&&vi()==32))}function wv(t){for(;vi();)switch(ar){case t:return Yn;case 34:case 39:t!==34&&t!==39&&wv(ar);break;case 40:t===41&&wv(t);break;case 92:vi();break}return Yn}function JB(t,e){for(;vi()&&t+ar!==57;)if(t+ar===84&&Aa()===47)break;return"/*"+Ff(e,Yn-1)+"*"+fv(t===47?t:vi())}function QB(t){for(;!mv(Aa());)vi();return Ff(t,Yn)}function ej(t){return KB(Vf("",null,null,null,[""],t=qB(t),0,[0],t))}function Vf(t,e,r,n,i,o,s,a,l){for(var u=0,c=0,h=s,d=0,f=0,g=0,w=1,v=1,b=1,p=0,_="",O=i,T=o,M=n,P=_;v;)switch(g=p,p=vi()){case 40:if(g!=108&&Er(P,h-1)==58){Df(P+=Le(pv(p),"&","&\f"),"&\f",fP(u?a[u-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:P+=pv(p);break;case 9:case 10:case 13:case 32:P+=XB(g);break;case 92:P+=ZB($f()-1,7);continue;case 47:switch(Aa()){case 42:case 47:Xc(tj(JB(vi(),$f()),e,r,l),l);break;default:P+="/"}break;case 123*w:a[u++]=Xi(P)*b;case 125*w:case 59:case 0:switch(p){case 0:case 125:v=0;case 59+c:b==-1&&(P=Le(P,/\f/g,"")),f>0&&Xi(P)-h&&Xc(f>32?yP(P+";",n,r,h-1,l):yP(Le(P," ","")+";",n,r,h-2,l),l);break;case 59:P+=";";default:if(Xc(M=vP(P,e,r,u,c,i,a,_,O=[],T=[],h,o),o),p===123)if(c===0)Vf(P,e,M,M,O,o,h,a,T);else switch(d===99&&Er(P,3)===110?100:d){case 100:case 108:case 109:case 115:Vf(t,M,M,n&&Xc(vP(t,M,M,0,0,i,a,_,i,O=[],h,T),T),i,T,h,a,n?O:T);break;default:Vf(P,M,M,M,[""],T,0,a,T)}}u=c=f=0,w=b=1,_=P="",h=s;break;case 58:h=1+Xi(P),f=g;default:if(w<1){if(p==123)--w;else if(p==125&&w++==0&&GB()==125)continue}switch(P+=fv(p),p*w){case 38:b=c>0?1:(P+="\f",-1);break;case 44:a[u++]=(Xi(P)-1)*b,b=1;break;case 64:Aa()===45&&(P+=pv(vi())),d=Aa(),c=h=Xi(_=P+=QB($f())),p++;break;case 45:g===45&&Xi(P)==2&&(w=0)}}return o}function vP(t,e,r,n,i,o,s,a,l,u,c,h){for(var d=i-1,f=i===0?o:[""],g=mP(f),w=0,v=0,b=0;w<n;++w)for(var p=0,_=ou(t,d+1,d=fP(v=s[w])),O=t;p<g;++p)(O=gP(v>0?f[p]+" "+_:Le(_,/&\f/g,f[p])))&&(l[b++]=O);return Lf(t,e,r,i===0?Nf:a,l,u,c,h)}function tj(t,e,r,n){return Lf(t,e,r,hP,fv(YB()),ou(t,2,-2),0,n)}function yP(t,e,r,n,i){return Lf(t,e,r,dv,ou(t,0,n),ou(t,n+1,-1),n,i)}function CP(t,e,r){switch(UB(t,e)){case 5103:return ut+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ut+t+t;case 4789:return Kc+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return ut+t+Kc+t+Mt+t+t;case 5936:switch(Er(t,e+11)){case 114:return ut+t+Mt+Le(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return ut+t+Mt+Le(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return ut+t+Mt+Le(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return ut+t+Mt+t+t;case 6165:return ut+t+Mt+"flex-"+t+t;case 5187:return ut+t+Le(t,/(\w+).+(:[^]+)/,ut+"box-$1$2"+Mt+"flex-$1$2")+t;case 5443:return ut+t+Mt+"flex-item-"+Le(t,/flex-|-self/g,"")+(Fo(t,/flex-|baseline/)?"":Mt+"grid-row-"+Le(t,/flex-|-self/g,""))+t;case 4675:return ut+t+Mt+"flex-line-pack"+Le(t,/align-content|flex-|-self/g,"")+t;case 5548:return ut+t+Mt+Le(t,"shrink","negative")+t;case 5292:return ut+t+Mt+Le(t,"basis","preferred-size")+t;case 6060:return ut+"box-"+Le(t,"-grow","")+ut+t+Mt+Le(t,"grow","positive")+t;case 4554:return ut+Le(t,/([^-])(transform)/g,"$1"+ut+"$2")+t;case 6187:return Le(Le(Le(t,/(zoom-|grab)/,ut+"$1"),/(image-set)/,ut+"$1"),t,"")+t;case 5495:case 3959:return Le(t,/(image-set\([^]*)/,ut+"$1$`$1");case 4968:return Le(Le(t,/(.+:)(flex-)?(.*)/,ut+"box-pack:$3"+Mt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ut+t+t;case 4200:if(!Fo(t,/flex-|baseline/))return Mt+"grid-column-align"+ou(t,e)+t;break;case 2592:case 3360:return Mt+Le(t,"template-","")+t;case 4384:case 3616:return r&&r.some(function(n,i){return e=i,Fo(n.props,/grid-\w+-end/)})?~Df(t+(r=r[e].value),"span",0)?t:Mt+Le(t,"-start","")+t+Mt+"grid-row-span:"+(~Df(r,"span",0)?Fo(r,/\d+/):+Fo(r,/\d+/)-+Fo(t,/\d+/))+";":Mt+Le(t,"-start","")+t;case 4896:case 4128:return r&&r.some(function(n){return Fo(n.props,/grid-\w+-start/)})?t:Mt+Le(Le(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Le(t,/(.+)-inline(.+)/,ut+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Xi(t)-1-e>6)switch(Er(t,e+1)){case 109:if(Er(t,e+4)!==45)break;case 102:return Le(t,/(.+:)(.+)-([^]+)/,"$1"+ut+"$2-$3$1"+Kc+(Er(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Df(t,"stretch",0)?CP(Le(t,"stretch","fill-available"),e,r)+t:t}break;case 5152:case 5920:return Le(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,i,o,s,a,l,u){return Mt+i+":"+o+u+(s?Mt+i+"-span:"+(a?l:+l-+o)+u:"")+t});case 4949:if(Er(t,e+6)===121)return Le(t,":",":"+ut)+t;break;case 6444:switch(Er(t,Er(t,14)===45?18:11)){case 120:return Le(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ut+(Er(t,14)===45?"inline-":"")+"box$3$1"+ut+"$2$3$1"+Mt+"$2box$3")+t;case 100:return Le(t,":",":"+Mt)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Le(t,"scroll-","scroll-snap-")+t}return t}function Wf(t,e){for(var r="",n=0;n<t.length;n++)r+=e(t[n],n,t,e)||"";return r}function rj(t,e,r,n){switch(t.type){case jB:if(t.children.length)break;case BB:case dv:return t.return=t.return||t.value;case hP:return"";case dP:return t.return=t.value+"{"+Wf(t.children,n)+"}";case Nf:if(!Xi(t.value=t.props.join(",")))return""}return Xi(r=Wf(t.children,n))?t.return=t.value+"{"+r+"}":""}function nj(t){var e=mP(t);return function(r,n,i,o){for(var s="",a=0;a<e;a++)s+=t[a](r,n,i,o)||"";return s}}function ij(t){return function(e){e.root||(e=e.return)&&t(e)}}function oj(t,e,r,n){if(t.length>-1&&!t.return)switch(t.type){case dv:t.return=CP(t.value,t.length,r);return;case dP:return Wf([Ls(t,{value:Le(t.value,"@","@"+ut)})],n);case Nf:if(t.length)return zB(r=t.props,function(i){switch(Fo(i,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":lu(Ls(t,{props:[Le(i,/:(read-\w+)/,":"+Kc+"$1")]})),lu(Ls(t,{props:[i]})),gv(t,{props:pP(r,n)});break;case"::placeholder":lu(Ls(t,{props:[Le(i,/:(plac\w+)/,":"+ut+"input-$1")]})),lu(Ls(t,{props:[Le(i,/:(plac\w+)/,":"+Kc+"$1")]})),lu(Ls(t,{props:[Le(i,/:(plac\w+)/,Mt+"input-$1")]})),lu(Ls(t,{props:[i]})),gv(t,{props:pP(r,n)});break}return""})}}var sj={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ha=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",bP="active",SP="data-styled-version",Bf="6.1.18",vv=`/*!sc*/
23
+ `,jf=typeof window<"u"&&typeof document<"u",aj=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production"),lj={},RP=/invalid hook call/i,Uf=new Set,EP=function(t,e){if(process.env.NODE_ENV!=="production"){var r=e?' with the id of "'.concat(e,'"'):"",n="The component ".concat(t).concat(r,` has been created dynamically.
24
+ `)+`You may see this warning because you've called styled inside another component.
25
+ To resolve this only create new StyledComponents outside of any render method and function component.
26
+ See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.
27
+ `,i=console.error;try{var o=!0;console.error=function(s){for(var a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];RP.test(s)?(o=!1,Uf.delete(n)):i.apply(void 0,ks([s],a,!1))},ne.useRef(),o&&!Uf.has(n)&&(console.warn(n),Uf.add(n))}catch(s){RP.test(s.message)&&Uf.delete(n)}finally{console.error=i}}},zf=Object.freeze([]),uu=Object.freeze({});function TP(t,e,r){return r===void 0&&(r=uu),t.theme!==r.theme&&t.theme||e||r.theme}var yv=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),uj=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,cj=/(^-|-$)/g;function _P(t){return t.replace(uj,"-").replace(cj,"")}var hj=/(a)(d)/gi,Yf=52,MP=function(t){return String.fromCharCode(t+(t>25?39:97))};function Cv(t){var e,r="";for(e=Math.abs(t);e>Yf;e=e/Yf|0)r=MP(e%Yf)+r;return(MP(e%Yf)+r).replace(hj,"$1-$2")}var bv,PP=5381,Na=function(t,e){for(var r=e.length;r;)t=33*t^e.charCodeAt(--r);return t},IP=function(t){return Na(PP,t)};function Sv(t){return Cv(IP(t)>>>0)}function OP(t){return process.env.NODE_ENV!=="production"&&typeof t=="string"&&t||t.displayName||t.name||"Component"}function Rv(t){return typeof t=="string"&&(process.env.NODE_ENV==="production"||t.charAt(0)===t.charAt(0).toLowerCase())}var xP=typeof Symbol=="function"&&Symbol.for,AP=xP?Symbol.for("react.memo"):60115,dj=xP?Symbol.for("react.forward_ref"):60112,fj={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},gj={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},HP={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},mj=((bv={})[dj]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},bv[AP]=HP,bv);function NP(t){return("type"in(e=t)&&e.type.$$typeof)===AP?HP:"$$typeof"in t?mj[t.$$typeof]:fj;var e}var pj=Object.defineProperty,wj=Object.getOwnPropertyNames,DP=Object.getOwnPropertySymbols,vj=Object.getOwnPropertyDescriptor,yj=Object.getPrototypeOf,kP=Object.prototype;function LP(t,e,r){if(typeof e!="string"){if(kP){var n=yj(e);n&&n!==kP&&LP(t,n,r)}var i=wj(e);DP&&(i=i.concat(DP(e)));for(var o=NP(t),s=NP(e),a=0;a<i.length;++a){var l=i[a];if(!(l in gj||r&&r[l]||s&&l in s||o&&l in o)){var u=vj(e,l);try{pj(t,l,u)}catch{}}}}return t}function cu(t){return typeof t=="function"}function Ev(t){return typeof t=="object"&&"styledComponentId"in t}function Da(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function Gf(t,e){if(t.length===0)return"";for(var r=t[0],n=1;n<t.length;n++)r+=t[n];return r}function hu(t){return t!==null&&typeof t=="object"&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function Tv(t,e,r){if(r===void 0&&(r=!1),!r&&!hu(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var n=0;n<e.length;n++)t[n]=Tv(t[n],e[n]);else if(hu(e))for(var n in e)t[n]=Tv(t[n],e[n]);return t}function _v(t,e){Object.defineProperty(t,"toString",{value:e})}var Cj=process.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
28
+
29
+ `,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
30
+
31
+ - Are you trying to reuse it across renders?
32
+ - Are you accidentally calling collectStyles twice?
33
+
34
+ `,3:`Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.
35
+
36
+ `,4:`The \`StyleSheetManager\` expects a valid target or sheet prop!
37
+
38
+ - Does this error occur on the client and is your target falsy?
39
+ - Does this error occur on the server and is the sheet falsy?
40
+
41
+ `,5:`The clone method cannot be used on the client!
42
+
43
+ - Are you running in a client-like environment on the server?
44
+ - Are you trying to run SSR on the client?
45
+
46
+ `,6:`Trying to insert a new style tag, but the given Node is unmounted!
47
+
48
+ - Are you using a custom target that isn't mounted?
49
+ - Does your document not have a valid head element?
50
+ - Have you accidentally removed a style tag manually?
51
+
52
+ `,7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:`ThemeProvider: Please make your "theme" prop an object.
53
+
54
+ `,9:"Missing document `<head>`\n\n",10:`Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021
55
+
56
+ `,11:`_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.
57
+
58
+ `,12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:`%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.
59
+
60
+ `,14:`ThemeProvider: "theme" prop is required.
61
+
62
+ `,15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:`Reached the limit of how many styled components may be created at group %s.
63
+ You may only create up to 1,073,741,824 components. If you're creating components dynamically,
64
+ as for instance in your render method then you may be running into this limitation.
65
+
66
+ `,17:`CSSStyleSheet could not be found on HTMLStyleElement.
67
+ Has styled-components' style tag been unmounted or altered by another script?
68
+ `,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function bj(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=t[0],n=[],i=1,o=t.length;i<o;i+=1)n.push(t[i]);return n.forEach(function(s){r=r.replace(/%[a-z]/,s)}),r}function du(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):"")):new Error(bj.apply(void 0,ks([Cj[t]],e,!1)).trim())}var Sj=function(){function t(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return t.prototype.indexOfGroup=function(e){for(var r=0,n=0;n<e;n++)r+=this.groupSizes[n];return r},t.prototype.insertRules=function(e,r){if(e>=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,o=i;e>=o;)if((o<<=1)<0)throw du(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=i;s<o;s++)this.groupSizes[s]=0}for(var a=this.indexOfGroup(e+1),l=(s=0,r.length);s<l;s++)this.tag.insertRule(a,r[s])&&(this.groupSizes[e]++,a++)},t.prototype.clearGroup=function(e){if(e<this.length){var r=this.groupSizes[e],n=this.indexOfGroup(e),i=n+r;this.groupSizes[e]=0;for(var o=n;o<i;o++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(e){var r="";if(e>=this.length||this.groupSizes[e]===0)return r;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),o=i+n,s=i;s<o;s++)r+="".concat(this.tag.getRule(s)).concat(vv);return r},t}(),Rj=1<<30,qf=new Map,Kf=new Map,Xf=1,Zf=function(t){if(qf.has(t))return qf.get(t);for(;Kf.has(Xf);)Xf++;var e=Xf++;if(process.env.NODE_ENV!=="production"&&((0|e)<0||e>Rj))throw du(16,"".concat(e));return qf.set(t,e),Kf.set(e,t),e},Ej=function(t,e){Xf=e+1,qf.set(t,e),Kf.set(e,t)},Tj="style[".concat(Ha,"][").concat(SP,'="').concat(Bf,'"]'),_j=new RegExp("^".concat(Ha,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Mj=function(t,e,r){for(var n,i=r.split(","),o=0,s=i.length;o<s;o++)(n=i[o])&&t.registerName(e,n)},Pj=function(t,e){for(var r,n=((r=e.textContent)!==null&&r!==void 0?r:"").split(vv),i=[],o=0,s=n.length;o<s;o++){var a=n[o].trim();if(a){var l=a.match(_j);if(l){var u=0|parseInt(l[1],10),c=l[2];u!==0&&(Ej(c,u),Mj(t,c,l[3]),t.getTag().insertRules(u,i)),i.length=0}else i.push(a)}}},$P=function(t){for(var e=document.querySelectorAll(Tj),r=0,n=e.length;r<n;r++){var i=e[r];i&&i.getAttribute(Ha)!==bP&&(Pj(t,i),i.parentNode&&i.parentNode.removeChild(i))}};function Ij(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var FP=function(t){var e=document.head,r=t||e,n=document.createElement("style"),i=function(a){var l=Array.from(a.querySelectorAll("style[".concat(Ha,"]")));return l[l.length-1]}(r),o=i!==void 0?i.nextSibling:null;n.setAttribute(Ha,bP),n.setAttribute(SP,Bf);var s=Ij();return s&&n.setAttribute("nonce",s),r.insertBefore(n,o),n},Oj=function(){function t(e){this.element=FP(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(r){if(r.sheet)return r.sheet;for(var n=document.styleSheets,i=0,o=n.length;i<o;i++){var s=n[i];if(s.ownerNode===r)return s}throw du(17)}(this.element),this.length=0}return t.prototype.insertRule=function(e,r){try{return this.sheet.insertRule(r,e),this.length++,!0}catch{return!1}},t.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.prototype.getRule=function(e){var r=this.sheet.cssRules[e];return r&&r.cssText?r.cssText:""},t}(),xj=function(){function t(e){this.element=FP(e),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(e,r){if(e<=this.length&&e>=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},t}(),Aj=function(){function t(e){this.rules=[],this.length=0}return t.prototype.insertRule=function(e,r){return e<=this.length&&(this.rules.splice(e,0,r),this.length++,!0)},t.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},t}(),VP=jf,Hj={isServer:!jf,useCSSOMInjection:!aj},Jf=function(){function t(e,r,n){e===void 0&&(e=uu),r===void 0&&(r={});var i=this;this.options=Nr(Nr({},Hj),e),this.gs=r,this.names=new Map(n),this.server=!!e.isServer,!this.server&&jf&&VP&&(VP=!1,$P(this)),_v(this,function(){return function(o){for(var s=o.getTag(),a=s.length,l="",u=function(h){var d=function(b){return Kf.get(b)}(h);if(d===void 0)return"continue";var f=o.names.get(d),g=s.getGroup(h);if(f===void 0||!f.size||g.length===0)return"continue";var w="".concat(Ha,".g").concat(h,'[id="').concat(d,'"]'),v="";f!==void 0&&f.forEach(function(b){b.length>0&&(v+="".concat(b,","))}),l+="".concat(g).concat(w,'{content:"').concat(v,'"}').concat(vv)},c=0;c<a;c++)u(c);return l}(i)})}return t.registerId=function(e){return Zf(e)},t.prototype.rehydrate=function(){!this.server&&jf&&$P(this)},t.prototype.reconstructWithOptions=function(e,r){return r===void 0&&(r=!0),new t(Nr(Nr({},this.options),e),this.gs,r&&this.names||void 0)},t.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(e=function(r){var n=r.useCSSOMInjection,i=r.target;return r.isServer?new Aj(i):n?new Oj(i):new xj(i)}(this.options),new Sj(e)));var e},t.prototype.hasNameForId=function(e,r){return this.names.has(e)&&this.names.get(e).has(r)},t.prototype.registerName=function(e,r){if(Zf(e),this.names.has(e))this.names.get(e).add(r);else{var n=new Set;n.add(r),this.names.set(e,n)}},t.prototype.insertRules=function(e,r,n){this.registerName(e,r),this.getTag().insertRules(Zf(e),n)},t.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.prototype.clearRules=function(e){this.getTag().clearGroup(Zf(e)),this.clearNames(e)},t.prototype.clearTag=function(){this.tag=void 0},t}(),Nj=/&/g,Dj=/^\s*\/\/.*$/gm;function WP(t,e){return t.map(function(r){return r.type==="rule"&&(r.value="".concat(e," ").concat(r.value),r.value=r.value.replaceAll(",",",".concat(e," ")),r.props=r.props.map(function(n){return"".concat(e," ").concat(n)})),Array.isArray(r.children)&&r.type!=="@keyframes"&&(r.children=WP(r.children,e)),r})}function kj(t){var e,r,n,i=uu,o=i.options,s=o===void 0?uu:o,a=i.plugins,l=a===void 0?zf:a,u=function(d,f,g){return g.startsWith(r)&&g.endsWith(r)&&g.replaceAll(r,"").length>0?".".concat(e):d},c=l.slice();c.push(function(d){d.type===Nf&&d.value.includes("&")&&(d.props[0]=d.props[0].replace(Nj,r).replace(n,u))}),s.prefix&&c.push(oj),c.push(rj);var h=function(d,f,g,w){f===void 0&&(f=""),g===void 0&&(g=""),w===void 0&&(w="&"),e=w,r=f,n=new RegExp("\\".concat(r,"\\b"),"g");var v=d.replace(Dj,""),b=ej(g||f?"".concat(g," ").concat(f," { ").concat(v," }"):v);s.namespace&&(b=WP(b,s.namespace));var p=[];return Wf(b,nj(c.concat(ij(function(_){return p.push(_)})))),p};return h.hash=l.length?l.reduce(function(d,f){return f.name||du(15),Na(d,f.name)},PP).toString():"",h}var Lj=new Jf,Mv=kj(),BP=ne.createContext({shouldForwardProp:void 0,styleSheet:Lj,stylis:Mv});BP.Consumer,ne.createContext(void 0);function Pv(){return ne.useContext(BP)}var Iv=function(){function t(e,r){var n=this;this.inject=function(i,o){o===void 0&&(o=Mv);var s=n.name+o.hash;i.hasNameForId(n.id,s)||i.insertRules(n.id,s,o(n.rules,s,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=r,_v(this,function(){throw du(12,String(n.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=Mv),this.name+e.hash},t}(),$j=function(t){return t>="A"&&t<="Z"};function jP(t){for(var e="",r=0;r<t.length;r++){var n=t[r];if(r===1&&n==="-"&&t[0]==="-")return t;$j(n)?e+="-"+n.toLowerCase():e+=n}return e.startsWith("ms-")?"-"+e:e}var UP=function(t){return t==null||t===!1||t===""},zP=function(t){var e,r,n=[];for(var i in t){var o=t[i];t.hasOwnProperty(i)&&!UP(o)&&(Array.isArray(o)&&o.isCss||cu(o)?n.push("".concat(jP(i),":"),o,";"):hu(o)?n.push.apply(n,ks(ks(["".concat(i," {")],zP(o),!1),["}"],!1)):n.push("".concat(jP(i),": ").concat((e=i,(r=o)==null||typeof r=="boolean"||r===""?"":typeof r!="number"||r===0||e in sj||e.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return n};function $s(t,e,r,n){if(UP(t))return[];if(Ev(t))return[".".concat(t.styledComponentId)];if(cu(t)){if(!cu(o=t)||o.prototype&&o.prototype.isReactComponent||!e)return[t];var i=t(e);return process.env.NODE_ENV==="production"||typeof i!="object"||Array.isArray(i)||i instanceof Iv||hu(i)||i===null||console.error("".concat(OP(t)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),$s(i,e,r,n)}var o;return t instanceof Iv?r?(t.inject(r,n),[t.getName(n)]):[t]:hu(t)?zP(t):Array.isArray(t)?Array.prototype.concat.apply(zf,t.map(function(s){return $s(s,e,r,n)})):[t.toString()]}function YP(t){for(var e=0;e<t.length;e+=1){var r=t[e];if(cu(r)&&!Ev(r))return!1}return!0}var Fj=IP(Bf),Vj=function(){function t(e,r,n){this.rules=e,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(n===void 0||n.isStatic)&&YP(e),this.componentId=r,this.baseHash=Na(Fj,r),this.baseStyle=n,Jf.registerId(r)}return t.prototype.generateAndInjectStyles=function(e,r,n){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,r,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&r.hasNameForId(this.componentId,this.staticRulesId))i=Da(i,this.staticRulesId);else{var o=Gf($s(this.rules,e,r,n)),s=Cv(Na(this.baseHash,o)>>>0);if(!r.hasNameForId(this.componentId,s)){var a=n(o,".".concat(s),void 0,this.componentId);r.insertRules(this.componentId,s,a)}i=Da(i,s),this.staticRulesId=s}else{for(var l=Na(this.baseHash,n.hash),u="",c=0;c<this.rules.length;c++){var h=this.rules[c];if(typeof h=="string")u+=h,process.env.NODE_ENV!=="production"&&(l=Na(l,h));else if(h){var d=Gf($s(h,e,r,n));l=Na(l,d+c),u+=d}}if(u){var f=Cv(l>>>0);r.hasNameForId(this.componentId,f)||r.insertRules(this.componentId,f,n(u,".".concat(f),void 0,this.componentId)),i=Da(i,f)}}return i},t}(),Ov=ne.createContext(void 0);Ov.Consumer;var xv={},GP=new Set;function Wj(t,e,r){var n=Ev(t),i=t,o=!Rv(t),s=e.attrs,a=s===void 0?zf:s,l=e.componentId,u=l===void 0?function(O,T){var M=typeof O!="string"?"sc":_P(O);xv[M]=(xv[M]||0)+1;var P="".concat(M,"-").concat(Sv(Bf+M+xv[M]));return T?"".concat(T,"-").concat(P):P}(e.displayName,e.parentComponentId):l,c=e.displayName,h=c===void 0?function(O){return Rv(O)?"styled.".concat(O):"Styled(".concat(OP(O),")")}(t):c,d=e.displayName&&e.componentId?"".concat(_P(e.displayName),"-").concat(e.componentId):e.componentId||u,f=n&&i.attrs?i.attrs.concat(a).filter(Boolean):a,g=e.shouldForwardProp;if(n&&i.shouldForwardProp){var w=i.shouldForwardProp;if(e.shouldForwardProp){var v=e.shouldForwardProp;g=function(O,T){return w(O,T)&&v(O,T)}}else g=w}var b=new Vj(r,d,n?i.componentStyle:void 0);function p(O,T){return function(M,P,G){var j=M.attrs,A=M.componentStyle,q=M.defaultProps,Q=M.foldedComponentIds,ue=M.styledComponentId,J=M.target,Z=ne.useContext(Ov),ie=Pv(),ee=M.shouldForwardProp||ie.shouldForwardProp;process.env.NODE_ENV!=="production"&&ne.useDebugValue(ue);var te=TP(P,Z,q)||uu,ae=function(I,x,N){for(var B,Y=Nr(Nr({},x),{className:void 0,theme:N}),R=0;R<I.length;R+=1){var E=cu(B=I[R])?B(Y):B;for(var S in E)Y[S]=S==="className"?Da(Y[S],E[S]):S==="style"?Nr(Nr({},Y[S]),E[S]):E[S]}return x.className&&(Y.className=Da(Y.className,x.className)),Y}(j,P,te),z=ae.as||J,$={};for(var m in ae)ae[m]===void 0||m[0]==="$"||m==="as"||m==="theme"&&ae.theme===te||(m==="forwardedAs"?$.as=ae.forwardedAs:ee&&!ee(m,z)||($[m]=ae[m],ee||process.env.NODE_ENV!=="development"||WB(m)||GP.has(m)||!yv.has(z)||(GP.add(m),console.warn('styled-components: it looks like an unknown prop "'.concat(m,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var C=function(I,x){var N=Pv(),B=I.generateAndInjectStyles(x,N.styleSheet,N.stylis);return process.env.NODE_ENV!=="production"&&ne.useDebugValue(B),B}(A,ae);process.env.NODE_ENV!=="production"&&M.warnTooManyClasses&&M.warnTooManyClasses(C);var y=Da(Q,ue);return C&&(y+=" "+C),ae.className&&(y+=" "+ae.className),$[Rv(z)&&!yv.has(z)?"class":"className"]=y,G&&($.ref=G),ne.createElement(z,$)}(_,O,T)}p.displayName=h;var _=ne.forwardRef(p);return _.attrs=f,_.componentStyle=b,_.displayName=h,_.shouldForwardProp=g,_.foldedComponentIds=n?Da(i.foldedComponentIds,i.styledComponentId):"",_.styledComponentId=d,_.target=n?i.target:t,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(O){this._foldedDefaultProps=n?function(T){for(var M=[],P=1;P<arguments.length;P++)M[P-1]=arguments[P];for(var G=0,j=M;G<j.length;G++)Tv(T,j[G],!0);return T}({},i.defaultProps,O):O}}),process.env.NODE_ENV!=="production"&&(EP(h,d),_.warnTooManyClasses=function(O,T){var M={},P=!1;return function(G){if(!P&&(M[G]=!0,Object.keys(M).length>=200)){var j=T?' with the id of "'.concat(T,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(O).concat(j,`.
69
+ `)+`Consider using the attrs method, together with a style object for frequently changed styles.
70
+ Example:
71
+ const Component = styled.div.attrs(props => ({
72
+ style: {
73
+ background: props.background,
74
+ },
75
+ }))\`width: 100%;\`
76
+
77
+ <Component />`),P=!0,M={}}}}(h,d)),_v(_,function(){return".".concat(_.styledComponentId)}),o&&LP(_,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function qP(t,e){for(var r=[t[0]],n=0,i=e.length;n<i;n+=1)r.push(e[n],t[n+1]);return r}var KP=function(t){return Object.assign(t,{isCss:!0})};function Zi(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(cu(t)||hu(t))return KP($s(qP(zf,ks([t],e,!0))));var n=t;return e.length===0&&n.length===1&&typeof n[0]=="string"?$s(n):KP($s(qP(n,e)))}function Av(t,e,r){if(r===void 0&&(r=uu),!e)throw du(1,e);var n=function(i){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return t(e,r,Zi.apply(void 0,ks([i],o,!1)))};return n.attrs=function(i){return Av(t,e,Nr(Nr({},r),{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},n.withConfig=function(i){return Av(t,e,Nr(Nr({},r),i))},n}var XP=function(t){return Av(Wj,t)},Xe=XP;yv.forEach(function(t){Xe[t]=XP(t)});var Bj=function(){function t(e,r){this.rules=e,this.componentId=r,this.isStatic=YP(e),Jf.registerId(this.componentId+1)}return t.prototype.createStyles=function(e,r,n,i){var o=i(Gf($s(this.rules,r,n,i)),""),s=this.componentId+e;n.insertRules(s,s,o)},t.prototype.removeStyles=function(e,r){r.clearRules(this.componentId+e)},t.prototype.renderStyles=function(e,r,n,i){e>2&&Jf.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,r,n,i)},t}();function jj(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=Zi.apply(void 0,ks([t],e,!1)),i="sc-global-".concat(Sv(JSON.stringify(n))),o=new Bj(n,i);process.env.NODE_ENV!=="production"&&EP(i);var s=function(l){var u=Pv(),c=ne.useContext(Ov),h=ne.useRef(u.styleSheet.allocateGSInstance(i)).current;return process.env.NODE_ENV!=="production"&&ne.Children.count(l.children)&&console.warn("The global style component ".concat(i," was given child JSX. createGlobalStyle does not render children.")),process.env.NODE_ENV!=="production"&&n.some(function(d){return typeof d=="string"&&d.indexOf("@import")!==-1})&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),u.styleSheet.server&&a(h,l,u.styleSheet,c,u.stylis),ne.useLayoutEffect(function(){if(!u.styleSheet.server)return a(h,l,u.styleSheet,c,u.stylis),function(){return o.removeStyles(h,u.styleSheet)}},[h,l,u.styleSheet,c,u.stylis]),null};function a(l,u,c,h,d){if(o.isStatic)o.renderStyles(l,lj,c,d);else{var f=Nr(Nr({},u),{theme:TP(u,h,s.defaultProps)});o.renderStyles(l,f,c,d)}}return ne.memo(s)}function Uj(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var n=Gf(Zi.apply(void 0,ks([t],e,!1))),i=Sv(n);return new Iv(i,n)}process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn(`It looks like you've imported 'styled-components' on React Native.
78
+ Perhaps you're looking to import 'styled-components/native'?
79
+ Read more about this at https://www.styled-components.com/docs/basics#react-native`);var Qf="__sc-".concat(Ha,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[Qf]||(window[Qf]=0),window[Qf]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
80
+
81
+ See https://s-c.sh/2BAXzed for more info.`),window[Qf]+=1);let Zc;function zj(t,e){return[(...i)=>{const o=()=>{Zc=void 0,t(...i)};clearTimeout(Zc),Zc=setTimeout(o,e)},()=>{Zc&&clearTimeout(Zc)}]}const Yj=t=>(t==null?void 0:t.map(e=>({sheet:e.sheet,items:e.items.map(r=>({alias:r.alias,type:r.type,row_num:r.row_num,row_start:r.row_start,items:r.items.map(n=>({alias:n.alias,type:n.type,cell:n.cell,column:n.column,action_type:n.action_type,option:n.option,cell_type:n.cell_type,value:n.value}))}))})))??[],ZP=[{alias:"",type:"form",items:[{alias:"",type:"input",cell:"",action_type:[]}]}],Gj=()=>{const[t,e]=ne.useState([{sheet:"Hoja 1",items:ZP}]),[r,n]=ne.useState("0");return{tabs:t,activeKey:r,setActiveKey:n,addTab:()=>{const a=t.length;e([...t,{sheet:`Hoja ${a+1}`,items:ZP}]),n(a.toString())},setTabs:a=>e(Yj(a)),removeTab:a=>{const l=parseInt(a),u=t.filter((c,h)=>h!==l);e(u),l===parseInt(r)&&n("0")},updateTab:(a,l)=>{const u=[...t];return u[a]={...u[a],...l},e(u),u}}};class JP extends Error{constructor(r,n){super(r);EB(this,"response");this.name="ResponseError",this.response=n}}const Jc={API_GO_XCEL_HOST:null,async readTemplateIdentity(t,e){const r=await fetch(`${Jc.API_GO_XCEL_HOST}/templates/identity/${e}/`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!r.ok)throw new JP(`HTTP error! status: ${r.status}`,r);return await r.json()},async applyAction(t,e){const r=await fetch(`${Jc.API_GO_XCEL_HOST}/excel/apply-actions/`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!r.ok)throw new JP(`HTTP error! status: ${r.status}`,r);return await r.json()}},qj=t=>new URL(t);var QP=(t=>(t.applyActions="ws/apply-actions/",t))(QP||{});const Kj=(t,e)=>`${e.protocol??"wss"}://${qj(e.apiBaseUrl).host}/${t}`,Tr="#25cc89",Xj=({primary:t})=>(ne.useEffect(()=>{if(!(typeof document>"u"))return document.body.style.setProperty("--hot-primary",t??Tr),()=>{document.body.style.removeProperty("--hot-primary")}},[t]),null),eI=(t,e)=>{const r=t.replace("#",""),n=parseInt(r.length===3?r.split("").map(a=>a+a).join(""):r,16),i=n>>16&255,o=n>>8&255,s=n&255;return`rgba(${i}, ${o}, ${s}, ${e})`},Rt=t=>(t==null?void 0:t.primaryColor)??Tr,Qc=t=>{const e=t==null?void 0:t.focusShadowColor;return e?e.startsWith("#")?eI(e,.2):e:eI((t==null?void 0:t.primaryColor)??Rt(),.2)},Zj=Uj`
82
+ 0% {
83
+ transform: rotate(0deg);
84
+ }
85
+ 100% {
86
+ transform: rotate(360deg);
87
+ }
88
+ `,Jj=Xe.div`
89
+ display: flex;
90
+ flex-direction: column;
91
+ align-items: center;
92
+ justify-content: center;
93
+ padding: 20px;
94
+ `,Qj=Xe.div`
95
+ border: 4px solid rgba(0, 0, 0, 0.1);
96
+ border-left-color: ${t=>Rt(t.theme)};
97
+
98
+ border-radius: 50%;
99
+ width: 30px;
100
+ height: 30px;
101
+ animation: ${Zj} 1s linear infinite;
102
+ `,eU=Xe.div`
103
+ margin-top: 16px;
104
+ color: rgba(0, 0, 0, 0.85);
105
+ font-size: 14px;
106
+ `,tU=({theme:t,text:e,className:r})=>he.jsxs(Jj,{className:r,children:[he.jsx(Qj,{theme:t}),e&&he.jsx(eU,{children:e})]});var Hv=(t=>(t.ADD="ADD",t.READ="READ",t.EDIT="EDIT",t))(Hv||{});const rU=Xe.div`
107
+ background-color: #fff;
108
+ border-radius: 8px;
109
+ box-shadow:
110
+ 0 1px 2px 0 rgba(0, 0, 0, 0.03),
111
+ 0 1px 6px -1px rgba(0, 0, 0, 0.02),
112
+ 0 2px 4px 0 rgba(0, 0, 0, 0.02);
113
+ margin-bottom: 16px;
114
+ padding: 24px;
115
+ transition: all 0.3s;
116
+
117
+ &:hover {
118
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
119
+ }
120
+ `,nU=({children:t,className:e})=>he.jsx(rU,{className:e,children:t}),Nv=Zi`
121
+ margin: 0;
122
+ padding: 0;
123
+ color: rgba(0, 0, 0, 0.85);
124
+ `,iU=Xe.div`
125
+ ${Nv}
126
+ font-weight: 600;
127
+ margin-bottom: 0.5em;
128
+
129
+ ${t=>{switch(t.$level){case 1:return Zi`
130
+ font-size: 38px;
131
+ line-height: 1.23;
132
+ `;case 2:return Zi`
133
+ font-size: 30px;
134
+ line-height: 1.35;
135
+ `;case 3:return Zi`
136
+ font-size: 24px;
137
+ line-height: 1.35;
138
+ `;case 4:return Zi`
139
+ font-size: 20px;
140
+ line-height: 1.4;
141
+ `;case 5:return Zi`
142
+ font-size: 16px;
143
+ line-height: 1.5;
144
+ `;default:return Zi`
145
+ font-size: 24px;
146
+ line-height: 1.35;
147
+ `}}}
148
+
149
+ &:hover {
150
+ color: ${t=>t.theme.primaryColor??Tr};
151
+ }
152
+ `,oU=({theme:t,level:e=1,children:r,className:n})=>{const i=e===1?"h1":e===2?"h2":e===3?"h3":e===4?"h4":"h5";return he.jsx(iU,{theme:t,as:i,$level:e,className:n,children:r})},sU=Xe.span`
153
+ ${Nv}
154
+ font-size: 14px;
155
+ line-height: 1.5715;
156
+ `,aU=({theme:t,children:e,className:r,style:n})=>he.jsx(sU,{style:n,theme:t,className:r,children:e});Xe.p`
157
+ ${Nv}
158
+ font-size: 14px;
159
+ line-height: 1.5715;
160
+ margin-bottom: 1em;
161
+ `;const Dv={Title:oU,Text:aU},lU=Xe.select`
162
+ width: 100%;
163
+ padding: ${t=>t.size==="small"?"7.25px 11px":t.size==="large"?"11.577px 11px":"9.25px 11px"};
164
+ font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
165
+ line-height: 1.5715;
166
+ background-color: #fff;
167
+ background-image: none;
168
+ border: 1px solid #d9d9d9;
169
+ border-radius: ${t=>(t==null?void 0:t.$borderRadius)??"2px"};
170
+ transition: all 0.3s;
171
+ box-sizing: border-box;
172
+
173
+ &:hover {
174
+ border-color: ${t=>Rt(t.theme)};
175
+ }
176
+
177
+ &:focus {
178
+ border-color: ${t=>Rt(t.theme)};
179
+ box-shadow: 0 0 0 2px
180
+ ${t=>Qc({primaryColor:Rt(t.theme),focusShadowColor:(t==null?void 0:t.$focusShadowColor)??Rt(t.theme)})};
181
+ outline: 0;
182
+ }
183
+
184
+ &:disabled {
185
+ background-color: #f5f5f5;
186
+ cursor: not-allowed;
187
+ opacity: 1;
188
+ }
189
+ `,kv=({id:t,value:e,disabled:r,onChange:n,options:i=[],borderRadius:o,focusShadowColor:s,...a})=>he.jsxs(lU,{...a,$borderRadius:o,$focusShadowColor:s,id:t,value:e,disabled:r,onChange:l=>n==null?void 0:n(l.target.value),children:[he.jsx("option",{value:"",children:"Select an option"}),i.map((l,u)=>he.jsx("option",{value:l.value,children:l.label},u))]}),uU=({config:t,size:e,onSizeChange:r,span:n,onSpanChange:i,languageConfig:o})=>{var l,u,c;const s=(l=o==null?void 0:o.languageOptions)==null?void 0:l[(o==null?void 0:o.language)||"es"],a=h=>h==="small"?"14px":h==="large"?"16px":"14px";return he.jsxs("div",{children:[he.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:"10px",alignItems:"start"},children:[he.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[he.jsx(Dv.Text,{style:{fontSize:a(e)},children:(s==null?void 0:s.formSize)??"Form size"}),he.jsx(kv,{size:e,theme:t==null?void 0:t.theme,...(u=t==null?void 0:t.components)==null?void 0:u.Select,id:"form-size",value:e,onChange:h=>r(h),options:[{value:"small",label:(s==null?void 0:s.small)??"Small"},{value:"middle",label:(s==null?void 0:s.middle)??"Middle"},{value:"large",label:(s==null?void 0:s.large)??"Large"}]})]}),he.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[he.jsx(Dv.Text,{style:{fontSize:a(e)},children:(s==null?void 0:s.fieldWidthPerRow)??"Field widths (per row)"}),he.jsx(kv,{size:e,theme:t==null?void 0:t.theme,...(c=t==null?void 0:t.components)==null?void 0:c.Select,id:"field-span",value:String(n),onChange:h=>i(Number(h)),options:[{value:"8",label:(s==null?void 0:s.oneThirdRow)??"1/3 de fila"},{value:"12",label:(s==null?void 0:s.halfRow)??"Media fila"},{value:"16",label:(s==null?void 0:s.twoThirdsRow)??"2/3 de fila"},{value:"24",label:(s==null?void 0:s.fullRow)??"Fila completa"}]})]})]}),he.jsx("hr",{style:{margin:"16px 0",border:0,borderTop:"1px solid #f0f0f0"}})]})},cU=Xe.div`
190
+ display: flex;
191
+ flex-direction: column;
192
+ width: 100%;
193
+ `,hU=Xe.div`
194
+ display: flex;
195
+ border-bottom: ${t=>t.$position==="top"?"1px solid #f0f0f0":"none"};
196
+ border-top: ${t=>t.$position==="bottom"?"1px solid #f0f0f0":"none"};
197
+ order: ${t=>t.$position==="bottom"?1:0};
198
+ overflow-x: auto;
199
+ scrollbar-width: thin;
200
+
201
+ &::-webkit-scrollbar {
202
+ height: 4px;
203
+ }
204
+
205
+ &::-webkit-scrollbar-thumb {
206
+ background-color: #d9d9d9;
207
+ border-radius: 4px;
208
+ }
209
+ `,dU=Xe.button`
210
+ padding: 8px 16px;
211
+ border: none;
212
+ background-color: ${t=>t.$active?Rt(t.theme):"transparent"};
213
+ color: ${t=>t.$active?"white":"rgba(0, 0, 0, 0.85)"};
214
+ cursor: pointer;
215
+ border-radius: 4px;
216
+ margin: 4px;
217
+ transition: all 0.3s;
218
+ font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
219
+
220
+ &:hover {
221
+ color: ${t=>t.$active?"white":Rt(t.theme)};
222
+ }
223
+
224
+ &:focus {
225
+ outline: none;
226
+ }
227
+ `,fU=Xe.div`
228
+ padding: 16px;
229
+ order: ${t=>t.$tabPosition==="bottom"?0:1};
230
+ `,gU=({items:t,activeKey:e,onChange:r,tabPosition:n="top",type:i="line",theme:o,size:s="middle"})=>{const[a,l]=ne.useState(e||(t.length>0?t[0].key:"")),u=h=>{l(h),r&&r(h)},c=t.find(h=>h.key===a);return he.jsxs(cU,{children:[he.jsx(hU,{$position:n,children:t.map(h=>he.jsx(dU,{size:s,theme:o,$active:h.key===a,onClick:()=>u(h.key),children:h.label},h.key))}),he.jsx(fU,{$tabPosition:n,children:c==null?void 0:c.children})]})};var eg={exports:{}},mU=eg.exports,tI;function pU(){return tI||(tI=1,function(t,e){(function(r,n){t.exports=n()})(mU,function(){var r=1e3,n=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",c="week",h="month",d="quarter",f="year",g="date",w="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(J){var Z=["th","st","nd","rd"],ie=J%100;return"["+J+(Z[(ie-20)%10]||Z[ie]||Z[0])+"]"}},_=function(J,Z,ie){var ee=String(J);return!ee||ee.length>=Z?J:""+Array(Z+1-ee.length).join(ie)+J},O={s:_,z:function(J){var Z=-J.utcOffset(),ie=Math.abs(Z),ee=Math.floor(ie/60),te=ie%60;return(Z<=0?"+":"-")+_(ee,2,"0")+":"+_(te,2,"0")},m:function J(Z,ie){if(Z.date()<ie.date())return-J(ie,Z);var ee=12*(ie.year()-Z.year())+(ie.month()-Z.month()),te=Z.clone().add(ee,h),ae=ie-te<0,z=Z.clone().add(ee+(ae?-1:1),h);return+(-(ee+(ie-te)/(ae?te-z:z-te))||0)},a:function(J){return J<0?Math.ceil(J)||0:Math.floor(J)},p:function(J){return{M:h,y:f,w:c,d:u,D:g,h:l,m:a,s,ms:o,Q:d}[J]||String(J||"").toLowerCase().replace(/s$/,"")},u:function(J){return J===void 0}},T="en",M={};M[T]=p;var P="$isDayjsObject",G=function(J){return J instanceof Q||!(!J||!J[P])},j=function J(Z,ie,ee){var te;if(!Z)return T;if(typeof Z=="string"){var ae=Z.toLowerCase();M[ae]&&(te=ae),ie&&(M[ae]=ie,te=ae);var z=Z.split("-");if(!te&&z.length>1)return J(z[0])}else{var $=Z.name;M[$]=Z,te=$}return!ee&&te&&(T=te),te||!ee&&T},A=function(J,Z){if(G(J))return J.clone();var ie=typeof Z=="object"?Z:{};return ie.date=J,ie.args=arguments,new Q(ie)},q=O;q.l=j,q.i=G,q.w=function(J,Z){return A(J,{locale:Z.$L,utc:Z.$u,x:Z.$x,$offset:Z.$offset})};var Q=function(){function J(ie){this.$L=j(ie.locale,null,!0),this.parse(ie),this.$x=this.$x||ie.x||{},this[P]=!0}var Z=J.prototype;return Z.parse=function(ie){this.$d=function(ee){var te=ee.date,ae=ee.utc;if(te===null)return new Date(NaN);if(q.u(te))return new Date;if(te instanceof Date)return new Date(te);if(typeof te=="string"&&!/Z$/i.test(te)){var z=te.match(v);if(z){var $=z[2]-1||0,m=(z[7]||"0").substring(0,3);return ae?new Date(Date.UTC(z[1],$,z[3]||1,z[4]||0,z[5]||0,z[6]||0,m)):new Date(z[1],$,z[3]||1,z[4]||0,z[5]||0,z[6]||0,m)}}return new Date(te)}(ie),this.init()},Z.init=function(){var ie=this.$d;this.$y=ie.getFullYear(),this.$M=ie.getMonth(),this.$D=ie.getDate(),this.$W=ie.getDay(),this.$H=ie.getHours(),this.$m=ie.getMinutes(),this.$s=ie.getSeconds(),this.$ms=ie.getMilliseconds()},Z.$utils=function(){return q},Z.isValid=function(){return this.$d.toString()!==w},Z.isSame=function(ie,ee){var te=A(ie);return this.startOf(ee)<=te&&te<=this.endOf(ee)},Z.isAfter=function(ie,ee){return A(ie)<this.startOf(ee)},Z.isBefore=function(ie,ee){return this.endOf(ee)<A(ie)},Z.$g=function(ie,ee,te){return q.u(ie)?this[ee]:this.set(te,ie)},Z.unix=function(){return Math.floor(this.valueOf()/1e3)},Z.valueOf=function(){return this.$d.getTime()},Z.startOf=function(ie,ee){var te=this,ae=!!q.u(ee)||ee,z=q.p(ie),$=function(Y,R){var E=q.w(te.$u?Date.UTC(te.$y,R,Y):new Date(te.$y,R,Y),te);return ae?E:E.endOf(u)},m=function(Y,R){return q.w(te.toDate()[Y].apply(te.toDate("s"),(ae?[0,0,0,0]:[23,59,59,999]).slice(R)),te)},C=this.$W,y=this.$M,I=this.$D,x="set"+(this.$u?"UTC":"");switch(z){case f:return ae?$(1,0):$(31,11);case h:return ae?$(1,y):$(0,y+1);case c:var N=this.$locale().weekStart||0,B=(C<N?C+7:C)-N;return $(ae?I-B:I+(6-B),y);case u:case g:return m(x+"Hours",0);case l:return m(x+"Minutes",1);case a:return m(x+"Seconds",2);case s:return m(x+"Milliseconds",3);default:return this.clone()}},Z.endOf=function(ie){return this.startOf(ie,!1)},Z.$set=function(ie,ee){var te,ae=q.p(ie),z="set"+(this.$u?"UTC":""),$=(te={},te[u]=z+"Date",te[g]=z+"Date",te[h]=z+"Month",te[f]=z+"FullYear",te[l]=z+"Hours",te[a]=z+"Minutes",te[s]=z+"Seconds",te[o]=z+"Milliseconds",te)[ae],m=ae===u?this.$D+(ee-this.$W):ee;if(ae===h||ae===f){var C=this.clone().set(g,1);C.$d[$](m),C.init(),this.$d=C.set(g,Math.min(this.$D,C.daysInMonth())).$d}else $&&this.$d[$](m);return this.init(),this},Z.set=function(ie,ee){return this.clone().$set(ie,ee)},Z.get=function(ie){return this[q.p(ie)]()},Z.add=function(ie,ee){var te,ae=this;ie=Number(ie);var z=q.p(ee),$=function(y){var I=A(ae);return q.w(I.date(I.date()+Math.round(y*ie)),ae)};if(z===h)return this.set(h,this.$M+ie);if(z===f)return this.set(f,this.$y+ie);if(z===u)return $(1);if(z===c)return $(7);var m=(te={},te[a]=n,te[l]=i,te[s]=r,te)[z]||1,C=this.$d.getTime()+ie*m;return q.w(C,this)},Z.subtract=function(ie,ee){return this.add(-1*ie,ee)},Z.format=function(ie){var ee=this,te=this.$locale();if(!this.isValid())return te.invalidDate||w;var ae=ie||"YYYY-MM-DDTHH:mm:ssZ",z=q.z(this),$=this.$H,m=this.$m,C=this.$M,y=te.weekdays,I=te.months,x=te.meridiem,N=function(R,E,S,D){return R&&(R[E]||R(ee,ae))||S[E].slice(0,D)},B=function(R){return q.s($%12||12,R,"0")},Y=x||function(R,E,S){var D=R<12?"AM":"PM";return S?D.toLowerCase():D};return ae.replace(b,function(R,E){return E||function(S){switch(S){case"YY":return String(ee.$y).slice(-2);case"YYYY":return q.s(ee.$y,4,"0");case"M":return C+1;case"MM":return q.s(C+1,2,"0");case"MMM":return N(te.monthsShort,C,I,3);case"MMMM":return N(I,C);case"D":return ee.$D;case"DD":return q.s(ee.$D,2,"0");case"d":return String(ee.$W);case"dd":return N(te.weekdaysMin,ee.$W,y,2);case"ddd":return N(te.weekdaysShort,ee.$W,y,3);case"dddd":return y[ee.$W];case"H":return String($);case"HH":return q.s($,2,"0");case"h":return B(1);case"hh":return B(2);case"a":return Y($,m,!0);case"A":return Y($,m,!1);case"m":return String(m);case"mm":return q.s(m,2,"0");case"s":return String(ee.$s);case"ss":return q.s(ee.$s,2,"0");case"SSS":return q.s(ee.$ms,3,"0");case"Z":return z}return null}(R)||z.replace(":","")})},Z.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Z.diff=function(ie,ee,te){var ae,z=this,$=q.p(ee),m=A(ie),C=(m.utcOffset()-this.utcOffset())*n,y=this-m,I=function(){return q.m(z,m)};switch($){case f:ae=I()/12;break;case h:ae=I();break;case d:ae=I()/3;break;case c:ae=(y-C)/6048e5;break;case u:ae=(y-C)/864e5;break;case l:ae=y/i;break;case a:ae=y/n;break;case s:ae=y/r;break;default:ae=y}return te?ae:q.a(ae)},Z.daysInMonth=function(){return this.endOf(h).$D},Z.$locale=function(){return M[this.$L]},Z.locale=function(ie,ee){if(!ie)return this.$L;var te=this.clone(),ae=j(ie,ee,!0);return ae&&(te.$L=ae),te},Z.clone=function(){return q.w(this.$d,this)},Z.toDate=function(){return new Date(this.valueOf())},Z.toJSON=function(){return this.isValid()?this.toISOString():null},Z.toISOString=function(){return this.$d.toISOString()},Z.toString=function(){return this.$d.toUTCString()},J}(),ue=Q.prototype;return A.prototype=ue,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",h],["$y",f],["$D",g]].forEach(function(J){ue[J[1]]=function(Z){return this.$g(Z,J[0],J[1])}}),A.extend=function(J,Z){return J.$i||(J(Z,Q,A),J.$i=!0),A},A.locale=j,A.isDayjs=G,A.unix=function(J){return A(1e3*J)},A.en=M[T],A.Ls=M,A.p={},A})}(eg)),eg.exports}var wU=pU();const Lv=zM(wU),rI=ne.createContext({values:{},setFieldValue:()=>{},size:"middle"}),vU=Xe.form`
231
+ width: 100%;
232
+ `,nI=Xe.div`
233
+ margin-bottom: 24px;
234
+ `,iI=Xe.label`
235
+ font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
236
+ display: block;
237
+ margin-bottom: 8px;
238
+ color: rgba(0, 0, 0, 0.85);
239
+ `;Xe.div`
240
+ color: #ff4d4f;
241
+ font-size: 14px;
242
+ margin-top: 4px;
243
+ `;const yU=({label:t,labelProps:e,name:r,children:n,valuePropName:i="value",className:o})=>{var c,h,d;const{values:s,setFieldValue:a,size:l}=ne.useContext(rI),u=ne.Children.only(n);if(ne.isValidElement(u)&&r){const f=s[r],g=(c=u.props)==null?void 0:c.onChange,w=p=>{g&&g(p);const _=p&&p.target?i==="checked"?p.target.checked:p.target.value:p;a(r,_)},v={...u.props,[i]:f!==void 0?f:(h=u.props)==null?void 0:h[i],onChange:w,size:l||((d=u.props)==null?void 0:d.size)},b=ne.cloneElement(u,v);return he.jsxs(nI,{className:o,children:[t&&he.jsx(iI,{size:l,...e,children:t}),b]})}return he.jsxs(nI,{className:o,children:[t&&he.jsx(iI,{...e,children:t}),n]})},$v=({children:t,layout:e="horizontal",initialValues:r={},onValuesChange:n,size:i="middle",className:o,autoComplete:s})=>{const[a,l]=ne.useState(r);ne.useEffect(()=>{l(r)},[r]);const u=(c,h)=>{const d={...a,[c]:h};l(d),n&&n({[c]:h},d)};return he.jsx(rI.Provider,{value:{values:a,setFieldValue:u,size:i},children:he.jsx(vU,{className:o,autoComplete:s,children:t})})};$v.Item=yU;const CU=Xe.div`
244
+ display: flex;
245
+ flex-wrap: wrap;
246
+ margin-left: ${t=>t.$gutter?`-${t.$gutter[0]/2}px`:"0"};
247
+ margin-right: ${t=>t.$gutter?`-${t.$gutter[0]/2}px`:"0"};
248
+ margin-top: ${t=>t.$gutter&&t.$gutter[1]?`-${t.$gutter[1]/2}px`:"0"};
249
+ margin-bottom: ${t=>t.$gutter&&t.$gutter[1]?`-${t.$gutter[1]/2}px`:"0"};
250
+ `,oI=({children:t,gutter:e,className:r})=>he.jsx(CU,{$gutter:e,className:r,children:ne.Children.map(t,n=>{var i;return ne.isValidElement(n)&&e?ne.cloneElement(n,{style:{paddingLeft:e[0]/2,paddingRight:e[0]/2,paddingTop:e[1]?e[1]/2:0,paddingBottom:e[1]?e[1]/2:0,...(i=n.props)==null?void 0:i.style}}):n})}),ct=t=>`${t/24*100}%`,bU=Xe.div`
251
+ box-sizing: border-box;
252
+ min-width: 0;
253
+ flex: 0 0 ${t=>t.$span?ct(t.$span):"100%"};
254
+ max-width: ${t=>t.$span?ct(t.$span):"100%"};
255
+
256
+ @media (min-width: 576px) {
257
+ flex: 0 0
258
+ ${t=>t.$sm?ct(t.$sm):t.$span?ct(t.$span):"100%"};
259
+ max-width: ${t=>t.$sm?ct(t.$sm):t.$span?ct(t.$span):"100%"};
260
+ }
261
+
262
+ @media (min-width: 768px) {
263
+ flex: 0 0
264
+ ${t=>t.$md?ct(t.$md):t.$sm?ct(t.$sm):t.$span?ct(t.$span):"100%"};
265
+ max-width: ${t=>t.$md?ct(t.$md):t.$sm?ct(t.$sm):t.$span?ct(t.$span):"100%"};
266
+ }
267
+
268
+ @media (min-width: 992px) {
269
+ flex: 0 0
270
+ ${t=>t.$lg?ct(t.$lg):t.$md?ct(t.$md):t.$sm?ct(t.$sm):t.$span?ct(t.$span):"100%"};
271
+ max-width: ${t=>t.$lg?ct(t.$lg):t.$md?ct(t.$md):t.$sm?ct(t.$sm):t.$span?ct(t.$span):"100%"};
272
+ }
273
+
274
+ @media (min-width: 1200px) {
275
+ flex: 0 0
276
+ ${t=>t.$xl?ct(t.$xl):t.$lg?ct(t.$lg):t.$md?ct(t.$md):t.$sm?ct(t.$sm):t.$span?ct(t.$span):"100%"};
277
+ max-width: ${t=>t.$xl?ct(t.$xl):t.$lg?ct(t.$lg):t.$md?ct(t.$md):t.$sm?ct(t.$sm):t.$span?ct(t.$span):"100%"};
278
+ }
279
+ `,sI=({children:t,span:e,sm:r,md:n,lg:i,xl:o,className:s,style:a})=>he.jsx(bU,{$span:e,$sm:r,$md:n,$lg:i,$xl:o,className:s,style:a,children:t}),SU=Xe.div`
280
+ display: flex;
281
+ align-items: center;
282
+ margin-bottom: 8px;
283
+ `,RU=Xe.input`
284
+ margin-right: ${t=>t.size==="small"?"6px":t.size==="large"?"10px":"8px"};
285
+ cursor: pointer;
286
+ accent-color: ${t=>Rt(t.theme)};
287
+ /* Escala del checkbox nativo según size */
288
+ transform: ${t=>t.size==="small"?"scale(0.9)":t.size==="large"?"scale(1.1)":"scale(1)"};
289
+ transform-origin: left center;
290
+
291
+ &:disabled {
292
+ cursor: not-allowed;
293
+ }
294
+ `,EU=Xe.label`
295
+ cursor: pointer;
296
+ font-size: ${t=>t.size==="small"?"13px":t.size==="large"?"15px":"14px"};
297
+ line-height: 1.5715;
298
+
299
+ &:disabled {
300
+ cursor: not-allowed;
301
+ color: rgba(0, 0, 0, 0.25);
302
+ }
303
+ `,aI=({id:t,checked:e,disabled:r,onChange:n,children:i,...o})=>he.jsxs(SU,{children:[he.jsx(RU,{...o,id:t,type:"checkbox",checked:e,disabled:r,onChange:n}),he.jsx(EU,{size:o==null?void 0:o.size,htmlFor:t,children:i})]}),TU=({id:t,value:e=[],disabled:r,onChange:n,children:i,style:o})=>{const s=(l,u)=>{const c=u?[...e,l]:e.filter(h=>h!==l);n==null||n(c)},a=ne.Children.map(i,(l,u)=>{if(ne.isValidElement(l)){const c=l.props;return ne.cloneElement(l,{...c,id:t,onCheckboxChange:s,groupValue:e,disabled:r||(c==null?void 0:c.disabled)})}return l});return he.jsx("div",{style:o,children:a})},_U=Xe.input`
304
+ width: 100%;
305
+ padding: ${t=>t.size==="small"?"4px 11px":t.size==="large"?"8px 11px":"6px 11px"};
306
+ font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
307
+ line-height: 1.5715;
308
+ background-color: #fff;
309
+ background-image: none;
310
+ border: 1px solid #d9d9d9;
311
+ border-radius: 2px;
312
+ transition: all 0.3s;
313
+ box-sizing: border-box;
314
+
315
+ &:hover {
316
+ border-color: ${t=>Rt(t.theme)};
317
+ }
318
+
319
+ &:focus {
320
+ border-color: ${t=>Rt(t.theme)};
321
+ box-shadow: 0 0 0 2px
322
+ ${t=>Qc({primaryColor:Rt(t.theme),focusShadowColor:(t==null?void 0:t.$focusShadowColor)??Rt(t.theme)})};
323
+ outline: 0;
324
+ }
325
+
326
+ &:disabled {
327
+ background-color: #f5f5f5;
328
+ cursor: not-allowed;
329
+ opacity: 1;
330
+ }
331
+ `,MU=({value:t,disabled:e,showTime:r,onChange:n,borderRadius:i,focusShadowColor:o,...s})=>{const a=l=>{l.target.value&&n&&n(Lv(l.target.value))};return he.jsx(_U,{...s,$borderRadius:i,$focusShadowColor:o,type:r?"datetime-local":"date",value:typeof t!="string"?Lv(t).format(r?"YYYY-MM-DDTHH:mm":"YYYY-MM-DD"):t,disabled:e,onChange:a})},PU=Xe.input`
332
+ width: 100%;
333
+ padding: ${t=>t.size==="small"?"5px 11px":t.size==="large"?"9px 11px":"7px 11px"};
334
+ font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
335
+ line-height: 1.5715;
336
+ background-color: #fff;
337
+ background-image: none;
338
+ border: 1px solid #d9d9d9;
339
+ border-radius: ${t=>(t==null?void 0:t.$borderRadius)??"2px"};
340
+ transition: all 0.3s;
341
+ box-sizing: border-box;
342
+
343
+ &:hover {
344
+ border-color: ${t=>Rt(t.theme)};
345
+ }
346
+
347
+ &:focus {
348
+ border-color: ${t=>Rt(t.theme)};
349
+ box-shadow: 0 0 0 2px
350
+ ${t=>Qc({primaryColor:Rt(t.theme),focusShadowColor:(t==null?void 0:t.$focusShadowColor)??Rt(t.theme)})};
351
+ outline: 0;
352
+ }
353
+
354
+ &:disabled,
355
+ &[readonly] {
356
+ background-color: #f5f5f5;
357
+ cursor: not-allowed;
358
+ opacity: 1;
359
+ }
360
+ `,IU=Xe.textarea`
361
+ width: 100%;
362
+ padding: ${t=>t.size==="small"?"4px 11px":t.size==="large"?"8px 11px":"6px 11px"};
363
+ font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
364
+ line-height: 1.5715;
365
+ background-color: #fff;
366
+ background-image: none;
367
+ border: 1px solid #d9d9d9;
368
+ border-radius: ${t=>(t==null?void 0:t.$borderRadius)??"2px"};
369
+ transition: all 0.3s;
370
+ min-height: 100px;
371
+ resize: vertical;
372
+ box-sizing: border-box;
373
+
374
+ &:hover {
375
+ border-color: ${t=>Rt(t.theme)};
376
+ }
377
+
378
+ &:focus {
379
+ border-color: ${t=>Rt(t.theme)};
380
+ box-shadow: 0 0 0 2px
381
+ ${t=>Qc({primaryColor:Rt(t.theme),focusShadowColor:(t==null?void 0:t.$focusShadowColor)??Rt(t.theme)})};
382
+ outline: 0;
383
+ }
384
+
385
+ &:disabled,
386
+ &[readonly] {
387
+ background-color: #f5f5f5;
388
+ cursor: not-allowed;
389
+ opacity: 1;
390
+ }
391
+ `,OU=({id:t,value:e,readOnly:r,onChange:n,borderRadius:i,focusShadowColor:o,...s})=>he.jsx(PU,{...s,$borderRadius:i,$focusShadowColor:o,type:"text",id:t,value:e,readOnly:r,onChange:n}),xU=({id:t,value:e,readOnly:r,onChange:n,borderRadius:i,focusShadowColor:o,...s})=>he.jsx(IU,{...s,$borderRadius:i,$focusShadowColor:o,id:t,value:e,readOnly:r,onChange:n}),AU=Xe.div`
392
+ display: inline-flex;
393
+ width: 100%;
394
+ position: relative;
395
+ `,HU=Xe.input`
396
+ width: 100%;
397
+ padding: ${t=>t.size==="small"?"5px 11px":t.size==="large"?"9px 11px":"7px 11px"};
398
+ font-size: ${t=>t.size==="small"?"14px":t.size==="large"?"16px":"14px"};
399
+ line-height: 1.5715;
400
+ background-color: #fff;
401
+ background-image: none;
402
+ border: 1px solid #d9d9d9;
403
+ border-radius: ${t=>(t==null?void 0:t.$borderRadius)??"2px"};
404
+ transition: all 0.3s;
405
+ box-sizing: border-box;
406
+
407
+ &:hover {
408
+ border-color: ${t=>Rt(t.theme)};
409
+ }
410
+
411
+ &:focus {
412
+ border-color: ${t=>Rt(t.theme)};
413
+ box-shadow: 0 0 0 2px
414
+ ${t=>Qc({primaryColor:Rt(t.theme),focusShadowColor:(t==null?void 0:t.$focusShadowColor)??Rt(t.theme)})};
415
+ outline: 0;
416
+ }
417
+
418
+ &:disabled {
419
+ background-color: #f5f5f5;
420
+ cursor: not-allowed;
421
+ opacity: 1;
422
+ }
423
+ `,NU=Xe.div`
424
+ position: absolute;
425
+ right: 0;
426
+ top: 0;
427
+ height: 100%;
428
+ display: flex;
429
+ flex-direction: column;
430
+ width: 22px;
431
+ border-left: 1px solid #d9d9d9;
432
+ `,lI=Xe.button`
433
+ height: 50%;
434
+ width: 100%;
435
+ display: flex;
436
+ align-items: center;
437
+ justify-content: center;
438
+ border: none;
439
+ background: #fafafa;
440
+ cursor: ${t=>t.disabled?"not-allowed":"pointer"};
441
+ opacity: ${t=>t.disabled?.5:1};
442
+
443
+ &:hover {
444
+ background-color: ${t=>t.disabled?"#fafafa":"#f0f0f0"};
445
+ }
446
+
447
+ &:first-child {
448
+ border-bottom: 1px solid #d9d9d9;
449
+ }
450
+ `,DU=({id:t,value:e,defaultValue:r,min:n,max:i,step:o=1,disabled:s=!1,onChange:a,className:l,borderRadius:u,focusShadowColor:c,...h})=>{const[d,f]=ne.useState(e!==void 0?e:r);ne.useEffect(()=>{e!==void 0&&f(e)},[e]);const g=p=>{const _=p.target.value===""?void 0:parseFloat(p.target.value);(_===void 0||!isNaN(_))&&(f(_),a&&_!==void 0&&a(_))},w=()=>{if(d!==void 0){let p=d;n!==void 0&&d<n&&(p=n),i!==void 0&&d>i&&(p=i),p!==d&&(f(p),a&&a(p))}},v=()=>{if(s||i!==void 0&&d!==void 0&&d>=i)return;const p=(d||0)+o;f(p),a&&a(p)},b=()=>{if(s||n!==void 0&&d!==void 0&&d<=n)return;const p=(d||0)-o;f(p),a&&a(p)};return he.jsxs(AU,{className:l,children:[he.jsx(HU,{...h,$borderRadius:u,$focusShadowColor:c,id:t,type:"number",value:d===void 0?"":d,onChange:g,onBlur:w,min:n,max:i,step:o,disabled:s}),he.jsxs(NU,{children:[he.jsx(lI,{onClick:v,disabled:s||i!==void 0&&d!==void 0&&d>=i,children:"▲"}),he.jsx(lI,{onClick:b,disabled:s||n!==void 0&&d!==void 0&&d<=n,children:"▼"})]})]})},kU=Xe.div`
451
+ display: flex;
452
+ flex-direction: column;
453
+ `,LU=Xe.div`
454
+ display: flex;
455
+ align-items: center;
456
+ margin-bottom: 8px;
457
+ `,$U=Xe.input`
458
+ margin-right: ${t=>t.size==="small"?"6px":t.size==="large"?"10px":"8px"};
459
+ cursor: pointer;
460
+ accent-color: ${t=>Rt(t.theme)};
461
+ /* Escala del checkbox nativo según size */
462
+ transform: ${t=>t.size==="small"?"scale(0.9)":t.size==="large"?"scale(1.1)":"scale(1)"};
463
+ transform-origin: left center;
464
+
465
+ &:disabled {
466
+ cursor: not-allowed;
467
+ }
468
+ `,FU=Xe.label`
469
+ cursor: pointer;
470
+ font-size: ${t=>t.size==="small"?"13px":t.size==="large"?"15px":"14px"};
471
+ line-height: 1.5715;
472
+
473
+ &:disabled {
474
+ cursor: not-allowed;
475
+ color: rgba(0, 0, 0, 0.25);
476
+ }
477
+ `,uI=({id:t,value:e,checked:r,disabled:n,onChange:i,children:o,...s})=>he.jsxs(LU,{children:[he.jsx($U,{...s,id:t,type:"radio",value:e,checked:r,disabled:n,onChange:i}),he.jsx(FU,{size:s.size,htmlFor:t,children:o})]}),VU={input:OU,check:TU,radio:({id:t,value:e,disabled:r,onChange:n,options:i=[],...o})=>{const s=a=>{n==null||n({target:{value:a.target.value}})};return he.jsx(kU,{children:i.map((a,l)=>ne.createElement(uI,{...o,id:`${t}-${l}`,key:l,value:a.value,checked:e===a.value,disabled:r,onChange:s},a.label))})},textarea:xU,datetime:MU,select:kv,number:DU},WU={check:aI,radio:uI},BU=t=>{var n,i;const{type:e,value:r}=t;if(r==null||r==="")switch(e){case"check":return(n=t.option)!=null&&n.length?[]:!1;case"radio":return;case"number":return;case"datetime":return;case"select":return;case"input":case"textarea":default:return""}switch(e){case"check":return(i=t.option)!=null&&i.length?typeof r=="string"?r.split(", ").filter(o=>o.trim()!==""):Array.isArray(r)?r:[r].filter(Boolean):typeof r=="boolean"?r:typeof r=="string"?r.toLowerCase()==="true"||r==="1":!!r;case"radio":case"select":return r;case"number":if(typeof r=="number")return r;if(typeof r=="string"){const o=parseFloat(r);return isNaN(o)?void 0:o}return;case"datetime":if(typeof r=="string"&&r.trim()!==""){const o=Lv(r);return o.isValid()?o:void 0}return;case"input":case"textarea":default:return String(r)}};function jU({config:t,itemOptions:e,...r}){const n=(l,u)=>{const c=[...r.item.items];c[l]=u,r.onUpdate({...r.item,items:c})},i=({id:l,item:u,onCheckboxChange:c,groupValue:h=[],disabled:d,...f})=>{var g;return he.jsx(he.Fragment,{children:he.jsx(oI,{children:(g=u.option)==null?void 0:g.map((w,v)=>{const b=w.value??w.alias,p=h.includes(b);return he.jsx(sI,{span:24,sm:12,md:10,lg:8,xl:6,children:he.jsx(aI,{id:`${l}-${v}`,...f,checked:p,disabled:d,onChange:_=>{c==null||c(b,_.target.checked)},children:w.alias})},v)})})})},o=(l,u,c)=>{n(l,{...u,value:c.join(", ")})},s=(l,u)=>{var j;const c=`item${l}`,h={label:u.alias,labelProps:{htmlFor:c},name:u.cell},d=!u.action_type.includes("write"),f=!((j=u.option)!=null&&j.length)&&["check","radio"].includes(u.type)?"item1":"item",P={item:{select:()=>{var A,q;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.Select,id:c,disabled:d,onChange:Q=>n(l,{...u,value:Q}),options:(q=u.option)==null?void 0:q.map(Q=>({value:Q.value??Q.alias,label:Q.alias}))}}},input:()=>{var A;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.Input,id:c,readOnly:d,onChange:q=>{n(l,{...u,value:q.target.value})}}}},check:()=>{var A;return{formItem:{labelProps:{htmlFor:void 0}},item:{id:c,children:he.jsx(i,{...(A=t==null?void 0:t.components)==null?void 0:A.Checkbox,size:e==null?void 0:e.size,theme:t==null?void 0:t.theme,item:u}),style:{width:"100%"},disabled:d,onChange:q=>{o(l,u,q)}}}},radio:()=>{var A,q;return{formItem:{labelProps:{htmlFor:void 0}},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.Radio,id:c,disabled:d,onChange:Q=>n(l,{...u,value:Q.target.value}),options:(q=u.option)==null?void 0:q.map(Q=>({value:Q.value??Q.alias,label:Q.alias}))}}},textarea:()=>{var A;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.TextArea,id:c,readOnly:d,onChange:q=>n(l,{...u,value:q.target.value})}}},datetime:()=>{var A;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.DataPicker,id:c,disabled:d,showTime:!0,onChange:q=>n(l,{...u,value:(q==null?void 0:q.format())||""})}}},number:()=>{var A;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.InputNumber,id:c,className:"w-full",disabled:d,onChange:q=>n(l,{...u,value:q})}}}},item1:{check:()=>{var A;return{formItem:{name:u.cell,valuePropName:"checked"},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.Checkbox,id:c,disabled:d,children:u.alias,onChange:q=>n(l,{...u,value:q.target.checked})}}},radio:()=>{var A;return{formItem:{},item:{theme:t==null?void 0:t.theme,...(A=t==null?void 0:t.components)==null?void 0:A.Radio,disabled:d,onChange:q=>n(l,{...u,value:q.target.value})}}}}}[f][u.type],G=P==null?void 0:P();return{Component:f==="item"?VU[u.type]:WU[u.type],props:G,formItemProps:h}},a=r.item.items.reduce((l,u,c)=>(l[`item${c}`]=BU(u),l),{});return he.jsx($v,{layout:"vertical",className:"w-full mb-6",autoComplete:"off",initialValues:{...e,...a},size:(e==null?void 0:e.size)??"middle",children:he.jsx(oI,{gutter:[16,16],children:r.item.items.map((l,u)=>{const{Component:c,props:h,formItemProps:d}=s(u,l);return he.jsx(sI,{span:(e==null?void 0:e.span)??24,children:he.jsx($v.Item,{...d,...h==null?void 0:h.formItem,name:`item${u}`,children:he.jsx(c,{...h==null?void 0:h.item})})},u)})})})}var cI={},eh,hI;function tr(){if(hI)return eh;hI=1;var t=function(e){return e&&e.Math===Math&&e};return eh=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof UM=="object"&&UM)||t(typeof eh=="object"&&eh)||function(){return this}()||Function("return this")(),eh}var Fv={},Vv,dI;function lr(){return dI||(dI=1,Vv=function(t){try{return!!t()}catch{return!0}}),Vv}var Wv,fI;function Gn(){if(fI)return Wv;fI=1;var t=lr();return Wv=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Wv}var Bv,gI;function tg(){if(gI)return Bv;gI=1;var t=lr();return Bv=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Bv}var jv,mI;function ur(){if(mI)return jv;mI=1;var t=tg(),e=Function.prototype.call;return jv=t?e.bind(e):function(){return e.apply(e,arguments)},jv}var Uv={},pI;function UU(){if(pI)return Uv;pI=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return Uv.f=r?function(i){var o=e(this,i);return!!o&&o.enumerable}:t,Uv}var zv,wI;function rg(){return wI||(wI=1,zv=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),zv}var Yv,vI;function rr(){if(vI)return Yv;vI=1;var t=tg(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return Yv=t?n:function(i){return function(){return r.apply(i,arguments)}},Yv}var Gv,yI;function ka(){if(yI)return Gv;yI=1;var t=rr(),e=t({}.toString),r=t("".slice);return Gv=function(n){return r(e(n),8,-1)},Gv}var qv,CI;function zU(){if(CI)return qv;CI=1;var t=rr(),e=lr(),r=ka(),n=Object,i=t("".split);return qv=e(function(){return!n("z").propertyIsEnumerable(0)})?function(o){return r(o)==="String"?i(o,""):n(o)}:n,qv}var Kv,bI;function Xv(){return bI||(bI=1,Kv=function(t){return t==null}),Kv}var Zv,SI;function th(){if(SI)return Zv;SI=1;var t=Xv(),e=TypeError;return Zv=function(r){if(t(r))throw new e("Can't call method on "+r);return r},Zv}var Jv,RI;function rh(){if(RI)return Jv;RI=1;var t=zU(),e=th();return Jv=function(r){return t(e(r))},Jv}var Qv,EI;function cr(){if(EI)return Qv;EI=1;var t=typeof document=="object"&&document.all;return Qv=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Qv}var ey,TI;function qn(){if(TI)return ey;TI=1;var t=cr();return ey=function(e){return typeof e=="object"?e!==null:t(e)},ey}var ty,_I;function fu(){if(_I)return ty;_I=1;var t=tr(),e=cr(),r=function(n){return e(n)?n:void 0};return ty=function(n,i){return arguments.length<2?r(t[n]):t[n]&&t[n][i]},ty}var ry,MI;function nh(){if(MI)return ry;MI=1;var t=rr();return ry=t({}.isPrototypeOf),ry}var ny,PI;function ng(){if(PI)return ny;PI=1;var t=tr(),e=t.navigator,r=e&&e.userAgent;return ny=r?String(r):"",ny}var iy,II;function YU(){if(II)return iy;II=1;var t=tr(),e=ng(),r=t.process,n=t.Deno,i=r&&r.versions||n&&n.version,o=i&&i.v8,s,a;return o&&(s=o.split("."),a=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!a&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(a=+s[1]))),iy=a,iy}var oy,OI;function sy(){if(OI)return oy;OI=1;var t=YU(),e=lr(),r=tr(),n=r.String;return oy=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!n(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&t&&t<41}),oy}var ay,xI;function AI(){if(xI)return ay;xI=1;var t=sy();return ay=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ay}var ly,HI;function uy(){if(HI)return ly;HI=1;var t=fu(),e=cr(),r=nh(),n=AI(),i=Object;return ly=n?function(o){return typeof o=="symbol"}:function(o){var s=t("Symbol");return e(s)&&r(s.prototype,i(o))},ly}var cy,NI;function ig(){if(NI)return cy;NI=1;var t=String;return cy=function(e){try{return t(e)}catch{return"Object"}},cy}var hy,DI;function ln(){if(DI)return hy;DI=1;var t=cr(),e=ig(),r=TypeError;return hy=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},hy}var dy,kI;function ih(){if(kI)return dy;kI=1;var t=ln(),e=Xv();return dy=function(r,n){var i=r[n];return e(i)?void 0:t(i)},dy}var fy,LI;function GU(){if(LI)return fy;LI=1;var t=ur(),e=cr(),r=qn(),n=TypeError;return fy=function(i,o){var s,a;if(o==="string"&&e(s=i.toString)&&!r(a=t(s,i))||e(s=i.valueOf)&&!r(a=t(s,i))||o!=="string"&&e(s=i.toString)&&!r(a=t(s,i)))return a;throw new n("Can't convert object to primitive value")},fy}var gy={exports:{}},my,$I;function Fs(){return $I||($I=1,my=!1),my}var py,FI;function wy(){if(FI)return py;FI=1;var t=tr(),e=Object.defineProperty;return py=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},py}var VI;function vy(){if(VI)return gy.exports;VI=1;var t=Fs(),e=tr(),r=wy(),n="__core-js_shared__",i=gy.exports=e[n]||r(n,{});return(i.versions||(i.versions=[])).push({version:"3.43.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",source:"https://github.com/zloirock/core-js"}),gy.exports}var yy,WI;function BI(){if(WI)return yy;WI=1;var t=vy();return yy=function(e,r){return t[e]||(t[e]=r||{})},yy}var Cy,jI;function gu(){if(jI)return Cy;jI=1;var t=th(),e=Object;return Cy=function(r){return e(t(r))},Cy}var by,UI;function Kn(){if(UI)return by;UI=1;var t=rr(),e=gu(),r=t({}.hasOwnProperty);return by=Object.hasOwn||function(i,o){return r(e(i),o)},by}var Sy,zI;function YI(){if(zI)return Sy;zI=1;var t=rr(),e=0,r=Math.random(),n=t(1.1.toString);return Sy=function(i){return"Symbol("+(i===void 0?"":i)+")_"+n(++e+r,36)},Sy}var Ry,GI;function yi(){if(GI)return Ry;GI=1;var t=tr(),e=BI(),r=Kn(),n=YI(),i=sy(),o=AI(),s=t.Symbol,a=e("wks"),l=o?s.for||s:s&&s.withoutSetter||n;return Ry=function(u){return r(a,u)||(a[u]=i&&r(s,u)?s[u]:l("Symbol."+u)),a[u]},Ry}var Ey,qI;function qU(){if(qI)return Ey;qI=1;var t=ur(),e=qn(),r=uy(),n=ih(),i=GU(),o=yi(),s=TypeError,a=o("toPrimitive");return Ey=function(l,u){if(!e(l)||r(l))return l;var c=n(l,a),h;if(c){if(u===void 0&&(u="default"),h=t(c,l,u),!e(h)||r(h))return h;throw new s("Can't convert object to primitive value")}return u===void 0&&(u="number"),i(l,u)},Ey}var Ty,KI;function XI(){if(KI)return Ty;KI=1;var t=qU(),e=uy();return Ty=function(r){var n=t(r,"string");return e(n)?n:n+""},Ty}var _y,ZI;function My(){if(ZI)return _y;ZI=1;var t=tr(),e=qn(),r=t.document,n=e(r)&&e(r.createElement);return _y=function(i){return n?r.createElement(i):{}},_y}var Py,JI;function QI(){if(JI)return Py;JI=1;var t=Gn(),e=lr(),r=My();return Py=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),Py}var eO;function tO(){if(eO)return Fv;eO=1;var t=Gn(),e=ur(),r=UU(),n=rg(),i=rh(),o=XI(),s=Kn(),a=QI(),l=Object.getOwnPropertyDescriptor;return Fv.f=t?l:function(c,h){if(c=i(c),h=o(h),a)try{return l(c,h)}catch{}if(s(c,h))return n(!e(r.f,c,h),c[h])},Fv}var Iy={},Oy,rO;function nO(){if(rO)return Oy;rO=1;var t=Gn(),e=lr();return Oy=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Oy}var xy,iO;function hr(){if(iO)return xy;iO=1;var t=qn(),e=String,r=TypeError;return xy=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},xy}var oO;function Vs(){if(oO)return Iy;oO=1;var t=Gn(),e=QI(),r=nO(),n=hr(),i=XI(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",c="writable";return Iy.f=t?r?function(d,f,g){if(n(d),f=i(f),n(g),typeof d=="function"&&f==="prototype"&&"value"in g&&c in g&&!g[c]){var w=a(d,f);w&&w[c]&&(d[f]=g.value,g={configurable:u in g?g[u]:w[u],enumerable:l in g?g[l]:w[l],writable:!1})}return s(d,f,g)}:s:function(d,f,g){if(n(d),f=i(f),n(g),e)try{return s(d,f,g)}catch{}if("get"in g||"set"in g)throw new o("Accessors not supported");return"value"in g&&(d[f]=g.value),d},Iy}var Ay,sO;function mu(){if(sO)return Ay;sO=1;var t=Gn(),e=Vs(),r=rg();return Ay=t?function(n,i,o){return e.f(n,i,r(1,o))}:function(n,i,o){return n[i]=o,n},Ay}var Hy={exports:{}},Ny,aO;function KU(){if(aO)return Ny;aO=1;var t=Gn(),e=Kn(),r=Function.prototype,n=t&&Object.getOwnPropertyDescriptor,i=e(r,"name"),o=i&&(function(){}).name==="something",s=i&&(!t||t&&n(r,"name").configurable);return Ny={EXISTS:i,PROPER:o,CONFIGURABLE:s},Ny}var Dy,lO;function XU(){if(lO)return Dy;lO=1;var t=rr(),e=cr(),r=vy(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(i){return n(i)}),Dy=r.inspectSource,Dy}var ky,uO;function ZU(){if(uO)return ky;uO=1;var t=tr(),e=cr(),r=t.WeakMap;return ky=e(r)&&/native code/.test(String(r)),ky}var Ly,cO;function $y(){if(cO)return Ly;cO=1;var t=BI(),e=YI(),r=t("keys");return Ly=function(n){return r[n]||(r[n]=e(n))},Ly}var Fy,hO;function Vy(){return hO||(hO=1,Fy={}),Fy}var Wy,dO;function fO(){if(dO)return Wy;dO=1;var t=ZU(),e=tr(),r=qn(),n=mu(),i=Kn(),o=vy(),s=$y(),a=Vy(),l="Object already initialized",u=e.TypeError,c=e.WeakMap,h,d,f,g=function(p){return f(p)?d(p):h(p,{})},w=function(p){return function(_){var O;if(!r(_)||(O=d(_)).type!==p)throw new u("Incompatible receiver, "+p+" required");return O}};if(t||o.state){var v=o.state||(o.state=new c);v.get=v.get,v.has=v.has,v.set=v.set,h=function(p,_){if(v.has(p))throw new u(l);return _.facade=p,v.set(p,_),_},d=function(p){return v.get(p)||{}},f=function(p){return v.has(p)}}else{var b=s("state");a[b]=!0,h=function(p,_){if(i(p,b))throw new u(l);return _.facade=p,n(p,b,_),_},d=function(p){return i(p,b)?p[b]:{}},f=function(p){return i(p,b)}}return Wy={set:h,get:d,has:f,enforce:g,getterFor:w},Wy}var gO;function mO(){if(gO)return Hy.exports;gO=1;var t=rr(),e=lr(),r=cr(),n=Kn(),i=Gn(),o=KU().CONFIGURABLE,s=XU(),a=fO(),l=a.enforce,u=a.get,c=String,h=Object.defineProperty,d=t("".slice),f=t("".replace),g=t([].join),w=i&&!e(function(){return h(function(){},"length",{value:8}).length!==8}),v=String(String).split("String"),b=Hy.exports=function(p,_,O){d(c(_),0,7)==="Symbol("&&(_="["+f(c(_),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),O&&O.getter&&(_="get "+_),O&&O.setter&&(_="set "+_),(!n(p,"name")||o&&p.name!==_)&&(i?h(p,"name",{value:_,configurable:!0}):p.name=_),w&&O&&n(O,"arity")&&p.length!==O.arity&&h(p,"length",{value:O.arity});try{O&&n(O,"constructor")&&O.constructor?i&&h(p,"prototype",{writable:!1}):p.prototype&&(p.prototype=void 0)}catch{}var T=l(p);return n(T,"source")||(T.source=g(v,typeof _=="string"?_:"")),p};return Function.prototype.toString=b(function(){return r(this)&&u(this).source||s(this)},"toString"),Hy.exports}var By,pO;function jy(){if(pO)return By;pO=1;var t=cr(),e=Vs(),r=mO(),n=wy();return By=function(i,o,s,a){a||(a={});var l=a.enumerable,u=a.name!==void 0?a.name:o;if(t(s)&&r(s,u,a),a.global)l?i[o]=s:n(o,s);else{try{a.unsafe?i[o]&&(l=!0):delete i[o]}catch{}l?i[o]=s:e.f(i,o,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return i},By}var Uy={},zy,wO;function JU(){if(wO)return zy;wO=1;var t=Math.ceil,e=Math.floor;return zy=Math.trunc||function(n){var i=+n;return(i>0?e:t)(i)},zy}var Yy,vO;function oh(){if(vO)return Yy;vO=1;var t=JU();return Yy=function(e){var r=+e;return r!==r||r===0?0:t(r)},Yy}var Gy,yO;function QU(){if(yO)return Gy;yO=1;var t=oh(),e=Math.max,r=Math.min;return Gy=function(n,i){var o=t(n);return o<0?e(o+i,0):r(o,i)},Gy}var qy,CO;function ez(){if(CO)return qy;CO=1;var t=oh(),e=Math.min;return qy=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},qy}var Ky,bO;function pu(){if(bO)return Ky;bO=1;var t=ez();return Ky=function(e){return t(e.length)},Ky}var Xy,SO;function tz(){if(SO)return Xy;SO=1;var t=rh(),e=QU(),r=pu(),n=function(i){return function(o,s,a){var l=t(o),u=r(l);if(u===0)return!i&&-1;var c=e(a,u),h;if(i&&s!==s){for(;u>c;)if(h=l[c++],h!==h)return!0}else for(;u>c;c++)if((i||c in l)&&l[c]===s)return i||c||0;return!i&&-1}};return Xy={includes:n(!0),indexOf:n(!1)},Xy}var Zy,RO;function EO(){if(RO)return Zy;RO=1;var t=rr(),e=Kn(),r=rh(),n=tz().indexOf,i=Vy(),o=t([].push);return Zy=function(s,a){var l=r(s),u=0,c=[],h;for(h in l)!e(i,h)&&e(l,h)&&o(c,h);for(;a.length>u;)e(l,h=a[u++])&&(~n(c,h)||o(c,h));return c},Zy}var Jy,TO;function Qy(){return TO||(TO=1,Jy=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Jy}var _O;function rz(){if(_O)return Uy;_O=1;var t=EO(),e=Qy(),r=e.concat("length","prototype");return Uy.f=Object.getOwnPropertyNames||function(i){return t(i,r)},Uy}var eC={},MO;function nz(){return MO||(MO=1,eC.f=Object.getOwnPropertySymbols),eC}var tC,PO;function iz(){if(PO)return tC;PO=1;var t=fu(),e=rr(),r=rz(),n=nz(),i=hr(),o=e([].concat);return tC=t("Reflect","ownKeys")||function(a){var l=r.f(i(a)),u=n.f;return u?o(l,u(a)):l},tC}var rC,IO;function OO(){if(IO)return rC;IO=1;var t=Kn(),e=iz(),r=tO(),n=Vs();return rC=function(i,o,s){for(var a=e(o),l=n.f,u=r.f,c=0;c<a.length;c++){var h=a[c];!t(i,h)&&!(s&&t(s,h))&&l(i,h,u(o,h))}},rC}var nC,xO;function oz(){if(xO)return nC;xO=1;var t=lr(),e=cr(),r=/#|\.prototype\./,n=function(l,u){var c=o[i(l)];return c===a?!0:c===s?!1:e(u)?t(u):!!u},i=n.normalize=function(l){return String(l).replace(r,".").toLowerCase()},o=n.data={},s=n.NATIVE="N",a=n.POLYFILL="P";return nC=n,nC}var iC,AO;function bt(){if(AO)return iC;AO=1;var t=tr(),e=tO().f,r=mu(),n=jy(),i=wy(),o=OO(),s=oz();return iC=function(a,l){var u=a.target,c=a.global,h=a.stat,d,f,g,w,v,b;if(c?f=t:h?f=t[u]||i(u,{}):f=t[u]&&t[u].prototype,f)for(g in l){if(v=l[g],a.dontCallGetSet?(b=e(f,g),w=b&&b.value):w=f[g],d=s(c?g:u+(h?".":"#")+g,a.forced),!d&&w!==void 0){if(typeof v==typeof w)continue;o(v,w)}(a.sham||w&&w.sham)&&r(v,"sham",!0),n(f,g,v,a)}},iC}var oC,HO;function sh(){if(HO)return oC;HO=1;var t=tg(),e=Function.prototype,r=e.apply,n=e.call;return oC=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),oC}var sC,NO;function DO(){if(NO)return sC;NO=1;var t=rr(),e=ln();return sC=function(r,n,i){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[i]))}catch{}},sC}var aC,kO;function sz(){if(kO)return aC;kO=1;var t=qn();return aC=function(e){return t(e)||e===null},aC}var lC,LO;function az(){if(LO)return lC;LO=1;var t=sz(),e=String,r=TypeError;return lC=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},lC}var uC,$O;function FO(){if($O)return uC;$O=1;var t=DO(),e=qn(),r=th(),n=az();return uC=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,o={},s;try{s=t(Object.prototype,"__proto__","set"),s(o,[]),i=o instanceof Array}catch{}return function(l,u){return r(l),n(u),e(l)&&(i?s(l,u):l.__proto__=u),l}}():void 0),uC}var cC,VO;function lz(){if(VO)return cC;VO=1;var t=Vs().f;return cC=function(e,r,n){n in e||t(e,n,{configurable:!0,get:function(){return r[n]},set:function(i){r[n]=i}})},cC}var hC,WO;function uz(){if(WO)return hC;WO=1;var t=cr(),e=qn(),r=FO();return hC=function(n,i,o){var s,a;return r&&t(s=i.constructor)&&s!==o&&e(a=s.prototype)&&a!==o.prototype&&r(n,a),n},hC}var dC,BO;function cz(){if(BO)return dC;BO=1;var t=yi(),e=t("toStringTag"),r={};return r[e]="z",dC=String(r)==="[object z]",dC}var fC,jO;function UO(){if(jO)return fC;jO=1;var t=cz(),e=cr(),r=ka(),n=yi(),i=n("toStringTag"),o=Object,s=r(function(){return arguments}())==="Arguments",a=function(l,u){try{return l[u]}catch{}};return fC=t?r:function(l){var u,c,h;return l===void 0?"Undefined":l===null?"Null":typeof(c=a(u=o(l),i))=="string"?c:s?r(u):(h=r(u))==="Object"&&e(u.callee)?"Arguments":h},fC}var gC,zO;function og(){if(zO)return gC;zO=1;var t=UO(),e=String;return gC=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},gC}var mC,YO;function hz(){if(YO)return mC;YO=1;var t=og();return mC=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},mC}var pC,GO;function dz(){if(GO)return pC;GO=1;var t=qn(),e=mu();return pC=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},pC}var wC,qO;function fz(){if(qO)return wC;qO=1;var t=rr(),e=Error,r=t("".replace),n=function(s){return String(new e(s).stack)}("zxcasd"),i=/\n\s*at [^:]*:[^\n]*/,o=i.test(n);return wC=function(s,a){if(o&&typeof s=="string"&&!e.prepareStackTrace)for(;a--;)s=r(s,i,"");return s},wC}var vC,KO;function gz(){if(KO)return vC;KO=1;var t=lr(),e=rg();return vC=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),vC}var yC,XO;function mz(){if(XO)return yC;XO=1;var t=mu(),e=fz(),r=gz(),n=Error.captureStackTrace;return yC=function(i,o,s,a){r&&(n?n(i,o):t(i,"stack",e(s,a)))},yC}var CC,ZO;function pz(){if(ZO)return CC;ZO=1;var t=fu(),e=Kn(),r=mu(),n=nh(),i=FO(),o=OO(),s=lz(),a=uz(),l=hz(),u=dz(),c=mz(),h=Gn(),d=Fs();return CC=function(f,g,w,v){var b="stackTraceLimit",p=v?2:1,_=f.split("."),O=_[_.length-1],T=t.apply(null,_);if(T){var M=T.prototype;if(!d&&e(M,"cause")&&delete M.cause,!w)return T;var P=t("Error"),G=g(function(j,A){var q=l(v?A:j,void 0),Q=v?new T(j):new T;return q!==void 0&&r(Q,"message",q),c(Q,G,Q.stack,2),this&&n(M,this)&&a(Q,this,G),arguments.length>p&&u(Q,arguments[p]),Q});if(G.prototype=M,O!=="Error"?i?i(G,P):o(G,P,{name:!0}):h&&b in T&&(s(G,T,b),s(G,T,"prepareStackTrace")),o(G,T),!d)try{M.name!==O&&r(M,"name",O),M.constructor=G}catch{}return G}},CC}var JO;function wz(){if(JO)return cI;JO=1;var t=bt(),e=tr(),r=sh(),n=pz(),i="WebAssembly",o=e[i],s=new Error("e",{cause:7}).cause!==7,a=function(u,c){var h={};h[u]=n(u,c,s),t({global:!0,constructor:!0,arity:1,forced:s},h)},l=function(u,c){if(o&&o[u]){var h={};h[u]=n(i+"."+u,c,s),t({target:i,stat:!0,constructor:!0,arity:1,forced:s},h)}};return a("Error",function(u){return function(h){return r(u,this,arguments)}}),a("EvalError",function(u){return function(h){return r(u,this,arguments)}}),a("RangeError",function(u){return function(h){return r(u,this,arguments)}}),a("ReferenceError",function(u){return function(h){return r(u,this,arguments)}}),a("SyntaxError",function(u){return function(h){return r(u,this,arguments)}}),a("TypeError",function(u){return function(h){return r(u,this,arguments)}}),a("URIError",function(u){return function(h){return r(u,this,arguments)}}),l("CompileError",function(u){return function(h){return r(u,this,arguments)}}),l("LinkError",function(u){return function(h){return r(u,this,arguments)}}),l("RuntimeError",function(u){return function(h){return r(u,this,arguments)}}),cI}wz();var QO={},bC,ex;function tx(){if(ex)return bC;ex=1;var t=ka();return bC=Array.isArray||function(r){return t(r)==="Array"},bC}var SC,rx;function nx(){if(rx)return SC;rx=1;var t=Gn(),e=tx(),r=TypeError,n=Object.getOwnPropertyDescriptor,i=t&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(o){return o instanceof TypeError}}();return SC=i?function(o,s){if(e(o)&&!n(o,"length").writable)throw new r("Cannot set read only .length");return o.length=s}:function(o,s){return o.length=s},SC}var RC,ix;function ox(){if(ix)return RC;ix=1;var t=TypeError,e=9007199254740991;return RC=function(r){if(r>e)throw t("Maximum allowed index exceeded");return r},RC}var sx;function vz(){if(sx)return QO;sx=1;var t=bt(),e=gu(),r=pu(),n=nx(),i=ox(),o=lr(),s=o(function(){return[].push.call({length:4294967296},1)!==4294967297}),a=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{push:function(c){var h=e(this),d=r(h),f=arguments.length;i(d+f);for(var g=0;g<f;g++)h[d]=arguments[g],d++;return n(h,d),d}}),QO}vz();var ax={},EC,lx;function yz(){if(lx)return EC;lx=1;var t=ka(),e=rr();return EC=function(r){if(t(r)==="Function")return e(r)},EC}var TC,ux;function cx(){if(ux)return TC;ux=1;var t=yz(),e=ln(),r=tg(),n=t(t.bind);return TC=function(i,o){return e(i),o===void 0?i:r?n(i,o):function(){return i.apply(o,arguments)}},TC}var _C,hx;function dx(){return hx||(hx=1,_C={}),_C}var MC,fx;function Cz(){if(fx)return MC;fx=1;var t=yi(),e=dx(),r=t("iterator"),n=Array.prototype;return MC=function(i){return i!==void 0&&(e.Array===i||n[r]===i)},MC}var PC,gx;function IC(){if(gx)return PC;gx=1;var t=UO(),e=ih(),r=Xv(),n=dx(),i=yi(),o=i("iterator");return PC=function(s){if(!r(s))return e(s,o)||e(s,"@@iterator")||n[t(s)]},PC}var OC,mx;function bz(){if(mx)return OC;mx=1;var t=ur(),e=ln(),r=hr(),n=ig(),i=IC(),o=TypeError;return OC=function(s,a){var l=arguments.length<2?i(s):a;if(e(l))return r(t(l,s));throw new o(n(s)+" is not iterable")},OC}var xC,px;function un(){if(px)return xC;px=1;var t=ur(),e=hr(),r=ih();return xC=function(n,i,o){var s,a;e(n);try{if(s=r(n,"return"),!s){if(i==="throw")throw o;return o}s=t(s,n)}catch(l){a=!0,s=l}if(i==="throw")throw o;if(a)throw s;return e(s),o},xC}var AC,wx;function wu(){if(wx)return AC;wx=1;var t=cx(),e=ur(),r=hr(),n=ig(),i=Cz(),o=pu(),s=nh(),a=bz(),l=IC(),u=un(),c=TypeError,h=function(f,g){this.stopped=f,this.result=g},d=h.prototype;return AC=function(f,g,w){var v=w&&w.that,b=!!(w&&w.AS_ENTRIES),p=!!(w&&w.IS_RECORD),_=!!(w&&w.IS_ITERATOR),O=!!(w&&w.INTERRUPTED),T=t(g,v),M,P,G,j,A,q,Q,ue=function(Z){return M&&u(M,"normal"),new h(!0,Z)},J=function(Z){return b?(r(Z),O?T(Z[0],Z[1],ue):T(Z[0],Z[1])):O?T(Z,ue):T(Z)};if(p)M=f.iterator;else if(_)M=f;else{if(P=l(f),!P)throw new c(n(f)+" is not iterable");if(i(P)){for(G=0,j=o(f);j>G;G++)if(A=J(f[G]),A&&s(d,A))return A;return new h(!1)}M=a(f,P)}for(q=p?f.next:M.next;!(Q=e(q,M)).done;){try{A=J(Q.value)}catch(Z){u(M,"throw",Z)}if(typeof A=="object"&&A&&s(d,A))return A}return new h(!1)},AC}var HC,vx;function yx(){if(vx)return HC;vx=1;var t=Gn(),e=Vs(),r=rg();return HC=function(n,i,o){t?e.f(n,i,r(0,o)):n[i]=o},HC}var Cx;function Sz(){if(Cx)return ax;Cx=1;var t=bt(),e=wu(),r=yx();return t({target:"Object",stat:!0},{fromEntries:function(i){var o={};return e(i,function(s,a){r(o,s,a)},{AS_ENTRIES:!0}),o}}),ax}Sz();var bx={},NC,Sx;function Ji(){if(Sx)return NC;Sx=1;var t=rr(),e=Set.prototype;return NC={Set,add:t(e.add),has:t(e.has),remove:t(e.delete),proto:e},NC}var DC,Rx;function La(){if(Rx)return DC;Rx=1;var t=Ji().has;return DC=function(e){return t(e),e},DC}var kC,Ex;function $a(){if(Ex)return kC;Ex=1;var t=ur();return kC=function(e,r,n){for(var i=n?e:e.iterator,o=e.next,s,a;!(s=t(o,i)).done;)if(a=r(s.value),a!==void 0)return a},kC}var LC,Tx;function ah(){if(Tx)return LC;Tx=1;var t=rr(),e=$a(),r=Ji(),n=r.Set,i=r.proto,o=t(i.forEach),s=t(i.keys),a=s(new n).next;return LC=function(l,u,c){return c?e({iterator:s(l),next:a},u):o(l,u)},LC}var $C,_x;function FC(){if(_x)return $C;_x=1;var t=Ji(),e=ah(),r=t.Set,n=t.add;return $C=function(i){var o=new r;return e(i,function(s){n(o,s)}),o},$C}var VC,Mx;function lh(){if(Mx)return VC;Mx=1;var t=DO(),e=Ji();return VC=t(e.proto,"size","get")||function(r){return r.size},VC}var WC,Px;function Qi(){return Px||(Px=1,WC=function(t){return{iterator:t,next:t.next,done:!1}}),WC}var BC,Ix;function Fa(){if(Ix)return BC;Ix=1;var t=ln(),e=hr(),r=ur(),n=oh(),i=Qi(),o="Invalid size",s=RangeError,a=TypeError,l=Math.max,u=function(c,h){this.set=c,this.size=l(h,0),this.has=t(c.has),this.keys=t(c.keys)};return u.prototype={getIterator:function(){return i(e(r(this.keys,this.set)))},includes:function(c){return r(this.has,this.set,c)}},BC=function(c){e(c);var h=+c.size;if(h!==h)throw new a(o);var d=n(h);if(d<0)throw new s(o);return new u(c,d)},BC}var jC,Ox;function Rz(){if(Ox)return jC;Ox=1;var t=La(),e=Ji(),r=FC(),n=lh(),i=Fa(),o=ah(),s=$a(),a=e.has,l=e.remove;return jC=function(c){var h=t(this),d=i(c),f=r(h);return n(h)<=d.size?o(h,function(g){d.includes(g)&&l(f,g)}):s(d.getIterator(),function(g){a(f,g)&&l(f,g)}),f},jC}var UC,xx;function Va(){if(xx)return UC;xx=1;var t=fu(),e=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},r=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};return UC=function(n,i){var o=t("Set");try{new o()[n](e(0));try{return new o()[n](e(-1)),!1}catch{if(!i)return!0;try{return new o()[n](r(-1/0)),!1}catch{var s=new o;return s.add(1),s.add(2),i(s[n](r(1/0)))}}}catch{return!1}},UC}var Ax;function Ez(){if(Ax)return bx;Ax=1;var t=bt(),e=Rz(),r=lr(),n=Va(),i=!n("difference",function(s){return s.size===0}),o=i||r(function(){var s={size:1,has:function(){return!0},keys:function(){var l=0;return{next:function(){var u=l++>1;return a.has(1)&&a.clear(),{done:u,value:2}}}}},a=new Set([1,2,3,4]);return a.difference(s).size!==3});return t({target:"Set",proto:!0,real:!0,forced:o},{difference:e}),bx}Ez();var Hx={},zC,Nx;function Tz(){if(Nx)return zC;Nx=1;var t=La(),e=Ji(),r=lh(),n=Fa(),i=ah(),o=$a(),s=e.Set,a=e.add,l=e.has;return zC=function(c){var h=t(this),d=n(c),f=new s;return r(h)>d.size?o(d.getIterator(),function(g){l(h,g)&&a(f,g)}):i(h,function(g){d.includes(g)&&a(f,g)}),f},zC}var Dx;function _z(){if(Dx)return Hx;Dx=1;var t=bt(),e=lr(),r=Tz(),n=Va(),i=!n("intersection",function(o){return o.size===2&&o.has(1)&&o.has(2)})||e(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});return t({target:"Set",proto:!0,real:!0,forced:i},{intersection:r}),Hx}_z();var kx={},YC,Lx;function Mz(){if(Lx)return YC;Lx=1;var t=La(),e=Ji().has,r=lh(),n=Fa(),i=ah(),o=$a(),s=un();return YC=function(l){var u=t(this),c=n(l);if(r(u)<=c.size)return i(u,function(d){if(c.includes(d))return!1},!0)!==!1;var h=c.getIterator();return o(h,function(d){if(e(u,d))return s(h,"normal",!1)})!==!1},YC}var $x;function Pz(){if($x)return kx;$x=1;var t=bt(),e=Mz(),r=Va(),n=!r("isDisjointFrom",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:n},{isDisjointFrom:e}),kx}Pz();var Fx={},GC,Vx;function Iz(){if(Vx)return GC;Vx=1;var t=La(),e=lh(),r=ah(),n=Fa();return GC=function(o){var s=t(this),a=n(o);return e(s)>a.size?!1:r(s,function(l){if(!a.includes(l))return!1},!0)!==!1},GC}var Wx;function Oz(){if(Wx)return Fx;Wx=1;var t=bt(),e=Iz(),r=Va(),n=!r("isSubsetOf",function(i){return i});return t({target:"Set",proto:!0,real:!0,forced:n},{isSubsetOf:e}),Fx}Oz();var Bx={},qC,jx;function xz(){if(jx)return qC;jx=1;var t=La(),e=Ji().has,r=lh(),n=Fa(),i=$a(),o=un();return qC=function(a){var l=t(this),u=n(a);if(r(l)<u.size)return!1;var c=u.getIterator();return i(c,function(h){if(!e(l,h))return o(c,"normal",!1)})!==!1},qC}var Ux;function Az(){if(Ux)return Bx;Ux=1;var t=bt(),e=xz(),r=Va(),n=!r("isSupersetOf",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:n},{isSupersetOf:e}),Bx}Az();var zx={},KC,Yx;function Hz(){if(Yx)return KC;Yx=1;var t=La(),e=Ji(),r=FC(),n=Fa(),i=$a(),o=e.add,s=e.has,a=e.remove;return KC=function(u){var c=t(this),h=n(u).getIterator(),d=r(c);return i(h,function(f){s(c,f)?a(d,f):o(d,f)}),d},KC}var XC,Gx;function qx(){return Gx||(Gx=1,XC=function(t){try{var e=new Set,r={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},n=e[t](r);return n.size!==1||n.values().next().value!==4}catch{return!1}}),XC}var Kx;function Nz(){if(Kx)return zx;Kx=1;var t=bt(),e=Hz(),r=qx(),n=Va(),i=!n("symmetricDifference")||!r("symmetricDifference");return t({target:"Set",proto:!0,real:!0,forced:i},{symmetricDifference:e}),zx}Nz();var Xx={},ZC,Zx;function Dz(){if(Zx)return ZC;Zx=1;var t=La(),e=Ji().add,r=FC(),n=Fa(),i=$a();return ZC=function(s){var a=t(this),l=n(s).getIterator(),u=r(a);return i(l,function(c){e(u,c)}),u},ZC}var Jx;function kz(){if(Jx)return Xx;Jx=1;var t=bt(),e=Dz(),r=qx(),n=Va(),i=!n("union")||!r("union");return t({target:"Set",proto:!0,real:!0,forced:i},{union:e}),Xx}kz();var Qx={},e1={},JC,t1;function Lz(){if(t1)return JC;t1=1;var t=nh(),e=TypeError;return JC=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},JC}var QC,r1;function $z(){if(r1)return QC;r1=1;var t=lr();return QC=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),QC}var eb,n1;function i1(){if(n1)return eb;n1=1;var t=Kn(),e=cr(),r=gu(),n=$y(),i=$z(),o=n("IE_PROTO"),s=Object,a=s.prototype;return eb=i?s.getPrototypeOf:function(l){var u=r(l);if(t(u,o))return u[o];var c=u.constructor;return e(c)&&u instanceof c?c.prototype:u instanceof s?a:null},eb}var tb,o1;function Fz(){if(o1)return tb;o1=1;var t=mO(),e=Vs();return tb=function(r,n,i){return i.get&&t(i.get,n,{getter:!0}),i.set&&t(i.set,n,{setter:!0}),e.f(r,n,i)},tb}var rb={},nb,s1;function Vz(){if(s1)return nb;s1=1;var t=EO(),e=Qy();return nb=Object.keys||function(n){return t(n,e)},nb}var a1;function Wz(){if(a1)return rb;a1=1;var t=Gn(),e=nO(),r=Vs(),n=hr(),i=rh(),o=Vz();return rb.f=t&&!e?Object.defineProperties:function(a,l){n(a);for(var u=i(l),c=o(l),h=c.length,d=0,f;h>d;)r.f(a,f=c[d++],u[f]);return a},rb}var ib,l1;function u1(){if(l1)return ib;l1=1;var t=fu();return ib=t("document","documentElement"),ib}var ob,c1;function sb(){if(c1)return ob;c1=1;var t=hr(),e=Wz(),r=Qy(),n=Vy(),i=u1(),o=My(),s=$y(),a=">",l="<",u="prototype",c="script",h=s("IE_PROTO"),d=function(){},f=function(p){return l+c+a+p+l+"/"+c+a},g=function(p){p.write(f("")),p.close();var _=p.parentWindow.Object;return p=null,_},w=function(){var p=o("iframe"),_="java"+c+":",O;return p.style.display="none",i.appendChild(p),p.src=String(_),O=p.contentWindow.document,O.open(),O.write(f("document.F=Object")),O.close(),O.F},v,b=function(){try{v=new ActiveXObject("htmlfile")}catch{}b=typeof document<"u"?document.domain&&v?g(v):w():g(v);for(var p=r.length;p--;)delete b[u][r[p]];return b()};return n[h]=!0,ob=Object.create||function(_,O){var T;return _!==null?(d[u]=t(_),T=new d,d[u]=null,T[h]=_):T=b(),O===void 0?T:e.f(T,O)},ob}var ab,h1;function d1(){if(h1)return ab;h1=1;var t=lr(),e=cr(),r=qn(),n=sb(),i=i1(),o=jy(),s=yi(),a=Fs(),l=s("iterator"),u=!1,c,h,d;[].keys&&(d=[].keys(),"next"in d?(h=i(i(d)),h!==Object.prototype&&(c=h)):u=!0);var f=!r(c)||t(function(){var g={};return c[l].call(g)!==g});return f?c={}:a&&(c=n(c)),e(c[l])||o(c,l,function(){return this}),ab={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:u},ab}var f1;function Bz(){if(f1)return e1;f1=1;var t=bt(),e=tr(),r=Lz(),n=hr(),i=cr(),o=i1(),s=Fz(),a=yx(),l=lr(),u=Kn(),c=yi(),h=d1().IteratorPrototype,d=Gn(),f=Fs(),g="constructor",w="Iterator",v=c("toStringTag"),b=TypeError,p=e[w],_=f||!i(p)||p.prototype!==h||!l(function(){p({})}),O=function(){if(r(this,h),o(this)===h)throw new b("Abstract class Iterator not directly constructable")},T=function(M,P){d?s(h,M,{configurable:!0,get:function(){return P},set:function(G){if(n(this),this===h)throw new b("You can't redefine this property");u(this,M)?this[M]=G:a(this,M,G)}}):h[M]=P};return u(h,v)||T(v,w),(_||!u(h,g)||h[g]===Object)&&T(g,O),O.prototype=h,t({global:!0,constructor:!0,forced:_},{Iterator:O}),e1}var g1;function jz(){return g1||(g1=1,Bz()),Qx}jz();var m1={},p1={},lb,w1;function Uz(){if(w1)return lb;w1=1;var t=jy();return lb=function(e,r,n){for(var i in r)t(e,i,r[i],n);return e},lb}var ub,v1;function zz(){return v1||(v1=1,ub=function(t,e){return{value:t,done:e}}),ub}var cb,y1;function Yz(){if(y1)return cb;y1=1;var t=un();return cb=function(e,r,n){for(var i=e.length-1;i>=0;i--)if(e[i]!==void 0)try{n=t(e[i].iterator,r,n)}catch(o){r="throw",n=o}if(r==="throw")throw n;return n},cb}var hb,C1;function db(){if(C1)return hb;C1=1;var t=ur(),e=sb(),r=mu(),n=Uz(),i=yi(),o=fO(),s=ih(),a=d1().IteratorPrototype,l=zz(),u=un(),c=Yz(),h=i("toStringTag"),d="IteratorHelper",f="WrapForValidIterator",g="normal",w="throw",v=o.set,b=function(O){var T=o.getterFor(O?f:d);return n(e(a),{next:function(){var P=T(this);if(O)return P.nextHandler();if(P.done)return l(void 0,!0);try{var G=P.nextHandler();return P.returnHandlerResult?G:l(G,P.done)}catch(j){throw P.done=!0,j}},return:function(){var M=T(this),P=M.iterator;if(M.done=!0,O){var G=s(P,"return");return G?t(G,P):l(void 0,!0)}if(M.inner)try{u(M.inner.iterator,g)}catch(j){return u(P,w,j)}if(M.openIters)try{c(M.openIters,g)}catch(j){return u(P,w,j)}return P&&u(P,g),l(void 0,!0)}})},p=b(!0),_=b(!1);return r(_,h,"Iterator Helper"),hb=function(O,T,M){var P=function(j,A){A?(A.iterator=j.iterator,A.next=j.next):A=j,A.type=T?f:d,A.returnHandlerResult=!!M,A.nextHandler=O,A.counter=0,A.done=!1,v(this,A)};return P.prototype=T?p:_,P},hb}var fb,b1;function S1(){if(b1)return fb;b1=1;var t=hr(),e=un();return fb=function(r,n,i,o){try{return o?n(t(i)[0],i[1]):n(i)}catch(s){e(r,"throw",s)}},fb}var gb,R1;function mb(){return R1||(R1=1,gb=function(t,e){var r=typeof Iterator=="function"&&Iterator.prototype[t];if(r)try{r.call({next:null},e).next()}catch{return!0}}),gb}var pb,E1;function Ws(){if(E1)return pb;E1=1;var t=tr();return pb=function(e,r){var n=t.Iterator,i=n&&n.prototype,o=i&&i[e],s=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){s=!0}},-1)}catch(a){a instanceof r||(s=!1)}if(!s)return o},pb}var T1;function Gz(){if(T1)return p1;T1=1;var t=bt(),e=ur(),r=ln(),n=hr(),i=Qi(),o=db(),s=S1(),a=Fs(),l=un(),u=mb(),c=Ws(),h=!a&&!u("filter",function(){}),d=!a&&!h&&c("filter",TypeError),f=a||h||d,g=o(function(){for(var w=this.iterator,v=this.predicate,b=this.next,p,_,O;;){if(p=n(e(b,w)),_=this.done=!!p.done,_)return;if(O=p.value,s(w,v,[O,this.counter++],!0))return O}});return t({target:"Iterator",proto:!0,real:!0,forced:f},{filter:function(v){n(this);try{r(v)}catch(b){l(this,"throw",b)}return d?e(d,this,v):new g(i(this),{predicate:v})}}),p1}var _1;function qz(){return _1||(_1=1,Gz()),m1}qz();var M1={},P1={},I1;function Kz(){if(I1)return P1;I1=1;var t=bt(),e=ur(),r=wu(),n=ln(),i=hr(),o=Qi(),s=un(),a=Ws(),l=a("forEach",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{forEach:function(c){i(this);try{n(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;r(h,function(f){c(f,d++)},{IS_RECORD:!0})}}),P1}var O1;function Xz(){return O1||(O1=1,Kz()),M1}Xz();var x1={},A1={},H1;function Zz(){if(H1)return A1;H1=1;var t=bt(),e=ur(),r=ln(),n=hr(),i=Qi(),o=db(),s=S1(),a=un(),l=mb(),u=Ws(),c=Fs(),h=!c&&!l("map",function(){}),d=!c&&!h&&u("map",TypeError),f=c||h||d,g=o(function(){var w=this.iterator,v=n(e(this.next,w)),b=this.done=!!v.done;if(!b)return s(w,this.mapper,[v.value,this.counter++],!0)});return t({target:"Iterator",proto:!0,real:!0,forced:f},{map:function(v){n(this);try{r(v)}catch(b){a(this,"throw",b)}return d?e(d,this,v):new g(i(this),{mapper:v})}}),A1}var N1;function Jz(){return N1||(N1=1,Zz()),x1}Jz();var D1={},k1={},wb,L1;function vb(){if(L1)return wb;L1=1;var t=rr();return wb=t([].slice),wb}var yb,$1;function F1(){if($1)return yb;$1=1;var t=TypeError;return yb=function(e,r){if(e<r)throw new t("Not enough arguments");return e},yb}var Cb,V1;function Qz(){if(V1)return Cb;V1=1;var t=ng();return Cb=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),Cb}var bb,W1;function B1(){if(W1)return bb;W1=1;var t=tr(),e=ng(),r=ka(),n=function(i){return e.slice(0,i.length)===i};return bb=function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":t.Bun&&typeof Bun.version=="string"?"BUN":t.Deno&&typeof Deno.version=="object"?"DENO":r(t.process)==="process"?"NODE":t.window&&t.document?"BROWSER":"REST"}(),bb}var Sb,j1;function eY(){if(j1)return Sb;j1=1;var t=B1();return Sb=t==="NODE",Sb}var Rb,U1;function z1(){if(U1)return Rb;U1=1;var t=tr(),e=sh(),r=cx(),n=cr(),i=Kn(),o=lr(),s=u1(),a=vb(),l=My(),u=F1(),c=Qz(),h=eY(),d=t.setImmediate,f=t.clearImmediate,g=t.process,w=t.Dispatch,v=t.Function,b=t.MessageChannel,p=t.String,_=0,O={},T="onreadystatechange",M,P,G,j;o(function(){M=t.location});var A=function(J){if(i(O,J)){var Z=O[J];delete O[J],Z()}},q=function(J){return function(){A(J)}},Q=function(J){A(J.data)},ue=function(J){t.postMessage(p(J),M.protocol+"//"+M.host)};return(!d||!f)&&(d=function(Z){u(arguments.length,1);var ie=n(Z)?Z:v(Z),ee=a(arguments,1);return O[++_]=function(){e(ie,void 0,ee)},P(_),_},f=function(Z){delete O[Z]},h?P=function(J){g.nextTick(q(J))}:w&&w.now?P=function(J){w.now(q(J))}:b&&!c?(G=new b,j=G.port2,G.port1.onmessage=Q,P=r(j.postMessage,j)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&M&&M.protocol!=="file:"&&!o(ue)?(P=ue,t.addEventListener("message",Q,!1)):T in l("script")?P=function(J){s.appendChild(l("script"))[T]=function(){s.removeChild(this),A(J)}}:P=function(J){setTimeout(q(J),0)}),Rb={set:d,clear:f},Rb}var Y1;function tY(){if(Y1)return k1;Y1=1;var t=bt(),e=tr(),r=z1().clear;return t({global:!0,bind:!0,enumerable:!0,forced:e.clearImmediate!==r},{clearImmediate:r}),k1}var G1={},Eb,q1;function rY(){if(q1)return Eb;q1=1;var t=tr(),e=sh(),r=cr(),n=B1(),i=ng(),o=vb(),s=F1(),a=t.Function,l=/MSIE .\./.test(i)||n==="BUN"&&function(){var u=t.Bun.version.split(".");return u.length<3||u[0]==="0"&&(u[1]<3||u[1]==="3"&&u[2]==="0")}();return Eb=function(u,c){var h=c?2:1;return l?function(d,f){var g=s(arguments.length,1)>h,w=r(d)?d:a(d),v=g?o(arguments,h):[],b=g?function(){e(w,this,v)}:w;return c?u(b,f):u(b)}:u},Eb}var K1;function nY(){if(K1)return G1;K1=1;var t=bt(),e=tr(),r=z1().set,n=rY(),i=e.setImmediate?n(r,!1):r;return t({global:!0,bind:!0,enumerable:!0,forced:e.setImmediate!==i},{setImmediate:i}),G1}var X1;function iY(){return X1||(X1=1,tY(),nY()),D1}iY();/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Z1,setPrototypeOf:J1,isFrozen:oY,getPrototypeOf:sY,getOwnPropertyDescriptor:aY}=Object;let{freeze:Yr,seal:Xn,create:Q1}=Object,{apply:Tb,construct:_b}=typeof Reflect<"u"&&Reflect;Yr||(Yr=function(e){return e}),Xn||(Xn=function(e){return e}),Tb||(Tb=function(e,r,n){return e.apply(r,n)}),_b||(_b=function(e,r){return new e(...r)});const sg=qr(Array.prototype.forEach),lY=qr(Array.prototype.lastIndexOf),eA=qr(Array.prototype.pop),uh=qr(Array.prototype.push),uY=qr(Array.prototype.splice),ag=qr(String.prototype.toLowerCase),Mb=qr(String.prototype.toString),tA=qr(String.prototype.match),ch=qr(String.prototype.replace),cY=qr(String.prototype.indexOf),hY=qr(String.prototype.trim),Ci=qr(Object.prototype.hasOwnProperty),Gr=qr(RegExp.prototype.test),hh=dY(TypeError);function qr(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return Tb(t,e,n)}}function dY(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return _b(t,r)}}function je(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ag;J1&&J1(t,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const o=r(i);o!==i&&(oY(e)||(e[n]=o),i=o)}t[i]=!0}return t}function fY(t){for(let e=0;e<t.length;e++)Ci(t,e)||(t[e]=null);return t}function Vo(t){const e=Q1(null);for(const[r,n]of Z1(t))Ci(t,r)&&(Array.isArray(n)?e[r]=fY(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=Vo(n):e[r]=n);return e}function dh(t,e){for(;t!==null;){const n=aY(t,e);if(n){if(n.get)return qr(n.get);if(typeof n.value=="function")return qr(n.value)}t=sY(t)}function r(){return null}return r}const rA=Yr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pb=Yr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ib=Yr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),gY=Yr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ob=Yr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),mY=Yr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nA=Yr(["#text"]),iA=Yr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),xb=Yr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),oA=Yr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),lg=Yr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),pY=Xn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),wY=Xn(/<%[\w\W]*|[\w\W]*%>/gm),vY=Xn(/\$\{[\w\W]*/gm),yY=Xn(/^data-[\-\w.\u00B7-\uFFFF]+$/),CY=Xn(/^aria-[\-\w]+$/),sA=Xn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bY=Xn(/^(?:\w+script|data):/i),SY=Xn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),aA=Xn(/^html$/i),RY=Xn(/^[a-z][.\w]*(-[.\w]+)+$/i);var lA=Object.freeze({__proto__:null,ARIA_ATTR:CY,ATTR_WHITESPACE:SY,CUSTOM_ELEMENT:RY,DATA_ATTR:yY,DOCTYPE_NAME:aA,ERB_EXPR:wY,IS_ALLOWED_URI:sA,IS_SCRIPT_OR_DATA:bY,MUSTACHE_EXPR:pY,TMPLIT_EXPR:vY});const fh={element:1,text:3,progressingInstruction:7,comment:8,document:9},EY=function(){return typeof window>"u"?null:window},TY=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},uA=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function cA(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:EY();const e=Me=>cA(Me);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==fh.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,i=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:f}=t,g=l.prototype,w=dh(g,"cloneNode"),v=dh(g,"remove"),b=dh(g,"nextSibling"),p=dh(g,"childNodes"),_=dh(g,"parentNode");if(typeof s=="function"){const Me=r.createElement("template");Me.content&&Me.content.ownerDocument&&(r=Me.content.ownerDocument)}let O,T="";const{implementation:M,createNodeIterator:P,createDocumentFragment:G,getElementsByTagName:j}=r,{importNode:A}=n;let q=uA();e.isSupported=typeof Z1=="function"&&typeof _=="function"&&M&&M.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Q,ERB_EXPR:ue,TMPLIT_EXPR:J,DATA_ATTR:Z,ARIA_ATTR:ie,IS_SCRIPT_OR_DATA:ee,ATTR_WHITESPACE:te,CUSTOM_ELEMENT:ae}=lA;let{IS_ALLOWED_URI:z}=lA,$=null;const m=je({},[...rA,...Pb,...Ib,...Ob,...nA]);let C=null;const y=je({},[...iA,...xb,...oA,...lg]);let I=Object.seal(Q1(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),x=null,N=null,B=!0,Y=!0,R=!1,E=!0,S=!1,D=!0,H=!1,F=!1,X=!1,L=!1,W=!1,K=!1,U=!0,re=!1;const me="user-content-";let ye=!0,xe=!1,Be={},Ke=null;const Ie=je({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ze=null;const Ht=je({},["audio","video","img","source","image","track"]);let qi=null;const As=je({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pi="http://www.w3.org/1998/Math/MathML",Nt="http://www.w3.org/2000/svg",vr="http://www.w3.org/1999/xhtml";let _t=vr,Dt=!1,Ye=null;const wi=je({},[pi,Nt,vr],Mb);let nu=je({},["mi","mo","mn","ms","mtext"]),iu=je({},["annotation-xml"]);const Yge=je({},["title","style","font","a","script"]);let Of=null;const Gge=["application/xhtml+xml","text/html"],qge="text/html";let Or=null,jc=null;const Kge=r.createElement("form"),dB=function(V){return V instanceof RegExp||V instanceof Function},WM=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(jc&&jc===V)){if((!V||typeof V!="object")&&(V={}),V=Vo(V),Of=Gge.indexOf(V.PARSER_MEDIA_TYPE)===-1?qge:V.PARSER_MEDIA_TYPE,Or=Of==="application/xhtml+xml"?Mb:ag,$=Ci(V,"ALLOWED_TAGS")?je({},V.ALLOWED_TAGS,Or):m,C=Ci(V,"ALLOWED_ATTR")?je({},V.ALLOWED_ATTR,Or):y,Ye=Ci(V,"ALLOWED_NAMESPACES")?je({},V.ALLOWED_NAMESPACES,Mb):wi,qi=Ci(V,"ADD_URI_SAFE_ATTR")?je(Vo(As),V.ADD_URI_SAFE_ATTR,Or):As,ze=Ci(V,"ADD_DATA_URI_TAGS")?je(Vo(Ht),V.ADD_DATA_URI_TAGS,Or):Ht,Ke=Ci(V,"FORBID_CONTENTS")?je({},V.FORBID_CONTENTS,Or):Ie,x=Ci(V,"FORBID_TAGS")?je({},V.FORBID_TAGS,Or):Vo({}),N=Ci(V,"FORBID_ATTR")?je({},V.FORBID_ATTR,Or):Vo({}),Be=Ci(V,"USE_PROFILES")?V.USE_PROFILES:!1,B=V.ALLOW_ARIA_ATTR!==!1,Y=V.ALLOW_DATA_ATTR!==!1,R=V.ALLOW_UNKNOWN_PROTOCOLS||!1,E=V.ALLOW_SELF_CLOSE_IN_ATTR!==!1,S=V.SAFE_FOR_TEMPLATES||!1,D=V.SAFE_FOR_XML!==!1,H=V.WHOLE_DOCUMENT||!1,L=V.RETURN_DOM||!1,W=V.RETURN_DOM_FRAGMENT||!1,K=V.RETURN_TRUSTED_TYPE||!1,X=V.FORCE_BODY||!1,U=V.SANITIZE_DOM!==!1,re=V.SANITIZE_NAMED_PROPS||!1,ye=V.KEEP_CONTENT!==!1,xe=V.IN_PLACE||!1,z=V.ALLOWED_URI_REGEXP||sA,_t=V.NAMESPACE||vr,nu=V.MATHML_TEXT_INTEGRATION_POINTS||nu,iu=V.HTML_INTEGRATION_POINTS||iu,I=V.CUSTOM_ELEMENT_HANDLING||{},V.CUSTOM_ELEMENT_HANDLING&&dB(V.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(I.tagNameCheck=V.CUSTOM_ELEMENT_HANDLING.tagNameCheck),V.CUSTOM_ELEMENT_HANDLING&&dB(V.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(I.attributeNameCheck=V.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),V.CUSTOM_ELEMENT_HANDLING&&typeof V.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(I.allowCustomizedBuiltInElements=V.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),S&&(Y=!1),W&&(L=!0),Be&&($=je({},nA),C=[],Be.html===!0&&(je($,rA),je(C,iA)),Be.svg===!0&&(je($,Pb),je(C,xb),je(C,lg)),Be.svgFilters===!0&&(je($,Ib),je(C,xb),je(C,lg)),Be.mathMl===!0&&(je($,Ob),je(C,oA),je(C,lg))),V.ADD_TAGS&&($===m&&($=Vo($)),je($,V.ADD_TAGS,Or)),V.ADD_ATTR&&(C===y&&(C=Vo(C)),je(C,V.ADD_ATTR,Or)),V.ADD_URI_SAFE_ATTR&&je(qi,V.ADD_URI_SAFE_ATTR,Or),V.FORBID_CONTENTS&&(Ke===Ie&&(Ke=Vo(Ke)),je(Ke,V.FORBID_CONTENTS,Or)),ye&&($["#text"]=!0),H&&je($,["html","head","body"]),$.table&&(je($,["tbody"]),delete x.tbody),V.TRUSTED_TYPES_POLICY){if(typeof V.TRUSTED_TYPES_POLICY.createHTML!="function")throw hh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof V.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw hh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=V.TRUSTED_TYPES_POLICY,T=O.createHTML("")}else O===void 0&&(O=TY(f,i)),O!==null&&typeof T=="string"&&(T=O.createHTML(""));Yr&&Yr(V),jc=V}},fB=je({},[...Pb,...Ib,...gY]),gB=je({},[...Ob,...mY]),Xge=function(V){let ce=_(V);(!ce||!ce.tagName)&&(ce={namespaceURI:_t,tagName:"template"});const Se=ag(V.tagName),Ft=ag(ce.tagName);return Ye[V.namespaceURI]?V.namespaceURI===Nt?ce.namespaceURI===vr?Se==="svg":ce.namespaceURI===pi?Se==="svg"&&(Ft==="annotation-xml"||nu[Ft]):!!fB[Se]:V.namespaceURI===pi?ce.namespaceURI===vr?Se==="math":ce.namespaceURI===Nt?Se==="math"&&iu[Ft]:!!gB[Se]:V.namespaceURI===vr?ce.namespaceURI===Nt&&!iu[Ft]||ce.namespaceURI===pi&&!nu[Ft]?!1:!gB[Se]&&(Yge[Se]||!fB[Se]):!!(Of==="application/xhtml+xml"&&Ye[V.namespaceURI]):!1},Do=function(V){uh(e.removed,{element:V});try{_(V).removeChild(V)}catch{v(V)}},Uc=function(V,ce){try{uh(e.removed,{attribute:ce.getAttributeNode(V),from:ce})}catch{uh(e.removed,{attribute:null,from:ce})}if(ce.removeAttribute(V),V==="is")if(L||W)try{Do(ce)}catch{}else try{ce.setAttribute(V,"")}catch{}},mB=function(V){let ce=null,Se=null;if(X)V="<remove></remove>"+V;else{const Rr=tA(V,/^[\r\n\t ]+/);Se=Rr&&Rr[0]}Of==="application/xhtml+xml"&&_t===vr&&(V='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+V+"</body></html>");const Ft=O?O.createHTML(V):V;if(_t===vr)try{ce=new d().parseFromString(Ft,Of)}catch{}if(!ce||!ce.documentElement){ce=M.createDocument(_t,"template",null);try{ce.documentElement.innerHTML=Dt?T:Ft}catch{}}const Ur=ce.body||ce.documentElement;return V&&Se&&Ur.insertBefore(r.createTextNode(Se),Ur.childNodes[0]||null),_t===vr?j.call(ce,H?"html":"body")[0]:H?ce.documentElement:Ur},pB=function(V){return P.call(V.ownerDocument||V,V,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},BM=function(V){return V instanceof h&&(typeof V.nodeName!="string"||typeof V.textContent!="string"||typeof V.removeChild!="function"||!(V.attributes instanceof c)||typeof V.removeAttribute!="function"||typeof V.setAttribute!="function"||typeof V.namespaceURI!="string"||typeof V.insertBefore!="function"||typeof V.hasChildNodes!="function")},wB=function(V){return typeof a=="function"&&V instanceof a};function Hs(Me,V,ce){sg(Me,Se=>{Se.call(e,V,ce,jc)})}const vB=function(V){let ce=null;if(Hs(q.beforeSanitizeElements,V,null),BM(V))return Do(V),!0;const Se=Or(V.nodeName);if(Hs(q.uponSanitizeElement,V,{tagName:Se,allowedTags:$}),D&&V.hasChildNodes()&&!wB(V.firstElementChild)&&Gr(/<[/\w!]/g,V.innerHTML)&&Gr(/<[/\w!]/g,V.textContent)||V.nodeType===fh.progressingInstruction||D&&V.nodeType===fh.comment&&Gr(/<[/\w]/g,V.data))return Do(V),!0;if(!$[Se]||x[Se]){if(!x[Se]&&CB(Se)&&(I.tagNameCheck instanceof RegExp&&Gr(I.tagNameCheck,Se)||I.tagNameCheck instanceof Function&&I.tagNameCheck(Se)))return!1;if(ye&&!Ke[Se]){const Ft=_(V)||V.parentNode,Ur=p(V)||V.childNodes;if(Ur&&Ft){const Rr=Ur.length;for(let Pn=Rr-1;Pn>=0;--Pn){const Ns=w(Ur[Pn],!0);Ns.__removalCount=(V.__removalCount||0)+1,Ft.insertBefore(Ns,b(V))}}}return Do(V),!0}return V instanceof l&&!Xge(V)||(Se==="noscript"||Se==="noembed"||Se==="noframes")&&Gr(/<\/no(script|embed|frames)/i,V.innerHTML)?(Do(V),!0):(S&&V.nodeType===fh.text&&(ce=V.textContent,sg([Q,ue,J],Ft=>{ce=ch(ce,Ft," ")}),V.textContent!==ce&&(uh(e.removed,{element:V.cloneNode()}),V.textContent=ce)),Hs(q.afterSanitizeElements,V,null),!1)},yB=function(V,ce,Se){if(U&&(ce==="id"||ce==="name")&&(Se in r||Se in Kge))return!1;if(!(Y&&!N[ce]&&Gr(Z,ce))){if(!(B&&Gr(ie,ce))){if(!C[ce]||N[ce]){if(!(CB(V)&&(I.tagNameCheck instanceof RegExp&&Gr(I.tagNameCheck,V)||I.tagNameCheck instanceof Function&&I.tagNameCheck(V))&&(I.attributeNameCheck instanceof RegExp&&Gr(I.attributeNameCheck,ce)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(ce))||ce==="is"&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&Gr(I.tagNameCheck,Se)||I.tagNameCheck instanceof Function&&I.tagNameCheck(Se))))return!1}else if(!qi[ce]){if(!Gr(z,ch(Se,te,""))){if(!((ce==="src"||ce==="xlink:href"||ce==="href")&&V!=="script"&&cY(Se,"data:")===0&&ze[V])){if(!(R&&!Gr(ee,ch(Se,te,"")))){if(Se)return!1}}}}}}return!0},CB=function(V){return V!=="annotation-xml"&&tA(V,ae)},bB=function(V){Hs(q.beforeSanitizeAttributes,V,null);const{attributes:ce}=V;if(!ce||BM(V))return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:C,forceKeepAttr:void 0};let Ft=ce.length;for(;Ft--;){const Ur=ce[Ft],{name:Rr,namespaceURI:Pn,value:Ns}=Ur,xf=Or(Rr),jM=Ns;let zr=Rr==="value"?jM:hY(jM);if(Se.attrName=xf,Se.attrValue=zr,Se.keepAttr=!0,Se.forceKeepAttr=void 0,Hs(q.uponSanitizeAttribute,V,Se),zr=Se.attrValue,re&&(xf==="id"||xf==="name")&&(Uc(Rr,V),zr=me+zr),D&&Gr(/((--!?|])>)|<\/(style|title)/i,zr)){Uc(Rr,V);continue}if(Se.forceKeepAttr)continue;if(!Se.keepAttr){Uc(Rr,V);continue}if(!E&&Gr(/\/>/i,zr)){Uc(Rr,V);continue}S&&sg([Q,ue,J],RB=>{zr=ch(zr,RB," ")});const SB=Or(V.nodeName);if(!yB(SB,xf,zr)){Uc(Rr,V);continue}if(O&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Pn)switch(f.getAttributeType(SB,xf)){case"TrustedHTML":{zr=O.createHTML(zr);break}case"TrustedScriptURL":{zr=O.createScriptURL(zr);break}}if(zr!==jM)try{Pn?V.setAttributeNS(Pn,Rr,zr):V.setAttribute(Rr,zr),BM(V)?Do(V):eA(e.removed)}catch{Uc(Rr,V)}}Hs(q.afterSanitizeAttributes,V,null)},Zge=function Me(V){let ce=null;const Se=pB(V);for(Hs(q.beforeSanitizeShadowDOM,V,null);ce=Se.nextNode();)Hs(q.uponSanitizeShadowNode,ce,null),vB(ce),bB(ce),ce.content instanceof o&&Me(ce.content);Hs(q.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(Me){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ce=null,Se=null,Ft=null,Ur=null;if(Dt=!Me,Dt&&(Me="<!-->"),typeof Me!="string"&&!wB(Me))if(typeof Me.toString=="function"){if(Me=Me.toString(),typeof Me!="string")throw hh("dirty is not a string, aborting")}else throw hh("toString is not a function");if(!e.isSupported)return Me;if(F||WM(V),e.removed=[],typeof Me=="string"&&(xe=!1),xe){if(Me.nodeName){const Ns=Or(Me.nodeName);if(!$[Ns]||x[Ns])throw hh("root node is forbidden and cannot be sanitized in-place")}}else if(Me instanceof a)ce=mB("<!---->"),Se=ce.ownerDocument.importNode(Me,!0),Se.nodeType===fh.element&&Se.nodeName==="BODY"||Se.nodeName==="HTML"?ce=Se:ce.appendChild(Se);else{if(!L&&!S&&!H&&Me.indexOf("<")===-1)return O&&K?O.createHTML(Me):Me;if(ce=mB(Me),!ce)return L?null:K?T:""}ce&&X&&Do(ce.firstChild);const Rr=pB(xe?Me:ce);for(;Ft=Rr.nextNode();)vB(Ft),bB(Ft),Ft.content instanceof o&&Zge(Ft.content);if(xe)return Me;if(L){if(W)for(Ur=G.call(ce.ownerDocument);ce.firstChild;)Ur.appendChild(ce.firstChild);else Ur=ce;return(C.shadowroot||C.shadowrootmode)&&(Ur=A.call(n,Ur,!0)),Ur}let Pn=H?ce.outerHTML:ce.innerHTML;return H&&$["!doctype"]&&ce.ownerDocument&&ce.ownerDocument.doctype&&ce.ownerDocument.doctype.name&&Gr(aA,ce.ownerDocument.doctype.name)&&(Pn="<!DOCTYPE "+ce.ownerDocument.doctype.name+`>
478
+ `+Pn),S&&sg([Q,ue,J],Ns=>{Pn=ch(Pn,Ns," ")}),O&&K?O.createHTML(Pn):Pn},e.setConfig=function(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};WM(Me),F=!0},e.clearConfig=function(){jc=null,F=!1},e.isValidAttribute=function(Me,V,ce){jc||WM({});const Se=Or(Me),Ft=Or(V);return yB(Se,Ft,ce)},e.addHook=function(Me,V){typeof V=="function"&&uh(q[Me],V)},e.removeHook=function(Me,V){if(V!==void 0){const ce=lY(q[Me],V);return ce===-1?void 0:uY(q[Me],ce,1)[0]}return eA(q[Me])},e.removeHooks=function(Me){q[Me]=[]},e.removeAllHooks=function(){q=uA()},e}var _Y=cA();//! moment.js
479
+ //! version : 2.30.1
480
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
481
+ //! license : MIT
482
+ //! momentjs.com
483
+ var hA;function se(){return hA.apply(null,arguments)}function MY(t){hA=t}function bi(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Wa(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function it(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Ab(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(it(t,e))return!1;return!0}function cn(t){return t===void 0}function Wo(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function gh(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function dA(t,e){var r=[],n,i=t.length;for(n=0;n<i;++n)r.push(e(t[n],n));return r}function Bs(t,e){for(var r in e)it(e,r)&&(t[r]=e[r]);return it(e,"toString")&&(t.toString=e.toString),it(e,"valueOf")&&(t.valueOf=e.valueOf),t}function eo(t,e,r,n){return FA(t,e,r,n,!0).utc()}function PY(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function De(t){return t._pf==null&&(t._pf=PY()),t._pf}var Hb;Array.prototype.some?Hb=Array.prototype.some:Hb=function(t){var e=Object(this),r=e.length>>>0,n;for(n=0;n<r;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};function Nb(t){var e=null,r=!1,n=t._d&&!isNaN(t._d.getTime());if(n&&(e=De(t),r=Hb.call(e.parsedDateParts,function(i){return i!=null}),n=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&r),t._strict&&(n=n&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=n;else return n;return t._isValid}function ug(t){var e=eo(NaN);return t!=null?Bs(De(e),t):De(e).userInvalidated=!0,e}var fA=se.momentProperties=[],Db=!1;function kb(t,e){var r,n,i,o=fA.length;if(cn(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),cn(e._i)||(t._i=e._i),cn(e._f)||(t._f=e._f),cn(e._l)||(t._l=e._l),cn(e._strict)||(t._strict=e._strict),cn(e._tzm)||(t._tzm=e._tzm),cn(e._isUTC)||(t._isUTC=e._isUTC),cn(e._offset)||(t._offset=e._offset),cn(e._pf)||(t._pf=De(e)),cn(e._locale)||(t._locale=e._locale),o>0)for(r=0;r<o;r++)n=fA[r],i=e[n],cn(i)||(t[n]=i);return t}function mh(t){kb(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Db===!1&&(Db=!0,se.updateOffset(this),Db=!1)}function Si(t){return t instanceof mh||t!=null&&t._isAMomentObject!=null}function gA(t){se.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Zn(t,e){var r=!0;return Bs(function(){if(se.deprecationHandler!=null&&se.deprecationHandler(null,t),r){var n=[],i,o,s,a=arguments.length;for(o=0;o<a;o++){if(i="",typeof arguments[o]=="object"){i+=`
484
+ [`+o+"] ";for(s in arguments[0])it(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];n.push(i)}gA(t+`
485
+ Arguments: `+Array.prototype.slice.call(n).join("")+`
486
+ `+new Error().stack),r=!1}return e.apply(this,arguments)},e)}var mA={};function pA(t,e){se.deprecationHandler!=null&&se.deprecationHandler(t,e),mA[t]||(gA(e),mA[t]=!0)}se.suppressDeprecationWarnings=!1,se.deprecationHandler=null;function to(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function IY(t){var e,r;for(r in t)it(t,r)&&(e=t[r],to(e)?this[r]=e:this["_"+r]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Lb(t,e){var r=Bs({},t),n;for(n in e)it(e,n)&&(Wa(t[n])&&Wa(e[n])?(r[n]={},Bs(r[n],t[n]),Bs(r[n],e[n])):e[n]!=null?r[n]=e[n]:delete r[n]);for(n in t)it(t,n)&&!it(e,n)&&Wa(t[n])&&(r[n]=Bs({},r[n]));return r}function $b(t){t!=null&&this.set(t)}var Fb;Object.keys?Fb=Object.keys:Fb=function(t){var e,r=[];for(e in t)it(t,e)&&r.push(e);return r};var OY={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function xY(t,e,r){var n=this._calendar[t]||this._calendar.sameElse;return to(n)?n.call(e,r):n}function ro(t,e,r){var n=""+Math.abs(t),i=e-n.length,o=t>=0;return(o?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var Vb=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,cg=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Wb={},vu={};function Te(t,e,r,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),t&&(vu[t]=i),e&&(vu[e[0]]=function(){return ro(i.apply(this,arguments),e[1],e[2])}),r&&(vu[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function AY(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function HY(t){var e=t.match(Vb),r,n;for(r=0,n=e.length;r<n;r++)vu[e[r]]?e[r]=vu[e[r]]:e[r]=AY(e[r]);return function(i){var o="",s;for(s=0;s<n;s++)o+=to(e[s])?e[s].call(i,t):e[s];return o}}function hg(t,e){return t.isValid()?(e=wA(e,t.localeData()),Wb[e]=Wb[e]||HY(e),Wb[e](t)):t.localeData().invalidDate()}function wA(t,e){var r=5;function n(i){return e.longDateFormat(i)||i}for(cg.lastIndex=0;r>=0&&cg.test(t);)t=t.replace(cg,n),cg.lastIndex=0,r-=1;return t}var NY={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function DY(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.match(Vb).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[t])}var kY="Invalid date";function LY(){return this._invalidDate}var $Y="%d",FY=/\d{1,2}/;function VY(t){return this._ordinal.replace("%d",t)}var WY={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function BY(t,e,r,n){var i=this._relativeTime[r];return to(i)?i(t,e,r,n):i.replace(/%d/i,t)}function jY(t,e){var r=this._relativeTime[t>0?"future":"past"];return to(r)?r(e):r.replace(/%s/i,e)}var vA={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Jn(t){return typeof t=="string"?vA[t]||vA[t.toLowerCase()]:void 0}function Bb(t){var e={},r,n;for(n in t)it(t,n)&&(r=Jn(n),r&&(e[r]=t[n]));return e}var UY={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function zY(t){var e=[],r;for(r in t)it(t,r)&&e.push({unit:r,priority:UY[r]});return e.sort(function(n,i){return n.priority-i.priority}),e}var yA=/\d/,On=/\d\d/,CA=/\d{3}/,jb=/\d{4}/,dg=/[+-]?\d{6}/,Pt=/\d\d?/,bA=/\d\d\d\d?/,SA=/\d\d\d\d\d\d?/,fg=/\d{1,3}/,Ub=/\d{1,4}/,gg=/[+-]?\d{1,6}/,yu=/\d+/,mg=/[+-]?\d+/,YY=/Z|[+-]\d\d:?\d\d/gi,pg=/Z|[+-]\d\d(?::?\d\d)?/gi,GY=/[+-]?\d+(\.\d{1,3})?/,ph=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Cu=/^[1-9]\d?/,zb=/^([1-9]\d|\d)/,wg;wg={};function pe(t,e,r){wg[t]=to(e)?e:function(n,i){return n&&r?r:e}}function qY(t,e){return it(wg,t)?wg[t](e._strict,e._locale):new RegExp(KY(t))}function KY(t){return Bo(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,r,n,i,o){return r||n||i||o}))}function Bo(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Qn(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Ge(t){var e=+t,r=0;return e!==0&&isFinite(e)&&(r=Qn(e)),r}var Yb={};function Ct(t,e){var r,n=e,i;for(typeof t=="string"&&(t=[t]),Wo(e)&&(n=function(o,s){s[e]=Ge(o)}),i=t.length,r=0;r<i;r++)Yb[t[r]]=n}function wh(t,e){Ct(t,function(r,n,i,o){i._w=i._w||{},e(r,i._w,i,o)})}function XY(t,e,r){e!=null&&it(Yb,t)&&Yb[t](e,r._a,r,t)}function vg(t){return t%4===0&&t%100!==0||t%400===0}var Dr=0,jo=1,no=2,yr=3,Ri=4,Uo=5,Ba=6,ZY=7,JY=8;Te("Y",0,0,function(){var t=this.year();return t<=9999?ro(t,4):"+"+t}),Te(0,["YY",2],0,function(){return this.year()%100}),Te(0,["YYYY",4],0,"year"),Te(0,["YYYYY",5],0,"year"),Te(0,["YYYYYY",6,!0],0,"year"),pe("Y",mg),pe("YY",Pt,On),pe("YYYY",Ub,jb),pe("YYYYY",gg,dg),pe("YYYYYY",gg,dg),Ct(["YYYYY","YYYYYY"],Dr),Ct("YYYY",function(t,e){e[Dr]=t.length===2?se.parseTwoDigitYear(t):Ge(t)}),Ct("YY",function(t,e){e[Dr]=se.parseTwoDigitYear(t)}),Ct("Y",function(t,e){e[Dr]=parseInt(t,10)});function vh(t){return vg(t)?366:365}se.parseTwoDigitYear=function(t){return Ge(t)+(Ge(t)>68?1900:2e3)};var RA=bu("FullYear",!0);function QY(){return vg(this.year())}function bu(t,e){return function(r){return r!=null?(EA(this,t,r),se.updateOffset(this,e),this):yh(this,t)}}function yh(t,e){if(!t.isValid())return NaN;var r=t._d,n=t._isUTC;switch(e){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function EA(t,e,r){var n,i,o,s,a;if(!(!t.isValid()||isNaN(r))){switch(n=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(i?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(i?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(i?n.setUTCHours(r):n.setHours(r));case"Date":return void(i?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}o=r,s=t.month(),a=t.date(),a=a===29&&s===1&&!vg(o)?28:a,i?n.setUTCFullYear(o,s,a):n.setFullYear(o,s,a)}}function e2(t){return t=Jn(t),to(this[t])?this[t]():this}function t2(t,e){if(typeof t=="object"){t=Bb(t);var r=zY(t),n,i=r.length;for(n=0;n<i;n++)this[r[n].unit](t[r[n].unit])}else if(t=Jn(t),to(this[t]))return this[t](e);return this}function r2(t,e){return(t%e+e)%e}var nr;Array.prototype.indexOf?nr=Array.prototype.indexOf:nr=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function Gb(t,e){if(isNaN(t)||isNaN(e))return NaN;var r=r2(e,12);return t+=(e-r)/12,r===1?vg(t)?29:28:31-r%7%2}Te("M",["MM",2],"Mo",function(){return this.month()+1}),Te("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),Te("MMMM",0,0,function(t){return this.localeData().months(this,t)}),pe("M",Pt,Cu),pe("MM",Pt,On),pe("MMM",function(t,e){return e.monthsShortRegex(t)}),pe("MMMM",function(t,e){return e.monthsRegex(t)}),Ct(["M","MM"],function(t,e){e[jo]=Ge(t)-1}),Ct(["MMM","MMMM"],function(t,e,r,n){var i=r._locale.monthsParse(t,n,r._strict);i!=null?e[jo]=i:De(r).invalidMonth=t});var n2="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),TA="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),_A=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,i2=ph,o2=ph;function s2(t,e){return t?bi(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||_A).test(e)?"format":"standalone"][t.month()]:bi(this._months)?this._months:this._months.standalone}function a2(t,e){return t?bi(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[_A.test(e)?"format":"standalone"][t.month()]:bi(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function l2(t,e,r){var n,i,o,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)o=eo([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(o,"").toLocaleLowerCase();return r?e==="MMM"?(i=nr.call(this._shortMonthsParse,s),i!==-1?i:null):(i=nr.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=nr.call(this._shortMonthsParse,s),i!==-1?i:(i=nr.call(this._longMonthsParse,s),i!==-1?i:null)):(i=nr.call(this._longMonthsParse,s),i!==-1?i:(i=nr.call(this._shortMonthsParse,s),i!==-1?i:null))}function u2(t,e,r){var n,i,o;if(this._monthsParseExact)return l2.call(this,t,e,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=eo([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!r&&!this._monthsParse[n]&&(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(o.replace(".",""),"i")),r&&e==="MMMM"&&this._longMonthsParse[n].test(t))return n;if(r&&e==="MMM"&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}}function MA(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=Ge(e);else if(e=t.localeData().monthsParse(e),!Wo(e))return t}var r=e,n=t.date();return n=n<29?n:Math.min(n,Gb(t.year(),r)),t._isUTC?t._d.setUTCMonth(r,n):t._d.setMonth(r,n),t}function PA(t){return t!=null?(MA(this,t),se.updateOffset(this,!0),this):yh(this,"Month")}function c2(){return Gb(this.year(),this.month())}function h2(t){return this._monthsParseExact?(it(this,"_monthsRegex")||IA.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(it(this,"_monthsShortRegex")||(this._monthsShortRegex=i2),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function d2(t){return this._monthsParseExact?(it(this,"_monthsRegex")||IA.call(this),t?this._monthsStrictRegex:this._monthsRegex):(it(this,"_monthsRegex")||(this._monthsRegex=o2),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function IA(){function t(l,u){return u.length-l.length}var e=[],r=[],n=[],i,o,s,a;for(i=0;i<12;i++)o=eo([2e3,i]),s=Bo(this.monthsShort(o,"")),a=Bo(this.months(o,"")),e.push(s),r.push(a),n.push(a),n.push(s);e.sort(t),r.sort(t),n.sort(t),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function f2(t,e,r,n,i,o,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,r,n,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,r,n,i,o,s),a}function Ch(t){var e,r;return t<100&&t>=0?(r=Array.prototype.slice.call(arguments),r[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function yg(t,e,r){var n=7+e-r,i=(7+Ch(t,0,n).getUTCDay()-e)%7;return-i+n-1}function OA(t,e,r,n,i){var o=(7+r-n)%7,s=yg(t,n,i),a=1+7*(e-1)+o+s,l,u;return a<=0?(l=t-1,u=vh(l)+a):a>vh(t)?(l=t+1,u=a-vh(t)):(l=t,u=a),{year:l,dayOfYear:u}}function bh(t,e,r){var n=yg(t.year(),e,r),i=Math.floor((t.dayOfYear()-n-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+zo(s,e,r)):i>zo(t.year(),e,r)?(o=i-zo(t.year(),e,r),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function zo(t,e,r){var n=yg(t,e,r),i=yg(t+1,e,r);return(vh(t)-n+i)/7}Te("w",["ww",2],"wo","week"),Te("W",["WW",2],"Wo","isoWeek"),pe("w",Pt,Cu),pe("ww",Pt,On),pe("W",Pt,Cu),pe("WW",Pt,On),wh(["w","ww","W","WW"],function(t,e,r,n){e[n.substr(0,1)]=Ge(t)});function g2(t){return bh(t,this._week.dow,this._week.doy).week}var m2={dow:0,doy:6};function p2(){return this._week.dow}function w2(){return this._week.doy}function v2(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function y2(t){var e=bh(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Te("d",0,"do","day"),Te("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Te("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Te("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Te("e",0,0,"weekday"),Te("E",0,0,"isoWeekday"),pe("d",Pt),pe("e",Pt),pe("E",Pt),pe("dd",function(t,e){return e.weekdaysMinRegex(t)}),pe("ddd",function(t,e){return e.weekdaysShortRegex(t)}),pe("dddd",function(t,e){return e.weekdaysRegex(t)}),wh(["dd","ddd","dddd"],function(t,e,r,n){var i=r._locale.weekdaysParse(t,n,r._strict);i!=null?e.d=i:De(r).invalidWeekday=t}),wh(["d","e","E"],function(t,e,r,n){e[n]=Ge(t)});function C2(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function b2(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function qb(t,e){return t.slice(e,7).concat(t.slice(0,e))}var S2="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),xA="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),R2="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),E2=ph,T2=ph,_2=ph;function M2(t,e){var r=bi(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?qb(r,this._week.dow):t?r[t.day()]:r}function P2(t){return t===!0?qb(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function I2(t){return t===!0?qb(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function O2(t,e,r){var n,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=eo([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?e==="dddd"?(i=nr.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=nr.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=nr.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=nr.call(this._weekdaysParse,s),i!==-1||(i=nr.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=nr.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=nr.call(this._shortWeekdaysParse,s),i!==-1||(i=nr.call(this._weekdaysParse,s),i!==-1)?i:(i=nr.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=nr.call(this._minWeekdaysParse,s),i!==-1||(i=nr.call(this._weekdaysParse,s),i!==-1)?i:(i=nr.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function x2(t,e,r){var n,i,o;if(this._weekdaysParseExact)return O2.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=eo([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&e==="dddd"&&this._fullWeekdaysParse[n].test(t))return n;if(r&&e==="ddd"&&this._shortWeekdaysParse[n].test(t))return n;if(r&&e==="dd"&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}}function A2(t){if(!this.isValid())return t!=null?this:NaN;var e=yh(this,"Day");return t!=null?(t=C2(t,this.localeData()),this.add(t-e,"d")):e}function H2(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function N2(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=b2(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function D2(t){return this._weekdaysParseExact?(it(this,"_weekdaysRegex")||Kb.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(it(this,"_weekdaysRegex")||(this._weekdaysRegex=E2),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function k2(t){return this._weekdaysParseExact?(it(this,"_weekdaysRegex")||Kb.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(it(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=T2),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function L2(t){return this._weekdaysParseExact?(it(this,"_weekdaysRegex")||Kb.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(it(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=_2),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Kb(){function t(c,h){return h.length-c.length}var e=[],r=[],n=[],i=[],o,s,a,l,u;for(o=0;o<7;o++)s=eo([2e3,1]).day(o),a=Bo(this.weekdaysMin(s,"")),l=Bo(this.weekdaysShort(s,"")),u=Bo(this.weekdays(s,"")),e.push(a),r.push(l),n.push(u),i.push(a),i.push(l),i.push(u);e.sort(t),r.sort(t),n.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Xb(){return this.hours()%12||12}function $2(){return this.hours()||24}Te("H",["HH",2],0,"hour"),Te("h",["hh",2],0,Xb),Te("k",["kk",2],0,$2),Te("hmm",0,0,function(){return""+Xb.apply(this)+ro(this.minutes(),2)}),Te("hmmss",0,0,function(){return""+Xb.apply(this)+ro(this.minutes(),2)+ro(this.seconds(),2)}),Te("Hmm",0,0,function(){return""+this.hours()+ro(this.minutes(),2)}),Te("Hmmss",0,0,function(){return""+this.hours()+ro(this.minutes(),2)+ro(this.seconds(),2)});function AA(t,e){Te(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}AA("a",!0),AA("A",!1);function HA(t,e){return e._meridiemParse}pe("a",HA),pe("A",HA),pe("H",Pt,zb),pe("h",Pt,Cu),pe("k",Pt,Cu),pe("HH",Pt,On),pe("hh",Pt,On),pe("kk",Pt,On),pe("hmm",bA),pe("hmmss",SA),pe("Hmm",bA),pe("Hmmss",SA),Ct(["H","HH"],yr),Ct(["k","kk"],function(t,e,r){var n=Ge(t);e[yr]=n===24?0:n}),Ct(["a","A"],function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t}),Ct(["h","hh"],function(t,e,r){e[yr]=Ge(t),De(r).bigHour=!0}),Ct("hmm",function(t,e,r){var n=t.length-2;e[yr]=Ge(t.substr(0,n)),e[Ri]=Ge(t.substr(n)),De(r).bigHour=!0}),Ct("hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[yr]=Ge(t.substr(0,n)),e[Ri]=Ge(t.substr(n,2)),e[Uo]=Ge(t.substr(i)),De(r).bigHour=!0}),Ct("Hmm",function(t,e,r){var n=t.length-2;e[yr]=Ge(t.substr(0,n)),e[Ri]=Ge(t.substr(n))}),Ct("Hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[yr]=Ge(t.substr(0,n)),e[Ri]=Ge(t.substr(n,2)),e[Uo]=Ge(t.substr(i))});function F2(t){return(t+"").toLowerCase().charAt(0)==="p"}var V2=/[ap]\.?m?\.?/i,W2=bu("Hours",!0);function B2(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"}var NA={calendar:OY,longDateFormat:NY,invalidDate:kY,ordinal:$Y,dayOfMonthOrdinalParse:FY,relativeTime:WY,months:n2,monthsShort:TA,week:m2,weekdays:S2,weekdaysMin:R2,weekdaysShort:xA,meridiemParse:V2},kt={},Sh={},Rh;function j2(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r<n;r+=1)if(t[r]!==e[r])return r;return n}function DA(t){return t&&t.toLowerCase().replace("_","-")}function U2(t){for(var e=0,r,n,i,o;e<t.length;){for(o=DA(t[e]).split("-"),r=o.length,n=DA(t[e+1]),n=n?n.split("-"):null;r>0;){if(i=Cg(o.slice(0,r).join("-")),i)return i;if(n&&n.length>=r&&j2(o,n)>=r-1)break;r--}e++}return Rh}function z2(t){return!!(t&&t.match("^[^/\\\\]*$"))}function Cg(t){var e=null,r;if(kt[t]===void 0&&typeof module<"u"&&module&&module.exports&&z2(t))try{e=Rh._abbr,r=require,r("./locale/"+t),js(e)}catch{kt[t]=null}return kt[t]}function js(t,e){var r;return t&&(cn(e)?r=Yo(t):r=Zb(t,e),r?Rh=r:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Rh._abbr}function Zb(t,e){if(e!==null){var r,n=NA;if(e.abbr=t,kt[t]!=null)pA("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=kt[t]._config;else if(e.parentLocale!=null)if(kt[e.parentLocale]!=null)n=kt[e.parentLocale]._config;else if(r=Cg(e.parentLocale),r!=null)n=r._config;else return Sh[e.parentLocale]||(Sh[e.parentLocale]=[]),Sh[e.parentLocale].push({name:t,config:e}),null;return kt[t]=new $b(Lb(n,e)),Sh[t]&&Sh[t].forEach(function(i){Zb(i.name,i.config)}),js(t),kt[t]}else return delete kt[t],null}function Y2(t,e){if(e!=null){var r,n,i=NA;kt[t]!=null&&kt[t].parentLocale!=null?kt[t].set(Lb(kt[t]._config,e)):(n=Cg(t),n!=null&&(i=n._config),e=Lb(i,e),n==null&&(e.abbr=t),r=new $b(e),r.parentLocale=kt[t],kt[t]=r),js(t)}else kt[t]!=null&&(kt[t].parentLocale!=null?(kt[t]=kt[t].parentLocale,t===js()&&js(t)):kt[t]!=null&&delete kt[t]);return kt[t]}function Yo(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Rh;if(!bi(t)){if(e=Cg(t),e)return e;t=[t]}return U2(t)}function G2(){return Fb(kt)}function Jb(t){var e,r=t._a;return r&&De(t).overflow===-2&&(e=r[jo]<0||r[jo]>11?jo:r[no]<1||r[no]>Gb(r[Dr],r[jo])?no:r[yr]<0||r[yr]>24||r[yr]===24&&(r[Ri]!==0||r[Uo]!==0||r[Ba]!==0)?yr:r[Ri]<0||r[Ri]>59?Ri:r[Uo]<0||r[Uo]>59?Uo:r[Ba]<0||r[Ba]>999?Ba:-1,De(t)._overflowDayOfYear&&(e<Dr||e>no)&&(e=no),De(t)._overflowWeeks&&e===-1&&(e=ZY),De(t)._overflowWeekday&&e===-1&&(e=JY),De(t).overflow=e),t}var q2=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,K2=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,X2=/Z|[+-]\d\d(?::?\d\d)?/,bg=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Qb=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Z2=/^\/?Date\((-?\d+)/i,J2=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Q2={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function kA(t){var e,r,n=t._i,i=q2.exec(n)||K2.exec(n),o,s,a,l,u=bg.length,c=Qb.length;if(i){for(De(t).iso=!0,e=0,r=u;e<r;e++)if(bg[e][1].exec(i[1])){s=bg[e][0],o=bg[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,r=c;e<r;e++)if(Qb[e][1].exec(i[3])){a=(i[2]||" ")+Qb[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(X2.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),tS(t)}else t._isValid=!1}function eG(t,e,r,n,i,o){var s=[tG(t),TA.indexOf(e),parseInt(r,10),parseInt(n,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function tG(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function rG(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function nG(t,e,r){if(t){var n=xA.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(n!==i)return De(r).weekdayMismatch=!0,r._isValid=!1,!1}return!0}function iG(t,e,r){if(t)return Q2[t];if(e)return 0;var n=parseInt(r,10),i=n%100,o=(n-i)/100;return o*60+i}function LA(t){var e=J2.exec(rG(t._i)),r;if(e){if(r=eG(e[4],e[3],e[2],e[5],e[6],e[7]),!nG(e[1],r,t))return;t._a=r,t._tzm=iG(e[8],e[9],e[10]),t._d=Ch.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),De(t).rfc2822=!0}else t._isValid=!1}function oG(t){var e=Z2.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(kA(t),t._isValid===!1)delete t._isValid;else return;if(LA(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:se.createFromInputFallback(t)}se.createFromInputFallback=Zn("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function Su(t,e,r){return t??e??r}function sG(t){var e=new Date(se.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function eS(t){var e,r,n=[],i,o,s;if(!t._d){for(i=sG(t),t._w&&t._a[no]==null&&t._a[jo]==null&&aG(t),t._dayOfYear!=null&&(s=Su(t._a[Dr],i[Dr]),(t._dayOfYear>vh(s)||t._dayOfYear===0)&&(De(t)._overflowDayOfYear=!0),r=Ch(s,0,t._dayOfYear),t._a[jo]=r.getUTCMonth(),t._a[no]=r.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=n[e]=i[e];for(;e<7;e++)t._a[e]=n[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[yr]===24&&t._a[Ri]===0&&t._a[Uo]===0&&t._a[Ba]===0&&(t._nextDay=!0,t._a[yr]=0),t._d=(t._useUTC?Ch:f2).apply(null,n),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[yr]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(De(t).weekdayMismatch=!0)}}function aG(t){var e,r,n,i,o,s,a,l,u;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(o=1,s=4,r=Su(e.GG,t._a[Dr],bh(It(),1,4).year),n=Su(e.W,1),i=Su(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,u=bh(It(),o,s),r=Su(e.gg,t._a[Dr],u.year),n=Su(e.w,u.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),n<1||n>zo(r,o,s)?De(t)._overflowWeeks=!0:l!=null?De(t)._overflowWeekday=!0:(a=OA(r,n,i,o,s),t._a[Dr]=a.year,t._dayOfYear=a.dayOfYear)}se.ISO_8601=function(){},se.RFC_2822=function(){};function tS(t){if(t._f===se.ISO_8601){kA(t);return}if(t._f===se.RFC_2822){LA(t);return}t._a=[],De(t).empty=!0;var e=""+t._i,r,n,i,o,s,a=e.length,l=0,u,c;for(i=wA(t._f,t._locale).match(Vb)||[],c=i.length,r=0;r<c;r++)o=i[r],n=(e.match(qY(o,t))||[])[0],n&&(s=e.substr(0,e.indexOf(n)),s.length>0&&De(t).unusedInput.push(s),e=e.slice(e.indexOf(n)+n.length),l+=n.length),vu[o]?(n?De(t).empty=!1:De(t).unusedTokens.push(o),XY(o,n,t)):t._strict&&!n&&De(t).unusedTokens.push(o);De(t).charsLeftOver=a-l,e.length>0&&De(t).unusedInput.push(e),t._a[yr]<=12&&De(t).bigHour===!0&&t._a[yr]>0&&(De(t).bigHour=void 0),De(t).parsedDateParts=t._a.slice(0),De(t).meridiem=t._meridiem,t._a[yr]=lG(t._locale,t._a[yr],t._meridiem),u=De(t).era,u!==null&&(t._a[Dr]=t._locale.erasConvertYear(u,t._a[Dr])),eS(t),Jb(t)}function lG(t,e,r){var n;return r==null?e:t.meridiemHour!=null?t.meridiemHour(e,r):(t.isPM!=null&&(n=t.isPM(r),n&&e<12&&(e+=12),!n&&e===12&&(e=0)),e)}function uG(t){var e,r,n,i,o,s,a=!1,l=t._f.length;if(l===0){De(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=kb({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],tS(e),Nb(e)&&(s=!0),o+=De(e).charsLeftOver,o+=De(e).unusedTokens.length*10,De(e).score=o,a?o<n&&(n=o,r=e):(n==null||o<n||s)&&(n=o,r=e,s&&(a=!0));Bs(t,r||e)}function cG(t){if(!t._d){var e=Bb(t._i),r=e.day===void 0?e.date:e.day;t._a=dA([e.year,e.month,r,e.hour,e.minute,e.second,e.millisecond],function(n){return n&&parseInt(n,10)}),eS(t)}}function hG(t){var e=new mh(Jb($A(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function $A(t){var e=t._i,r=t._f;return t._locale=t._locale||Yo(t._l),e===null||r===void 0&&e===""?ug({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),Si(e)?new mh(Jb(e)):(gh(e)?t._d=e:bi(r)?uG(t):r?tS(t):dG(t),Nb(t)||(t._d=null),t))}function dG(t){var e=t._i;cn(e)?t._d=new Date(se.now()):gh(e)?t._d=new Date(e.valueOf()):typeof e=="string"?oG(t):bi(e)?(t._a=dA(e.slice(0),function(r){return parseInt(r,10)}),eS(t)):Wa(e)?cG(t):Wo(e)?t._d=new Date(e):se.createFromInputFallback(t)}function FA(t,e,r,n,i){var o={};return(e===!0||e===!1)&&(n=e,e=void 0),(r===!0||r===!1)&&(n=r,r=void 0),(Wa(t)&&Ab(t)||bi(t)&&t.length===0)&&(t=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=r,o._i=t,o._f=e,o._strict=n,hG(o)}function It(t,e,r,n){return FA(t,e,r,n,!1)}var fG=Zn("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=It.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:ug()}),gG=Zn("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=It.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:ug()});function VA(t,e){var r,n;if(e.length===1&&bi(e[0])&&(e=e[0]),!e.length)return It();for(r=e[0],n=1;n<e.length;++n)(!e[n].isValid()||e[n][t](r))&&(r=e[n]);return r}function mG(){var t=[].slice.call(arguments,0);return VA("isBefore",t)}function pG(){var t=[].slice.call(arguments,0);return VA("isAfter",t)}var wG=function(){return Date.now?Date.now():+new Date},Eh=["year","quarter","month","week","day","hour","minute","second","millisecond"];function vG(t){var e,r=!1,n,i=Eh.length;for(e in t)if(it(t,e)&&!(nr.call(Eh,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(n=0;n<i;++n)if(t[Eh[n]]){if(r)return!1;parseFloat(t[Eh[n]])!==Ge(t[Eh[n]])&&(r=!0)}return!0}function yG(){return this._isValid}function CG(){return Ei(NaN)}function Sg(t){var e=Bb(t),r=e.year||0,n=e.quarter||0,i=e.month||0,o=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,l=e.minute||0,u=e.second||0,c=e.millisecond||0;this._isValid=vG(e),this._milliseconds=+c+u*1e3+l*6e4+a*1e3*60*60,this._days=+s+o*7,this._months=+i+n*3+r*12,this._data={},this._locale=Yo(),this._bubble()}function Rg(t){return t instanceof Sg}function rS(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function bG(t,e,r){var n=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),o=0,s;for(s=0;s<n;s++)Ge(t[s])!==Ge(e[s])&&o++;return o+i}function WA(t,e){Te(t,0,0,function(){var r=this.utcOffset(),n="+";return r<0&&(r=-r,n="-"),n+ro(~~(r/60),2)+e+ro(~~r%60,2)})}WA("Z",":"),WA("ZZ",""),pe("Z",pg),pe("ZZ",pg),Ct(["Z","ZZ"],function(t,e,r){r._useUTC=!0,r._tzm=nS(pg,t)});var SG=/([\+\-]|\d\d)/gi;function nS(t,e){var r=(e||"").match(t),n,i,o;return r===null?null:(n=r[r.length-1]||[],i=(n+"").match(SG)||["-",0,0],o=+(i[1]*60)+Ge(i[2]),o===0?0:i[0]==="+"?o:-o)}function iS(t,e){var r,n;return e._isUTC?(r=e.clone(),n=(Si(t)||gh(t)?t.valueOf():It(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+n),se.updateOffset(r,!1),r):It(t).local()}function oS(t){return-Math.round(t._d.getTimezoneOffset())}se.updateOffset=function(){};function RG(t,e,r){var n=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=nS(pg,t),t===null)return this}else Math.abs(t)<16&&!r&&(t=t*60);return!this._isUTC&&e&&(i=oS(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),n!==t&&(!e||this._changeInProgress?zA(this,Ei(t-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,se.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:oS(this)}function EG(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function TG(t){return this.utcOffset(0,t)}function _G(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(oS(this),"m")),this}function MG(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=nS(YY,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function PG(t){return this.isValid()?(t=t?It(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function IG(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function OG(){if(!cn(this._isDSTShifted))return this._isDSTShifted;var t={},e;return kb(t,this),t=$A(t),t._a?(e=t._isUTC?eo(t._a):It(t._a),this._isDSTShifted=this.isValid()&&bG(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function xG(){return this.isValid()?!this._isUTC:!1}function AG(){return this.isValid()?this._isUTC:!1}function BA(){return this.isValid()?this._isUTC&&this._offset===0:!1}var HG=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,NG=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ei(t,e){var r=t,n=null,i,o,s;return Rg(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:Wo(t)||!isNaN(+t)?(r={},e?r[e]=+t:r.milliseconds=+t):(n=HG.exec(t))?(i=n[1]==="-"?-1:1,r={y:0,d:Ge(n[no])*i,h:Ge(n[yr])*i,m:Ge(n[Ri])*i,s:Ge(n[Uo])*i,ms:Ge(rS(n[Ba]*1e3))*i}):(n=NG.exec(t))?(i=n[1]==="-"?-1:1,r={y:ja(n[2],i),M:ja(n[3],i),w:ja(n[4],i),d:ja(n[5],i),h:ja(n[6],i),m:ja(n[7],i),s:ja(n[8],i)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(s=DG(It(r.from),It(r.to)),r={},r.ms=s.milliseconds,r.M=s.months),o=new Sg(r),Rg(t)&&it(t,"_locale")&&(o._locale=t._locale),Rg(t)&&it(t,"_isValid")&&(o._isValid=t._isValid),o}Ei.fn=Sg.prototype,Ei.invalid=CG;function ja(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function jA(t,e){var r={};return r.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function DG(t,e){var r;return t.isValid()&&e.isValid()?(e=iS(e,t),t.isBefore(e)?r=jA(t,e):(r=jA(e,t),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function UA(t,e){return function(r,n){var i,o;return n!==null&&!isNaN(+n)&&(pA(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=r,r=n,n=o),i=Ei(r,n),zA(this,i,t),this}}function zA(t,e,r,n){var i=e._milliseconds,o=rS(e._days),s=rS(e._months);t.isValid()&&(n=n??!0,s&&MA(t,yh(t,"Month")+s*r),o&&EA(t,"Date",yh(t,"Date")+o*r),i&&t._d.setTime(t._d.valueOf()+i*r),n&&se.updateOffset(t,o||s))}var kG=UA(1,"add"),LG=UA(-1,"subtract");function YA(t){return typeof t=="string"||t instanceof String}function $G(t){return Si(t)||gh(t)||YA(t)||Wo(t)||VG(t)||FG(t)||t===null||t===void 0}function FG(t){var e=Wa(t)&&!Ab(t),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,o,s=n.length;for(i=0;i<s;i+=1)o=n[i],r=r||it(t,o);return e&&r}function VG(t){var e=bi(t),r=!1;return e&&(r=t.filter(function(n){return!Wo(n)&&YA(t)}).length===0),e&&r}function WG(t){var e=Wa(t)&&!Ab(t),r=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,o;for(i=0;i<n.length;i+=1)o=n[i],r=r||it(t,o);return e&&r}function BG(t,e){var r=t.diff(e,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function jG(t,e){arguments.length===1&&(arguments[0]?$G(arguments[0])?(t=arguments[0],e=void 0):WG(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var r=t||It(),n=iS(r,this).startOf("day"),i=se.calendarFormat(this,n)||"sameElse",o=e&&(to(e[i])?e[i].call(this,r):e[i]);return this.format(o||this.localeData().calendar(i,this,It(r)))}function UG(){return new mh(this)}function zG(t,e){var r=Si(t)?t:It(t);return this.isValid()&&r.isValid()?(e=Jn(e)||"millisecond",e==="millisecond"?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(e).valueOf()):!1}function YG(t,e){var r=Si(t)?t:It(t);return this.isValid()&&r.isValid()?(e=Jn(e)||"millisecond",e==="millisecond"?this.valueOf()<r.valueOf():this.clone().endOf(e).valueOf()<r.valueOf()):!1}function GG(t,e,r,n){var i=Si(t)?t:It(t),o=Si(e)?e:It(e);return this.isValid()&&i.isValid()&&o.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(i,r):!this.isBefore(i,r))&&(n[1]===")"?this.isBefore(o,r):!this.isAfter(o,r))):!1}function qG(t,e){var r=Si(t)?t:It(t),n;return this.isValid()&&r.isValid()?(e=Jn(e)||"millisecond",e==="millisecond"?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf())):!1}function KG(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function XG(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function ZG(t,e,r){var n,i,o;if(!this.isValid())return NaN;if(n=iS(t,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,e=Jn(e),e){case"year":o=Eg(this,n)/12;break;case"month":o=Eg(this,n);break;case"quarter":o=Eg(this,n)/3;break;case"second":o=(this-n)/1e3;break;case"minute":o=(this-n)/6e4;break;case"hour":o=(this-n)/36e5;break;case"day":o=(this-n-i)/864e5;break;case"week":o=(this-n-i)/6048e5;break;default:o=this-n}return r?o:Qn(o)}function Eg(t,e){if(t.date()<e.date())return-Eg(e,t);var r=(e.year()-t.year())*12+(e.month()-t.month()),n=t.clone().add(r,"months"),i,o;return e-n<0?(i=t.clone().add(r-1,"months"),o=(e-n)/(n-i)):(i=t.clone().add(r+1,"months"),o=(e-n)/(i-n)),-(r+o)||0}se.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",se.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function JG(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function QG(t){if(!this.isValid())return null;var e=t!==!0,r=e?this.clone().utc():this;return r.year()<0||r.year()>9999?hg(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):to(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",hg(r,"Z")):hg(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function eq(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",r,n,i,o;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),r="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",o=e+'[")]',this.format(r+n+i+o)}function tq(t){t||(t=this.isUtc()?se.defaultFormatUtc:se.defaultFormat);var e=hg(this,t);return this.localeData().postformat(e)}function rq(t,e){return this.isValid()&&(Si(t)&&t.isValid()||It(t).isValid())?Ei({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function nq(t){return this.from(It(),t)}function iq(t,e){return this.isValid()&&(Si(t)&&t.isValid()||It(t).isValid())?Ei({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function oq(t){return this.to(It(),t)}function GA(t){var e;return t===void 0?this._locale._abbr:(e=Yo(t),e!=null&&(this._locale=e),this)}var qA=Zn("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function KA(){return this._locale}var Tg=1e3,Ru=60*Tg,_g=60*Ru,XA=(365*400+97)*24*_g;function Eu(t,e){return(t%e+e)%e}function ZA(t,e,r){return t<100&&t>=0?new Date(t+400,e,r)-XA:new Date(t,e,r).valueOf()}function JA(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-XA:Date.UTC(t,e,r)}function sq(t){var e,r;if(t=Jn(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?JA:ZA,t){case"year":e=r(this.year(),0,1);break;case"quarter":e=r(this.year(),this.month()-this.month()%3,1);break;case"month":e=r(this.year(),this.month(),1);break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=r(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Eu(e+(this._isUTC?0:this.utcOffset()*Ru),_g);break;case"minute":e=this._d.valueOf(),e-=Eu(e,Ru);break;case"second":e=this._d.valueOf(),e-=Eu(e,Tg);break}return this._d.setTime(e),se.updateOffset(this,!0),this}function aq(t){var e,r;if(t=Jn(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?JA:ZA,t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=_g-Eu(e+(this._isUTC?0:this.utcOffset()*Ru),_g)-1;break;case"minute":e=this._d.valueOf(),e+=Ru-Eu(e,Ru)-1;break;case"second":e=this._d.valueOf(),e+=Tg-Eu(e,Tg)-1;break}return this._d.setTime(e),se.updateOffset(this,!0),this}function lq(){return this._d.valueOf()-(this._offset||0)*6e4}function uq(){return Math.floor(this.valueOf()/1e3)}function cq(){return new Date(this.valueOf())}function hq(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function dq(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function fq(){return this.isValid()?this.toISOString():null}function gq(){return Nb(this)}function mq(){return Bs({},De(this))}function pq(){return De(this).overflow}function wq(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Te("N",0,0,"eraAbbr"),Te("NN",0,0,"eraAbbr"),Te("NNN",0,0,"eraAbbr"),Te("NNNN",0,0,"eraName"),Te("NNNNN",0,0,"eraNarrow"),Te("y",["y",1],"yo","eraYear"),Te("y",["yy",2],0,"eraYear"),Te("y",["yyy",3],0,"eraYear"),Te("y",["yyyy",4],0,"eraYear"),pe("N",sS),pe("NN",sS),pe("NNN",sS),pe("NNNN",Pq),pe("NNNNN",Iq),Ct(["N","NN","NNN","NNNN","NNNNN"],function(t,e,r,n){var i=r._locale.erasParse(t,n,r._strict);i?De(r).era=i:De(r).invalidEra=t}),pe("y",yu),pe("yy",yu),pe("yyy",yu),pe("yyyy",yu),pe("yo",Oq),Ct(["y","yy","yyy","yyyy"],Dr),Ct(["yo"],function(t,e,r,n){var i;r._locale._eraYearOrdinalRegex&&(i=t.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?e[Dr]=r._locale.eraYearOrdinalParse(t,i):e[Dr]=parseInt(t,10)});function vq(t,e){var r,n,i,o=this._eras||Yo("en")._eras;for(r=0,n=o.length;r<n;++r){switch(typeof o[r].since){case"string":i=se(o[r].since).startOf("day"),o[r].since=i.valueOf();break}switch(typeof o[r].until){case"undefined":o[r].until=1/0;break;case"string":i=se(o[r].until).startOf("day").valueOf(),o[r].until=i.valueOf();break}}return o}function yq(t,e,r){var n,i,o=this.eras(),s,a,l;for(t=t.toUpperCase(),n=0,i=o.length;n<i;++n)if(s=o[n].name.toUpperCase(),a=o[n].abbr.toUpperCase(),l=o[n].narrow.toUpperCase(),r)switch(e){case"N":case"NN":case"NNN":if(a===t)return o[n];break;case"NNNN":if(s===t)return o[n];break;case"NNNNN":if(l===t)return o[n];break}else if([s,a,l].indexOf(t)>=0)return o[n]}function Cq(t,e){var r=t.since<=t.until?1:-1;return e===void 0?se(t.since).year():se(t.since).year()+(e-t.offset)*r}function bq(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].name;return""}function Sq(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].narrow;return""}function Rq(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].abbr;return""}function Eq(){var t,e,r,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(r=i[t].since<=i[t].until?1:-1,n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until||i[t].until<=n&&n<=i[t].since)return(this.year()-se(i[t].since).year())*r+i[t].offset;return this.year()}function Tq(t){return it(this,"_erasNameRegex")||aS.call(this),t?this._erasNameRegex:this._erasRegex}function _q(t){return it(this,"_erasAbbrRegex")||aS.call(this),t?this._erasAbbrRegex:this._erasRegex}function Mq(t){return it(this,"_erasNarrowRegex")||aS.call(this),t?this._erasNarrowRegex:this._erasRegex}function sS(t,e){return e.erasAbbrRegex(t)}function Pq(t,e){return e.erasNameRegex(t)}function Iq(t,e){return e.erasNarrowRegex(t)}function Oq(t,e){return e._eraYearOrdinalRegex||yu}function aS(){var t=[],e=[],r=[],n=[],i,o,s,a,l,u=this.eras();for(i=0,o=u.length;i<o;++i)s=Bo(u[i].name),a=Bo(u[i].abbr),l=Bo(u[i].narrow),e.push(s),t.push(a),r.push(l),n.push(s),n.push(a),n.push(l);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}Te(0,["gg",2],0,function(){return this.weekYear()%100}),Te(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Mg(t,e){Te(0,[t,t.length],0,e)}Mg("gggg","weekYear"),Mg("ggggg","weekYear"),Mg("GGGG","isoWeekYear"),Mg("GGGGG","isoWeekYear"),pe("G",mg),pe("g",mg),pe("GG",Pt,On),pe("gg",Pt,On),pe("GGGG",Ub,jb),pe("gggg",Ub,jb),pe("GGGGG",gg,dg),pe("ggggg",gg,dg),wh(["gggg","ggggg","GGGG","GGGGG"],function(t,e,r,n){e[n.substr(0,2)]=Ge(t)}),wh(["gg","GG"],function(t,e,r,n){e[n]=se.parseTwoDigitYear(t)});function xq(t){return QA.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Aq(t){return QA.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Hq(){return zo(this.year(),1,4)}function Nq(){return zo(this.isoWeekYear(),1,4)}function Dq(){var t=this.localeData()._week;return zo(this.year(),t.dow,t.doy)}function kq(){var t=this.localeData()._week;return zo(this.weekYear(),t.dow,t.doy)}function QA(t,e,r,n,i){var o;return t==null?bh(this,n,i).year:(o=zo(t,n,i),e>o&&(e=o),Lq.call(this,t,e,r,n,i))}function Lq(t,e,r,n,i){var o=OA(t,e,r,n,i),s=Ch(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Te("Q",0,"Qo","quarter"),pe("Q",yA),Ct("Q",function(t,e){e[jo]=(Ge(t)-1)*3});function $q(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Te("D",["DD",2],"Do","date"),pe("D",Pt,Cu),pe("DD",Pt,On),pe("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Ct(["D","DD"],no),Ct("Do",function(t,e){e[no]=Ge(t.match(Pt)[0])});var eH=bu("Date",!0);Te("DDD",["DDDD",3],"DDDo","dayOfYear"),pe("DDD",fg),pe("DDDD",CA),Ct(["DDD","DDDD"],function(t,e,r){r._dayOfYear=Ge(t)});function Fq(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Te("m",["mm",2],0,"minute"),pe("m",Pt,zb),pe("mm",Pt,On),Ct(["m","mm"],Ri);var Vq=bu("Minutes",!1);Te("s",["ss",2],0,"second"),pe("s",Pt,zb),pe("ss",Pt,On),Ct(["s","ss"],Uo);var Wq=bu("Seconds",!1);Te("S",0,0,function(){return~~(this.millisecond()/100)}),Te(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Te(0,["SSS",3],0,"millisecond"),Te(0,["SSSS",4],0,function(){return this.millisecond()*10}),Te(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Te(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Te(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Te(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Te(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),pe("S",fg,yA),pe("SS",fg,On),pe("SSS",fg,CA);var Us,tH;for(Us="SSSS";Us.length<=9;Us+="S")pe(Us,yu);function Bq(t,e){e[Ba]=Ge(("0."+t)*1e3)}for(Us="S";Us.length<=9;Us+="S")Ct(Us,Bq);tH=bu("Milliseconds",!1),Te("z",0,0,"zoneAbbr"),Te("zz",0,0,"zoneName");function jq(){return this._isUTC?"UTC":""}function Uq(){return this._isUTC?"Coordinated Universal Time":""}var le=mh.prototype;le.add=kG,le.calendar=jG,le.clone=UG,le.diff=ZG,le.endOf=aq,le.format=tq,le.from=rq,le.fromNow=nq,le.to=iq,le.toNow=oq,le.get=e2,le.invalidAt=pq,le.isAfter=zG,le.isBefore=YG,le.isBetween=GG,le.isSame=qG,le.isSameOrAfter=KG,le.isSameOrBefore=XG,le.isValid=gq,le.lang=qA,le.locale=GA,le.localeData=KA,le.max=gG,le.min=fG,le.parsingFlags=mq,le.set=t2,le.startOf=sq,le.subtract=LG,le.toArray=hq,le.toObject=dq,le.toDate=cq,le.toISOString=QG,le.inspect=eq,typeof Symbol<"u"&&Symbol.for!=null&&(le[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),le.toJSON=fq,le.toString=JG,le.unix=uq,le.valueOf=lq,le.creationData=wq,le.eraName=bq,le.eraNarrow=Sq,le.eraAbbr=Rq,le.eraYear=Eq,le.year=RA,le.isLeapYear=QY,le.weekYear=xq,le.isoWeekYear=Aq,le.quarter=le.quarters=$q,le.month=PA,le.daysInMonth=c2,le.week=le.weeks=v2,le.isoWeek=le.isoWeeks=y2,le.weeksInYear=Dq,le.weeksInWeekYear=kq,le.isoWeeksInYear=Hq,le.isoWeeksInISOWeekYear=Nq,le.date=eH,le.day=le.days=A2,le.weekday=H2,le.isoWeekday=N2,le.dayOfYear=Fq,le.hour=le.hours=W2,le.minute=le.minutes=Vq,le.second=le.seconds=Wq,le.millisecond=le.milliseconds=tH,le.utcOffset=RG,le.utc=TG,le.local=_G,le.parseZone=MG,le.hasAlignedHourOffset=PG,le.isDST=IG,le.isLocal=xG,le.isUtcOffset=AG,le.isUtc=BA,le.isUTC=BA,le.zoneAbbr=jq,le.zoneName=Uq,le.dates=Zn("dates accessor is deprecated. Use date instead.",eH),le.months=Zn("months accessor is deprecated. Use month instead",PA),le.years=Zn("years accessor is deprecated. Use year instead",RA),le.zone=Zn("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",EG),le.isDSTShifted=Zn("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",OG);function zq(t){return It(t*1e3)}function Yq(){return It.apply(null,arguments).parseZone()}function rH(t){return t}var ot=$b.prototype;ot.calendar=xY,ot.longDateFormat=DY,ot.invalidDate=LY,ot.ordinal=VY,ot.preparse=rH,ot.postformat=rH,ot.relativeTime=BY,ot.pastFuture=jY,ot.set=IY,ot.eras=vq,ot.erasParse=yq,ot.erasConvertYear=Cq,ot.erasAbbrRegex=_q,ot.erasNameRegex=Tq,ot.erasNarrowRegex=Mq,ot.months=s2,ot.monthsShort=a2,ot.monthsParse=u2,ot.monthsRegex=d2,ot.monthsShortRegex=h2,ot.week=g2,ot.firstDayOfYear=w2,ot.firstDayOfWeek=p2,ot.weekdays=M2,ot.weekdaysMin=I2,ot.weekdaysShort=P2,ot.weekdaysParse=x2,ot.weekdaysRegex=D2,ot.weekdaysShortRegex=k2,ot.weekdaysMinRegex=L2,ot.isPM=F2,ot.meridiem=B2;function Pg(t,e,r,n){var i=Yo(),o=eo().set(n,e);return i[r](o,t)}function nH(t,e,r){if(Wo(t)&&(e=t,t=void 0),t=t||"",e!=null)return Pg(t,e,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=Pg(t,n,r,"month");return i}function lS(t,e,r,n){typeof t=="boolean"?(Wo(e)&&(r=e,e=void 0),e=e||""):(e=t,r=e,t=!1,Wo(e)&&(r=e,e=void 0),e=e||"");var i=Yo(),o=t?i._week.dow:0,s,a=[];if(r!=null)return Pg(e,(r+o)%7,n,"day");for(s=0;s<7;s++)a[s]=Pg(e,(s+o)%7,n,"day");return a}function Gq(t,e){return nH(t,e,"months")}function qq(t,e){return nH(t,e,"monthsShort")}function Kq(t,e,r){return lS(t,e,r,"weekdays")}function Xq(t,e,r){return lS(t,e,r,"weekdaysShort")}function Zq(t,e,r){return lS(t,e,r,"weekdaysMin")}js("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,r=Ge(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+r}}),se.lang=Zn("moment.lang is deprecated. Use moment.locale instead.",js),se.langData=Zn("moment.langData is deprecated. Use moment.localeData instead.",Yo);var Go=Math.abs;function Jq(){var t=this._data;return this._milliseconds=Go(this._milliseconds),this._days=Go(this._days),this._months=Go(this._months),t.milliseconds=Go(t.milliseconds),t.seconds=Go(t.seconds),t.minutes=Go(t.minutes),t.hours=Go(t.hours),t.months=Go(t.months),t.years=Go(t.years),this}function iH(t,e,r,n){var i=Ei(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function Qq(t,e){return iH(this,t,e,1)}function eK(t,e){return iH(this,t,e,-1)}function oH(t){return t<0?Math.floor(t):Math.ceil(t)}function tK(){var t=this._milliseconds,e=this._days,r=this._months,n=this._data,i,o,s,a,l;return t>=0&&e>=0&&r>=0||t<=0&&e<=0&&r<=0||(t+=oH(uS(r)+e)*864e5,e=0,r=0),n.milliseconds=t%1e3,i=Qn(t/1e3),n.seconds=i%60,o=Qn(i/60),n.minutes=o%60,s=Qn(o/60),n.hours=s%24,e+=Qn(s/24),l=Qn(sH(e)),r+=l,e-=oH(uS(l)),a=Qn(r/12),r%=12,n.days=e,n.months=r,n.years=a,this}function sH(t){return t*4800/146097}function uS(t){return t*146097/4800}function rK(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if(t=Jn(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+n/864e5,r=this._months+sH(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(uS(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return e*24+n/36e5;case"minute":return e*1440+n/6e4;case"second":return e*86400+n/1e3;case"millisecond":return Math.floor(e*864e5)+n;default:throw new Error("Unknown unit "+t)}}function qo(t){return function(){return this.as(t)}}var aH=qo("ms"),nK=qo("s"),iK=qo("m"),oK=qo("h"),sK=qo("d"),aK=qo("w"),lK=qo("M"),uK=qo("Q"),cK=qo("y"),hK=aH;function dK(){return Ei(this)}function fK(t){return t=Jn(t),this.isValid()?this[t+"s"]():NaN}function Ua(t){return function(){return this.isValid()?this._data[t]:NaN}}var gK=Ua("milliseconds"),mK=Ua("seconds"),pK=Ua("minutes"),wK=Ua("hours"),vK=Ua("days"),yK=Ua("months"),CK=Ua("years");function bK(){return Qn(this.days()/7)}var Ko=Math.round,Tu={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function SK(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}function RK(t,e,r,n){var i=Ei(t).abs(),o=Ko(i.as("s")),s=Ko(i.as("m")),a=Ko(i.as("h")),l=Ko(i.as("d")),u=Ko(i.as("M")),c=Ko(i.as("w")),h=Ko(i.as("y")),d=o<=r.ss&&["s",o]||o<r.s&&["ss",o]||s<=1&&["m"]||s<r.m&&["mm",s]||a<=1&&["h"]||a<r.h&&["hh",a]||l<=1&&["d"]||l<r.d&&["dd",l];return r.w!=null&&(d=d||c<=1&&["w"]||c<r.w&&["ww",c]),d=d||u<=1&&["M"]||u<r.M&&["MM",u]||h<=1&&["y"]||["yy",h],d[2]=e,d[3]=+t>0,d[4]=n,SK.apply(null,d)}function EK(t){return t===void 0?Ko:typeof t=="function"?(Ko=t,!0):!1}function TK(t,e){return Tu[t]===void 0?!1:e===void 0?Tu[t]:(Tu[t]=e,t==="s"&&(Tu.ss=e-1),!0)}function _K(t,e){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Tu,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(r=t),typeof e=="object"&&(n=Object.assign({},Tu,e),e.s!=null&&e.ss==null&&(n.ss=e.s-1)),i=this.localeData(),o=RK(this,!r,n,i),r&&(o=i.pastFuture(+this,o)),i.postformat(o)}var cS=Math.abs;function _u(t){return(t>0)-(t<0)||+t}function Ig(){if(!this.isValid())return this.localeData().invalidDate();var t=cS(this._milliseconds)/1e3,e=cS(this._days),r=cS(this._months),n,i,o,s,a=this.asSeconds(),l,u,c,h;return a?(n=Qn(t/60),i=Qn(n/60),t%=60,n%=60,o=Qn(r/12),r%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=_u(this._months)!==_u(a)?"-":"",c=_u(this._days)!==_u(a)?"-":"",h=_u(this._milliseconds)!==_u(a)?"-":"",l+"P"+(o?u+o+"Y":"")+(r?u+r+"M":"")+(e?c+e+"D":"")+(i||n||t?"T":"")+(i?h+i+"H":"")+(n?h+n+"M":"")+(t?h+s+"S":"")):"P0D"}var Je=Sg.prototype;Je.isValid=yG,Je.abs=Jq,Je.add=Qq,Je.subtract=eK,Je.as=rK,Je.asMilliseconds=aH,Je.asSeconds=nK,Je.asMinutes=iK,Je.asHours=oK,Je.asDays=sK,Je.asWeeks=aK,Je.asMonths=lK,Je.asQuarters=uK,Je.asYears=cK,Je.valueOf=hK,Je._bubble=tK,Je.clone=dK,Je.get=fK,Je.milliseconds=gK,Je.seconds=mK,Je.minutes=pK,Je.hours=wK,Je.days=vK,Je.weeks=bK,Je.months=yK,Je.years=CK,Je.humanize=_K,Je.toISOString=Ig,Je.toString=Ig,Je.toJSON=Ig,Je.locale=GA,Je.localeData=KA,Je.toIsoString=Zn("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ig),Je.lang=qA,Te("X",0,0,"unix"),Te("x",0,0,"valueOf"),pe("x",mg),pe("X",GY),Ct("X",function(t,e,r){r._d=new Date(parseFloat(t)*1e3)}),Ct("x",function(t,e,r){r._d=new Date(Ge(t))});//! moment.js
487
+ se.version="2.30.1",MY(It),se.fn=le,se.min=mG,se.max=pG,se.now=wG,se.utc=eo,se.unix=zq,se.months=Gq,se.isDate=gh,se.locale=js,se.invalid=ug,se.duration=Ei,se.isMoment=Si,se.weekdays=Kq,se.parseZone=Yq,se.localeData=Yo,se.isDuration=Rg,se.monthsShort=qq,se.weekdaysMin=Zq,se.defineLocale=Zb,se.updateLocale=Y2,se.locales=G2,se.weekdaysShort=Xq,se.normalizeUnits=Jn,se.relativeTimeRounding=EK,se.relativeTimeThreshold=TK,se.calendarFormat=BG,se.prototype=le,se.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};function MK(t){const e=t.length;let r=0;for(;r<e;)t[r]=[t[r]],r+=1}function lH(t,e){const r=e.length;let n=0;for(;n<r;)t.push(e[n]),n+=1}function Og(t){const e=[];if(!t||t.length===0||!t[0]||t[0].length===0)return e;const r=t.length,n=t[0].length;for(let i=0;i<r;i++)for(let o=0;o<n;o++)e[o]||(e[o]=[]),e[o][i]=t[i][o];return e}function hn(t,e,r,n){let i=-1,o=t,s=r;Array.isArray(t)||(o=Array.from(t));const a=o.length;for(i+=1;i<a;)s=e(s,o[i],i,o),i+=1;return s}function za(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length,o=[];let s=-1;for(;r<i;){const a=n[r];e(a,r,n)&&(s+=1,o[s]=a),r+=1}return o}function qe(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length,o=[];let s=-1;for(;r<i;){const a=n[r];s+=1,o[s]=e(a,r,n),r+=1}return o}function k(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length;for(;r<i&&e(n[r],r,n)!==!1;)r+=1;return t}function PK(t){const e=[];return k(t,r=>{e.indexOf(r)===-1&&e.push(r)}),e}function uH(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const[n,...i]=[...e];let o=n;return k(i,s=>{o=o.filter(a=>!s.includes(a))}),o}function cH(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function at(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return hn(t,(o,s,a)=>{const l=s.replace(/\r?\n\s*/g,""),u=r[a]?r[a]:"";return o+l+u},"").trim()}function Lt(t){let e;switch(typeof t){case"string":case"number":e=`${t}`;break;case"object":e=t===null?"":t.toString();break;case"undefined":e="";break;default:e=t.toString();break}return e}function we(t){return typeof t<"u"}function $t(t){return typeof t>"u"}function qt(t){return t===null||t===""||$t(t)}function IK(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const Th="length",_h=t=>parseInt(t,16),hH=t=>parseInt(t,10),xg=(t,e,r)=>t.substr(e,r),Mh=t=>t.codePointAt(0)-65,hS=t=>`${t}`.replace(/\-/g,""),OK=t=>_h(xg(hS(t),_h("12"),Mh("F")))/(_h(xg(hS(t),Mh("B"),~~![][Th]))||9),xK=()=>typeof location<"u"&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host);let dH=!1;const fH={invalid:()=>at`
488
+ The license key for Handsontable is invalid.\x20
489
+ If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:r}=t;return at`
490
+ The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
491
+ version ${r}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
492
+ to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>at`
493
+ The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
494
+ Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
495
+ passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
496
+ us at support@handsontable.com.`,non_commercial:()=>""},gH={invalid:()=>at`
497
+ The license key for Handsontable is invalid.\x20
498
+ <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
499
+ install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:t=>{let{keyValidityDate:e,hotVersion:r}=t;return at`
500
+ The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
501
+ version ${r}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
502
+ license key or downgrade to a version released prior to ${e}. If you need any\x20
503
+ help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>at`
504
+ The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
505
+ Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
506
+ passing the key: 'non-commercial-and-evaluation'.\x20
507
+ <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
508
+ the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function AK(t,e){const r=!qt(t),n=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="15.3.0";let o,s="invalid",a="invalid";t=hS(t||"");const l=HK(t);if(r||n||l)if(l){const u=se("29/04/2025","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=OK(t);o=se((h+1)*864e5,"x").format("MMMM DD, YYYY"),c>h?(s="expired",a="expired"):(s="valid",a="valid")}else n?(s="non_commercial",a="valid"):(s="invalid",a="invalid");else s="missing",a="missing";if(xK()&&(s="valid",a="valid"),!dH&&s!=="valid"&&(fH[s]({keyValidityDate:o,hotVersion:i})&&console[s==="non_commercial"?"info":"warn"](fH[s]({keyValidityDate:o,hotVersion:i})),dH=!0),a!=="valid"&&e.parentNode&&gH[a]({keyValidityDate:o,hotVersion:i})){const c=document.createElement("div");c.className="handsontable hot-display-license-info",c.innerHTML=gH[a]({keyValidityDate:o,hotVersion:i}),e.parentNode.insertBefore(c,e.nextSibling)}}function HK(t){let e=[][Th],r=e;if(t[Th]!==Mh("Z"))return!1;for(let n="",i="B<H4P+".split(""),o=Mh(i.shift());o;o=Mh(i.shift()||"A"))--o<""[Th]?r=r|(hH(`${hH(_h(n)+(_h(xg(t,Math.abs(o),2))+[]).padStart(2,"0"))}`)%97||2)>>1:n=xg(t,o,o?i[Th]===1?9:8:6);return r===e}function Ti(t){return t[0].toUpperCase()+t.substr(1)}function mH(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function pH(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function wH(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return`${t}`.replace(/(?:\\)?\[([^[\]]+)]/g,(r,n)=>r.charAt(0)==="\\"?r.substr(1,r.length-1):e[n]===void 0?"":e[n])}function vH(t){return dS(`${t}`,{ALLOWED_TAGS:[]})}function dS(t,e){return _Y.sanitize(t,e)}const Ya=t=>["tabindex",t],NK=()=>["role","treegrid"],Xo=()=>["role","presentation"],DK=()=>["role","gridcell"],kK=()=>["role","rowheader"],yH=()=>["role","rowgroup"],LK=()=>["role","columnheader"],fS=()=>["role","row"],$K=()=>["role","menu"],FK=()=>["role","menuitem"],VK=()=>["role","menuitemcheckbox"],WK=()=>["role","combobox"],CH=()=>["role","listbox"],BK=()=>["role","option"],jK=()=>["role","checkbox"],UK=()=>["scope","col"],zK=()=>["scope","row"],YK=()=>["type","text"],Ph=t=>["aria-label",t],Ga=()=>["aria-hidden","true"],GK=()=>["aria-disabled","true"],qK=()=>["aria-multiselectable","true"],bH=t=>["aria-haspopup",t],SH=t=>["aria-rowcount",t],Ag=t=>["aria-colcount",t],RH=t=>["aria-rowindex",t],gS=t=>["aria-colindex",t],ei=t=>["aria-expanded",t],KK=t=>["aria-sort",t],EH=()=>["aria-readonly","true"],TH=()=>["aria-invalid","true"],_H=t=>["aria-checked",t],mS=()=>["aria-selected","true"],XK=()=>["aria-autocomplete","list"],ZK=t=>["aria-controls",t],JK=t=>["aria-activedescendant",t],QK=t=>["aria-live",t],e3=t=>["aria-relevant",t],t3=t=>["aria-setsize",t],r3=t=>["aria-posinset",t];function n3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=null,i=t;for(;i!==null;){if(r===e){n=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(r+=1,i=i.parentNode)}return n}function Hg(t,e){const r=t.closest(".handsontable");return!!r&&(r.parentNode===e||r===e)}function i3(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function Mu(t){return i3(t)&&t.parent}function qa(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:n,DOCUMENT_FRAGMENT_NODE:i}=Node;let o=t;for(;o!=null&&o!==r;){const{nodeType:s,nodeName:a}=o;if(s===n&&(e.includes(a)||e.includes(o)))return o;const{host:l}=o;l&&s===i?o=l:o=o.parentNode}return null}function Ng(t,e,r){const n=[];let i=t;for(;i&&(i=qa(i,e,r),!(!i||r&&!r.contains(i)));)n.push(i),i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:i=i.parentNode;const o=n.length;return o?n[o-1]:null}function o3(t,e){const r={element:void 0,classNames:[]};let n=t;for(;n!==null&&n!==t.ownerDocument.documentElement&&!r.element;){if(typeof e=="string"&&n.classList.contains(e))r.element=n,r.classNames.push(e);else if(e instanceof RegExp){const i=Array.from(n.classList).filter(o=>e.test(o));i.length&&(r.element=n,r.classNames.push(...i))}n=n.parentElement}return r}function Ka(t,e){let r=t.parentNode,n=[];for(typeof e=="string"?t.defaultView?n=Array.prototype.slice.call(t.querySelectorAll(e),0):n=Array.prototype.slice.call(t.ownerDocument.querySelectorAll(e),0):n.push(e);r!==null;){if(n.indexOf(r)>-1)return!0;r=r.parentNode}return!1}function s3(t){let e=0,r=t;if(r.previousSibling)for(;r=r.previousSibling;)e+=1;return e}function Xa(t,e,r){const n=r.parentElement.querySelector(`.ht_clone_${t}`);return n?n.contains(e):null}function MH(t){return!t||!t.length?[]:t.filter(e=>!!e)}function PH(t,e){if(!t||!t.length)return{regexFree:[],regexes:[]};const r=[],n=[];return n.push(...t.filter(i=>{const o=i instanceof RegExp;return o&&e&&r.push(i),!o})),{regexFree:n,regexes:r}}function _e(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function oe(t,e){typeof e=="string"&&(e=e.split(" ")),e=MH(e),e.length>0&&t.classList.add(...e)}function Ee(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:r,regexes:n}=PH(e,!0);r=MH(r),r.length>0&&t.classList.remove(...r),n.forEach(i=>{t.classList.forEach(o=>{i.test(o)&&t.classList.remove(o)})})}function Pe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;Array.isArray(e)||(e=[[e,r]]),e.forEach(n=>{Array.isArray(n)&&n[0]!==""&&t.setAttribute(...n)})}function Pu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);const{regexFree:r,regexes:n}=PH(e,!0);r.forEach(i=>{i!==""&&t.removeAttribute(i)}),n.forEach(i=>{t.getAttributeNames().forEach(o=>{i.test(o)&&t.removeAttribute(o)})})}function IH(t){if(t.nodeType===3)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){const e=t.childNodes;for(let r=e.length-1;r>=0;r--)IH(e[r])}}function Zo(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const a3=/(<(.*)>|&(.*);)/;function Iu(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;a3.test(e)?t.innerHTML=r?dS(e):e:Za(t,e)}function Za(t,e){const r=t.firstChild;r&&r.nodeType===3&&r.nextSibling===null?r.textContent=e:(Zo(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function Ou(t){const e=t.ownerDocument.documentElement,r=t.ownerDocument.defaultView;let n=t;for(;n!==e;){if(n===null)return!1;if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(n.host){if(n.host.impl)return Ou(n.host.impl);if(n.host)return Ou(n.host);throw new Error("Lost in Web Components world")}else return!1;else if(r.getComputedStyle(n).display==="none")return!1;n=n.parentNode}return!0}function l3(t){const r=t.ownerDocument.defaultView;let n=t;for(;n.parentNode;){if(n.style.height==="0px"||n.style.height==="0")return r.getComputedStyle(n).overflow==="hidden";n=n.parentNode}return!1}function kr(t){const e=t.ownerDocument,r=e.defaultView,n=e.documentElement;let i=t,o,s,a;for(o=i.offsetLeft,s=i.offsetTop,a=i;(i=i.offsetParent)&&!(i===e.body||!("offsetLeft"in i));)o+=i.offsetLeft,s+=i.offsetTop,a=i;return a&&a.style.position==="fixed"&&(o+=r.pageXOffset||n.scrollLeft,s+=r.pageYOffset||n.scrollTop),{left:o,top:s}}function OH(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function pS(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function wS(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?OH(e):t.scrollTop}function xH(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?pS(e):t.scrollLeft}function Dg(t){let e=t.ownerDocument,r=e?e.defaultView:void 0;e||(e=t.document?t.document:t,r=e.defaultView);const n=["auto","scroll"];let i=t.parentNode;for(;i&&i.style&&e.body!==i;){let{overflow:o,overflowX:s,overflowY:a}=i.style;if([o,s,a].includes("scroll"))return i;if({overflow:o,overflowX:s,overflowY:a}=r.getComputedStyle(i),n.includes(o)||n.includes(s)||n.includes(a)||i.clientHeight<=i.scrollHeight+1&&(n.includes(a)||n.includes(o))||i.clientWidth<=i.scrollWidth+1&&(n.includes(s)||n.includes(o)))return i;i=i.parentNode}return r}function u3(t){return t.scrollHeight-t.clientHeight}function c3(t){return t.scrollWidth-t.clientWidth}function Ih(t){const e=t.ownerDocument,r=e.defaultView;let n=t.parentNode;for(;n&&n.style&&e.body!==n;){if(n.style.overflow!=="visible"&&n.style.overflow!=="")return n;const i=r.getComputedStyle(n),o=["scroll","hidden","auto"],s=i.getPropertyValue("overflow"),a=i.getPropertyValue("overflow-y"),l=i.getPropertyValue("overflow-x");if(o.includes(s)||o.includes(a)||o.includes(l))return n;n=n.parentNode}return r}function kg(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window;if(t){if(t===r)return e==="width"?`${r.innerWidth}px`:e==="height"?`${r.innerHeight}px`:void 0}else return;const n=t.style[e];if(n!==""&&n!==void 0)return n;const i=r.getComputedStyle(t);if(i[e]!==""&&i[e]!==void 0)return i[e]}function ir(t){return t.offsetWidth}function dr(t){return t.offsetHeight}function Oh(t){return t.clientHeight||t.innerHeight}function AH(t){return t.clientWidth||t.innerWidth}function HH(t){return t.selectionStart?t.selectionStart:0}function h3(t){return t.selectionEnd?t.selectionEnd:0}function NH(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;t.getSelection&&(t.getSelection().empty?t.getSelection().empty():t.getSelection().removeAllRanges&&t.getSelection().removeAllRanges())}function Lg(t,e,r){if(r===void 0&&(r=e),t.setSelectionRange){t.focus();try{t.setSelectionRange(e,r)}catch{const i=t.parentNode,o=i.style.display;i.style.display="block",t.setSelectionRange(e,r),i.style.display=o}}}let vS;function d3(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;const e=t.createElement("div");e.style.height="200px",e.style.width="100%";const r=t.createElement("div");r.style.boxSizing="content-box",r.style.height="150px",r.style.left="0px",r.style.overflow="hidden",r.style.position="absolute",r.style.top="0px",r.style.width="200px",r.style.visibility="hidden",r.appendChild(e),(t.body||t.documentElement).appendChild(r);const n=e.offsetWidth;r.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=r.clientWidth),(t.body||t.documentElement).removeChild(r),n-i}function _r(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return vS===void 0&&(vS=d3(t)),vS}function DH(t){return t instanceof Window?t.document.body.scrollHeight>t.innerHeight:t.offsetWidth!==t.clientWidth}function kH(t){return t instanceof Window?t.document.body.scrollWidth>t.innerWidth:t.offsetHeight!==t.clientHeight}function yS(t,e,r){t.style.transform=`translate3d(${e},${r},0)`}function $g(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function Fg(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function LH(t){return Fg(t)&&t.hasAttribute("data-hot-input")===!1}function $H(t){return!t.parentNode}function f3(t,e){new IntersectionObserver((n,i)=>{n.forEach(o=>{o.isIntersecting&&t.offsetParent!==null&&(e(),i.unobserve(t))})},{root:t.ownerDocument.body}).observe(t)}function FH(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const n=t.ownerDocument,i=n.createRange(),o=n.defaultView.getSelection();Pe(t,"contenteditable",!0),r&&Pe(t,...Ga()),e&&oe(t,"invisibleSelection"),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i)}function VH(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=t.ownerDocument.defaultView.getSelection();t.hasAttribute("aria-hidden")&&t.removeAttribute("aria-hidden"),r.removeAllRanges(),e&&Ee(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function g3(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;FH(t,r),e(),VH(t,r)}function Jo(t){var e;const r=t==null||(e=t.ownerDocument)===null||e===void 0?void 0:e.defaultView.Element;return!!(r&&r!==null&&t instanceof r)}function ht(t){return typeof t=="function"}function Vg(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,r=null,n;function i(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return r&&clearTimeout(r),r=setTimeout(()=>{n=t.apply(this,s)},e),n}return i}function WH(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return t.apply(this,r.concat(s))}}function m3(t){const e=t.length;function r(n){return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=n.concat(s);let u;return l.length>=e?u=t.apply(this,l):u=r(l),u}}return r([])}function CS(t,e,r,n,i,o,s,a){return we(a)?t.call(e,r,n,i,o,s,a):we(s)?t.call(e,r,n,i,o,s):we(o)?t.call(e,r,n,i,o):we(i)?t.call(e,r,n,i):we(n)?t.call(e,r,n):we(r)?t.call(e,r):t.call(e)}var BH={},bS,jH;function p3(){if(jH)return bS;jH=1;var t=rr(),e=tx(),r=cr(),n=ka(),i=og(),o=t([].push);return bS=function(s){if(r(s))return s;if(e(s)){for(var a=s.length,l=[],u=0;u<a;u++){var c=s[u];typeof c=="string"?o(l,c):(typeof c=="number"||n(c)==="Number"||n(c)==="String")&&o(l,i(c))}var h=l.length,d=!0;return function(f,g){if(d)return d=!1,g;if(e(this))return g;for(var w=0;w<h;w++)if(l[w]===f)return g}}},bS}var UH;function w3(){if(UH)return BH;UH=1;var t=bt(),e=fu(),r=sh(),n=ur(),i=rr(),o=lr(),s=cr(),a=uy(),l=vb(),u=p3(),c=sy(),h=String,d=e("JSON","stringify"),f=i(/./.exec),g=i("".charAt),w=i("".charCodeAt),v=i("".replace),b=i(1.1.toString),p=/[\uD800-\uDFFF]/g,_=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,T=!c||o(function(){var j=e("Symbol")("stringify detection");return d([j])!=="[null]"||d({a:j})!=="{}"||d(Object(j))!=="{}"}),M=o(function(){return d("\uDF06\uD834")!=='"\\udf06\\ud834"'||d("\uDEAD")!=='"\\udead"'}),P=function(j,A){var q=l(arguments),Q=u(A);if(!(!s(Q)&&(j===void 0||a(j))))return q[1]=function(ue,J){if(s(Q)&&(J=n(Q,this,h(ue),J)),!a(J))return J},r(d,null,q)},G=function(j,A,q){var Q=g(q,A-1),ue=g(q,A+1);return f(_,j)&&!f(O,ue)||f(O,j)&&!f(_,Q)?"\\u"+b(w(j,0),16):j};return d&&t({target:"JSON",stat:!0,arity:3,forced:T||M},{stringify:function(A,q,Q){var ue=l(arguments),J=r(T?P:d,null,ue);return M&&typeof J=="string"?v(J,p,G):J}}),BH}w3();function xh(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},Fe(t,(r,n)=>{n!=="__children"&&(r&&typeof r=="object"&&!Array.isArray(r)?e[n]=xh(r):Array.isArray(r)?r.length&&typeof r[0]=="object"&&!Array.isArray(r[0])?e[n]=[xh(r[0])]:e[n]=[]:e[n]=null)})),e}function v3(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function fr(t,e,r){const n=Array.isArray(r);return Fe(e,(i,o)=>{(n===!1||r.includes(o))&&(t[o]=i)}),t}function Wg(t,e){Fe(e,(r,n)=>{e[n]&&typeof e[n]=="object"?(t[n]||(Array.isArray(e[n])?t[n]=[]:Object.prototype.toString.call(e[n])==="[object Date]"?t[n]=e[n]:t[n]={}),Wg(t[n],e[n])):t[n]=e[n]})}function Kr(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function io(t){const e={};return Fe(t,(r,n)=>{e[n]=r}),e}function wt(t){t.MIXINS||(t.MIXINS=[]);for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return k(r,i=>{t.MIXINS.push(i.MIXIN_NAME),Fe(i,(o,s)=>{if(t.prototype[s]!==void 0)throw new Error(`Mixin conflict. Property '${s}' already exist and cannot be overwritten.`);if(typeof o=="function")t.prototype[s]=o;else{const a=function(c,h){const d=`_${c}`,f=g=>{let w=g;return(Array.isArray(w)||$e(w))&&(w=Kr(w)),w};return function(){return this[d]===void 0&&(this[d]=f(h)),this[d]}},l=function(c){const h=`_${c}`;return function(d){this[h]=d}};Object.defineProperty(t.prototype,s,{get:a(s,o),set:l(s),configurable:!0})}})}),t}function SS(t,e){return JSON.stringify(t)===JSON.stringify(e)}function $e(t){return Object.prototype.toString.call(t)==="[object Object]"}function Qo(t,e,r,n){n.value=r,n.writable=n.writable!==!1,n.enumerable=n.enumerable!==!1,n.configurable=n.configurable!==!1,Object.defineProperty(t,e,n)}function Fe(t,e){for(const r in t)if((!t.hasOwnProperty||t.hasOwnProperty&&Object.prototype.hasOwnProperty.call(t,r))&&e(t[r],r,t)===!1)break;return t}function y3(t,e){const r=e.split(".");let n=t;return Fe(r,i=>{if(n=n[i],n===void 0)return n=void 0,!1}),n}function RS(t,e,r){if(typeof e!="string")return;const n=e.split(".");let i=t;n.forEach((o,s)=>{o==="__proto__"||o==="constructor"||o==="prototype"||(s!==n.length-1?(gr(i,o)||(i[o]={}),i=i[o]):i[o]=r)})}function ES(t){if(!$e(t))return 0;const e=function(r){let n=0;return $e(r)?Fe(r,(i,o)=>{o!=="__children"&&(n+=e(i))}):n+=1,n};return e(t)}function xn(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"value";const r=`_${e}`,n={_touched:!1,[r]:t,isTouched(){return this._touched}};return Object.defineProperty(n,e,{get(){return this[r]},set(i){this._touched=!0,this[r]=i},enumerable:!0,configurable:!0}),n}function gr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Bg(t){return window.requestAnimationFrame(t)}function jg(t){window.cancelAnimationFrame(t)}function zH(){return"ontouchstart"in window}function C3(){return typeof window<"u"}let xu;function b3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return xu||(typeof Intl=="object"?xu=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?xu=(r,n)=>`${r}`.localeCompare(n):xu=(r,n)=>r===n?0:r>n?-1:1,xu)}const ti=t=>{const e={value:!1};return e.test=(r,n)=>{e.value=t(r,n)},e},zs={chrome:ti((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:ti(t=>/CriOS/.test(t)),edge:ti(t=>/Edge/.test(t)),edgeWebKit:ti(t=>/EdgiOS/.test(t)),firefox:ti(t=>/Firefox/.test(t)),firefoxWebKit:ti(t=>/FxiOS/.test(t)),mobile:ti(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:ti((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},Ah={mac:ti(t=>/^Mac/.test(t)),win:ti(t=>/^Win/.test(t)),linux:ti(t=>/^Linux/.test(t)),ios:ti(t=>/iPhone|iPad|iPod/i.test(t))};function S3(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fe(zs,r=>{let{test:n}=r;return void n(t,e)})}function R3(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fe(Ah,e=>{let{test:r}=e;return void r(t)})}C3()&&(S3(),R3());function YH(){return zs.chrome.value}function E3(){return zs.chromeWebKit.value}function TS(){return zs.firefox.value}function T3(){return zs.firefoxWebKit.value}function Ug(){return zs.safari.value}function _3(){return zs.edge.value}function es(){return zs.mobile.value}function GH(){return Ah.ios.value}function qH(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&Ah.mac.value}function KH(){return Ah.win.value}function XH(){return Ah.mac.value}const Re={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:TS()?182:174,AUDIO_MUTE:TS()?181:173,AUDIO_UP:TS()?183:175,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,CONTROL:17,DELETE:46,END:35,ENTER:13,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,HOME:36,INSERT:45,MEDIA_NEXT:176,MEDIA_PLAY_PAUSE:179,MEDIA_PREV:177,MEDIA_STOP:178,NULL:0,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PERIOD:190,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88,Y:89,Z:90},M3=[Re.ALT,Re.ARROW_DOWN,Re.ARROW_LEFT,Re.ARROW_RIGHT,Re.ARROW_UP,Re.AUDIO_DOWN,Re.AUDIO_MUTE,Re.AUDIO_UP,Re.BACKSPACE,Re.CAPS_LOCK,Re.DELETE,Re.END,Re.ENTER,Re.ESCAPE,Re.F1,Re.F2,Re.F3,Re.F4,Re.F5,Re.F6,Re.F7,Re.F8,Re.F9,Re.F10,Re.F11,Re.F12,Re.F13,Re.F14,Re.F15,Re.F16,Re.F17,Re.F18,Re.F19,Re.HOME,Re.INSERT,Re.MEDIA_NEXT,Re.MEDIA_PLAY_PAUSE,Re.MEDIA_PREV,Re.MEDIA_STOP,Re.NULL,Re.NUM_LOCK,Re.PAGE_DOWN,Re.PAGE_UP,Re.PAUSE,Re.SCROLL_LOCK,Re.SHIFT,Re.TAB];function P3(t){return t===32||t>=48&&t<=57||t>=96&&t<=111||t>=186&&t<=192||t>=219&&t<=222||t>=226||t>=65&&t<=90}function ZH(t){return M3.includes(t)}function I3(t){return[Re.CONTROL,Re.COMMAND_LEFT,Re.COMMAND_RIGHT,Re.COMMAND_FIREFOX].includes(t)}function Hh(t,e){const r=e.split("|");let n=!1;return k(r,i=>{if(t===Re[i])return n=!0,!1}),n}function _i(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function Ja(t){return t.isImmediatePropagationEnabled===!1}function Qa(t){return t.button===2}function _S(t){return t.button===0}function O3(t){return t instanceof TouchEvent}function x3(t,e){const r={x:t.offsetX,y:t.offsetY};let n=t.target;if(!Jo(e)||n!==e&&n.contains(e))return r;for(;n!==e;)r.x+=n.offsetLeft,r.y+=n.offsetTop,n=n.offsetParent;return r}function st(){we(console)&&console.warn(...arguments)}function MS(){we(console)&&console.error(...arguments)}const el=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","beforeCompositionStart","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeDrawBorders","beforeGetCellMeta","beforeRemoveCellMeta","beforeInit","beforeInitWalkontable","beforeLoadData","beforeUpdateData","beforeKeyDown","beforeOnCellMouseDown","beforeOnCellMouseUp","beforeOnCellContextMenu","beforeOnCellMouseOver","beforeOnCellMouseOut","beforeRemoveCol","beforeRemoveRow","beforeViewRender","afterViewRender","beforeRender","afterRender","beforeRowWrap","beforeColumnWrap","beforeSetCellMeta","beforeSelectionFocusSet","beforeSetRangeStartOnly","beforeSetRangeStart","beforeSetRangeEnd","beforeSelectionHighlightSet","beforeTouchScroll","beforeValidate","beforeValueRender","construct","init","modifyColHeader","modifyColWidth","modifyFiltersMultiSelectValue","modifyFocusedElement","modifyRowHeader","modifyRowHeight","modifyRowHeightByOverlayName","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","modifyGetCoordsElement","modifyFocusOnTabNavigation","beforeHighlightingRowHeader","beforeHighlightingColumnHeader","persistentStateLoad","persistentStateReset","persistentStateSave","beforeColumnSort","afterColumnSort","modifyAutofillRange","modifyCopyableRange","beforeCut","afterCut","beforeCopy","afterCopy","beforePaste","afterPaste","beforeColumnFreeze","afterColumnFreeze","beforeColumnMove","afterColumnMove","beforeColumnUnfreeze","afterColumnUnfreeze","beforeRowMove","afterRowMove","beforeColumnResize","afterColumnResize","beforeRowResize","afterRowResize","afterGetColumnHeaderRenderers","afterGetRowHeaderRenderers","beforeStretchingColumnWidth","beforeFilter","afterFilter","afterFormulasValuesUpdate","afterNamedExpressionAdded","afterNamedExpressionRemoved","afterSheetAdded","afterSheetRenamed","afterSheetRemoved","modifyColumnHeaderHeight","modifyColumnHeaderValue","beforeUndo","beforeUndoStackChange","afterUndo","afterUndoStackChange","beforeRedo","beforeRedoStackChange","afterRedo","afterRedoStackChange","modifyRowHeaderWidth","modifyTransformFocus","modifyTransformStart","modifyTransformEnd","afterModifyTransformFocus","afterModifyTransformStart","afterModifyTransformEnd","afterViewportRowCalculatorOverride","afterViewportColumnCalculatorOverride","afterPluginsInitialized","beforeHideRows","afterHideRows","beforeUnhideRows","afterUnhideRows","beforeHideColumns","afterHideColumns","beforeUnhideColumns","afterUnhideColumns","beforeTrimRow","afterTrimRow","beforeUntrimRow","afterUntrimRow","beforeDropdownMenuShow","afterDropdownMenuShow","afterDropdownMenuHide","beforeAddChild","afterAddChild","beforeDetachChild","afterDetachChild","beforeBeginEditing","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],PS=new Map([["modifyRow","8.0.0"],["modifyCol","8.0.0"],["unmodifyRow","8.0.0"],["unmodifyCol","8.0.0"],["skipLengthCache","8.0.0"],["hiddenColumn","8.0.0"],["hiddenRow","8.0.0"]]),IS=new Map([[]]);var JH={},OS,QH;function A3(){if(QH)return OS;QH=1;var t=pu();return OS=function(e,r,n){for(var i=0,o=arguments.length>2?n:t(r),s=new e(o);o>i;)s[i]=r[i++];return s},OS}var xS,eN;function H3(){if(eN)return xS;eN=1;var t=tr();return xS=function(e,r){var n=t[e],i=n&&n.prototype;return i&&i[r]},xS}var AS,tN;function zg(){if(tN)return AS;tN=1;var t=yi(),e=sb(),r=Vs().f,n=t("unscopables"),i=Array.prototype;return i[n]===void 0&&r(i,n,{configurable:!0,value:e(null)}),AS=function(o){i[n][o]=!0},AS}var rN;function N3(){if(rN)return JH;rN=1;var t=bt(),e=rr(),r=ln(),n=rh(),i=A3(),o=H3(),s=zg(),a=Array,l=e(o("Array","sort"));return t({target:"Array",proto:!0},{toSorted:function(c){c!==void 0&&r(c);var h=n(this),d=i(a,h);return l(d,c)}}),s("toSorted"),JH}N3();var nN={},iN={},oN;function D3(){if(oN)return iN;oN=1;var t=bt(),e=ur(),r=wu(),n=ln(),i=hr(),o=Qi(),s=un(),a=Ws(),l=a("find",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{find:function(c){i(this);try{n(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return r(h,function(f,g){if(c(f,d++))return g(f)},{IS_RECORD:!0,INTERRUPTED:!0}).result}}),iN}var sN;function k3(){return sN||(sN=1,D3()),nN}k3();function L3(t,e){aN(t,e),e.add(t)}function HS(t,e,r){aN(t,e),e.set(t,r)}function aN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lN(t,e,r){return t.set(Yg(t,e),r),r}function xr(t,e){return t.get(Yg(t,e))}function Yg(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const $3=100;var An=new WeakMap,Au=new WeakMap,NS=new WeakMap,DS=new WeakSet;class uN{constructor(){L3(this,DS),HS(this,An,new Map),HS(this,Au,new Map),HS(this,NS,new Set),el.forEach(e=>Yg(DS,this,cN).call(this,e))}getHooks(e){var r;return(r=xr(An,this).get(e))!==null&&r!==void 0?r:[]}add(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};xr(An,this).has(e)||(Yg(DS,this,cN).call(this,e),el.push(e));const i=xr(An,this).get(e);if(i.find(u=>u.callback===r))return;const o=Number.isInteger(n.orderIndex)?n.orderIndex:0,s=!!n.runOnce,a=!!n.initialHook;let l=!1;if(a){const u=i.find(c=>c.initialHook);u&&(u.callback=r,l=!0)}if(!l){i.push({callback:r,orderIndex:o,runOnce:s,initialHook:a,skip:!1});let u=xr(NS,this).has(e);!u&&o!==0&&(u=!0,xr(NS,this).add(e)),u&&i.length>1&&xr(An,this).set(e,i.toSorted((c,h)=>c.orderIndex-h.orderIndex))}}has(e){return xr(An,this).has(e)&&xr(An,this).get(e).length>0}remove(e,r){if(!xr(An,this).has(e))return!1;const n=xr(An,this).get(e),i=n.find(o=>o.callback===r);if(i){let o=xr(Au,this).get(e);return i.skip=!0,o+=1,o>$3&&(xr(An,this).set(e,n.filter(s=>!s.skip)),o=0),xr(Au,this).set(e,o),!0}return!1}destroy(){xr(An,this).clear(),xr(Au,this).clear(),lN(An,this,null),lN(Au,this,null)}}function cN(t){xr(An,this).set(t,[]),xr(Au,this).set(t,0)}function F3(t,e,r){return(e=V3(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function V3(t){var e=W3(t,"string");return typeof e=="symbol"?e:e+""}function W3(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const B3=at`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
509
+ Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
510
+ learn about the migration path.`;class de{constructor(){F3(this,"globalBucket",new uN)}static getSingleton(){return U3()}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new uN),e.pluginHookBucket):this.globalBucket}add(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(r)?k(r,o=>this.add(e,o,n)):(PS.has(e)&&st(wH(B3,{hookName:e,removedInVersion:PS.get(e)})),IS.has(e)&&st(IS.get(e)),this.getBucket(n).add(e,r,{orderIndex:i,runOnce:!1})),this}once(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(r)?k(r,o=>this.once(e,o,n)):this.getBucket(n).add(e,r,{orderIndex:i,runOnce:!0}),this}addAsFixed(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return Array.isArray(r)?k(r,i=>this.addAsFixed(e,i,n)):this.getBucket(n).add(e,r,{initialHook:!0}),this}remove(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this.getBucket(n).remove(e,r)}has(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.getBucket(r).has(e)}run(e,r,n,i,o,s,a,l){{const u=this.getBucket().getHooks(r),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=CS(u[h].callback,e,n,i,o,s,a,l);d!==void 0&&(n=d),u[h]&&u[h].runOnce&&this.remove(r,u[h].callback),h+=1}}{const u=this.getBucket(e).getHooks(r),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=CS(u[h].callback,e,n,i,o,s,a,l);d!==void 0&&(n=d),u[h]&&u[h].runOnce&&this.remove(r,u[h].callback,e),h+=1}}return n}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.getBucket(e).destroy()}register(e){this.isRegistered(e)||el.push(e)}deregister(e){this.isRegistered(e)&&el.splice(el.indexOf(e),1)}isDeprecated(e){return IS.has(e)||PS.has(e)}isRegistered(e){return el.indexOf(e)>=0}getRegistered(){return el}}const j3=new de;function U3(){return j3}const kS=new Map;function Mi(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";kS.has(t)||kS.set(t,new Map);const e=kS.get(t);function r(a,l){e.set(a,l)}function n(a){return e.get(a)}function i(a){return e.has(a)}function o(){return[...e.keys()]}function s(){return[...e.values()]}return{register:r,getItem:n,hasItem:i,getNames:o,getValues:s}}const LS=new WeakMap,{register:z3,getItem:hN,hasItem:dN,getNames:rme,getValues:nme}=Mi("editors");function Y3(t){const e={},r=t;this.getConstructor=function(){return t},this.getInstance=function(n){return n.guid in e||(e[n.guid]=new r(n)),e[n.guid]},de.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function fN(t,e){let r;if(typeof t=="function")LS.get(t)||Hn(null,t),r=LS.get(t);else if(typeof t=="string")r=hN(t);else throw Error('Only strings and functions can be passed as "editor" parameter');if(!r)throw Error(`No editor registered under name "${t}"`);return r.getInstance(e)}function $S(t){if(typeof t=="function")return t;if(!dN(t))throw Error(`No registered editor found under "${t}" name`);return hN(t).getConstructor()}function Hn(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const r=new Y3(e);typeof t=="string"&&z3(t,r),LS.set(e,r)}function G3(t,e,r){return(e=q3(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function q3(t){var e=K3(t,"string");return typeof e=="symbol"?e:e+""}function K3(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Pi{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;G3(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;function o(s){n.call(this,X3(s))}return this.context.eventListeners.push({element:e,event:r,callback:n,callbackProxy:o,options:i,eventManager:this}),e.addEventListener(r,o,i),()=>{this.removeEventListener(e,r,n)}}removeEventListener(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=this.context.eventListeners.length,s;for(;o;)if(o-=1,s=this.context.eventListeners[o],s.event===r&&s.element===e){if(n&&n!==s.callback||i&&s.eventManager!==this)continue;this.context.eventListeners.splice(o,1),s.element.removeEventListener(s.event,s.callbackProxy,s.options)}}clearEvents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.context)return;let r=this.context.eventListeners.length;for(;r;){r-=1;const n=this.context.eventListeners[r];e&&n.eventManager!==this||(this.context.eventListeners.splice(r,1),n.element.removeEventListener(n.event,n.callbackProxy,n.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,r){let n=e.document,i=e;n||(n=e.ownerDocument?e.ownerDocument:e,i=n.defaultView);const o={bubbles:!0,cancelable:r!=="mousemove",view:i,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0};let s;n.createEvent?(s=n.createEvent("MouseEvents"),s.initMouseEvent(r,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,n.body.parentNode)):s=n.createEventObject(),e.dispatchEvent?e.dispatchEvent(s):e.fireEvent(`on${r}`,s)}}function X3(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),_i(this)},t}function Z3(t,e){J3(t,e),e.add(t)}function J3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tl(t,e,r){return(e=Q3(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q3(t){var e=e4(t,"string");return typeof e=="symbol"?e:e+""}function e4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FS(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Gg=new WeakSet;class VS{constructor(e,r,n){Z3(this,Gg),tl(this,"hot",void 0),tl(this,"tableMeta",void 0),tl(this,"selection",void 0),tl(this,"eventManager",void 0),tl(this,"destroyed",!1),tl(this,"activeEditor",void 0),tl(this,"cellProperties",void 0),this.hot=e,this.tableMeta=r,this.selection=n,this.eventManager=new Pi(e),this.hot.addHook("afterDocumentKeyDown",i=>FS(Gg,this,gN).call(this,i)),this.hot.addHook("beforeCompositionStart",i=>FS(Gg,this,gN).call(this,i)),this.hot.view._wt.update("onCellDblClick",(i,o,s)=>FS(Gg,this,t4).call(this,i,o,s))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,u=>{u&&this.prepareEditor()});return}const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!r||r.isHeader())return;const{row:n,col:i}=r,o=this.hot.runHooks("modifyGetCellCoords",n,i,!1,"meta");let s=n,a=i;if(Array.isArray(o)&&([s,a]=o),this.cellProperties=this.hot.getCellMeta(s,a),!this.isCellEditable()){this.clearActiveEditor();return}const l=this.hot.getCell(n,i,!0);if(l){const u=this.hot.getCellEditor(this.cellProperties),c=this.hot.colToProp(a),h=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s),a);this.activeEditor=fN(u,this.hot),this.activeEditor.prepare(n,i,c,l,h,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!this.isCellEditable()){this.clearActiveEditor();return}const i=this.hot.getSelectedRangeLast();let o=this.hot.runHooks("beforeBeginEditing",i.highlight.row,i.highlight.col,e,r,n);if(r instanceof MouseEvent&&typeof o!="boolean"&&(o=this.hot.selection.getLayerLevel()===0&&i.isSingle()),o===!1){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(n&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,r))}closeEditor(e,r,n){this.activeEditor?this.activeEditor.finishEditing(e,r,n):n&&n(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeLast();if(!e)return!1;const r=this.hot.getCellEditor(this.cellProperties),{row:n,col:i}=e.highlight,{rowIndexMapper:o,columnIndexMapper:s}=this.hot,a=o.isHidden(this.hot.toPhysicalRow(n))||s.isHidden(this.hot.toPhysicalColumn(i));return!(this.cellProperties.readOnly||!r||a)}moveSelectionAfterEnter(e){const r={...typeof this.tableMeta.enterMoves=="function"?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(r.row=-r.row,r.col=-r.col),this.hot.selection.isMultiple()?this.selection.transformFocus(r.row,r.col):this.selection.transformStart(r.row,r.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function gN(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||Ja(t))return;const{keyCode:r}=t,n=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!ZH(r)&&!I3(r)&&!n&&!this.isEditorOpened()&&this.openEditor("",t)}function t4(t,e){e.isCell()&&this.openEditor(null,t,!0)}const mN=new WeakMap;VS.getInstance=function(t,e,r){let n=mN.get(t);return n||(n=new VS(t,e,r),mN.set(t,n)),n};function r4(t,e){pN(t,e),e.add(t)}function Nh(t,e,r){pN(t,e),e.set(t,r)}function pN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Et(t,e){return t.get(ts(t,e))}function Dh(t,e,r){return t.set(ts(t,e),r),r}function ts(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Hu=Object.freeze({CELL:"cell",MIXED:"mixed"});var mr=new WeakMap,qg=new WeakMap,Kg=new WeakMap,Xg=new WeakMap,Zg=new WeakMap,Ys=new WeakSet;class n4{constructor(e){var r=this;r4(this,Ys),Nh(this,mr,void 0),Nh(this,qg,void 0),Nh(this,Kg,1),Nh(this,Xg,null),Nh(this,Zg,new Map);const n=e.getSettings();Dh(mr,this,e),Dh(qg,this,n.imeFastEdit?Hu.MIXED:Hu.CELL),Et(mr,this).addHook("afterUpdateSettings",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ts(Ys,r,o4).call(r,...o)}),Et(mr,this).addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ts(Ys,r,wN).call(r,...o)}),Et(mr,this).addHook("afterSelectionFocusSet",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ts(Ys,r,wN).call(r,...o)}),Et(mr,this).addHook("afterSelectionEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ts(Ys,r,i4).call(r,...o)})}getFocusMode(){return Et(qg,this)}setFocusMode(e){Object.values(Hu).includes(e)?Dh(qg,this,e):st(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return Et(Kg,this)}setRefocusDelay(e){Dh(Kg,this,e)}setRefocusElementGetter(e){Dh(Xg,this,e)}getRefocusElement(){var e;return typeof Et(Xg,this)=="function"?Et(Xg,this).call(this):(e=Et(mr,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const r=n=>{var i,o;const s=(i=Et(mr,this).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!s)return;let a=Et(mr,this).runHooks("modifyFocusedElement",s.row,s.col,n);Jo(a)||(a=n),a&&!((o=Et(mr,this).getActiveEditor())!==null&&o!==void 0&&o.isOpened())&&a.focus({preventScroll:!0})};e?r(e):ts(Ys,this,WS).call(this,n=>r(n))}refocusToEditorTextarea(){var e;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Et(Kg,this);if(Et(mr,this).getSettings().imeFastEdit&&!((e=Et(mr,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())){var n,i;(n=Et(mr,this).getActiveEditor())===null||n===void 0||(i=n.refreshValue)===null||i===void 0||i.call(n),Et(Zg,this).has(r)||Et(Zg,this).set(r,Vg(()=>{if(!Et(mr,this).isDestroyed){var o;(o=this.getRefocusElement())===null||o===void 0||o.select()}},r)),Et(Zg,this).get(r)()}}}function WS(t){var e;const r=(e=Et(mr,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!r||!Et(mr,this).selection.isCellVisible(r)){t(null);return}const n=Et(mr,this).getCell(r.row,r.col,!0);n===null?Et(mr,this).addHookOnce("afterScroll",()=>{t(Et(mr,this).getCell(r.row,r.col,!0))}):t(n)}function wN(){ts(Ys,this,WS).call(this,t=>{const{activeElement:e}=Et(mr,this).rootDocument;e&&LH(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function i4(){ts(Ys,this,WS).call(this,t=>{this.getFocusMode()===Hu.MIXED&&(t==null?void 0:t.nodeName)==="TD"&&this.refocusToEditorTextarea()})}function o4(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?Hu.MIXED:Hu.CELL)}var vN={},BS,yN;function s4(){if(yN)return BS;yN=1;var t=qn(),e=ka(),r=yi(),n=r("match");return BS=function(i){var o;return t(i)&&((o=i[n])!==void 0?!!o:e(i)==="RegExp")},BS}var jS,CN;function a4(){if(CN)return jS;CN=1;var t=tr(),e=lr(),r=t.RegExp,n=!e(function(){var i=!0;try{r(".","d")}catch{i=!1}var o={},s="",a=i?"dgimsy":"gimsy",l=function(d,f){Object.defineProperty(o,d,{get:function(){return s+=f,!0}})},u={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};i&&(u.hasIndices="d");for(var c in u)l(c,u[c]);var h=Object.getOwnPropertyDescriptor(r.prototype,"flags").get.call(o);return h!==a||s!==a});return jS={correct:n},jS}var US,bN;function l4(){if(bN)return US;bN=1;var t=hr();return US=function(){var e=t(this),r="";return e.hasIndices&&(r+="d"),e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.unicodeSets&&(r+="v"),e.sticky&&(r+="y"),r},US}var zS,SN;function u4(){if(SN)return zS;SN=1;var t=ur(),e=Kn(),r=nh(),n=a4(),i=l4(),o=RegExp.prototype;return zS=n.correct?function(s){return s.flags}:function(s){return!n.correct&&r(o,s)&&!e(s,"flags")?t(i,s):s.flags},zS}var YS,RN;function c4(){if(RN)return YS;RN=1;var t=rr(),e=gu(),r=Math.floor,n=t("".charAt),i=t("".replace),o=t("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;return YS=function(l,u,c,h,d,f){var g=c+l.length,w=h.length,v=a;return d!==void 0&&(d=e(d),v=s),i(f,v,function(b,p){var _;switch(n(p,0)){case"$":return"$";case"&":return l;case"`":return o(u,0,c);case"'":return o(u,g);case"<":_=d[o(p,1,-1)];break;default:var O=+p;if(O===0)return b;if(O>w){var T=r(O/10);return T===0?b:T<=w?h[T-1]===void 0?n(p,1):h[T-1]+n(p,1):b}_=h[O-1]}return _===void 0?"":_})},YS}var EN;function h4(){if(EN)return vN;EN=1;var t=bt(),e=ur(),r=rr(),n=th(),i=cr(),o=qn(),s=s4(),a=og(),l=ih(),u=u4(),c=c4(),h=yi(),d=Fs(),f=h("replace"),g=TypeError,w=r("".indexOf),v=r("".replace),b=r("".slice),p=Math.max;return t({target:"String",proto:!0},{replaceAll:function(O,T){var M=n(this),P,G,j,A,q,Q,ue,J,Z,ie,ee=0,te="";if(o(O)){if(P=s(O),P&&(G=a(n(u(O))),!~w(G,"g")))throw new g("`.replaceAll` does not allow non-global regexes");if(j=l(O,f),j)return e(j,O,M,T);if(d&&P)return v(a(M),O,T)}for(A=a(M),q=a(O),Q=i(T),Q||(T=a(T)),ue=q.length,J=p(1,ue),Z=w(A,q);Z!==-1;)ie=Q?a(T(q,Z,A)):c(q,A,Z,[],void 0,T),te+=b(A,ee,Z)+ie,ee=Z+ue,Z=Z+J>A.length?-1:w(A,q,Z+J);return ee<A.length&&(te+=b(A,ee)),te}}),vN}h4();var TN={},_N={},MN;function d4(){if(MN)return _N;MN=1;var t=bt(),e=wu(),r=ln(),n=hr(),i=Qi(),o=un(),s=Ws(),a=sh(),l=lr(),u=TypeError,c=l(function(){[].keys().reduce(function(){},void 0)}),h=!c&&s("reduce",u);return t({target:"Iterator",proto:!0,real:!0,forced:c||h},{reduce:function(f){n(this);try{r(f)}catch(p){o(this,"throw",p)}var g=arguments.length<2,w=g?void 0:arguments[1];if(h)return a(h,this,g?[f]:[f,w]);var v=i(this),b=0;if(e(v,function(p){g?(g=!1,w=p):w=f(w,p,b),b++},{IS_RECORD:!0}),g)throw new u("Reduce of empty iterator with no initial value");return w}}),_N}var PN;function f4(){return PN||(PN=1,d4()),TN}f4();const IN={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">"},g4=new RegExp(Object.keys(IN).map(t=>`(${t})`).join("|"),"gi");function m4(t){return(t&&t.nodeName||"")==="TABLE"}function ON(t){const e=t.hasColHeaders(),r=t.hasRowHeaders(),n=[e?-1:0,r?-1:0,t.countRows()-1,t.countCols()-1],i=t.getData(...n),o=i.length,s=o>0?i[0].length:0,a=["<table>","</table>"],l=e?["<thead>","</thead>"]:[],u=["<tbody>","</tbody>"],c=r?1:0,h=e?1:0;for(let d=0;d<o;d+=1){const f=e&&d===0,g=[];for(let v=0;v<s;v+=1){const b=!f&&r&&v===0;let p="";if(f)p=`<th>${t.getColHeader(v-c)}</th>`;else if(b)p=`<th>${t.getRowHeader(d-h)}</th>`;else{const _=i[d][v],{hidden:O,rowspan:T,colspan:M}=t.getCellMeta(d-h,v-c);if(!O){const P=[];if(T&&P.push(`rowspan="${T}"`),M&&P.push(`colspan="${M}"`),qt(_))p=`<td ${P.join(" ")}></td>`;else{const G=_.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
511
+ `).replace(/\x20/gi,"&nbsp;").replace(/\t/gi,"&#9;");p=`<td ${P.join(" ")}>${G}</td>`}}}g.push(p)}const w=["<tr>",...g,"</tr>"].join("");f?l.splice(1,0,w):u.splice(-1,0,w)}return a.splice(1,0,l.join(""),u.join("")),a.join("")}function xN(t){const e=t.length,r=["<table>"];for(let n=0;n<e;n+=1){const i=t[n],o=i.length,s=[];n===0&&r.push("<tbody>");for(let a=0;a<o;a+=1){const l=i[a],u=qt(l)?"":l.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
512
+ `).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(c.length-1)} </span>`).replace(/\t/gi,"&#9;");s.push(`<td>${u}</td>`)}r.push("<tr>",...s,"</tr>"),n+1===e&&r.push("</tbody>")}return r.push("</table>"),r.join("")}function p4(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const r={},n=e.createDocumentFragment(),i=e.createElement("div");n.appendChild(i);let o=t;if(typeof o=="string"){const _=o.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,O=>{const T=O.match(/<td\b[^>]*?>/g)[0],M=/<p.*?>/g,P=O.substring(T.length,O.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(M,`
513
+ `).replace(`
514
+ `,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^&nbsp;$/mg,"");return`${T}${P}</td>`});i.insertAdjacentHTML("afterbegin",`${_}`),o=i.querySelector("table")}if(!o||!m4(o))return;const s=i.querySelector('meta[name$="enerator"]'),a=o.querySelector("tbody th")!==null,l=o.querySelector("tr"),u=l?Array.from(l.cells).reduce((_,O)=>_+O.colSpan,0)-(a?1:0):0,c=o.tFoot&&Array.from(o.tFoot.rows)||[],h=[];let d=!1,f=0,g=0;if(o.tHead){const _=Array.from(o.tHead.rows).filter(O=>{const T=O.querySelector("td")!==null;return T&&h.push(O),!T});f=_.length,d=f>0,f>1?r.nestedHeaders=Array.from(_).reduce((O,T)=>{const M=Array.from(T.cells).reduce((P,G,j)=>{if(a&&j===0)return P;const{colSpan:A,innerHTML:q}=G,Q=A>1?{label:q,colspan:A}:q;return P.push(Q),P},[]);return O.push(M),O},[]):d&&(r.colHeaders=Array.from(_[0].children).reduce((O,T,M)=>(a&&M===0||O.push(T.innerHTML),O),[]))}h.length&&(r.fixedRowsTop=h.length),c.length&&(r.fixedRowsBottom=c.length);const w=[...h,...Array.from(o.tBodies).reduce((_,O)=>(_.push(...Array.from(O.rows)),_),[]),...c];g=w.length;const v=new Array(g);for(let _=0;_<g;_++)v[_]=new Array(u);const b=[],p=[];for(let _=0;_<g;_++){const O=w[_],T=Array.from(O.cells),M=T.length;for(let P=0;P<M;P++){const G=T[P],{nodeName:j,innerHTML:A,rowSpan:q,colSpan:Q}=G,ue=v[_].findIndex(J=>J===void 0);if(j==="TD"){if(q>1||Q>1){for(let ee=_;ee<_+q;ee++)if(ee<g)for(let te=ue;te<ue+Q;te++)v[ee][te]=null;const Z=G.getAttribute("style");Z&&Z.includes("mso-ignore:colspan")||b.push({col:ue,row:_,rowspan:q,colspan:Q})}let J="";s&&/excel/gi.test(s.content)?J=A.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
515
+ `):J=A.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
516
+ `),v[_][ue]=J.replace(g4,Z=>IN[Z])}else p.push(A)}}return b.length&&(r.mergeCells=b),p.length&&(r.rowHeaders=p),v.length&&(r.data=v),r}function Xr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=typeof t;if(r==="number")return!isNaN(t)&&isFinite(t);if(r==="string"){if(t.length===0)return!1;if(t.length===1)return/\d/.test(t);const n=Array.from(new Set([".",...e])).map(i=>`\\${i}`).join("|");return new RegExp(`^[+-]?(((${n})?\\d+((${n})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(t.trim())}else if(r==="object")return!!t&&typeof t.valueOf()=="number"&&!(t instanceof Date);return!1}function w4(t){return Xr(t,[","])}function Ce(t,e,r){let n=-1;for(typeof e=="function"?(r=e,e=t):n=t-1;++n<=e&&r(n)!==!1;);}function AN(t,e,r){let n=t+1;for(typeof e=="function"&&(r=e,e=0);--n>=e&&r(n)!==!1;);}function HN(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function Ze(t,e,r){return Math.min(t,e)===t?e:Math.max(t,r)===t?r:t}const GS="asc",v4="desc",NN=new Map([[GS,[-1,1]],[v4,[1,-1]]]),y4=t=>`The priority '${t}' is already declared in a map.`,C4=t=>`The priority '${t}' is not a number.`;function b4(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=new Map;t=ht(t)?t:y4,e=ht(e)?e:C4;function n(o,s){if(!Xr(o))throw new Error(e(o));if(r.has(o))throw new Error(t(o));r.set(o,s)}function i(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:GS;const[s,a]=NN.get(o)||NN.get(GS);return[...r].sort((l,u)=>l[0]<u[0]?s:a).map(l=>l[1])}return{addItem:n,getItems:i}}const S4=t=>`The id '${t}' is already declared in a map.`;function Jg(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=ht(t)?t:S4;function r(u,c){if(l(u))throw new Error(t(u));e.set(u,c)}function n(u){return e.delete(u)}function i(){e.clear()}function o(u){const[c]=a().find(h=>{let[d,f]=h;return u===f?d:!1})||[null];return c}function s(u){return e.get(u)}function a(){return[...e]}function l(u){return e.has(u)}return{addItem:r,clear:i,getId:o,getItem:s,getItems:a,hasItem:l,removeItem:n}}const R4=t=>`'${t}' value is already declared in a unique set.`;function E4(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=ht(t)?t:R4;function r(o){if(e.has(o))throw new Error(t(o));e.add(o)}function n(){return[...e]}function i(){e.clear()}return{addItem:r,clear:i,getItems:n}}const qS=t=>`There is already registered "${t}" plugin.`,DN=b4({errorPriorityExists:t=>`There is already registered plugin on priority "${t}".`,errorPriorityNaN:t=>`The priority "${t}" is not a number.`}),kN=E4({errorItemExists:qS}),KS=Jg({errorIdExists:qS});function LN(){return[...DN.getItems(),...kN.getItems()]}function XS(t){const e=Ti(t);return KS.getItem(e)}function T4(t){return!!XS(t)}function Qe(t,e,r){[t,e,r]=M4(t,e,r),XS(t)===void 0&&_4(t,e,r)}function _4(t,e,r){const n=Ti(t);if(KS.hasItem(n))throw new Error(qS(n));r===void 0?kN.addItem(n):DN.addItem(r,n),KS.addItem(n,e)}function M4(t,e,r){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,r=e.PLUGIN_PRIORITY),[t,e,r]}const{register:P4,getItem:I4,hasItem:$N,getNames:sme,getValues:ame}=Mi("renderers");function ZS(t){if(typeof t=="function")return t;if(!$N(t))throw Error(`No registered renderer found under "${t}" name`);return I4(t)}function ri(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),P4(t,e)}const{register:O4,getItem:x4,hasItem:FN,getNames:lme,getValues:ume}=Mi("validators");function A4(t){if(typeof t=="function")return t;if(!FN(t))throw Error(`No registered validator found under "${t}" name`);return x4(t)}function Nu(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),O4(t,e)}var VN={},WN;function H4(){if(WN)return VN;WN=1;var t=bt(),e=gu(),r=pu(),n=oh(),i=zg();return t({target:"Array",proto:!0},{at:function(s){var a=e(this),l=r(a),u=n(s),c=u>=0?u:l+u;return c<0||c>=l?void 0:a[c]}}),i("at"),VN}H4();var BN={},jN;function N4(){if(jN)return BN;jN=1;var t=bt(),e=rr(),r=th(),n=oh(),i=og(),o=lr(),s=e("".charAt),a=o(function(){return"𠮷".at(-2)!=="\uD842"});return t({target:"String",proto:!0,forced:a},{at:function(u){var c=i(r(this)),h=c.length,d=n(u),f=d>=0?d:h+d;return f<0||f>=h?void 0:s(c,f)}}),BN}N4();function kh(t,e,r){return(e=D4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D4(t){var e=k4(t,"string");return typeof e=="symbol"?e:e+""}function k4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class L4{constructor(){kh(this,"count",0),kh(this,"startColumn",null),kh(this,"endColumn",null),kh(this,"startPosition",null),kh(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,r){const{totalCalculatedWidth:n,zeroBasedScrollOffset:i,viewportWidth:o,columnWidth:s}=r,a=i>0?o+1:o;n>=i&&n+s<=i+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e)}finalize(e){var r;const{scrollOffset:n,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const g=u[this.endColumn]+c-u[this.startColumn-1];if(g<=i&&(this.startColumn-=1),g>=i)break}this.startPosition=(r=u[this.startColumn])!==null&&r!==void 0?r:null;const h=s>0?i+1:i,d=n+i-h,f=this.startColumn===null?0:e.getColumnWidth(this.startColumn);d<-1*o||n>u.at(-1)||-1*n-i>-1*f?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function Lh(t,e,r){return(e=$4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $4(t){var e=F4(t,"string");return typeof e=="symbol"?e:e+""}function F4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class V4{constructor(){Lh(this,"count",0),Lh(this,"startRow",null),Lh(this,"endRow",null),Lh(this,"startPosition",null),Lh(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,r){const{totalCalculatedHeight:n,zeroBasedScrollOffset:i,innerViewportHeight:o,rowHeight:s}=r;n>=i&&n+s<=o&&(this.startRow===null&&(this.startRow=e),this.endRow=e)}finalize(e){var r;const{scrollOffset:n,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const d=l[this.endRow]+u-l[this.startRow-1];if(d<=i-o&&(this.startRow-=1),d>=i-o)break}this.startPosition=(r=l[this.startRow])!==null&&r!==void 0?r:null;const c=n+i-o,h=this.startRow===null?0:e.getRowHeight(this.startRow);c<h||n>l.at(-1)?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function $h(t,e,r){return(e=W4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function W4(t){var e=B4(t,"string");return typeof e=="symbol"?e:e+""}function B4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class UN{constructor(){$h(this,"count",0),$h(this,"startColumn",null),$h(this,"endColumn",null),$h(this,"startPosition",null),$h(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,r){const{totalCalculatedWidth:n,zeroBasedScrollOffset:i,viewportWidth:o}=r;n<=i&&(this.startColumn=e);const s=i>0?o+1:o;n>=i&&n<=i+s&&(this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e}finalize(e){var r;const{scrollOffset:n,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const f=u[this.endColumn]+c-u[this.startColumn-1];if(this.startColumn-=1,f>i)break}this.startPosition=(r=u[this.startColumn])!==null&&r!==void 0?r:null;const h=s>0?i+1:i;n+i-h<-1*o||n>u.at(-1)+c||-1*n-i>0?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function Fh(t,e,r){return(e=j4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j4(t){var e=U4(t,"string");return typeof e=="symbol"?e:e+""}function U4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class zN{constructor(){Fh(this,"count",0),Fh(this,"startRow",null),Fh(this,"endRow",null),Fh(this,"startPosition",null),Fh(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,r){const{totalCalculatedHeight:n,zeroBasedScrollOffset:i,innerViewportHeight:o}=r;n<=i&&(this.startRow=e),n>=i&&n<=o&&this.startRow===null&&(this.startRow=e),this.endRow=e}finalize(e){var r;const{scrollOffset:n,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const h=l[this.endRow]+u-l[this.startRow-1];if(this.startRow-=1,h>=i-o)break}this.startPosition=(r=l[this.startRow])!==null&&r!==void 0?r:null,n+i-o<0||n>l.at(-1)+u?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function Vh(t,e,r){return(e=z4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z4(t){var e=Y4(t,"string");return typeof e=="symbol"?e:e+""}function Y4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class G4{constructor(){Vh(this,"count",0),Vh(this,"startColumn",0),Vh(this,"endColumn",0),Vh(this,"startPosition",0),Vh(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:r}=e;this.count=r,this.endColumn=this.count-1}process(){}finalize(){}}function Wh(t,e,r){return(e=q4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function q4(t){var e=K4(t,"string");return typeof e=="symbol"?e:e+""}function K4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class X4{constructor(){Wh(this,"count",0),Wh(this,"startRow",0),Wh(this,"endRow",0),Wh(this,"startPosition",0),Wh(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:r}=e;this.count=r,this.endRow=this.count-1}process(){}finalize(){}}function YN(t,e,r){return(e=Z4(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z4(t){var e=J4(t,"string");return typeof e=="symbol"?e:e+""}function J4(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Q4 extends UN{constructor(){super(...arguments),YN(this,"columnStartOffset",0),YN(this,"columnEndOffset",0)}finalize(e){var r;super.finalize(e);const{overrideFn:n,totalColumns:i,startPositions:o}=e;if(this.startColumn!==null&&typeof n=="function"){const s=this.startColumn,a=this.endColumn;n(this),this.columnStartOffset=s-this.startColumn,this.columnEndOffset=this.endColumn-a}this.startColumn<0&&(this.startColumn=0),this.startPosition=(r=o[this.startColumn])!==null&&r!==void 0?r:null,i<this.endColumn&&(this.endColumn=i-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function GN(t,e,r){return(e=eX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eX(t){var e=tX(t,"string");return typeof e=="symbol"?e:e+""}function tX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rX extends zN{constructor(){super(...arguments),GN(this,"rowStartOffset",0),GN(this,"rowEndOffset",0)}finalize(e){var r;super.finalize(e);const{overrideFn:n,totalRows:i,startPositions:o}=e;if(this.startRow!==null&&typeof n=="function"){const s=this.startRow,a=this.endRow;n(this),this.rowStartOffset=s-this.startRow,this.rowEndOffset=this.endRow-a}this.startRow<0&&(this.startRow=0),this.startPosition=(r=o[this.startRow])!==null&&r!==void 0?r:null,i<this.endRow&&(this.endRow=i-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function qN(t,e,r){return(e=nX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nX(t){var e=iX(t,"string");return typeof e=="symbol"?e:e+""}function iX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class KN{constructor(e){qN(this,"calculationTypes",[]),qN(this,"calculationResults",new Map),this.calculationTypes=e}_initialize(e){this.calculationTypes.forEach(r=>{let[n,i]=r;this.calculationResults.set(n,i),i.initialize(e)})}_process(e,r){this.calculationTypes.forEach(n=>{let[,i]=n;return i.process(e,r)})}_finalize(e){this.calculationTypes.forEach(r=>{let[,n]=r;return n.finalize(e)})}getResultsFor(e){return this.calculationResults.get(e)}}function Ii(t,e,r){return(e=oX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oX(t){var e=sX(t,"string");return typeof e=="symbol"?e:e+""}function sX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Du=50;class aX extends KN{constructor(e){let{calculationTypes:r,viewportWidth:n,scrollOffset:i,totalColumns:o,columnWidthFn:s,overrideFn:a,inlineStartOffset:l}=e;super(r),Ii(this,"viewportWidth",0),Ii(this,"scrollOffset",0),Ii(this,"zeroBasedScrollOffset",0),Ii(this,"totalColumns",0),Ii(this,"columnWidthFn",null),Ii(this,"columnWidth",0),Ii(this,"overrideFn",null),Ii(this,"inlineStartOffset",0),Ii(this,"totalCalculatedWidth",0),Ii(this,"startPositions",[]),Ii(this,"needReverse",!0),this.viewportWidth=n,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalColumns=o,this.columnWidthFn=s,this.overrideFn=a,this.inlineStartOffset=l,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalColumns;e++)if(this.columnWidth=this.getColumnWidth(e),this._process(e,this),this.startPositions.push(this.totalCalculatedWidth),this.totalCalculatedWidth+=this.columnWidth,this.totalCalculatedWidth>=this.zeroBasedScrollOffset+this.viewportWidth){this.needReverse=!1;break}this._finalize(this)}getColumnWidth(e){const r=this.columnWidthFn(e);return isNaN(r)?Du:r}}function ni(t,e,r){return(e=lX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lX(t){var e=uX(t,"string");return typeof e=="symbol"?e:e+""}function uX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cX extends KN{constructor(e){let{calculationTypes:r,viewportHeight:n,scrollOffset:i,totalRows:o,defaultRowHeight:s,rowHeightFn:a,overrideFn:l,horizontalScrollbarHeight:u}=e;super(r),ni(this,"viewportHeight",0),ni(this,"scrollOffset",0),ni(this,"zeroBasedScrollOffset",0),ni(this,"totalRows",0),ni(this,"rowHeightFn",null),ni(this,"rowHeight",0),ni(this,"overrideFn",null),ni(this,"horizontalScrollbarHeight",0),ni(this,"innerViewportHeight",0),ni(this,"totalCalculatedHeight",0),ni(this,"startPositions",[]),ni(this,"needReverse",!0),this.defaultHeight=s,this.viewportHeight=n,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalRows=o,this.rowHeightFn=a,this.overrideFn=l,this.horizontalScrollbarHeight=u??0,this.innerViewportHeight=this.zeroBasedScrollOffset+this.viewportHeight-this.horizontalScrollbarHeight,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalRows;e++)if(this.rowHeight=this.getRowHeight(e),this._process(e,this),this.startPositions.push(this.totalCalculatedHeight),this.totalCalculatedHeight+=this.rowHeight,this.totalCalculatedHeight>=this.innerViewportHeight){this.needReverse=!1;break}this._finalize(this)}getRowHeight(e){const r=this.rowHeightFn(e);return isNaN(r)?this.defaultHeight:r}}function hX(t,e,r){dX(t,e),e.set(t,r)}function dX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function XN(t,e,r){return(e=fX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fX(t){var e=gX(t,"string");return typeof e=="symbol"?e:e+""}function gX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ku(t,e){return t.get(JN(t,e))}function ZN(t,e,r){return t.set(JN(t,e),r),r}function JN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var rs=new WeakMap;class rl{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;XN(this,"row",null),XN(this,"col",null),hX(this,rs,!1),ZN(rs,this,n),typeof e<"u"&&typeof r<"u"&&(this.row=e,this.col=r)}isValid(e){const{countRows:r,countCols:n,countRowHeaders:i,countColHeaders:o}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-o||this.col<-i||this.row>=r||this.col>=n)}isEqual(e){return e===this?!0:this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return ku(rs,this)}isSouthEastOf(e){return this.row>=e.row&&(ku(rs,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(ku(rs,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(ku(rs,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(ku(rs,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=this.row===null?this.row:Math.max(this.row,0),this.col=this.col===null?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(e==null?void 0:e.row)&&(this.row=e.row),Number.isInteger(e==null?void 0:e.col)&&(this.col=e.col),e instanceof rl&&ZN(rs,this,e.isRtl()),this}clone(){return new rl(this.row,this.col,ku(rs,this))}toObject(){return{row:this.row,col:this.col}}}function mX(t,e,r){pX(t,e),e.set(t,r)}function pX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function JS(t,e,r){return(e=wX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wX(t){var e=vX(t,"string");return typeof e=="symbol"?e:e+""}function vX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ii(t,e){return t.get(QN(t,e))}function yX(t,e,r){return t.set(QN(t,e),r),r}function QN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var dn=new WeakMap;class Bh{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;JS(this,"highlight",null),JS(this,"from",null),JS(this,"to",null),mX(this,dn,!1),this.highlight=e.clone(),this.from=r.clone(),this.to=n.clone(),yX(dn,this,i)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}normalize(){return this.highlight.normalize(),this.from.normalize(),this.to.normalize(),this}isValid(e){return this.from.isValid(e)&&this.to.isValid(e)}isSingle(){return this.isSingleCell()||this.isSingleHeader()}isSingleCell(){return this.from.row>=0&&this.from.row===this.to.row&&this.from.col>=0&&this.from.col===this.to.col}isSingleHeader(){return(this.from.row<0||this.from.col<0)&&this.from.row===this.to.row&&this.from.col===this.to.col}isHeader(){return this.from.isHeader()&&this.to.isHeader()?!0:this.from.col<0&&this.to.col<0||this.from.row<0&&this.to.row<0}containsHeaders(){return this.from.isHeader()||this.to.isHeader()}getOuterHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getOuterWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}getHeight(){if(this.from.row<0&&this.to.row<0)return 0;const e=Math.max(this.from.row,0),r=Math.max(this.to.row,0);return Math.max(e,r)-Math.min(e,r)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),r=Math.max(this.to.col,0);return Math.max(e,r)-Math.min(e,r)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:r,col:n}=e,i=this.getOuterTopStartCorner(),o=this.getOuterBottomEndCorner();return i.row<=r&&o.row>=r&&i.col<=n&&o.col>=n}includesRange(e){return this.includes(e.getOuterTopStartCorner())&&this.includes(e.getOuterBottomEndCorner())}isEqual(e){return Math.min(this.from.row,this.to.row)===Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)===Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)===Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)===Math.max(e.from.col,e.to.col)}overlaps(e){return e.isSouthEastOf(this.getOuterTopLeftCorner())&&e.isNorthWestOf(this.getOuterBottomRightCorner())}isSouthEastOf(e){return this.getOuterTopLeftCorner().isSouthEastOf(e)||this.getOuterBottomRightCorner().isSouthEastOf(e)}isNorthWestOf(e){return this.getOuterTopLeftCorner().isNorthWestOf(e)||this.getOuterBottomRightCorner().isNorthWestOf(e)}isOverlappingHorizontally(e){return this.getOuterTopEndCorner().col>=e.getOuterTopStartCorner().col&&this.getOuterTopEndCorner().col<=e.getOuterTopEndCorner().col||this.getOuterTopStartCorner().col<=e.getOuterTopEndCorner().col&&this.getOuterTopStartCorner().col>=e.getOuterTopStartCorner().col}isOverlappingVertically(e){return this.getOuterBottomStartCorner().row>=e.getOuterTopRightCorner().row&&this.getOuterBottomStartCorner().row<=e.getOuterBottomStartCorner().row||this.getOuterTopEndCorner().row<=e.getOuterBottomStartCorner().row&&this.getOuterTopEndCorner().row>=e.getOuterTopRightCorner().row}expand(e){const r=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();return e.row<r.row||e.col<r.col||e.row>n.row||e.col>n.col?(this.from=this._createCellCoords(Math.min(r.row,e.row),Math.min(r.col,e.col)),this.to=this._createCellCoords(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1}expandByRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(this.includesRange(e)||!this.overlaps(e))return!1;const n=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),o=this.getDirection(),s=e.getOuterTopStartCorner(),a=e.getOuterBottomEndCorner(),l=Math.min(n.row,s.row),u=Math.min(n.col,s.col),c=Math.max(i.row,a.row),h=Math.max(i.col,a.col),d=this._createCellCoords(l,u),f=this._createCellCoords(c,h);return this.from=d,this.to=f,this.setDirection(o),r&&(this.highlight.row===this.getOuterBottomRightCorner().row&&this.getVerticalDirection()==="N-S"&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&this.getHorizontalDirection()==="W-E"&&this.flipDirectionHorizontally()),!0}getDirection(){if(this.from.isNorthWestOf(this.to))return"NW-SE";if(this.from.isNorthEastOf(this.to))return"NE-SW";if(this.from.isSouthEastOf(this.to))return"SE-NW";if(this.from.isSouthWestOf(this.to))return"SW-NE"}setDirection(e){switch(e){case"NW-SE":[this.from,this.to]=[this.getOuterTopLeftCorner(),this.getOuterBottomRightCorner()];break;case"NE-SW":[this.from,this.to]=[this.getOuterTopRightCorner(),this.getOuterBottomLeftCorner()];break;case"SE-NW":[this.from,this.to]=[this.getOuterBottomRightCorner(),this.getOuterTopLeftCorner()];break;case"SW-NE":[this.from,this.to]=[this.getOuterBottomLeftCorner(),this.getOuterTopRightCorner()];break}}getVerticalDirection(){return["NE-SW","NW-SE"].indexOf(this.getDirection())>-1?"N-S":"S-N"}getHorizontalDirection(){return["NW-SE","SW-NE"].indexOf(this.getDirection())>-1?"W-E":"E-W"}flipDirectionVertically(){switch(this.getDirection()){case"NW-SE":this.setDirection("SW-NE");break;case"NE-SW":this.setDirection("SE-NW");break;case"SE-NW":this.setDirection("NE-SW");break;case"SW-NE":this.setDirection("NW-SE");break}}flipDirectionHorizontally(){switch(this.getDirection()){case"NW-SE":this.setDirection("NE-SW");break;case"NE-SW":this.setDirection("NW-SE");break;case"SE-NW":this.setDirection("SW-NE");break;case"SW-NE":this.setDirection("SE-NW");break}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return ii(dn,this)?this.getTopEndCorner():this.getTopStartCorner()}getBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getBottomRightCorner(){return ii(dn,this)?this.getBottomStartCorner():this.getBottomEndCorner()}getTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getTopRightCorner(){return ii(dn,this)?this.getTopStartCorner():this.getTopEndCorner()}getBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getBottomLeftCorner(){return ii(dn,this)?this.getBottomEndCorner():this.getBottomStartCorner()}getOuterTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterTopLeftCorner(){return ii(dn,this)?this.getOuterTopEndCorner():this.getOuterTopStartCorner()}getOuterBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterBottomRightCorner(){return ii(dn,this)?this.getOuterBottomStartCorner():this.getOuterBottomEndCorner()}getOuterTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterTopRightCorner(){return ii(dn,this)?this.getOuterTopStartCorner():this.getOuterTopEndCorner()}getOuterBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterBottomLeftCorner(){return ii(dn,this)?this.getOuterBottomEndCorner():this.getOuterBottomStartCorner()}isCorner(e){return e.isEqual(this.getOuterTopLeftCorner())||e.isEqual(this.getOuterTopRightCorner())||e.isEqual(this.getOuterBottomLeftCorner())||e.isEqual(this.getOuterBottomRightCorner())}getOppositeCorner(e){if(!(e instanceof rl))return!1;if(e.isEqual(this.getOuterBottomEndCorner()))return this.getOuterTopStartCorner();if(e.isEqual(this.getOuterTopStartCorner()))return this.getOuterBottomEndCorner();if(e.isEqual(this.getOuterTopEndCorner()))return this.getOuterBottomStartCorner();if(e.isEqual(this.getOuterBottomStartCorner()))return this.getOuterTopEndCorner()}getBordersSharedWith(e){if(!this.includesRange(e))return[];const r={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},i=[];return r.top===n.top&&i.push("top"),r.right===n.right&&i.push(ii(dn,this)?"left":"right"),r.bottom===n.bottom&&i.push("bottom"),r.left===n.left&&i.push(ii(dn,this)?"right":"left"),i}getInner(){const e=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),n=[];for(let i=e.row;i<=r.row;i++)for(let o=e.col;o<=r.col;o++)!(this.from.row===i&&this.from.col===o)&&!(this.to.row===i&&this.to.col===o)&&n.push(this._createCellCoords(i,o));return n}getAll(){const e=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),n=[];for(let i=e.row;i<=r.row;i++)for(let o=e.col;o<=r.col;o++)e.row===i&&e.col===o?n.push(e):r.row===i&&r.col===o?n.push(r):n.push(this._createCellCoords(i,o));return n}forAll(e){const r=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();for(let i=r.row;i<=n.row;i++)for(let o=r.col;o<=n.col;o++)if(e(i,o)===!1)return}clone(){return new Bh(this.highlight,this.from,this.to,ii(dn,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,r){return new rl(e,r,ii(dn,this))}}function oo(t,e,r){CX(t,e),e.set(t,r)}function CX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function be(t,e){return t.get(eD(t,e))}function Gs(t,e,r){return t.set(eD(t,e),r),r}function eD(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var oi=new WeakMap,QS=new WeakMap,Mr=new WeakMap,Lu=new WeakMap,Qg=new WeakMap,Oi=new WeakMap,eR=new WeakMap,jh=new WeakMap,nl=new WeakMap,so=new WeakMap;let tD=class{constructor(e,r,n,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;oo(this,oi,void 0),oo(this,QS,void 0),oo(this,Mr,void 0),oo(this,Lu,void 0),oo(this,Qg,void 0),oo(this,Oi,void 0),oo(this,eR,void 0),oo(this,jh,void 0),oo(this,nl,[null,null]),oo(this,so,[null,null]),Gs(oi,this,n),Gs(QS,this,r),Gs(Mr,this,o),Gs(Lu,this,s),Gs(Qg,this,a),Gs(Oi,this,i),Gs(eR,this,e),this.registerEvents()}registerEvents(){be(Oi,this).addEventListener(be(Mr,this).holder,"contextmenu",n=>this.onContextMenu(n)),be(Oi,this).addEventListener(be(Mr,this).TABLE,"mouseover",n=>this.onMouseOver(n)),be(Oi,this).addEventListener(be(Mr,this).TABLE,"mouseout",n=>this.onMouseOut(n));const e=()=>{be(Oi,this).addEventListener(be(Mr,this).holder,"touchstart",n=>this.onTouchStart(n)),be(Oi,this).addEventListener(be(Mr,this).holder,"touchend",n=>this.onTouchEnd(n)),this.momentumScrolling||(this.momentumScrolling={}),be(Oi,this).addEventListener(be(Mr,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||be(oi,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,be(oi,this).getSetting("onAfterMomentumScroll"))},200)})},r=()=>{be(Oi,this).addEventListener(be(Mr,this).holder,"mouseup",n=>this.onMouseUp(n)),be(Oi,this).addEventListener(be(Mr,this).holder,"mousedown",n=>this.onMouseDown(n))};es()?e():(zH()&&e(),r())}selectedCellWasTouched(e){const n=this.parentCell(e).coords;if(be(jh,this)&&n){const[i,o]=[n.row,be(jh,this).from.row],[s,a]=[n.col,be(jh,this).from.col];return i===o&&s===a}return!1}parentCell(e){const r={},n=be(Mr,this).TABLE,i=Ng(e,["TD","TH"],n);return i?(r.coords=be(Mr,this).getCoords(i),r.TD=i):_e(e,"wtBorder")&&_e(e,"current")?(r.coords=be(Lu,this).getFocusSelection().cellRange.highlight,r.TD=be(Mr,this).getCell(r.coords)):_e(e,"wtBorder")&&_e(e,"area")&&be(Lu,this).getAreaSelection().cellRange&&(r.coords=be(Lu,this).getAreaSelection().cellRange.to,r.TD=be(Mr,this).getCell(r.coords)),r}onMouseDown(e){const r=be(QS,this).rootDocument.activeElement,n=WH(n3,e.target),i=e.target;if(!["TD","TH"].includes(r.nodeName)&&(i===r||n(0)===r||n(1)===r))return;const o=this.parentCell(i);_e(i,"corner")?be(oi,this).getSetting("onCellCornerMouseDown",e,i):o.TD&&be(oi,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(e.button===0||this.touchApplied)&&o.TD&&(be(so,this)[0]=o.TD,clearTimeout(be(nl,this)[0]),be(nl,this)[0]=setTimeout(()=>{be(so,this)[0]=null},1e3))}onContextMenu(e){if(be(oi,this).has("onCellContextMenu")){const r=this.parentCell(e.target);r.TD&&this.callListener("onCellContextMenu",e,r.coords,r.TD)}}onMouseOver(e){if(!be(oi,this).has("onCellMouseOver"))return;const r=be(Mr,this).TABLE,n=Ng(e.target,["TD","TH"],r),i=be(Qg,this)||this;n&&n!==i.lastMouseOver&&Ka(n,r)&&(i.lastMouseOver=n,this.callListener("onCellMouseOver",e,be(Mr,this).getCoords(n),n))}onMouseOut(e){if(!be(oi,this).has("onCellMouseOut"))return;const r=be(Mr,this).TABLE,n=Ng(e.target,["TD","TH"],r),i=Ng(e.relatedTarget,["TD","TH"],r),o=be(Qg,this)||this;n&&n!==i&&Ka(n,r)&&(this.callListener("onCellMouseOut",e,be(Mr,this).getCoords(n),n),i===null&&(o.lastMouseOver=null))}onMouseUp(e){const r=this.parentCell(e.target);r.TD&&be(oi,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,r.coords,r.TD),!(e.button!==0&&!this.touchApplied)&&(r.TD===be(so,this)[0]&&r.TD===be(so,this)[1]?(_e(e.target,"corner")?this.callListener("onCellCornerDblClick",e,r.coords,r.TD):this.callListener("onCellDblClick",e,r.coords,r.TD),be(so,this)[0]=null,be(so,this)[1]=null):r.TD===be(so,this)[0]&&(be(so,this)[1]=r.TD,clearTimeout(be(nl,this)[1]),be(nl,this)[1]=setTimeout(()=>{be(so,this)[1]=null},500)))}onTouchStart(e){Gs(jh,this,be(Lu,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var r;const n=e.target,i=(r=this.parentCell(n))===null||r===void 0?void 0:r.coords,o=we(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&o&&be(oi,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];GH()&&(E3()||T3())&&this.selectedCellWasTouched(n)&&!a.includes(n.tagName)?e.preventDefault():this.selectedCellWasTouched(n)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,r,n,i){const o=be(oi,this).getSettingPure(e);o&&o(r,n,i,be(eR,this).call(this))}destroy(){clearTimeout(be(nl,this)[0]),clearTimeout(be(nl,this)[1]),be(Oi,this).destroy()}};function tR(t,e,r){return(e=bX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bX(t){var e=SX(t,"string");return typeof e=="symbol"?e:e+""}function SX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class RX{constructor(e,r,n){tR(this,"offset",void 0),tR(this,"total",void 0),tR(this,"countTH",void 0),this.offset=e,this.total=r,this.countTH=n}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleRowHeadedColumnToSourceColumn(e){return this.renderedToSource(this.offsettedTH(e))}sourceColumnToVisibleRowHeadedColumn(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function rR(t,e,r){return(e=EX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function EX(t){var e=TX(t,"string");return typeof e=="symbol"?e:e+""}function TX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _X{constructor(e,r,n){rR(this,"offset",void 0),rR(this,"total",void 0),rR(this,"countTH",void 0),this.offset=e,this.total=r,this.countTH=n}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleColHeadedRowToSourceRow(e){return this.renderedToSource(this.offsettedTH(e))}sourceRowToVisibleColHeadedRow(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function em(t,e,r){return(e=MX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function MX(t){var e=PX(t,"string");return typeof e=="symbol"?e:e+""}function PX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class IX{constructor(){em(this,"currentSize",0),em(this,"nextSize",0),em(this,"currentOffset",0),em(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}const OX=0,rD=1,nR=2;function iR(t,e,r){return(e=xX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xX(t){var e=AX(t,"string");return typeof e=="symbol"?e:e+""}function AX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class HX{constructor(){iR(this,"size",new IX),iR(this,"workingSpace",OX),iR(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize!==null}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=rD,e.workingSpace=nR,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=nR,e.workingSpace=rD,this.sharedSize=e.getViewSize()}}var nD={},oR,iD;function NX(){if(iD)return oR;iD=1;var t=ig(),e=TypeError;return oR=function(r,n){if(!delete r[n])throw new e("Cannot delete property "+t(n)+" of "+t(r))},oR}var oD;function DX(){if(oD)return nD;oD=1;var t=bt(),e=gu(),r=pu(),n=nx(),i=NX(),o=ox(),s=[].unshift(0)!==1,a=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{unshift:function(c){var h=e(this),d=r(h),f=arguments.length;if(f){o(d+f);for(var g=d;g--;){var w=g+f;g in h?h[w]=h[g]:i(h,w)}for(var v=0;v<f;v++)h[v]=arguments[v]}return n(h,d+f)}}),nD}DX();function kX(t,e,r){return(e=LX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function LX(t){var e=$X(t,"string");return typeof e=="symbol"?e:e+""}function $X(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sD{constructor(e,r){kX(this,"order",[]),this.order=[...Array(r).keys()].map(n=>e+n)}get length(){return this.order.length}has(e){return this.order.indexOf(e)>-1}get(e){return e<this.order.length?this.order[e]:-1}remove(e){this.order.splice(this.order.indexOf(e),1)}prepend(e){return this.order.unshift(e),this.order.pop()}}function FX(t,e,r){return(e=VX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function VX(t){var e=WX(t,"string");return typeof e=="symbol"?e:e+""}function WX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class BX{constructor(e){FX(this,"sizeSet",void 0),this.sizeSet=e}diff(){const{sizeSet:e}=this,{currentSize:r,nextSize:n}=e.getViewSize();let i=Math.max(n,r);if(i===0)return[];const{currentOffset:o,nextOffset:s}=e.getViewSize(),a=new sD(o,r),l=new sD(s,n),u=[];for(let c=0;c<i;c++){const h=a.get(c),d=l.get(c);if(d===-1)u.push(["remove",h]);else if(h===-1)!e.isShared()||e.isShared()&&e.isPlaceOn(nR)?u.push(["append",d]):u.push(["prepend",d]);else if(d>h)a.has(d)&&(a.remove(d),n<=a.length&&(i-=1)),u.push(["replace",d,h]);else if(d<h){const f=a.prepend(d);u.push(["insert_before",d,h,f])}else u.push(["none",d])}return u}}function $u(t,e,r){return(e=jX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jX(t){var e=UX(t,"string");return typeof e=="symbol"?e:e+""}function UX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class aD{constructor(e,r){$u(this,"rootNode",void 0),$u(this,"nodesPool",void 0),$u(this,"sizeSet",new HX),$u(this,"collectedNodes",[]),$u(this,"viewDiffer",new BX(this.sizeSet)),$u(this,"leads",[]),this.rootNode=e,this.nodesPool=r}setSize(e){return this.sizeSet.setSize(e),this}setOffset(e){return this.sizeSet.setOffset(e),this}isSharedViewSet(){return this.sizeSet.isShared()}getNode(e){return e<this.collectedNodes.length?this.collectedNodes[e]:null}getCurrentNode(){const e=this.collectedNodes.length;return e>0?this.collectedNodes[e-1]:null}applyCommand(e){const{rootNode:r}=this,[n,i,o,s]=e,a=this.nodesPool(i);switch(this.collectedNodes.push(a),n){case"prepend":r.insertBefore(a,r.firstChild);break;case"append":r.appendChild(a);break;case"insert_before":r.insertBefore(a,this.nodesPool(o)),r.removeChild(this.nodesPool(s));break;case"replace":r.replaceChild(a,this.nodesPool(o));break;case"remove":r.removeChild(a);break}}start(){this.collectedNodes.length=0,this.leads=this.viewDiffer.diff()}render(){this.leads.length>0&&this.applyCommand(this.leads.shift())}end(){for(;this.leads.length>0;)this.applyCommand(this.leads.shift())}}class lD extends aD{prependView(e){return this.sizeSet.prepend(e.sizeSet),e.sizeSet.append(this.sizeSet),this}appendView(e){return this.sizeSet.append(e.sizeSet),e.sizeSet.prepend(this.sizeSet),this}}function uD(t,e,r){return(e=zX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zX(t){var e=YX(t,"string");return typeof e=="symbol"?e:e+""}function YX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class GX{constructor(e){uD(this,"nodeType",void 0),uD(this,"pool",new Map),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(e,r){const i=typeof r=="number"?`${e}x${r}`:e.toString();if(this.pool.has(i))return this.pool.get(i);const o=this.rootDocument.createElement(this.nodeType);return this.pool.set(i,o),o}}function Uh(t,e,r){return(e=qX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qX(t){var e=KX(t,"string");return typeof e=="symbol"?e:e+""}function KX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class zh{constructor(e,r){Uh(this,"nodesPool",null),Uh(this,"nodeType",void 0),Uh(this,"rootNode",void 0),Uh(this,"table",null),Uh(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new GX(e):null,this.nodeType=e,this.rootNode=r}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function cD(t,e,r){return(e=XX(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function XX(t){var e=ZX(t,"string");return typeof e=="symbol"?e:e+""}function ZX(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class JX extends zh{constructor(){super("TH"),cD(this,"orderViews",new WeakMap),cD(this,"sourceRowIndex",0)}obtainOrderView(e){let r;return this.orderViews.has(e)?r=this.orderViews.get(e):(r=new lD(e,n=>this.nodesPool.obtain(this.sourceRowIndex,n)),this.orderViews.set(e,r)),r}render(){const{rowsToRender:e,rowHeaderFunctions:r,rowHeadersCount:n,rows:i,cells:o}=this.table;for(let s=0;s<e;s++){const a=this.table.renderedRowToSource(s),l=i.getRenderedNode(s);this.sourceRowIndex=a;const u=this.obtainOrderView(l),c=o.obtainOrderView(l);u.appendView(c).setSize(n).setOffset(0).start();for(let h=n-1;h>=0;h--){u.render();const d=u.getCurrentNode();d.className="",d.removeAttribute("style"),Pu(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Pe(d,[kK(),zK(),gS(h+1),Ya(-1)]),r[h](a,d,h)}u.end()}}}class QX extends zh{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:r}=this.table;let n=this.rootNode.firstChild;if(e){const{columnsToRender:i}=this.table,o=i+r;for(let a=0,l=e;a<l;a++){for(n=this.rootNode.childNodes[a],n||(n=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(n)),this.renderedNodes=n.childNodes.length;this.renderedNodes<o;)n.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>o;)n.removeChild(n.lastChild),this.renderedNodes-=1}const s=this.rootNode.childNodes.length;if(s>e)for(let a=e;a<s;a++)this.rootNode.removeChild(this.rootNode.lastChild)}else n&&Zo(n)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&Pe(this.rootNode,[yH()]);for(let r=0;r<e;r+=1){const{columnHeaderFunctions:n,columnsToRender:i,rowHeadersCount:o}=this.table,s=this.rootNode.childNodes[r];this.table.isAriaEnabled()&&Pe(s,[fS(),RH(r+1)]);for(let a=-1*o;a<i;a+=1){const l=this.table.renderedColumnToSource(a),u=s.childNodes[a+o];u.className="",u.removeAttribute("style"),Pu(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Pe(u,[gS(a+1+this.table.rowHeadersCount),Ya(-1),LK(),...a>=0?[UK()]:[fS()]]),n[r](l,u,r)}}}}let hD=!1;class e6 extends zh{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:r}=this.table,n=e+r;for(;this.renderedNodes<n;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>n;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:r}=this.table;!hD&&e>1e3&&(hD=!0,st(at`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
517
+ Consider limiting the number of rendered columns by specifying the table width and/or\x20
518
+ turning off the "renderAllColumns" option.`));for(let i=0;i<r;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getHeaderWidth(o);this.rootNode.childNodes[i].style.width=`${s}px`}for(let i=0;i<e;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getWidth(o);this.rootNode.childNodes[i+r].style.width=`${s}px`}const n=this.rootNode.firstChild;n&&oe(n,"rowHeader")}}function t6(t,e,r){return(e=r6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function r6(t){var e=n6(t,"string");return typeof e=="symbol"?e:e+""}function n6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Fu={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let dD=!1;class i6 extends zh{constructor(e){super("TR",e),t6(this,"orderView",void 0),this.orderView=new aD(e,r=>this.nodesPool.obtain(r))}getRenderedNode(e){return this.orderView.getNode(e)}hasStaleContent(e){return this.orderView.hasStaleContent(e)}render(){const{rowsToRender:e}=this.table;!dD&&e>1e3&&(dD=!0,st(at`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
519
+ Consider limiting the number of rendered rows by specifying the table height and/or\x20
520
+ turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&Pe(this.rootNode,[yH()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let i=0;i<e;i++){this.orderView.render();const o=this.orderView.getCurrentNode(),s=this.table.renderedRowToSource(i);if(this.table.isAriaEnabled()){var r,n;Pe(o,[fS(),RH(s+((r=(n=this.table.rowUtils)===null||n===void 0||(n=n.dataAccessObject)===null||n===void 0?void 0:n.columnHeaders.length)!==null&&r!==void 0?r:0)+1)])}(s+1)%2===0?_e(o,Fu.rowEven)||(Ee(o,Fu.rowOdd),oe(o,Fu.rowEven)):_e(o,Fu.rowOdd)||(Ee(o,Fu.rowEven),oe(o,Fu.rowOdd))}this.orderView.end()}}function fD(t,e,r){return(e=o6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o6(t){var e=s6(t,"string");return typeof e=="symbol"?e:e+""}function s6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class a6 extends zh{constructor(){super("TD"),fD(this,"orderViews",new WeakMap),fD(this,"sourceRowIndex",0)}obtainOrderView(e){let r;return this.orderViews.has(e)?r=this.orderViews.get(e):(r=new lD(e,n=>this.nodesPool.obtain(this.sourceRowIndex,n),this.nodeType),this.orderViews.set(e,r)),r}render(){const{rowsToRender:e,columnsToRender:r,rows:n,rowHeaders:i}=this.table;for(let a=0;a<e;a++){const l=this.table.renderedRowToSource(a),u=n.getRenderedNode(a);this.sourceRowIndex=l;const c=this.obtainOrderView(u),h=i.obtainOrderView(u);c.prependView(h).setSize(r).setOffset(0).start();for(let d=0;d<r;d++){c.render();const f=this.table.renderedColumnToSource(d),g=c.getCurrentNode();if(_e(g,"hide")||(g.className=""),g.removeAttribute("style"),g.removeAttribute("dir"),Pu(g,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,f,g),this.table.isAriaEnabled()){var o,s;Pe(g,[...g.hasAttribute("role")?[]:[DK()],Ya(-1),gS(f+((o=(s=this.table.rowUtils)===null||s===void 0||(s=s.dataAccessObject)===null||s===void 0?void 0:s.rowHeaders.length)!==null&&o!==void 0?o:0)+1)])}}c.end()}}}function pr(t,e,r){return(e=l6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l6(t){var e=u6(t,"string");return typeof e=="symbol"?e:e+""}function u6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class c6{constructor(e){let{cellRenderer:r,stylesHandler:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};pr(this,"rootNode",void 0),pr(this,"rootDocument",void 0),pr(this,"rowHeaders",null),pr(this,"columnHeaders",null),pr(this,"colGroup",null),pr(this,"rows",null),pr(this,"cells",null),pr(this,"rowFilter",null),pr(this,"columnFilter",null),pr(this,"rowUtils",null),pr(this,"columnUtils",null),pr(this,"rowsToRender",0),pr(this,"columnsToRender",0),pr(this,"rowHeaderFunctions",[]),pr(this,"rowHeadersCount",0),pr(this,"columnHeaderFunctions",[]),pr(this,"columnHeadersCount",0),pr(this,"cellRenderer",void 0),pr(this,"activeOverlayName",void 0),pr(this,"stylesHandler",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=r,this.stylesHandler=n}setActiveOverlayName(e){this.activeOverlayName=e}setAxisUtils(e,r){this.rowUtils=e,this.columnUtils=r}setViewportSize(e,r){this.rowsToRender=e,this.columnsToRender=r}setFilters(e,r){this.rowFilter=e,this.columnFilter=r}setHeaderContentRenderers(e,r){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=r,this.columnHeadersCount=r.length}setRenderers(){let{rowHeaders:e,columnHeaders:r,colGroup:n,rows:i,cells:o}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.setTable(this),r.setTable(this),n.setTable(this),i.setTable(this),o.setTable(this),this.rowHeaders=e,this.columnHeaders=r,this.colGroup=n,this.rows=i,this.cells=o}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.colGroup.adjust(),this.columnHeaders.adjust(),this.rows.adjust(),this.rowHeaders.adjust(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:r}=this;for(let n=0;n<e;n++){const i=r.getRenderedNode(n),o=this.rowUtils;if(i.firstChild){const s=this.renderedRowToSource(n),a=o.getHeightByOverlayName(s,this.activeOverlayName),u=this.stylesHandler.areCellsBorderBox()?0:1;a?i.firstChild.style.height=`${a-u}px`:i.firstChild.style.height=""}}}}class h6{constructor(){let{TABLE:e,THEAD:r,COLGROUP:n,TBODY:i,rowUtils:o,columnUtils:s,cellRenderer:a,stylesHandler:l}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new c6(e,{cellRenderer:a,stylesHandler:l}),this.renderer.setRenderers({rowHeaders:new JX,columnHeaders:new QX(r),colGroup:new e6(n),rows:new i6(i),cells:new a6}),this.renderer.setAxisUtils(o,s)}setActiveOverlayName(e){return this.renderer.setActiveOverlayName(e),this}setFilters(e,r){return this.renderer.setFilters(e,r),this}setViewportSize(e,r){return this.renderer.setViewportSize(e,r),this}setHeaderContentRenderers(e,r){return this.renderer.setHeaderContentRenderers(e,r),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function sR(t,e,r){return(e=d6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d6(t){var e=f6(t,"string");return typeof e=="symbol"?e:e+""}function f6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class g6{constructor(e,r){sR(this,"dataAccessObject",void 0),sR(this,"wtSettings",void 0),sR(this,"headerWidths",new Map),this.dataAccessObject=e,this.wtSettings=r}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getHeaderHeight(e){let r=this.dataAccessObject.stylesHandler.getDefaultRowHeight();const n=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return n!==void 0&&(r=r?Math.max(r,n):n),r}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}calculateWidths(){const{wtSettings:e}=this;let r=e.getSetting("rowHeaderWidth");if(r=e.getSetting("onModifyRowHeaderWidth",r),r!=null){const n=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let o=0;o<n;o++){let s=Array.isArray(r)?r[o]:r;s=s??i,this.headerWidths.set(o,s)}}}}function gD(t,e,r){return(e=m6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function m6(t){var e=p6(t,"string");return typeof e=="symbol"?e:e+""}function p6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class w6{constructor(e,r){gD(this,"dataAccessObject",void 0),gD(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=r}getHeight(e){let r=this.wtSettings.getSetting("rowHeight",e);const n=this.dataAccessObject.wtViewport.oversizedRows[e];return n!==void 0&&(r=r===void 0?n:Math.max(r,n)),r}getHeightByOverlayName(e,r){let n=this.wtSettings.getSetting("rowHeightByOverlayName",e,r);const i=this.dataAccessObject.wtViewport.oversizedRows[e];return i!==void 0&&(n=n===void 0?i:Math.max(n,i)),n}}function ao(t,e,r){return(e=v6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v6(t){var e=y6(t,"string");return typeof e=="symbol"?e:e+""}function y6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Vu{constructor(e,r,n,i,o){ao(this,"wtSettings",null),ao(this,"domBindings",void 0),ao(this,"TBODY",null),ao(this,"THEAD",null),ao(this,"COLGROUP",null),ao(this,"hasTableHeight",!0),ao(this,"hasTableWidth",!0),ao(this,"isTableVisible",!1),ao(this,"tableOffset",0),ao(this,"holderOffset",0),this.domBindings=n,this.isMaster=o==="master",this.name=o,this.dataAccessObject=e,this.facadeGetter=r,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=n.rootTable,IH(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.isMaster&&this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.rowFilter=null,this.columnFilter=null,this.correctHeaderWidth=!1;const s=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(s)),this.rowUtils=new w6(this.dataAccessObject,this.wtSettings),this.columnUtils=new g6(this.dataAccessObject,this.wtSettings),this.tableRenderer=new h6({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer"),stylesHandler:this.dataAccessObject.stylesHandler})}is(e){return this.name===e}fixTableDomTree(){const e=this.domBindings.rootDocument;this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=e.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=e.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=e.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD))}createSpreader(e){const r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!_e(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.className="wtSpreader",r&&r.insertBefore(n,e),n.appendChild(e)),n.style.position="relative",this.wtSettings.getSetting("ariaTags")&&Pe(n,[Xo()]),n}createHider(e){const r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!_e(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.className="wtHider",r&&r.insertBefore(n,e),n.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Pe(n,[Xo()]),n}createHolder(e){const r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!_e(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.style.position="relative",n.className="wtHolder",Pe(n,[Ya(-1)]),r&&r.insertBefore(n,e),this.isMaster&&(n.parentNode.className+="ht_master handsontable",n.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&Pe(n.parentNode,[Xo()])),n.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Pe(n,[Xo()]),n}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:r}=this,{wtOverlays:n,wtViewport:i}=this.dataAccessObject,o=r.getSetting("totalRows"),s=r.getSetting("totalColumns"),a=r.getSetting("rowHeaders"),l=a.length,u=r.getSetting("columnHeaders"),c=u.length;let h=e;if(this.isMaster&&(n.beforeDraw(),this.holderOffset=kr(this.holder),h=i.createCalculators(h),l&&!r.getSetting("fixedColumnsStart"))){const f=n.inlineStartOverlay.getScrollPosition(),g=this.correctHeaderWidth;this.correctHeaderWidth=f!==0,g!==this.correctHeaderWidth&&(h=!1)}if(h)this.isMaster&&n.refresh(!0);else{this.isMaster?this.tableOffset=kr(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const f=Math.max(this.getFirstRenderedRow(),0),g=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new _X(f,o,c),this.columnFilter=new RX(g,s,l);let w=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const v={};this.wtSettings.getSetting("beforeDraw",!0,v),w=v.skipRender!==!0}w&&(this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(lo)||this.is(qs))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render(),this.isMaster&&this.markOversizedColumnHeaders(),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(lo))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||i.createVisibleCalculators(),n.refresh(!1),n.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(lo)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize())}let d=!1;return this.isMaster&&(d=n.topOverlay.resetFixedPosition(),n.bottomOverlay.clone&&(d=n.bottomOverlay.resetFixedPosition()||d),d=n.inlineStartOverlay.resetFixedPosition()||d,n.topInlineStartCornerOverlay&&n.topInlineStartCornerOverlay.resetFixedPosition(),n.bottomInlineStartCornerOverlay&&n.bottomInlineStartCornerOverlay.clone&&n.bottomInlineStartCornerOverlay.resetFixedPosition()),d?(n.refreshAll(),n.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(h),this.isMaster&&n.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const r=this.columnFilter.renderedToSource(e);let n=this.wtSettings.getSetting("columnHeaders").length;const i=this.dataAccessObject.stylesHandler.getDefaultRowHeight();let o,s,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;n;)n-=1,o=this.getColumnHeaderHeight(n),s=this.getColumnHeader(r,n),s&&(a=Oh(s),(!o&&i<a||o<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=a),Array.isArray(l)?l[n]!==null&&l[n]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l[n]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]<(l[n]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l[n]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,r=this.THEAD.childNodes,n=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let o=0,s=i.length;o<s;o++)if(n[o]){if(!r[o]||r[o].childNodes.length===0)return;r[o].childNodes[0].style.height=`${n[o]}px`}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:r}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(lo))&&!e.getSetting("externalRowCalculator")){const n=this.getRenderedRowsCount();for(let i=0;i<n;i++){const o=this.rowFilter.renderedToSource(i);r.oversizedRows&&r.oversizedRows[o]&&(r.oversizedRows[o]=void 0)}}}getCell(e){let r=e.row,n=e.col;const i=this.wtSettings.getSetting("onModifyGetCellCoords",r,n,!this.isMaster,"render");if(i&&Array.isArray(i)&&([r,n]=i),this.isRowBeforeRenderedRows(r))return-1;if(this.isRowAfterRenderedRows(r))return-2;if(this.isColumnBeforeRenderedColumns(n))return-3;if(this.isColumnAfterRenderedColumns(n))return-4;const o=this.getRow(r);if(!o&&r>=0)throw new Error("TR was expected to be rendered but is not");const s=o.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(n)];if(!s&&n>=0)throw new Error("TD or TH was expected to be rendered but is not");return s}getRow(e){let r=null,n=null;if(e<0){var i;r=(i=this.rowFilter)===null||i===void 0?void 0:i.sourceRowToVisibleColHeadedRow(e),n=this.THEAD}else{var o;r=(o=this.rowFilter)===null||o===void 0?void 0:o.sourceToRendered(e),n=this.TBODY}return r!==void 0&&n!==void 0?n.childNodes.length<r+1?!1:n.childNodes[r]:!1}getColumnHeader(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.THEAD.childNodes[r];return n==null?void 0:n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const r=[],n=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(i=>{const o=i.childNodes[n];o&&r.push(o)}),r}getRowHeader(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.wtSettings.getSetting("rowHeaders").length;if(r>=n)return;const i=this.rowFilter.sourceToRendered(e),o=i<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):i,a=(i<0?this.THEAD:this.TBODY).childNodes[o];return a==null?void 0:a.childNodes[r]}getRowHeaders(e){const r=[],n=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<n;i++){const o=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],s=o==null?void 0:o.childNodes[i];s&&r.push(s)}return r}getCoords(e){let r=e;if(r.nodeName!=="TD"&&r.nodeName!=="TH"&&(r=qa(r,["TD","TH"])),r===null)return null;const n=r.parentNode;if(!n)return null;const i=n.parentNode;let o=s3(n),s=r.cellIndex;Xa(sl,r,this.wtRootElement)||Xa(il,r,this.wtRootElement)?i.nodeName==="THEAD"&&(o-=i.childNodes.length):Xa(qs,r,this.wtRootElement)||Xa(lo,r,this.wtRootElement)?o=this.wtSettings.getSetting("totalRows")-i.childNodes.length+o:i===this.THEAD?o=this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter&&(o=this.rowFilter.renderedToSource(o)),Xa(sl,r,this.wtRootElement)||Xa(ol,r,this.wtRootElement)||Xa(qs,r,this.wtRootElement)?s=this.columnFilter.offsettedTH(s):this.columnFilter&&(s=this.columnFilter.visibleRowHeadedColumnToSourceColumn(s));const a=this.wtSettings.getSetting("onModifyGetCoordsElement",o,s);return a&&Array.isArray(a)&&([o,s]=a),this.wot.createCellCoords(o,s)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const r=e*this.dataAccessObject.stylesHandler.getDefaultRowHeight(),n=Oh(this.TBODY)-1,i=this.wot.stylesHandler.areCellsBorderBox(),o=i?dr:Oh,s=i?0:1,a=i?1:0;let l,u,c,h,d;if(!(r===n&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;){e-=1,c=this.rowFilter.renderedToSource(e),l=this.getRowHeight(c),h=this.getTrForRow(c),d=h.querySelector("th");const f=c===0?a:0;d?u=o(d):u=o(h)-s,(!l&&this.dataAccessObject.stylesHandler.getDefaultRowHeight()<u-f||l<u)&&(i||(u+=1),this.dataAccessObject.wtViewport.oversizedRows[c]=u)}}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const n=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=n}isRowHeaderRendered(e){if(e>=0)return!1;const n=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=n}isRowBeforeRenderedRows(e){const r=this.getFirstRenderedRow();return e<0&&r<=0?!this.isRowHeaderRendered(e):e<r}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const r=this.getFirstRenderedColumn();return e<0&&r<=0?!this.isColumnHeaderRendered(e):e<r}isColumnAfterRenderedColumns(e){return this.columnFilter&&e>this.getLastRenderedColumn()}isColumnAfterViewport(e){return this.columnFilter&&e>this.getLastVisibleColumn()}isRowAfterViewport(e){return this.rowFilter&&e>this.getLastVisibleRow()}isColumnBeforeViewport(e){return this.columnFilter&&this.columnFilter.sourceToRendered(e)<0&&e>=0}isLastRowFullyVisible(){return this.getLastVisibleRow()===this.getLastRenderedRow()}isLastColumnFullyVisible(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()}allRowsInViewport(){return this.wtSettings.getSetting("totalRows")===this.getVisibleRowsCount()}allColumnsInViewport(){return this.wtSettings.getSetting("totalColumns")===this.getVisibleColumnsCount()}getRowHeight(e){return this.rowUtils.getHeight(e)}getColumnHeaderHeight(e){return this.columnUtils.getHeaderHeight(e)}getColumnWidth(e){return this.columnUtils.getWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return ir(this.TABLE)}getHeight(){return dr(this.TABLE)}getTotalWidth(){const e=ir(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=dr(this.hider);return e!==0?e:this.getHeight()}isVisible(){return Ou(this.TABLE)}_modifyRowHeaderWidth(e){let r=ht(e)?e():null;return Array.isArray(r)?(r=[...r],r[r.length-1]=this._correctRowHeaderWidth(r[r.length-1])):r=this._correctRowHeaderWidth(r),r}_correctRowHeaderWidth(e){let r=e;return typeof e!="number"&&(r=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(r+=1),r}}const C6="stickyRowsBottom",aR={getFirstRenderedRow(){const t=this.getRenderedRowsCount();return t===0?-1:this.wtSettings.getSetting("totalRows")-t},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()===0?-1:this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsBottom"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};Qo(aR,"MIXIN_NAME",C6,{writable:!1,enumerable:!1});const b6="stickyColumnsStart",tm={getFirstRenderedColumn(){return this.getRenderedColumnsCount()===0?-1:0},getFirstVisibleColumn(){return this.getFirstRenderedColumn()},getFirstPartiallyVisibleColumn(){return this.getFirstRenderedColumn()},getLastRenderedColumn(){return this.getRenderedColumnsCount()-1},getLastVisibleColumn(){return this.getLastRenderedColumn()},getLastPartiallyVisibleColumn(){return this.getLastRenderedColumn()},getRenderedColumnsCount(){return Math.min(this.wtSettings.getSetting("totalColumns"),this.wtSettings.getSetting("fixedColumnsStart"))},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};Qo(tm,"MIXIN_NAME",b6,{writable:!1,enumerable:!1});class lR extends Vu{constructor(e,r,n,i){super(e,r,n,i,qs)}}wt(lR,aR),wt(lR,tm);const il="top",lo="bottom",ol="inline_start",sl="top_inline_start_corner",qs="bottom_inline_start_corner",mD=[il,lo,ol,sl,qs],S6=new Map([[il,`ht_clone_${il}`],[lo,`ht_clone_${lo}`],[ol,`ht_clone_${ol} ht_clone_left`],[sl,`ht_clone_${sl} ht_clone_top_left_corner`],[qs,`ht_clone_${qs} ht_clone_bottom_left_corner`]]);function R6(t,e){E6(t,e),e.add(t)}function E6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function T6(t,e,r){return(e=_6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _6(t){var e=M6(t,"string");return typeof e=="symbol"?e:e+""}function M6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rm(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Yh=new WeakSet;class P6{constructor(e){R6(this,Yh),T6(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,r,n){if(e.col<0||e.row<0)return!1;const i=this.scrollViewportHorizontally(e.col,r),o=this.scrollViewportVertically(e.row,n);return i||o}scrollViewportHorizontally(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:n,totalColumns:i}=this.dataAccessObject;if(!n)return!1;const o=xn(r);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e,o),!Number.isInteger(e)||e<0||e>i)return!1;r=o.value;const{fixedColumnsStart:s,inlineStartOverlay:a}=this.dataAccessObject,l=r==="auto";if(l&&e<s)return!1;const u=this.getFirstVisibleColumn(),c=this.getLastVisibleColumn();let h=!1;return(l&&(e<u||e>c)||!l)&&(h=a.scrollTo(e,l?e>=this.getLastPartiallyVisibleColumn():r==="end")),h}scrollViewportVertically(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:n,totalRows:i}=this.dataAccessObject;if(!n)return!1;const o=xn(r);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e,o),!Number.isInteger(e)||e<0||e>i)return!1;r=o.value;const{fixedRowsBottom:s,fixedRowsTop:a,topOverlay:l}=this.dataAccessObject,u=r==="auto";if(u&&(e<a||e>i-s-1))return!1;const c=this.getFirstVisibleRow(),h=this.getLastVisibleRow();let d=!1;return(u&&(e<c||e>h)||!u)&&(d=l.scrollTo(e,u?e>=this.getLastPartiallyVisibleRow():r==="bottom")),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return rm(Yh,this,wD).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return rm(Yh,this,wD).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return rm(Yh,this,pD).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return rm(Yh,this,pD).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function pD(t){const{wtSettings:e,inlineStartOverlay:r,wtTable:n,wtViewport:i,totalColumns:o,rootWindow:s}=this.dataAccessObject;if(r.mainTableScrollableElement===s){const a=e.getSetting("rtlMode");let l=null;if(a){const c=n.TABLE.getBoundingClientRect(),d=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;l=Math.abs(c.right-d)}else l=kr(n.wtRootElement).left;const u=Math.abs(xH(s,s));if(l>u){const c=AH(s);let h=i.getRowHeaderWidth();for(let d=1;d<=o;d++)if(h+=r.sumCellSizes(d-1,d),l+h-u>=c){t=d-2;break}}}return t}function wD(t){const{topOverlay:e,wtTable:r,wtViewport:n,totalRows:i,rootWindow:o}=this.dataAccessObject;if(e.mainTableScrollableElement===o){const s=kr(r.wtRootElement),a=wS(o,o);if(s.top>a){const l=Oh(o);let u=n.getColumnHeaderHeight();for(let c=1;c<=i;c++)if(u+=e.sumCellSizes(c-1,c),s.top+u-a>=l){t=c-2;break}}}return t}function si(t,e,r){return(e=I6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I6(t){var e=O6(t,"string");return typeof e=="symbol"?e:e+""}function O6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class uR{get eventManager(){return new Pi(this)}constructor(e,r){si(this,"wtTable",void 0),si(this,"wtScroll",void 0),si(this,"wtViewport",void 0),si(this,"wtOverlays",void 0),si(this,"selectionManager",void 0),si(this,"wtEvent",void 0),si(this,"guid",`wt_${mH()}`),si(this,"drawInterrupted",!1),si(this,"drawn",!1),si(this,"activeOverlayName","master"),si(this,"domBindings",void 0),si(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=r,this.wtScroll=new P6(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let r=0,n=this.wtTable.THEAD.childNodes[0].childNodes.length;r<n;r++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[r].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(r,n){Za(n,e[r])}])}}createCellCoords(e,r){return new rl(e,r,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,r,n){return new Bh(e,r,n,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.drawInterrupted=!1,!this.wtTable.isVisible()||l3(this.wtTable.wtRootElement.parentNode)?this.drawInterrupted=!0:this.wtTable.draw(e),this}getCell(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1))return this.wtTable.getCell(e);const n=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),o=this.wtSettings.getSetting("fixedRowsBottom"),s=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<s)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<s&&e.row>=n-o){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<s)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<n&&e.row>=n-o&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,r,n){return this.wtScroll.scrollViewport(e,r,n)}scrollViewportHorizontally(e,r){return this.wtScroll.scrollViewportHorizontally(e,r)}scrollViewportVertically(e,r){return this.wtScroll.scrollViewportVertically(e,r)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get stylesHandler(){return e.stylesHandler},get drawn(){return e.drawn},set drawn(r){e.drawn=r},get wtTable(){return e.wtTable},get startColumnRendered(){return e.wtViewport.columnsRenderCalculator.startColumn},get startColumnVisible(){return e.wtViewport.columnsVisibleCalculator.startColumn},get startColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.startColumn},get endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.endColumn},get endColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.endColumn},get countColumnsRendered(){return e.wtViewport.columnsRenderCalculator.count},get countColumnsVisible(){return e.wtViewport.columnsVisibleCalculator.count},get startRowRendered(){return e.wtViewport.rowsRenderCalculator.startRow},get startRowVisible(){return e.wtViewport.rowsVisibleCalculator.startRow},get startRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.startRow},get endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.endRow},get endRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.endRow},get countRowsRendered(){return e.wtViewport.rowsRenderCalculator.count},get countRowsVisible(){return e.wtViewport.rowsVisibleCalculator.count},get columnHeaders(){return e.wtSettings.getSetting("columnHeaders")},get rowHeaders(){return e.wtSettings.getSetting("rowHeaders")}}}}function vD(t,e,r){return(e=x6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x6(t){var e=A6(t,"string");return typeof e=="symbol"?e:e+""}function A6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class H6 extends uR{constructor(e,r,n){super(e,r),vD(this,"cloneSource",void 0),vD(this,"cloneOverlay",void 0);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=n.source,this.cloneOverlay=n.overlay,this.stylesHandler=n.stylesHandler,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=n.viewport,this.selectionManager=n.selectionManager,this.wtEvent=new tD(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,n.event),this.findOriginalHeaders()}}function N6(t,e,r){return(e=D6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D6(t){var e=k6(t,"string");return typeof e=="symbol"?e:e+""}function k6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Gh{constructor(e,r,n,i,o){N6(this,"wtSettings",null),Qo(this,"wot",e,{writable:!1}),this.domBindings=o,this.facadeGetter=r,this.wtSettings=i;const{TABLE:s,hider:a,spreader:l,holder:u,wtRootElement:c}=this.wot.wtTable;this.instance=this.wot,this.type=n,this.mainTableScrollableElement=null,this.TABLE=s,this.hider=a,this.spreader=l,this.holder=u,this.wtRootElement=c,this.trimmingContainer=Ih(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.clone=this.makeClone()}hasRenderingStateChanged(){return this.needFullRender!==this.shouldBeRendered()}updateStateOfRendering(e){e==="before"&&this.shouldBeRendered()?this.needFullRender=!0:e==="after"&&!this.shouldBeRendered()&&(this.needFullRender=!1)}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=Ih(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:r}=this.domBindings;r.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=Dg(e.TABLE)}getRelativeCellPosition(e,r,n){if(this.clone.wtTable.holder.contains(e)===!1){st(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,o=n<this.wtSettings.getSetting("fixedColumnsStart"),s=r<this.wtSettings.getSetting("fixedRowsTop"),a=r>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,u={start:this.getRelativeStartPosition(l),top:l.offsetTop},c={start:this.getRelativeStartPosition(e),top:e.offsetTop};let h=null;return i?h=this.getRelativeCellPositionWithinWindow(s,o,c,u):h=this.getRelativeCellPositionWithinHolder(s,a,o,c,u),h}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,r,n,i){const o=this.wot.wtTable.wtRootElement.getBoundingClientRect();let s=0,a=0;if(!r)s=i.start;else{let l=o.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(o.left+o.width+_r())),s=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-o.top:a=i.top,{start:n.start+s,top:n.top+a}}getRelativeCellPositionWithinHolder(e,r,n,i,o){const s={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(n||(a=s.horizontal-o.start),r){const u=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+u.top}else e||(l=s.vertical-o.top);return{start:i.start-a,top:i.top-l}}makeClone(){if(mD.indexOf(this.type)===-1)throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,o=n.createElement("div"),s=n.createElement("table"),a=e.wtRootElement.parentNode;o.className=`${S6.get(this.type)} handsontable`,o.setAttribute("dir",this.isRtl()?"rtl":"ltr"),o.style.position="absolute",o.style.top=0,o.style.overflow="visible",this.isRtl()?o.style.right=0:o.style.left=0,r.getSetting("ariaTags")&&Pe(o,[Xo()]),s.className=e.TABLE.className,e.TABLE.getAttribute("role")&&s.setAttribute("role",e.TABLE.getAttribute("role")),o.appendChild(s),a.appendChild(o);const u=this.wtSettings.getSetting("preventOverflow");return u===!0||u==="horizontal"&&this.type===il||u==="vertical"&&this.type===ol?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=Dg(e.TABLE),new H6(s,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager,stylesHandler:this.wot.stylesHandler})}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.needFullRender){const r=this.clone.cloneSource;r.activeOverlayName=this.clone.wtTable.name,this.clone.draw(e),r.activeOverlayName="master"}}reset(){const e=this.clone.wtTable.holder,r=this.clone.wtTable.hider,n=e.style,i=r.style,o=e.parentNode.style;[n,i,o].forEach(s=>{s.width="",s.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class L6 extends Gh{constructor(e,r,n,i,o,s){super(e,r,qs,n,i),this.bottomOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new lR(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wot:e}=this;if(this.updateTrimmingContainer(),!e.wtTable.holder.parentNode)return!1;const r=this.clone.wtTable.holder.parentNode;if(r.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const o=this.inlineStartOverlay.getOverlayOffset(),s=this.bottomOverlay.getOverlayOffset();r.style[this.isRtl()?"right":"left"]=`${o}px`,r.style.bottom=`${s}px`}else $g(r),this.repositionOverlay();let n=dr(this.clone.wtTable.TABLE);const i=ir(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),r.style.height=`${n}px`,r.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;r.hasVerticalScroll()||(o+=r.getWorkspaceHeight()-e.getTotalHeight()),r.hasVerticalScroll()&&r.hasHorizontalScroll()&&(o+=_r(n)),i.style.bottom=`${o}px`}}const $6="calculatedColumns",nm={getFirstRenderedColumn(){const t=this.dataAccessObject.startColumnRendered;return t===null?-1:t},getFirstVisibleColumn(){const t=this.dataAccessObject.startColumnVisible;return t===null?-1:t},getFirstPartiallyVisibleColumn(){const t=this.dataAccessObject.startColumnPartiallyVisible;return t===null?-1:t},getLastRenderedColumn(){const t=this.dataAccessObject.endColumnRendered;return t===null?-1:t},getLastVisibleColumn(){const t=this.dataAccessObject.endColumnVisible;return t===null?-1:t},getLastPartiallyVisibleColumn(){const t=this.dataAccessObject.endColumnPartiallyVisible;return t===null?-1:t},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};Qo(nm,"MIXIN_NAME",$6,{writable:!1,enumerable:!1});class cR extends Vu{constructor(e,r,n,i){super(e,r,n,i,lo)}}wt(cR,aR),wt(cR,nm);function F6(t,e,r){return(e=V6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function V6(t){var e=W6(t,"string");return typeof e=="symbol"?e:e+""}function W6(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class B6 extends Gh{constructor(e,r,n,i){super(e,r,lo,n,i),F6(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new cR(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,r=this.clone.wtTable.holder.parentNode;r.style.top="";let n=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(n=this.getOverlayOffset(),r.style.bottom=`${n}px`):(n=this.getScrollPosition(),this.repositionOverlay());const o=this.adjustHeaderBordersPosition(n);return this.adjustElementsSize(),o}repositionOverlay(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;r.hasVerticalScroll()||(o+=r.getWorkspaceHeight()-e.getTotalHeight()),r.hasVerticalScroll()&&r.hasHorizontalScroll()&&(o+=_r(n)),i.style.bottom=`${o}px`}setScrollPosition(e){const{rootWindow:r}=this.domBindings,n=this.mainTableScrollableElement;let i=!1;if(n===r&&e!==r.scrollY){const o=r.scrollY;r.scrollTo(pS(r),top),i=o!==r.scrollY}else if(e!==n.scrollTop){const o=n.scrollTop;n.scrollTop=e,i=o!==n.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,r){const{wtTable:n,stylesHandler:i}=this.wot,o=i.getDefaultRowHeight();let s=e,a=0;for(;s<r;){const l=n.getRowHeight(s);a+=l===void 0?o:l,s+=1}return a}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=r.getWorkspaceWidth();r.hasVerticalScroll()&&(u-=_r(n)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=dr(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=e.parentNode.style.height}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:r}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?r.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:r.style[e]=""}scrollTo(e,r){let n=this.getTableParentOffset();const o=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let s=0;r&&o.offsetHeight!==o.clientHeight&&(s=_r(this.domBindings.rootDocument)),r?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight(),n+=1):n+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),n+=s,this.setScrollPosition(n)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return wS(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o,a=this.domBindings.rootDocument.documentElement.clientHeight;n=Math.max(this.getTableParentOffset()-this.getScrollPosition()-a+i,0),n>s&&(n=0)}return n}adjustHeaderBordersPosition(e){const r=this.wtSettings.getSetting("fixedRowsBottom"),n=this.cachedFixedRowsBottom!==r,i=this.wtSettings.getSetting("columnHeaders");let o=!1;if((n||r===0)&&i.length>0){const s=this.wot.wtTable.holder.parentNode,a=_e(s,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(oe(s,"innerBorderBottom"),o=!a):(Ee(s,"innerBorderBottom"),o=a)}return o}}const j6="calculatedRows",hR={getFirstRenderedRow(){const t=this.dataAccessObject.startRowRendered;return t===null?-1:t},getFirstVisibleRow(){const t=this.dataAccessObject.startRowVisible;return t===null?-1:t},getFirstPartiallyVisibleRow(){const t=this.dataAccessObject.startRowPartiallyVisible;return t===null?-1:t},getLastRenderedRow(){const t=this.dataAccessObject.endRowRendered;return t===null?-1:t},getLastVisibleRow(){const t=this.dataAccessObject.endRowVisible;return t===null?-1:t},getLastPartiallyVisibleRow(){const t=this.dataAccessObject.endRowPartiallyVisible;return t===null?-1:t},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};Qo(hR,"MIXIN_NAME",j6,{writable:!1,enumerable:!1});class dR extends Vu{constructor(e,r,n,i){super(e,r,n,i,ol)}}wt(dR,hR),wt(dR,tm);const U6="localHooks",Ar={_localHooks:Object.create(null),addLocalHook(t,e){return this._localHooks[t]||(this._localHooks[t]=[]),this._localHooks[t].push(e),this},runLocalHooks(t,e,r,n,i,o,s){if(this._localHooks[t]){const a=this._localHooks[t].length;for(let l=0;l<a;l++)CS(this._localHooks[t][l],this,e,r,n,i,o,s)}},clearLocalHooks(){return this._localHooks={},this}};Qo(Ar,"MIXIN_NAME",U6,{writable:!1,enumerable:!1});let yD=class{constructor(e,r){this.settings=e,this.cellRange=r||null}isEmpty(){return this.cellRange===null}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,r){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=r,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=r,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),r=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,r.row,r.col]}destroy(){this.runLocalHooks("destroy")}};wt(yD,Ar);const CD="active-header",fR="header",gR="area",qh="focus",z6="fill",Y6="row",G6="column",q6="custom-selection",mR=t=>{const e=t.stylesHandler;if(e.isClassicTheme())return Object.freeze({width:6,height:6,borderWidth:1,borderStyle:"solid",borderColor:"#FFF"});const r=e.getCSSVariableValue("cell-autofill-size"),n=e.getCSSVariableValue("cell-autofill-border-width"),i=e.getCSSVariableValue("cell-autofill-border-color");return Object.freeze({width:r,height:r,borderWidth:n,borderStyle:"solid",borderColor:i})};var bD={},SD;function K6(){if(SD)return bD;SD=1;var t=zg();return t("flat"),bD}K6();function X6(t,e){ED(t,e),e.add(t)}function RD(t,e,r){ED(t,e),e.set(t,r)}function ED(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vt(t,e){return t.get(Kh(t,e))}function TD(t,e,r){return t.set(Kh(t,e),r),r}function Kh(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var xi=new WeakMap,Lr=new WeakMap,im=new WeakSet;class Z6{constructor(){X6(this,im),RD(this,xi,void 0),RD(this,Lr,void 0)}setActiveOverlay(e){return TD(Lr,this,e),this}setActiveSelection(e){return TD(xi,this,e),this}scan(){const e=Vt(xi,this).settings.selectionType,r=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n))):e==="area"?this.scanCellsRange(n=>r.add(n)):e==="focus"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n)),this.scanCellsRange(n=>r.add(n))):e==="fill"?this.scanCellsRange(n=>r.add(n)):e==="header"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n))):e==="row"?(this.scanRowsInHeadersRange(n=>r.add(n)),this.scanRowsInCellsRange(n=>r.add(n))):e==="column"&&(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanColumnsInCellsRange(n=>r.add(n))),r}scanColumnsInHeadersRange(e){const[r,n,i,o]=Vt(xi,this).getCorners(),{wtTable:s}=Vt(Lr,this),a=s.getRenderedColumnsCount(),l=s.getColumnHeadersCount();let u=0;for(let c=-s.getRowHeadersCount();c<a;c++){const h=s.columnFilter.renderedToSource(c);if(!(h<n||h>o)){for(let d=-l;d<0;d++){if(d<r||d>i)continue;const f=d+l;let g=s.getColumnHeader(h,f);const w=Vt(Lr,this).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:Vt(xi,this).settings.selectionType,columnCursor:u,selectionWidth:o-n+1});w!==null&&(w!==h&&(g=s.getColumnHeader(w,f)),e(g))}u+=1}}}scanRowsInHeadersRange(e){const[r,n,i,o]=Vt(xi,this).getCorners(),{wtTable:s}=Vt(Lr,this),a=s.getRenderedRowsCount(),l=s.getRowHeadersCount();let u=0;for(let c=-s.getColumnHeadersCount();c<a;c++){const h=s.rowFilter.renderedToSource(c);if(!(h<r||h>i)){for(let d=-l;d<0;d++){if(d<n||d>o)continue;const f=d+l;let g=s.getRowHeader(h,f);const w=Vt(Lr,this).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:Vt(xi,this).settings.selectionType,rowCursor:u,selectionHeight:i-r+1});w!==null&&(w!==h&&(g=s.getRowHeader(w,f)),e(g))}u+=1}}}scanCellsRange(e){const{wtTable:r}=Vt(Lr,this);Kh(im,this,J6).call(this,(n,i)=>{const o=r.getCell(Vt(Lr,this).createCellCoords(n,i)),s=Vt(Lr,this).getSetting("onAfterDrawSelection",n,i,Vt(xi,this).settings.layerLevel);typeof s=="string"&&oe(o,s),e(o)})}scanRowsInCellsRange(e){const[r,,n]=Vt(xi,this).getCorners(),{wtTable:i}=Vt(Lr,this);Kh(im,this,_D).call(this,(o,s)=>{if(o>=r&&o<=n){const a=i.getCell(Vt(Lr,this).createCellCoords(o,s));e(a)}})}scanColumnsInCellsRange(e){const[,r,,n]=Vt(xi,this).getCorners(),{wtTable:i}=Vt(Lr,this);Kh(im,this,_D).call(this,(o,s)=>{if(s>=r&&s<=n){const a=i.getCell(Vt(Lr,this).createCellCoords(o,s));e(a)}})}}function J6(t){let[e,r,n,i]=Vt(xi,this).getCorners();if(e<0&&n<0||r<0&&i<0)return;const{wtTable:o}=Vt(Lr,this),s=e!==n||r!==i;if(r=Math.max(r,0),i=Math.max(i,0),e=Math.max(e,0),n=Math.max(n,0),s){if(r=Math.max(r,o.getFirstRenderedColumn()),i=Math.min(i,o.getLastRenderedColumn()),e=Math.max(e,o.getFirstRenderedRow()),n=Math.min(n,o.getLastRenderedRow()),i<r||n<e)return}else{const a=o.getCell(Vt(Lr,this).createCellCoords(e,r));if(!Jo(a))return}for(let a=e;a<=n;a+=1)for(let l=r;l<=i;l+=1)t(a,l)}function _D(t){const{wtTable:e}=Vt(Lr,this),r=e.getRenderedRowsCount(),n=e.getRenderedColumnsCount();for(let i=0;i<r;i+=1){const o=e.rowFilter.renderedToSource(i);for(let s=0;s<n;s+=1)t(o,e.columnFilter.renderedToSource(s))}}class MD{constructor(e,r){r&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=r,this.mouseDown=!1,this.main=null,this.top=null,this.bottom=null,this.start=null,this.end=null,this.topStyle=null,this.bottomStyle=null,this.startStyle=null,this.endStyle=null,this.cornerDefaultStyle=mR(this.instance),this.cornerCenterPointOffset=-Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(r),this.registerListeners())}registerListeners(){const e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",()=>this.onMouseDown()),this.eventManager.addEventListener(e,"mouseup",()=>this.onMouseUp());for(let r=0,n=this.main.childNodes.length;r<n;r++){const i=this.main.childNodes[r];this.eventManager.addEventListener(i,"mouseenter",o=>this.onMouseEnter(o,this.main.childNodes[r]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,r){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),_i(e);const n=this,i=this.wot.rootDocument.body,o=r.getBoundingClientRect();r.style.display="none";function s(l){if(l.clientY<Math.floor(o.top)||l.clientY>Math.ceil(o.top+o.height)||l.clientX<Math.floor(o.left)||l.clientX>Math.ceil(o.left+o.width))return!0}function a(l){s(l)&&(n.eventManager.removeEventListener(i,"mousemove",a),r.style.display="block")}this.eventManager.addEventListener(i,"mousemove",a)}createBorders(e){const{rootDocument:r}=this.wot;this.main=r.createElement("div");const n=["top","start","bottom","end","corner"];let i=this.main.style;i.position="absolute",i.top=0,i.left=0;for(let a=0;a<5;a++){const l=n[a],u=r.createElement("div");u.className=`wtBorder ${this.settings.className||""}`,this.settings[l]&&this.settings[l].hide&&(u.className+=" hidden"),i=u.style,i.backgroundColor=this.settings[l]&&this.settings[l].color?this.settings[l].color:e.border.color,i.height=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,i.width=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,this.main.appendChild(u)}this.top=this.main.childNodes[0],this.start=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.end=this.main.childNodes[3],this.topStyle=this.top.style,this.startStyle=this.start.style,this.bottomStyle=this.bottom.style,this.endStyle=this.end.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=`${this.cornerDefaultStyle.width}px`,this.cornerStyle.height=`${this.cornerDefaultStyle.height}px`,this.cornerStyle.border=[`${this.cornerDefaultStyle.borderWidth}px`,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),es()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:o}=this.wot;let s=o.bordersHolder;s||(s=r.createElement("div"),s.className="htBorders",o.bordersHolder=s,o.spreader.appendChild(s)),s.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:e,stylesHandler:r}=this.wot,n=r.getCSSVariableValue("cell-mobile-handle-size"),i=r.getCSSVariableValue("cell-mobile-handle-border-radius"),o=r.getCSSVariableValue("cell-mobile-handle-background-color"),s=r.getCSSVariableValue("cell-mobile-handle-border-width"),a=r.getCSSVariableValue("cell-mobile-handle-border-color");this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};const l=10,u=40;this.selectionHandles.top.className="topSelectionHandle topLeftSelectionHandle",this.selectionHandles.topHitArea.className="topSelectionHandle-HitArea topLeftSelectionHandle-HitArea",this.selectionHandles.bottom.className="bottomSelectionHandle bottomRightSelectionHandle",this.selectionHandles.bottomHitArea.className="bottomSelectionHandle-HitArea bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={top:this.selectionHandles.top.style,topHitArea:this.selectionHandles.topHitArea.style,bottom:this.selectionHandles.bottom.style,bottomHitArea:this.selectionHandles.bottomHitArea.style};const c={position:"absolute",height:`${u}px`,width:`${u}px`,"border-radius":`${parseInt(u/1.5,10)}px`};Fe(c,(d,f)=>{this.selectionHandles.styles.bottomHitArea[f]=d,this.selectionHandles.styles.topHitArea[f]=d});const h=r.isClassicTheme()?{position:"absolute",height:`${l}px`,width:`${l}px`,"border-radius":`${parseInt(l/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"}:{position:"absolute",height:`${n}px`,width:`${n}px`,"border-radius":`${i}px`,background:`${o}`,border:`${s}px solid ${a}`};Fe(h,(d,f)=>{this.selectionHandles.styles.bottom[f]=d,this.selectionHandles.styles.top[f]=d}),this.main.appendChild(this.selectionHandles.top),this.main.appendChild(this.selectionHandles.bottom),this.main.appendChild(this.selectionHandles.topHitArea),this.main.appendChild(this.selectionHandles.bottomHitArea)}isPartRange(e,r){const n=this.wot.selectionManager.getAreaSelection();return!!(n.cellRange&&(e!==n.cellRange.to.row||r!==n.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,r,n,i,o,s){const l=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:u,topHitArea:c,bottom:h,bottomHitArea:d}=this.selectionHandles.styles,f=parseInt(u.borderWidth,10),g=parseInt(u.width,10),w=parseInt(c.width,10),v=this.wot.wtTable.getWidth(),b=this.wot.wtTable.getHeight();u.top=`${parseInt(n-g-1,10)}px`,u[l]=`${parseInt(i-g-1,10)}px`,c.top=`${parseInt(n-w/4*3,10)}px`,c[l]=`${parseInt(i-w/4*3,10)}px`;const p=Math.min(parseInt(i+o,10),v-g-f*2),_=Math.min(parseInt(i+o-w/4,10),v-w-f*2);h[l]=`${p}px`,d[l]=`${_}px`;const O=Math.min(parseInt(n+s,10),b-g-f*2),T=Math.min(parseInt(n+s-w/4,10),b-w-f*2);h.top=`${O}px`,d.top=`${T}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(u.display="block",c.display="block",this.isPartRange(e,r)?(h.display="none",d.display="none"):(h.display="block",d.display="block")):(u.display="none",h.display="none",c.display="none",d.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||r===this.wot.wtSettings.getSetting("fixedColumnsStart")?(u.zIndex="9999",c.zIndex="9999"):(u.zIndex="",c.zIndex="")}appear(e){if(this.disabled)return;let[r,n,i,o]=e;if(r<0&&i<0||n<0&&o<0){this.disappear();return}const{wtTable:s,rootDocument:a,rootWindow:l}=this.wot,u=r!==i||n!==o,c=s.getFirstRenderedRow(),h=s.getLastRenderedRow(),d=s.getFirstRenderedColumn(),f=s.getLastRenderedColumn();if(d<0&&f<0||c<0&&h<0){this.disappear();return}let g;if(u){if(n=Math.max(n,d),o=Math.min(o,f),r=Math.max(r,c),i=Math.min(i,h),o<n||i<r){this.disappear();return}g=s.getCell(this.wot.createCellCoords(r,n))}else if(g=s.getCell(this.wot.createCellCoords(r,n)),!Jo(g)){this.disappear();return}const w=u?s.getCell(this.wot.createCellCoords(i,o)):g,v=kr(g),b=u?kr(w):v,p=kr(s.TABLE),_=v.top,O=v.left,T=this.wot.wtSettings.getSetting("rtlMode");let M=0,P=0;if(T){const ee=ir(s.TABLE),te=ir(g),ae=l.innerWidth-p.left-ee;P=O+te-b.left,M=l.innerWidth-O-te-ae-1}else P=b.left+ir(w)-O,M=O-p.left-1;if(this.isEntireColumnSelected(r,i)){const ee=r,te=this.getDimensionsFromHeader("columns",n,o,ee,p);let ae=null;te&&([ae,M,P]=te),ae&&(g=ae)}let G=_-p.top-1,j=b.top+dr(w)-_;if(this.isEntireRowSelected(n,o)){const ee=n,te=this.getDimensionsFromHeader("rows",r,i,ee,p);let ae=null;te&&([ae,G,j]=te),ae&&(g=ae)}const A=l.getComputedStyle(g);parseInt(A.borderTopWidth,10)>0&&(G+=1,j=j>0?j-1:0),parseInt(A[T?"borderRightWidth":"borderLeftWidth"],10)>0&&(M+=1,P=P>0?P-1:0);const q=T?"right":"left";this.topStyle.top=`${G}px`,this.topStyle[q]=`${M}px`,this.topStyle.width=`${P}px`,this.topStyle.display="block",this.startStyle.top=`${G}px`,this.startStyle[q]=`${M}px`,this.startStyle.height=`${j}px`,this.startStyle.display="block";const Q=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${G+j-Q}px`,this.bottomStyle[q]=`${M}px`,this.bottomStyle.width=`${P}px`,this.bottomStyle.display="block",this.endStyle.top=`${G}px`,this.endStyle[q]=`${M+P-Q}px`,this.endStyle.height=`${j+1}px`,this.endStyle.display="block";let ue=this.settings.border.cornerVisible;ue=typeof ue=="function"?ue(this.settings.layerLevel):ue;const J=this.wot.getSetting("onModifyGetCellCoords",i,o,!1,"render");let[Z,ie]=[i,o];if(J&&Array.isArray(J)&&([,,Z,ie]=J),es()||!ue||this.isPartRange(Z,ie))this.cornerStyle.display="none";else{this.cornerStyle.top=`${G+j+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[q]=`${M+P+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderRightWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderLeftWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderBottomWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let ee=Ih(s.TABLE);const te=ee===l;te&&(ee=a.documentElement);const ae=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,z=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),$=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(o===this.wot.getSetting("totalColumns")-1){const m=te?w.getBoundingClientRect().left:w.offsetLeft;let C=!1,y=0;T?(y=m-parseInt(this.cornerDefaultStyle.width,10)/2,C=y<0):(y=m+ir(w)+parseInt(this.cornerDefaultStyle.width,10)/2,C=y>=AH(ee)),C&&(this.cornerStyle[q]=`${Math.floor(M+P+this.cornerCenterPointOffset-z-ae)}px`,this.cornerStyle[T?"borderLeftWidth":"borderRightWidth"]=0)}if(i===this.wot.getSetting("totalRows")-1){const y=(te?w.getBoundingClientRect().top:w.offsetTop)+dr(w)+parseInt(this.cornerDefaultStyle.height,10)/2>=Oh(ee),I=this.wot.stylesHandler.isClassicTheme();if(y){const x=Math.floor(G+j+this.cornerCenterPointOffset-$-ae);I?(this.cornerStyle.top=`${x}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=`${x-1}px`}}this.cornerStyle.display="block"}es()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,o,G,M,P,j)}isEntireColumnSelected(e,r){return e===this.wot.wtTable.getFirstRenderedRow()&&r===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,r){return e===this.wot.wtTable.getFirstRenderedColumn()&&r===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,r,n,i,o){const{wtTable:s}=this.wot,a=s.wtRootElement.parentNode;let l=null,u=null,c=null,h=null,d=null,f=null,g=null,w=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},u=function(){return dr(...arguments)},c="ht__selection--rows",f="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},u=function(){return ir(...arguments)},c="ht__selection--columns",f="left";break}if(a.classList.contains(c)){const v=this.wot.getSetting("columnHeaders").length;if(g=l(r,v-i),w=l(n,v-i),!g||!w)return!1;const b=kr(g),p=kr(w);return g&&w&&(h=b[f]-o[f]-1,d=p[f]+u(w)-b[f]),[g,h,d]}return!1}changeBorderStyle(e,r){const n=this[e].style,i=r[e];!i||i.hide?oe(this[e],"hidden"):(_e(this[e],"hidden")&&Ee(this[e],"hidden"),n.backgroundColor=i.color,(e==="top"||e==="bottom")&&(n.height=`${i.width}px`),(e==="start"||e==="end")&&(n.width=`${i.width}px`))}changeBorderToDefaultStyle(e){const r={width:1,color:"#000"},n=this[e].style;n.backgroundColor=r.color,n.width=`${r.width}px`,n.height=`${r.width}px`}toggleHiddenClass(e,r){this.changeBorderToDefaultStyle(e),r?oe(this[e],"hidden"):Ee(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",es()&&this.instance.getSetting("isDataViewInstance")&&(this.selectionHandles.styles.top.display="none",this.selectionHandles.styles.topHitArea.display="none",this.selectionHandles.styles.bottom.display="none",this.selectionHandles.styles.bottomHitArea.display="none")}destroy(){this.eventManager.destroyWithOwnEventsOnly(),this.main.parentNode.removeChild(this.main)}}function Q6(t,e){PD(t,e),e.add(t)}function Wu(t,e,r){PD(t,e),e.set(t,r)}function PD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ve(t,e){return t.get(pR(t,e))}function ID(t,e,r){return t.set(pR(t,e),r),r}function pR(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var $r=new WeakMap,fn=new WeakMap,wR=new WeakMap,Xh=new WeakMap,vR=new WeakMap,al=new WeakMap,OD=new WeakSet;class e5{constructor(e){Q6(this,OD),Wu(this,$r,void 0),Wu(this,fn,void 0),Wu(this,wR,new Z6),Wu(this,Xh,new WeakMap),Wu(this,vR,new WeakSet),Wu(this,al,new Map),ID(fn,this,e)}setActiveOverlay(e){return ID($r,this,e),Ve(wR,this).setActiveOverlay(Ve($r,this)),Ve(Xh,this).has(Ve($r,this))||Ve(Xh,this).set(Ve($r,this),new Set),this}getFocusSelection(){return Ve(fn,this)!==null?Ve(fn,this).getFocus():null}getAreaSelection(){return Ve(fn,this)!==null?Ve(fn,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Ve(al,this).has(e)){const n=Ve(al,this).get(e);if(n.has(Ve($r,this)))return n.get(Ve($r,this));const i=new MD(Ve($r,this),e.settings);return n.set(Ve($r,this),i),i}const r=new MD(Ve($r,this),e.settings);return Ve(al,this).set(e,new Map([[Ve($r,this),r]])),r}getBorderInstances(e){var r,n;return Array.from((r=(n=Ve(al,this).get(e))===null||n===void 0?void 0:n.values())!==null&&r!==void 0?r:[])}destroyBorders(e){Ve(al,this).get(e).forEach(r=>r.destroy()),Ve(al,this).delete(e)}render(e){if(Ve(fn,this)===null)return;e&&pR(OD,this,t5).call(this);const r=Array.from(Ve(fn,this)),n=new Map,i=new Map;for(let o=0;o<r.length;o++){const s=r[o],{className:a,headerAttributes:l,createLayers:u,selectionType:c}=s.settings;Ve(vR,this).has(s)||(Ve(vR,this).add(s),s.addLocalHook("destroy",()=>this.destroyBorders(s)));const h=this.getBorderInstance(s);if(s.isEmpty()){h==null||h.disappear();continue}a&&Ve(wR,this).setActiveSelection(s).scan().forEach(g=>{if(n.has(g)){const w=n.get(g);w.has(a)&&u===!0?w.set(a,w.get(a)+1):w.set(a,1)}else n.set(g,new Map([[a,1]]));l&&(i.has(g)||i.set(g,[]),g.nodeName==="TH"&&i.get(g).push(...l))});const d=s.getCorners();Ve($r,this).getSetting("onBeforeDrawBorders",d,c),h==null||h.appear(d)}n.forEach((o,s)=>{var a;const l=Array.from(o).map(u=>{let[c,h]=u;return h===1?c:[c,...Array.from({length:h-1},(d,f)=>`${c}-${f+1}`)]}).flat();l.forEach(u=>Ve(Xh,this).get(Ve($r,this)).add(u)),oe(s,l),s.nodeName==="TD"&&Array.isArray((a=Ve(fn,this).options)===null||a===void 0?void 0:a.cellAttributes)&&Pe(s,Ve(fn,this).options.cellAttributes)}),Array.from(i.keys()).forEach(o=>{Pe(o,[...i.get(o)])})}}function t5(){const t=Ve(Xh,this).get(Ve($r,this)),e=Ve($r,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let r=0;r<e.length;r++)t.add(e[r]);t.forEach(r=>{var n,i;const o=Ve($r,this).wtTable.TABLE.querySelectorAll(`.${r}`);let s=[];Array.isArray((n=Ve(fn,this).options)===null||n===void 0?void 0:n.cellAttributes)&&(s=Ve(fn,this).options.cellAttributes.map(a=>a[0])),Array.isArray((i=Ve(fn,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(s=[...s,...Ve(fn,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=o.length;a<l;a++)Ee(o[a],r),Pu(o[a],s)}),t.clear()}class r5 extends Gh{constructor(e,r,n,i){super(e,r,ol,n,i)}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new dR(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!this.shouldBeRendered()||!e.holder.parentNode)return!1;const{rootWindow:r}=this.domBindings,n=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let o=0;this.trimmingContainer===r&&(!i||i!=="horizontal")?(o=this.getOverlayOffset()*(this.isRtl()?-1:1),yS(n,`${o}px`,"0px")):(o=this.getScrollPosition(),$g(n));const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:r}=this.domBindings;let n=!1;this.isRtl()&&(e=-e);const i=this.mainTableScrollableElement;if(i===r&&e!==r.scrollX){const o=r.scrollX;r.scrollTo(e,OH(r)),n=o!==r.scrollX}else if(e!==i.scrollLeft){const o=i.scrollLeft;i.scrollLeft=e,n=o!==i.scrollLeft}return n}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,r){const n=this.wtSettings.getSetting("defaultColumnWidth");let i=e,o=0;for(;i<r;)o+=this.wot.wtTable.getColumnWidth(i)||n,i+=1;return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="vertical"){let u=r.getWorkspaceHeight();r.hasHorizontalScroll()&&(u-=_r(n)),u=Math.min(u,e.wtRootElement.scrollHeight),s.height=`${u}px`}else s.height="";this.clone.wtTable.holder.style.height=s.height;const l=ir(this.clone.wtTable.TABLE);s.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,r=mR(this.wot),n=this.wot.selectionManager.getFocusSelection()?parseInt(r.width,10)/2:0;this.clone.wtTable.hider.style.height=this.hider.style.height,e.style.height=e.parentNode.style.height,e.style.width=`${parseInt(e.parentNode.style.width,10)+n}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),r=this.isRtl()?"right":"left";if(typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number")this.spreader.style[r]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style[r]="0";else throw new Error("Incorrect value of the columnsRenderCalculator");this.isRtl()?this.spreader.style.left="":this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.clone.wtTable.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:this.clone.wtTable.spreader.style.top=""}scrollTo(e,r){const{wtSettings:n}=this,i=n.getSetting("rowHeaders"),o=n.getSetting("fixedColumnsStart"),a=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,l=o===0&&i.length>0&&!_e(a.parentNode,"innerBorderInlineStart")?1:0;let u=this.getTableParentOffset(),c=0;if(r){const h=this.wot.wtTable.getColumnWidth(e),d=this.wot.wtViewport.getViewportWidth();h>d&&(r=!1)}return r&&a.offsetWidth!==a.clientWidth&&(c=_r(this.domBindings.rootDocument)),r?(u+=this.sumCellSizes(0,e+1),u-=this.wot.wtViewport.getViewportWidth(),u+=l):u+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),u+=c,c3(this.mainTableScrollableElement)===u-l&&l>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(l),this.setScrollPosition(u)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let r=0;return!e&&this.trimmingContainer===this.domBindings.rootWindow&&(r=this.wot.wtTable.holderOffset.left),r}getScrollPosition(){return Math.abs(xH(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="horizontal")){this.isRtl()?n=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):n=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const i=this.wot.wtTable.getTotalWidth(),o=this.clone.wtTable.getTotalWidth(),s=i-o;n>s&&(n=0)}return n}adjustHeaderBordersPosition(e){const{wtSettings:r}=this,n=this.wot.wtTable.holder.parentNode,i=r.getSetting("rowHeaders"),o=r.getSetting("fixedColumnsStart"),s=r.getSetting("totalRows"),a=r.getSetting("preventOverflow")==="vertical";s?Ee(n,"emptyRows"):oe(n,"emptyRows");let l=!1;if(!a){if(o&&!i.length)oe(n,"innerBorderLeft innerBorderInlineStart");else if(!o&&i.length){const u=_e(n,"innerBorderInlineStart");e?(oe(n,"innerBorderLeft innerBorderInlineStart"),l=!u):(Ee(n,"innerBorderLeft innerBorderInlineStart"),l=u)}}return l}}const n5="stickyRowsTop",yR={getFirstRenderedRow(){return this.getRenderedRowsCount()===0?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsTop"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};Qo(yR,"MIXIN_NAME",n5,{writable:!1,enumerable:!1});class CR extends Vu{constructor(e,r,n,i){super(e,r,n,i,sl)}}wt(CR,yR),wt(CR,tm);function xD(t,e,r){return(e=i5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i5(t){var e=o5(t,"string");return typeof e=="symbol"?e:e+""}function o5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class s5 extends Gh{constructor(e,r,n,i,o,s){super(e,r,sl,n,i),xD(this,"topOverlay",void 0),xD(this,"inlineStartOverlay",void 0),this.topOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new CR(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){if(this.updateTrimmingContainer(),!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode;if(this.trimmingContainer===this.domBindings.rootWindow){const i=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),o=this.topOverlay.getOverlayOffset();yS(e,`${i}px`,`${o}px`)}else $g(e);let r=dr(this.clone.wtTable.TABLE);const n=ir(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),e.style.height=`${r}px`,e.style.width=`${n}px`,!1}}class bR extends Vu{constructor(e,r,n,i){super(e,r,n,i,il)}}wt(bR,yR),wt(bR,nm);function a5(t,e,r){return(e=l5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l5(t){var e=u5(t,"string");return typeof e=="symbol"?e:e+""}function u5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class c5 extends Gh{constructor(e,r,n,i){super(e,r,il,n,i),a5(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new bR(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode,{rootWindow:r}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let i=0,o=!1;if(this.trimmingContainer===r&&(!n||n!=="vertical")){const{wtTable:a}=this.wot,l=a.hider.getBoundingClientRect(),u=Math.ceil(l.bottom),c=e.offsetHeight;o=u===c,i=this.getOverlayOffset(),yS(e,"0px",`${i}px`)}else i=this.getScrollPosition(),$g(e);const s=this.adjustHeaderBordersPosition(i,o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:r}=this.domBindings,n=this.mainTableScrollableElement;let i=!1;if(n===r&&e!==r.scrollY){const o=r.scrollY;r.scrollTo(pS(r),e),i=o!==r.scrollY}else if(e!==n.scrollTop){const o=n.scrollTop;n.scrollTop=e,i=o!==n.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,r){const n=this.wot.stylesHandler.getDefaultRowHeight();let i=e,o=0;for(;i<r;){const s=this.wot.wtTable.getRowHeight(i);o+=s===void 0?n:s,i+=1}return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=r.getWorkspaceWidth();r.hasVerticalScroll()&&(u-=_r(n)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=dr(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,r=mR(this.wot),n=this.wot.selectionManager.getFocusSelection()?parseInt(r.height,10)/2:0;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=`${parseInt(e.parentNode.style.height,10)+n}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:r}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?r.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:r.style[e]=""}scrollTo(e,r){const{wot:n,wtSettings:i}=this,s=(n.cloneSource?n.cloneSource:n).wtTable.holder,a=i.getSetting("columnHeaders"),u=i.getSetting("fixedRowsTop")===0&&a.length>0&&!_e(s.parentNode,"innerBorderTop")?1:0;let c=this.getTableParentOffset(),h=0;if(r){const d=this.wot.wtTable.getRowHeight(e),f=this.wot.wtViewport.getViewportHeight();d>f&&(r=!1)}if(r&&s.offsetHeight!==s.clientHeight&&(h=_r(this.domBindings.rootDocument)),r){const d=i.getSetting("fixedRowsBottom"),f=i.getSetting("totalRows");c+=this.sumCellSizes(0,e+1),c-=n.wtViewport.getViewportHeight()-this.sumCellSizes(f-d,f),c+=1,c+=u}else c+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return c+=h,u3(this.mainTableScrollableElement)===c-u&&u>0&&this.wot.wtOverlays.expandHiderVerticallyBy(u),this.setScrollPosition(c)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return wS(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o;n=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),n>s&&(n=0)}return n}adjustHeaderBordersPosition(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{wtSettings:n}=this,i=this.wot.wtTable.holder.parentNode,o=n.getSetting("totalColumns"),s=n.getSetting("preventOverflow")==="horizontal";o?Ee(i,"emptyColumns"):oe(i,"emptyColumns");let a=!1;if(!r&&!s){const l=n.getSetting("fixedRowsTop"),u=this.cachedFixedRowsTop!==l,c=n.getSetting("columnHeaders");if((u||l===0)&&c.length>0){const h=_e(i,"innerBorderTop");this.cachedFixedRowsTop=n.getSetting("fixedRowsTop"),e||n.getSetting("totalRows")===0?(oe(i,"innerBorderTop"),a=!h):(Ee(i,"innerBorderTop"),a=h)}}return a}}function om(t,e,r){h5(t,e),e.set(t,r)}function h5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ns(t,e,r){return(e=d5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d5(t){var e=f5(t,"string");return typeof e=="symbol"?e:e+""}function f5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ll(t,e,r){return t.set(AD(t,e),r),r}function is(t,e){return t.get(AD(t,e))}function AD(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Bu=new WeakMap,sm=new WeakMap,ju=new WeakMap,am=new WeakMap;class g5{constructor(e,r,n,i,o,s){ns(this,"wot",null),om(this,Bu,[]),ns(this,"topOverlay",null),ns(this,"bottomOverlay",null),ns(this,"inlineStartOverlay",null),ns(this,"topInlineStartCornerOverlay",null),ns(this,"bottomInlineStartCornerOverlay",null),ns(this,"browserLineHeight",void 0),ns(this,"wtSettings",null),om(this,sm,!1),om(this,ju,0),om(this,am,null),ns(this,"resizeObserver",new ResizeObserver(c=>{Bg(()=>{!Array.isArray(c)||!c.length||(ll(ju,this,is(ju,this)+1),is(ju,this)===100&&(st("The ResizeObserver callback was fired too many times in direct succession.\nThis may be due to an infinite loop caused by setting a dynamic height/width (for example, with the `dvh` units) to a Handsontable container's parent. \nThe observer will be disconnected."),this.resizeObserver.disconnect()),is(am,this)!==null&&clearTimeout(is(am,this)),ll(am,this,setTimeout(()=>{ll(ju,this,0)},100)),this.wtSettings.getSetting("onContainerElementResize"))})})),this.wot=e,this.wtSettings=i,this.domBindings=n,this.facadeGetter=r,this.wtTable=s;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=o,this.scrollbarSize=_r(a);const u=l.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=u?s.holder:Dg(s.TABLE),this.initOverlays(),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.initBrowserLineHeight(),this.registerListeners(),this.lastScrollX=l.scrollX,this.lastScrollY=l.scrollY}getOverlays(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const r=[...is(Bu,this)];return e&&r.push(this.wtTable),r}initBrowserLineHeight(){const{rootWindow:e,rootDocument:r}=this.domBindings,n=e.getComputedStyle(r.body),i=parseInt(n.lineHeight,10),o=parseInt(n.fontSize,10)*1.2;this.browserLineHeight=i||o}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new c5(...e),this.bottomOverlay=new B6(...e),this.inlineStartOverlay=new r5(...e),this.topInlineStartCornerOverlay=new s5(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new L6(...e,this.bottomOverlay,this.inlineStartOverlay),ll(Bu,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){ll(sm,this,is(Bu,this).reduce((e,r)=>r.hasRenderingStateChanged()||e,!1)),is(Bu,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),is(Bu,this).forEach(e=>{const r=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),r&&!e.needFullRender&&e.reset()})}refreshAll(){if(this.wot.drawn){if(!this.wtTable.holder.parentNode){this.destroy();return}this.wot.draw(!0),this.verticalScrolling&&this.inlineStartOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}}registerListeners(){const{rootDocument:e,rootWindow:r}=this.domBindings,{mainTableScrollableElement:n}=this.topOverlay,{mainTableScrollableElement:i}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",h=>this.onKeyDown(h)),this.eventManager.addEventListener(e.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(e,"visibilitychange",()=>this.onKeyUp()),this.eventManager.addEventListener(n,"scroll",h=>this.onTableScroll(h),{passive:!0}),n!==i&&this.eventManager.addEventListener(i,"scroll",h=>this.onTableScroll(h),{passive:!0});const o=r.devicePixelRatio&&r.devicePixelRatio>1,s=this.scrollableElement===r,a=this.wtSettings.getSetting("preventWheel"),l={passive:s};(a||o||!YH())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",h=>this.onCloneWheel(h,a),l),[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach(h=>{this.eventManager.addEventListener(h.clone.wtTable.holder,"wheel",d=>this.onCloneWheel(d,a),l)});let c;this.eventManager.addEventListener(r,"resize",()=>{Bg(()=>{clearTimeout(c),this.wtSettings.getSetting("onWindowResize"),c=setTimeout(()=>{ll(ju,this,0)},200)})}),s||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}onTableScroll(e){const r=this.domBindings.rootWindow,n=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,o=e.target;this.keyPressed&&(i!==r&&o!==r&&!e.target.contains(i)||n!==r&&o!==r&&!e.target.contains(n))||this.syncScrollPositions(e)}onCloneWheel(e,r){const{rootWindow:n}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,o=this.topOverlay.mainTableScrollableElement,s=e.target,a=o!==n&&s!==n&&!s.contains(o),l=i!==n&&s!==n&&!s.contains(i);if(this.keyPressed&&(a||l)||this.scrollableElement===n)return;const u=this.translateMouseWheelToScroll(e);(r||this.scrollableElement!==n&&u)&&e.preventDefault()}onKeyDown(e){this.keyPressed=Hh(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let r=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,n=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(n+=n*this.browserLineHeight,r+=r*this.browserLineHeight);const i=this.scrollVertically(r),o=this.scrollHorizontally(n);return i||o}scrollVertically(e){const r=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,r!==this.scrollableElement.scrollTop}scrollHorizontally(e){const r=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,r!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const e=this.topOverlay.clone.wtTable.holder,r=this.inlineStartOverlay.clone.wtTable.holder;let n=this.scrollableElement.scrollLeft,i=this.scrollableElement.scrollTop;if(this.wot.wtViewport.isHorizontallyScrollableByWindow()&&(n=this.scrollableElement.scrollX),this.wot.wtViewport.isVerticallyScrollableByWindow()&&(i=this.scrollableElement.scrollY),this.horizontalScrolling=this.lastScrollX!==n,this.verticalScrolling=this.lastScrollY!==i,this.lastScrollX=n,this.lastScrollY=i,this.horizontalScrolling){e.scrollLeft=n;const o=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;o&&(o.scrollLeft=n)}this.verticalScrolling&&(r.scrollTop=i),this.refreshAll()}syncScrollWithMaster(){if(!is(sm,this))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:r,scrollTop:n}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=r),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=r),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=n),ll(sm,this,!1)}updateMainScrollableElements(){this.eventManager.clearEvents(!0),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:r}=this.domBindings;r.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.scrollableElement=e.holder:this.scrollableElement=Dg(e.TABLE),this.registerListeners()}destroy(){this.resizeObserver.disconnect(),this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.inlineStartOverlay.destroy(),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.destroy(),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.destroy(),this.destroyed=!0}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.updateLastSpreaderSize()&&this.adjustElementsSize(),this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.inlineStartOverlay.refresh(e),this.topOverlay.refresh(e),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.refresh(e),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.refresh(e)}updateLastSpreaderSize(){const e=this.wtTable.spreader,r=e.clientWidth,n=e.clientHeight,i=r!==this.spreaderLastSize.width||n!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=r,this.spreaderLastSize.height=n),i}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:r}=this,{rootWindow:n}=this.domBindings,i=this.scrollableElement===n,o=this.wtSettings.getSetting("totalColumns"),s=this.wtSettings.getSetting("totalRows"),a=e.getRowHeaderWidth(),u=e.getColumnHeaderHeight()+this.topOverlay.sumCellSizes(0,s)+1,c=a+this.inlineStartOverlay.sumCellSizes(0,o),d=r.hider.style,f=()=>i?!1:this.scrollableElement.scrollTop>Math.max(0,u-r.holder.clientHeight),g=()=>i?!1:this.scrollableElement.scrollLeft>Math.max(0,c-r.holder.clientWidth),w=f()?1:0,v=g()?1:0;d.width=`${c+v}px`,d.height=`${u+w}px`,this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){const{wtTable:r}=this;r.hider.style.height=`${parseInt(r.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){const{wtTable:r}=this;r.hider.style.width=`${parseInt(r.hider.style.width,10)+e}px`}applyToDOM(){this.wtTable.isVisible()&&(this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.inlineStartOverlay.applyToDOM())}getParentOverlay(e){if(!e)return null;const r=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let n=null;return k(r,i=>{i&&i.clone&&i.clone.wtTable.TABLE.contains(e)&&(n=i.clone)}),n}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,r=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];k(r,n=>{n&&(n.clone.wtTable.TABLE.className=e.className)})}}function HD(t,e,r){return(e=m5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function m5(t){var e=p5(t,"string");return typeof e=="symbol"?e:e+""}function p5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class w5{constructor(e){HD(this,"settings",{}),HD(this,"defaults",Object.freeze(this.getDefaults())),Fe(this.defaults,(r,n)=>{if(e[n]!==void 0)this.settings[n]=e[n];else{if(r===void 0)throw new Error(`A required setting "${n}" was not provided`);this.settings[n]=r}})}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,currentRowClassName:null,currentColumnClassName:null,preventOverflow(){return!1},preventWheel:!1,data:void 0,fixedColumnsStart:0,fixedRowsTop:0,fixedRowsBottom:0,shouldRenderInlineStartOverlay:()=>this.getSetting("fixedColumnsStart")>0||this.getSetting("rowHeaders").length>0,shouldRenderTopOverlay:()=>this.getSetting("fixedRowsTop")>0||this.getSetting("columnHeaders").length>0,shouldRenderBottomOverlay:()=>this.getSetting("fixedRowsBottom")>0,minSpareRows:0,rowHeaders(){return[]},columnHeaders(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:(e,r,n)=>{const i=this.getSetting("data",e,r);Za(n,i??"")},columnWidth(){},rowHeight(){},rowHeightByOverlayName(){},defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,viewportRowRenderingThreshold:null,viewportColumnRenderingThreshold:null,onCellMouseDown:null,onCellContextMenu:null,onCellMouseOver:null,onCellMouseOut:null,onCellMouseUp:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeRemoveCellClassNames:null,onAfterDrawSelection:null,onBeforeDrawBorders:null,onBeforeViewportScrollHorizontally:e=>e,onBeforeViewportScrollVertically:e=>e,onScrollHorizontally:null,onScrollVertically:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,onModifyRowHeaderWidth:null,onModifyGetCellCoords:null,onModifyGetCoordsElement:null,onModifyGetCoords:null,onBeforeHighlightingRowHeader:e=>e,onBeforeHighlightingColumnHeader:e=>e,onWindowResize:null,onContainerElementResize:null,renderAllColumns:!1,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null,headerClassName:null,rtlMode:!1,ariaTags:!0}}update(e,r){return r===void 0?Fe(e,(n,i)=>{this.settings[i]=n}):this.settings[e]=r,this}getSetting(e,r,n,i,o){return typeof this.settings[e]=="function"?this.settings[e](r,n,i,o):r!==void 0&&Array.isArray(this.settings[e])?this.settings[e][r]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}class SR extends Vu{constructor(e,r,n,i){super(e,r,n,i,"master")}alignOverlaysWithTrimmingContainer(){const e=Ih(this.wtRootElement),{rootWindow:r}=this.domBindings;if(e===r)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{const n=e.parentElement,i=kg(e,"height",r),o=kg(e,"overflow",r),s=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let u=e.offsetWidth,c=e.offsetHeight;if(n&&["auto","hidden","scroll"].includes(o)){const d=e.cloneNode(!1);d.style.overflow="auto",d.style.position="absolute",e.nextElementSibling?n.insertBefore(d,e.nextElementSibling):n.appendChild(d);const f=parseInt(r.getComputedStyle(d).height,10);n.removeChild(d),f===0&&(c=0)}c=Math.min(c,l),s.height=i==="auto"?"auto":`${c}px`,u=Math.min(u,a),s.width=`${u}px`,s.overflow="",this.hasTableHeight=s.height==="auto"?!0:c>0,this.hasTableWidth=u>0}this.isTableVisible=Ou(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:r}=this.dataAccessObject,n="master",o=e.getSetting("columnHeaders").length;if(o&&!r.hasOversizedColumnHeadersMarked[n]){const a=e.getSetting("rowHeaders").length,l=this.getRenderedColumnsCount();for(let u=0;u<o;u++)for(let c=-1*a;c<l;c++)this.markIfOversizedColumnHeader(c);r.hasOversizedColumnHeadersMarked[n]=!0}}}wt(SR,hR),wt(SR,nm);class v5{constructor(e,r,n,i,o){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=r,this.wtSettings=n,this.wtTable=o,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.hasOversizedColumnHeadersMarked={},this.clientHeight=0,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.rowsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllRows")?new X4:new rX],["fullyVisible",()=>new V4],["partiallyVisible",()=>new zN]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new G4:new Q4],["fullyVisible",()=>new L4],["partiallyVisible",()=>new UN]]),this.eventManager=i,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){const e=this.domBindings.rootDocument,r=this.dataAccessObject.topOverlayTrimmingContainer;let n=0;return r===this.domBindings.rootWindow?n=e.documentElement.clientHeight:n=dr(r)>0&&r.clientHeight>0?r.clientHeight:1/0,n}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const r=this.getColumnHeaderHeight();return r>0&&(e-=r),e}getWorkspaceWidth(){const{rootDocument:e,rootWindow:r}=this.domBindings,n=this.dataAccessObject.inlineStartOverlayTrimmingContainer;let i;if(n===r){const o=this.wtSettings.getSetting("totalColumns");i=this.wtTable.holder.offsetWidth,this.getRowHeaderWidth()+this.sumColumnWidths(0,o)>i&&(i=e.documentElement.clientWidth)}else i=n.clientWidth;return i}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const r=this.getRowHeaderWidth();return r>0?e-r:e}hasVerticalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollHeight>o.clientHeight}const{holder:e,hider:r}=this.wtTable,n=e.clientHeight,i=r.offsetHeight;return n<i?!0:i>this.getWorkspaceHeight()}hasHorizontalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollWidth>o.clientWidth}const{holder:e,hider:r}=this.wtTable,n=e.clientWidth,i=r.offsetWidth;return n<i?!0:i>this.getWorkspaceWidth()}isVerticallyScrollableByWindow(){return this.dataAccessObject.topOverlayTrimmingContainer===this.domBindings.rootWindow}isHorizontallyScrollableByWindow(){return this.dataAccessObject.inlineStartOverlayTrimmingContainer===this.domBindings.rootWindow}sumColumnWidths(e,r){let n=0,i=e;for(;i<r;)n+=this.wtTable.getColumnWidth(i),i+=1;return n}getWorkspaceOffset(){return kr(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=dr(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),r=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let n=0,i=r.length;n<i;n++)this.rowHeaderWidth+=e[n]||e}if(isNaN(this.rowHeaderWidth))if(r.length){let n=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let i=0,o=r.length;i<o;i++)n?(this.rowHeaderWidth+=ir(n),n=n.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:r,wtTable:n}=this;let i=this.getViewportHeight(),o,s;this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=r.getSetting("fixedRowsTop"),u=r.getSetting("fixedRowsBottom"),c=r.getSetting("totalRows");return l&&a>=0&&(s=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=s,i-=s),u&&this.dataAccessObject.bottomOverlay.clone&&(s=this.dataAccessObject.bottomOverlay.sumCellSizes(c-u,c),i-=s),n.holder.clientHeight===n.holder.offsetHeight?o=0:o=_r(this.domBindings.rootDocument),new cX({calculationTypes:e.map(h=>[h,this.rowsCalculatorTypes.get(h)()]),viewportHeight:i,scrollOffset:a,totalRows:r.getSetting("totalRows"),defaultRowHeight:this.instance.stylesHandler.getDefaultRowHeight(),rowHeightFn:h=>n.getRowHeight(h),overrideFn:r.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:o})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:r,wtTable:n}=this;let i=this.getViewportWidth(),o=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const s=r.getSetting("fixedColumnsStart");if(s&&o>=0){const a=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,s);o+=a,i-=a}return n.holder.clientWidth!==n.holder.offsetWidth&&(i-=_r(this.domBindings.rootDocument)),new aX({calculationTypes:e.map(a=>[a,this.columnsCalculatorTypes.get(a)()]),viewportWidth:i,scrollOffset:o,totalColumns:r.getSetting("totalColumns"),columnWidthFn:a=>n.getColumnWidth(a),overrideFn:r.getSettingPure("viewportColumnCalculatorOverride"),inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:r}=this,n=this.createRowsCalculator(),i=this.createColumnsCalculator();if(e&&!r.getSetting("renderAllRows")){const o=n.getResultsFor("fullyVisible");e=this.areAllProposedVisibleRowsAlreadyRendered(o)}if(e&&!r.getSetting("renderAllColumns")){const o=i.getResultsFor("fullyVisible");e=this.areAllProposedVisibleColumnsAlreadyRendered(o)}return e||(this.rowsRenderCalculator=n.getResultsFor("rendered"),this.columnsRenderCalculator=i.getResultsFor("rendered")),this.rowsVisibleCalculator=n.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=i.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=n.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=i.getResultsFor("partiallyVisible"),e}createVisibleCalculators(){const e=this.createRowsCalculator(["fullyVisible","partiallyVisible"]),r=this.createColumnsCalculator(["fullyVisible","partiallyVisible"]);this.rowsVisibleCalculator=e.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=r.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=e.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=r.getResultsFor("partiallyVisible")}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;let{startRow:r,endRow:n}=e;if(r===null&&n===null){if(!e.isVisibleInTrimmingContainer)return!0;r=this.rowsPartiallyVisibleCalculator.startRow,n=this.rowsPartiallyVisibleCalculator.endRow}const{startRow:i,endRow:o,rowStartOffset:s,rowEndOffset:a}=this.rowsRenderCalculator,l=this.wtSettings.getSetting("totalRows")-1,u=this.wtSettings.getSetting("viewportRowRenderingThreshold");return Number.isInteger(u)&&u>0?(r=Math.max(0,r-Math.min(s,u)),n=Math.min(l,n+Math.min(a,u))):u==="auto"&&(r=Math.max(0,r-Math.ceil(s/2)),n=Math.min(l,n+Math.ceil(a/2))),r<i||r===i&&r>0?!1:!(n>o||n===o&&n<l)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;let{startColumn:r,endColumn:n}=e;if(r===null&&n===null){if(!e.isVisibleInTrimmingContainer)return!0;r=this.columnsPartiallyVisibleCalculator.startColumn,n=this.columnsPartiallyVisibleCalculator.endColumn}const{startColumn:i,endColumn:o,columnStartOffset:s,columnEndOffset:a}=this.columnsRenderCalculator,l=this.wtSettings.getSetting("totalColumns")-1,u=this.wtSettings.getSetting("viewportColumnRenderingThreshold");return Number.isInteger(u)&&u>0?(r=Math.max(0,r-Math.min(s,u)),n=Math.min(l,n+Math.min(a,u))):u==="auto"&&(r=Math.max(0,r-Math.ceil(s/2)),n=Math.min(l,n+Math.ceil(a/2))),r<i||r===i&&r>0?!1:!(n>o||n===o&&n<l)}resetHasOversizedColumnHeadersMarked(){Fe(this.hasOversizedColumnHeadersMarked,(e,r,n)=>{n[r]=void 0})}}function y5(t,e){ND(t,e),e.add(t)}function ul(t,e,r){ND(t,e),e.set(t,r)}function ND(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ot(t,e){return t.get(Hi(t,e))}function Ai(t,e,r){return t.set(Hi(t,e),r),r}function Hi(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const DD=23;var uo=new WeakMap,os=new WeakMap,RR=new WeakMap,ER=new WeakMap,Ks=new WeakMap,Zh=new WeakMap,Jh=new WeakMap,co=new WeakSet;class C5{constructor(e){y5(this,co),ul(this,uo,void 0),ul(this,os,void 0),ul(this,RR,void 0),ul(this,ER,void 0),ul(this,Ks,!0),ul(this,Zh,{}),ul(this,Jh,{}),Ai(os,this,e.rootTable.parentElement.parentElement),Ai(ER,this,e.rootDocument)}isClassicTheme(){return Ot(Ks,this)}getCSSVariableValue(e){var r;if(Ot(Ks,this))return null;if(Ot(Zh,this)[`--ht-${e}`])return Ot(Zh,this)[`--ht-${e}`];const n=(r=Hi(co,this,E5).call(this,`--ht-${e}`))!==null&&r!==void 0?r:Hi(co,this,LD).call(this,`--ht-${e}`);if(n!==null)return Ot(Zh,this)[`--ht-${e}`]=n,n}getStyleForTD(e){var r;return(r=Ot(Jh,this))===null||r===void 0?void 0:r.td[e]}getDefaultRowHeight(){if(Ot(Ks,this))return DD;const e=Hi(co,this,b5).call(this);return!e&&_e(Ot(os,this),"ht-wrapper")?(st(`The "${Ot(uo,this)}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`),Ai(Ks,this,!0),this.useTheme(),DD):e}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!e){Hi(co,this,kD).call(this),Ai(Ks,this,!0),Ai(uo,this,e||void 0);return}e&&e!==Ot(uo,this)&&(Ot(uo,this)&&Hi(co,this,T5).call(this),Ai(uo,this,e),Ai(Ks,this,!1),Hi(co,this,S5).call(this),Hi(co,this,kD).call(this))}getThemeName(){return Ot(uo,this)}removeClassNames(){_e(Ot(os,this),Ot(uo,this))&&Ee(Ot(os,this),Ot(uo,this))}}function b5(){const t=this.getCSSVariableValue("line-height"),e=this.getCSSVariableValue("cell-vertical-padding"),r=Math.ceil(parseFloat(this.getStyleForTD("border-bottom-width")));return t===null||e===null||isNaN(r)?null:t+2*e+r}function S5(){Ee(Ot(os,this),/ht-theme-.*/g),oe(Ot(os,this),Ot(uo,this))}function kD(){this.isClassicTheme()||Ai(RR,this,getComputedStyle(Ot(os,this)));const t=Hi(co,this,R5).call(this,["box-sizing","border-bottom-width"]);Ot(Jh,this).td={...Ot(Jh,this).td,"box-sizing":t["box-sizing"],"border-bottom-width":t["border-bottom-width"]}}function R5(t){const e=Ot(ER,this),r=Ot(os,this),n=e.createElement("table"),i=e.createElement("tbody"),o=e.createElement("tr"),s=e.createElement("tr"),a=e.createElement("td");s.appendChild(a),i.appendChild(o),i.appendChild(s),n.appendChild(i),r.appendChild(n);const l=getComputedStyle(a),u={};return t.forEach(c=>{u[c]=l.getPropertyValue(c)}),r.removeChild(n),u}function E5(t){const e=Math.ceil(parseFloat(Hi(co,this,LD).call(this,t)));return Number.isNaN(e)?null:e}function LD(t){const e=Ot(RR,this).getPropertyValue(t);return e===""?null:e}function T5(){Ai(Jh,this,{}),Ai(Zh,this,{}),Ai(Ks,this,!0)}class _5 extends uR{constructor(e,r){super(e,new w5(r)),this.stylesHandler=new C5(this.domBindings);const n=this.wtSettings.getSetting("facade",this);this.wtTable=new SR(this.getTableDao(),n,this.domBindings,this.wtSettings),this.wtViewport=new v5(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new e5(this.wtSettings.getSetting("selections")),this.wtEvent=new tD(n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new g5(this,n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},r=[],n=[];Fe(e,(i,o)=>{this.wtSettings.getSetting(o).length&&n.push(i),r.push(i)}),Ee(this.wtTable.wtRootElement.parentNode,r),oe(this.wtTable.wtRootElement.parentNode,n)}getOverlayByName(e){var r;if(!mD.includes(e))return null;const n=e.replace(/_([a-z])/g,i=>i[1].toUpperCase());return(r=this.wtOverlays[`${n}Overlay`])!==null&&r!==void 0?r:null}getViewportDao(){const e=this;return{get wot(){return e},get topOverlayTrimmingContainer(){return e.wtOverlays.topOverlay.trimmingContainer},get inlineStartOverlayTrimmingContainer(){return e.wtOverlays.inlineStartOverlay.trimmingContainer},get topScrollPosition(){return e.wtOverlays.topOverlay.getScrollPosition()},get topParentOffset(){return e.wtOverlays.topOverlay.getTableParentOffset()},get inlineStartScrollPosition(){return e.wtOverlays.inlineStartOverlay.getScrollPosition()},get inlineStartParentOffset(){return e.wtOverlays.inlineStartOverlay.getTableParentOffset()},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get bottomOverlay(){return e.wtOverlays.bottomOverlay}}}}class TR{constructor(e){e instanceof uR?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=r=>{const n=new TR(r);return()=>n},this._wot=new _5(e.table,e)}get guid(){return this._wot.guid}get rootDocument(){return this._wot.domBindings.rootDocument}get rootWindow(){return this._wot.domBindings.rootWindow}get wtSettings(){return this._wot.wtSettings}get cloneSource(){return this._wot.cloneSource}get cloneOverlay(){return this._wot.cloneOverlay}get selectionManager(){return this._wot.selectionManager}get wtViewport(){return this._wot.wtViewport}get wtOverlays(){return this._wot.wtOverlays}get wtTable(){return this._wot.wtTable}get wtEvent(){return this._wot.wtEvent}get wtScroll(){return this._wot.wtScroll}get drawn(){return this._wot.drawn}set drawn(e){this._wot.drawn=e}get activeOverlayName(){return this._wot.activeOverlayName}get drawInterrupted(){return this._wot.drawInterrupted}set drawInterrupted(e){this._wot.drawInterrupted=e}get lastMouseOver(){return this._wot.lastMouseOver}set lastMouseOver(e){this._wot.lastMouseOver=e}get momentumScrolling(){return this._wot.momentumScrolling}set momentumScrolling(e){this._wot.momentumScrolling=e}get touchApplied(){return this._wot.touchApplied}set touchApplied(e){this._wot.touchApplied=e}get domBindings(){return this._wot.domBindings}get eventListeners(){return this._wot.eventListeners}set eventListeners(e){this._wot.eventListeners=e}get eventManager(){return this._wot.eventManager}get stylesHandler(){return this._wot.stylesHandler}createCellCoords(e,r){return this._wot.createCellCoords(e,r)}createCellRange(e,r,n){return this._wot.createCellRange(e,r,n)}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._wot.draw(e),this}getCell(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this._wot.getCell(e,r)}scrollViewport(e,r,n){return this._wot.scrollViewport(e,r,n)}scrollViewportHorizontally(e,r){return this._wot.scrollViewportHorizontally(e,r)}scrollViewportVertically(e,r){return this._wot.scrollViewportVertically(e,r)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}getOverlayByName(e){return this._wot.getOverlayByName(e)}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,r){return this._wot.wtSettings.update(e,r),this}getSetting(e,r,n,i,o){return this._wot.wtSettings.getSetting(e,r,n,i,o)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}function $D(t){let{isShiftKey:e,isLeftClick:r,isRightClick:n,coords:i,selection:o,controller:s,cellCoordsFactory:a}=t;const l=o.isSelected()?o.getSelectedRange().current():null,u=o.isSelectedByCorner(),c=o.isSelectedByRowHeader();if(o.markSource("mouse"),e&&l)i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(i):(u||c)&&i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(a(i.row,i.col)):u&&i.row<0&&!s.column?o.setRangeEnd(a(l.to.row,i.col)):c&&i.col<0&&!s.row?o.setRangeEnd(a(i.row,l.to.col)):(!u&&!c&&i.col<0||u&&i.col<0)&&!s.row?o.selectRows(Math.max(l.from.row,0),i.row,i.col):(!u&&!c&&i.row<0||c&&i.row<0)&&!s.column&&o.selectColumns(Math.max(l.from.col,0),i.col,i.row);else{const h=!o.inInSelection(i),d=r||n&&h;i.row<0&&i.col>=0&&!s.column?d&&o.selectColumns(i.col,i.col,i.row):i.col<0&&i.row>=0&&!s.row?d&&o.selectRows(i.row,i.row,i.col):i.col>=0&&i.row>=0&&!s.cell?d&&o.setRangeStart(i):i.col<0&&i.row<0&&o.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}o.markEndSource()}function M5(t){let{isLeftClick:e,coords:r,selection:n,controller:i,cellCoordsFactory:o}=t;if(!e)return;const s=n.isSelectedByRowHeader(),a=n.isSelectedByColumnHeader(),l=n.tableProps.countCols(),u=n.tableProps.countRows();n.markSource("mouse"),a&&!i.column?n.setRangeEnd(o(u-1,r.col)):s&&!i.row?n.setRangeEnd(o(r.row,l-1)):i.cell||n.setRangeEnd(r),n.markEndSource()}const P5=new Map([["mousedown",$D],["mouseover",M5],["touchstart",$D]]);function FD(t,e){let{coords:r,selection:n,controller:i,cellCoordsFactory:o}=e;P5.get(t.type)({coords:r,selection:n,controller:i,cellCoordsFactory:o,isShiftKey:t.shiftKey,isLeftClick:_S(t)||t.type==="touchstart",isRightClick:Qa(t)})}const VD=new WeakMap,_R=Symbol("rootInstance");function I5(t){VD.set(t,!0)}function O5(t){return t===_R}function lm(t){return VD.has(t)}function x5(t,e){WD(t,e),e.add(t)}function Xs(t,e,r){WD(t,e),e.set(t,r)}function WD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zs(t,e,r){return(e=A5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function A5(t){var e=H5(t,"string");return typeof e=="symbol"?e:e+""}function H5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function or(t,e){return t.get(Uu(t,e))}function gn(t,e,r){return t.set(Uu(t,e),r),r}function Uu(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var MR=new WeakMap,um=new WeakMap,cm=new WeakMap,ss=new WeakMap,Ni=new WeakMap,PR=new WeakMap,IR=new WeakMap,zu=new WeakMap,Qh=new WeakSet;class N5{constructor(e){x5(this,Qh),Zs(this,"hot",void 0),Zs(this,"eventManager",void 0),Zs(this,"settings",void 0),Zs(this,"THEAD",void 0),Zs(this,"TBODY",void 0),Zs(this,"_wt",void 0),Zs(this,"activeWt",void 0),Xs(this,MR,0),Xs(this,um,0),Zs(this,"postponedAdjustElementsSize",!1),Xs(this,cm,!1),Xs(this,ss,void 0),Xs(this,Ni,void 0),Xs(this,PR,0),Xs(this,IR,0),Xs(this,zu,null),this.hot=e,this.eventManager=new Pi(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){if(!this.hot.isRenderSuspended()){const e=this.hot.forceFullRender;this.hot.runHooks("beforeRender",e),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize()),this._wt.draw(!e),Uu(Qh,this,k5).call(this),this.hot.runHooks("afterRender",e),this.hot.forceFullRender=!1}}adjustElementsSize(){this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize()}getCellAtCoords(e,r){const n=this._wt.getCell(e,r);return n<0?null:n}scrollViewport(e,r,n){return this._wt.scrollViewport(e,r,n)}scrollViewportHorizontally(e,r){return this._wt.scrollViewportHorizontally(e,r)}scrollViewportVertically(e,r){return this._wt.scrollViewportVertically(e,r)}createElements(){const{rootElement:e,rootDocument:r}=this.hot,n=e.getAttribute("style");n&&e.setAttribute("data-originalstyle",n),oe(e,"handsontable"),gn(Ni,this,r.createElement("TABLE")),oe(or(Ni,this),"htCore"),this.hot.getSettings().tableClassName&&oe(or(Ni,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(Pe(or(Ni,this),[Xo()]),Pe(e,[NK(),SH(-1),Ag(this.hot.countCols()),qK()])),this.THEAD=r.createElement("THEAD"),or(Ni,this).appendChild(this.THEAD),this.TBODY=r.createElement("TBODY"),or(Ni,this).appendChild(this.TBODY),this.hot.table=or(Ni,this),this.hot.container.insertBefore(or(Ni,this),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:r,selection:n,rootWindow:i}=this.hot,o=r.documentElement;this.eventManager.addEventListener(e,"mousedown",a=>{gn(cm,this,!0),this.isTextSelectionAllowed(a.target)||(NH(i),a.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{gn(cm,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{or(cm,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&NH(i),a.preventDefault())}),this.eventManager.addEventListener(o,"keyup",a=>{n.isInProgress()&&!a.shiftKey&&n.finish()}),this.eventManager.addEventListener(o,"mouseup",a=>{n.isInProgress()&&_S(a)&&n.finish(),gn(ss,this,!1);const l=LH(r.activeElement);Fg(r.activeElement)&&!l||(l||!n.isSelected()&&!n.isSelectedByAnyHeader()&&!e.contains(a.target)&&!Qa(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(o,"contextmenu",a=>{n.isInProgress()&&Qa(a)&&(n.finish(),gn(ss,this,!1))}),this.eventManager.addEventListener(o,"touchend",()=>{n.isInProgress()&&n.finish(),gn(ss,this,!1)}),this.eventManager.addEventListener(o,"mousedown",a=>{const l=a.target,u=a.x||a.clientX,c=a.y||a.clientY;let h=a.target;if(or(ss,this)||!e||!this.hot.view)return;const{holder:d}=this._wt.wtTable;if(h===d){const g=_r(r);if(r.elementFromPoint(u+g,c)!==d||r.elementFromPoint(u,c+g)!==d)return}else for(;h!==o;){if(h===null){if(a.isTargetWebComponent)break;return}if(h===e)return;h=h.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(l):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let s=Mu(i);for(;s!==null;)this.eventManager.addEventListener(s.document.documentElement,"click",()=>{this.hot.unlisten()}),s=Mu(s);this.eventManager.addEventListener(or(Ni,this),"selectstart",a=>{this.settings.fragmentSelection||Fg(a.target)||a.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:r,col:n}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(r,n))}translateFromRenderableToVisualIndex(e,r){let n=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=r>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(r):r;return n===null&&(n=e),i===null&&(i=r),[n,i]}countRenderableIndexes(e,r){const n=Math.min(e.getNotTrimmedIndexesLength(),r),i=e.getNearestNotHiddenIndex(n-1,-1);return i===null?0:e.getRenderableFromVisualIndex(i)+1}countRenderableColumns(){return this.countRenderableIndexes(this.hot.columnIndexMapper,this.settings.maxCols)}countRenderableRows(){return this.countRenderableIndexes(this.hot.rowIndexMapper,this.settings.maxRows)}countNotHiddenRowIndexes(e,r){return this.countNotHiddenIndexes(e,r,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,r){return this.countNotHiddenIndexes(e,r,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,r,n,i){if(isNaN(e)||e<0)return 0;const o=n.getNearestNotHiddenIndex(e,r),s=n.getRenderableFromVisualIndex(o);if(!Number.isInteger(s))return 0;let a=0;return r<0?a=s+1:r>0&&(a=i-s),a}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),r=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(r,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),r=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(r,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),r=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(r,1)}countRenderableColumnsInRange(e,r){let n=0;for(let i=e;i<=r;i++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)!==null&&(n+=1);return n}countRenderableRowsInRange(e,r){let n=0;for(let i=e;i<=r;i++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)!==null&&(n+=1);return n}getStylesHandler(){return this._wt.stylesHandler}getDefaultRowHeight(){return this._wt.stylesHandler.getDefaultRowHeight()}addClassNameToLicenseElement(e){var r;const n=(r=this.hot.rootElement.parentNode)===null||r===void 0?void 0:r.querySelector(".hot-display-license-info");n&&oe(n,e)}removeClassNameFromLicenseElement(e){var r;const n=(r=this.hot.rootElement.parentNode)===null||r===void 0?void 0:r.querySelector(".hot-display-license-info");n&&Ee(n,e)}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),r=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>r}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:or(Ni,this),isDataViewInstance:()=>lm(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,viewportColumnRenderingThreshold:()=>this.settings.viewportColumnRenderingThreshold,viewportRowRenderingThreshold:()=>this.settings.viewportRowRenderingThreshold,data:(o,s)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(o,s)),totalRows:()=>this.countRenderableRows(),totalColumns:()=>this.countRenderableColumns(),fixedColumnsStart:()=>this.countNotHiddenFixedColumnsStart(),fixedRowsTop:()=>this.countNotHiddenFixedRowsTop(),fixedRowsBottom:()=>this.countNotHiddenFixedRowsBottom(),shouldRenderInlineStartOverlay:()=>this.settings.fixedColumnsStart>0||e.rowHeaders().length>0,shouldRenderTopOverlay:()=>this.settings.fixedRowsTop>0||e.columnHeaders().length>0,shouldRenderBottomOverlay:()=>this.settings.fixedRowsBottom>0,minSpareRows:()=>this.settings.minSpareRows,renderAllRows:this.settings.renderAllRows,renderAllColumns:this.settings.renderAllColumns,rowHeaders:()=>{const o=[];return this.hot.hasRowHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(s):s;this.appendRowHeader(l,a)}),this.hot.runHooks("afterGetRowHeaderRenderers",o),gn(um,this,o.length),this.hot.getSettings().ariaTags&&Uu(Qh,this,BD).call(this)===this.hot.countCols()&&Uu(Qh,this,D5).call(this,or(um,this)),o},columnHeaders:()=>{const o=[];return this.hot.hasColHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(s):s;this.appendColHeader(l,a)}),this.hot.runHooks("afterGetColumnHeaderRenderers",o),gn(MR,this,o.length),o},columnWidth:o=>{const s=this.hot.columnIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getColWidth(s===null?o:s)},rowHeight:o=>{const s=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getRowHeight(s===null?o:s)},rowHeightByOverlayName:(o,s)=>{const a=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o),l=a===null?o:a;return this.hot.runHooks("modifyRowHeightByOverlayName",this.hot.getRowHeight(l),l,s)},cellRenderer:(o,s,a)=>{const[l,u]=this.translateFromRenderableToVisualIndex(o,s),c=this.hot.runHooks("modifyGetCellCoords",l,u,!1,"meta");let h=l,d=u;Array.isArray(c)&&([h,d]=c);const f=this.hot.getCellMeta(h,d),g=this.hot.colToProp(d);let w=this.hot.getDataAtRowProp(h,g);this.hot.hasHook("beforeValueRender")&&(w=this.hot.runHooks("beforeValueRender",w,f)),this.hot.runHooks("beforeRenderer",a,l,u,g,w,f),this.hot.getCellRenderer(f)(this.hot,a,l,u,g,w,f),this.hot.runHooks("afterRenderer",a,l,u,g,w,f)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&Ou(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=l,gn(ss,this,!0),gn(zu,this,{x:o.clientX,y:o.clientY}),this.hot.runHooks("beforeOnCellMouseDown",o,u,a,c),!Ja(o)&&(FD(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseDown",o,u,a),this.activeWt=this._wt)},onCellContextMenu:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,gn(ss,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",o,u,a),!Ja(o)&&(this.hot.runHooks("afterOnCellContextMenu",o,u,a),this.activeWt=this._wt)},onCellMouseOut:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOut",o,u,a),!Ja(o)&&(this.hot.runHooks("afterOnCellMouseOut",o,u,a),this.activeWt=this._wt)},onCellMouseOver:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOver",o,u,a,c),!Ja(o)&&(or(ss,this)&&(!or(zu,this)||or(zu,this).x!==o.clientX||or(zu,this).y!==o.clientY)&&FD(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseOver",o,u,a),this.activeWt=this._wt,gn(zu,this,null))},onCellMouseUp:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",o,u,a),!(Ja(o)||this.hot.isDestroyed)&&(this.hot.runHooks("afterOnCellMouseUp",o,u,a),this.activeWt=this._wt)},onCellCornerMouseDown:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",o)},onCellCornerDblClick:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",o)},beforeDraw:(o,s)=>this.beforeRender(o,s),onDraw:o=>this.afterRender(o),onBeforeViewportScrollVertically:(o,s)=>{const a=this.hot.rowIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollVertically",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onBeforeViewportScrollHorizontally:(o,s)=>{const a=this.hot.columnIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollHorizontally",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(o,s,a)=>{const l=this.hot.rowIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingRowHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onBeforeHighlightingColumnHeader:(o,s,a)=>{const l=this.hot.columnIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingColumnHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onAfterDrawSelection:(o,s,a)=>{let l;const[u,c]=this.translateFromRenderableToVisualIndex(o,s),h=this.hot.selection.getSelectedRange();if(h.size()>0){const f=h.peekByIndex(a??0);l=[f.from.row,f.from.col,f.to.row,f.to.col]}return this.hot.runHooks("afterDrawSelection",u,c,l,a)},onBeforeDrawBorders:(o,s)=>{const[a,l,u,c]=o,h=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(a),this.hot.columnIndexMapper.getVisualFromRenderableIndex(l),this.hot.rowIndexMapper.getVisualFromRenderableIndex(u),this.hot.columnIndexMapper.getVisualFromRenderableIndex(c)];return this.hot.runHooks("beforeDrawBorders",h,s)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onModifyRowHeaderWidth:o=>this.hot.runHooks("modifyRowHeaderWidth",o),onModifyGetCellCoords:(o,s,a,l)=>{const u=this.hot.rowIndexMapper,c=this.hot.columnIndexMapper,h=s>=0?c.getVisualFromRenderableIndex(s):s,d=o>=0?u.getVisualFromRenderableIndex(o):o,f=this.hot.runHooks("modifyGetCellCoords",d,h,a,l);if(Array.isArray(f)){const[g,w,v,b]=f;return[g>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(g,1)):g,w>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(w,1)):w,v>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(v,-1)):v,b>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(b,-1)):b]}},onModifyGetCoordsElement:(o,s)=>{const a=this.hot.rowIndexMapper,l=this.hot.columnIndexMapper,u=s>=0?l.getVisualFromRenderableIndex(s):s,c=o>=0?a.getVisualFromRenderableIndex(o):o,h=this.hot.runHooks("modifyGetCoordsElement",c,u);if(Array.isArray(h)){const[d,f]=h;return[d>=0?a.getRenderableFromVisualIndex(a.getNearestNotHiddenIndex(d,1)):d,f>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(f,1)):f]}},viewportRowCalculatorOverride:o=>{let s=this.settings.viewportRowRenderingOffset;if(s==="auto"&&this.settings.fixedRowsTop&&(s=10),s>0||s==="auto"){const a=this.countRenderableRows(),l=o.startRow,u=o.endRow;if(typeof s=="number")o.startRow=Math.max(l-s,0),o.endRow=Math.min(u+s,a-1);else if(s==="auto"){const c=Math.max(1,Math.ceil(u/a*12));o.startRow=Math.max(l-c,0),o.endRow=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",o)},viewportColumnCalculatorOverride:o=>{let s=this.settings.viewportColumnRenderingOffset;if(s==="auto"&&this.settings.fixedColumnsStart&&(s=10),s>0||s==="auto"){const a=this.countRenderableColumns(),l=o.startColumn,u=o.endColumn;if(typeof s=="number"&&(o.startColumn=Math.max(l-s,0),o.endColumn=Math.min(u+s,a-1)),s==="auto"){const c=Math.max(1,Math.ceil(u/a*6));o.startColumn=Math.max(l-c,0),o.endColumn=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",o)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const o=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||o}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new TR(e),this.activeWt=this._wt;const r=this._wt.wtTable.spreader,{width:n,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(n,i),this.eventManager.addEventListener(r,"mousedown",o=>{o.target===r&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(r,"contextmenu",o=>{o.target===r&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&this.hot.render()})}isTextSelectionAllowed(e){if(Fg(e))return!0;const r=Ka(e,this._wt.wtTable.spreader);return!!(this.settings.fragmentSelection===!0&&r||this.settings.fragmentSelection==="cell"&&this.isSelectedOnlyCell()&&r||!this.settings.fragmentSelection&&this.isCellEdited()&&this.isSelectedOnlyCell())}isMouseDown(){return or(ss,this)}isSelectedOnlyCell(){var e,r;return(e=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingleCell())!==null&&e!==void 0?e:!1}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,r){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,r)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,r){if(r.firstChild){const n=r.firstChild;if(!_e(n,"relative")){Zo(r),this.appendRowHeader(e,r);return}this.updateCellHeader(n.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:n,getRowHeader:i}=this.hot,o=n.createElement("div"),s=n.createElement("span");o.className="relative",s.className="rowHeader",this.updateCellHeader(s,e,i),o.appendChild(s),r.appendChild(o)}this.hot.runHooks("afterGetRowHeader",e,r)}appendColHeader(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hot.getColHeader,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;const o=()=>{const s=e>=0?this.hot.getColumnMeta(e).headerClassName:null;return s?s.split(" "):[]};if(r.firstChild){const s=r.firstChild;_e(s,"relative")?(this.updateCellHeader(s.querySelector(".colHeader"),e,n,i),s.className="",oe(s,["relative",...o()])):(Zo(r),this.appendColHeader(e,r,n,i))}else{const{rootDocument:s}=this.hot,a=s.createElement("div"),l=s.createElement("span"),u=o();a.classList.add("relative",...u),l.className="colHeader",this.settings.ariaTags&&(Pe(a,...Xo()),Pe(l,...Xo())),this.updateCellHeader(l,e,n,i),a.appendChild(l),r.appendChild(a)}this.hot.runHooks("afterGetColHeader",e,r,i)}updateCellHeader(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=r;const s=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(_e(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(r):_e(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(r))),o>-1?Iu(e,n(r,i)):(Za(e," "),oe(e,"cornerHeader"))}maximumVisibleElementWidth(e){const n=this._wt.wtViewport.getWorkspaceWidth()-e;return n>0?n:0}maximumVisibleElementHeight(e){const n=this._wt.wtViewport.getWorkspaceHeight()-e;return n>0?n:0}setLastSize(e,r){gn(PR,this,e),gn(IR,this,r)}getLastSize(){return{width:or(PR,this),height:or(IR,this)}}getFirstRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,r=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());return e.getNearestNotHiddenIndex(r??0,1)}getLastRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,r=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());return e.getNearestNotHiddenIndex(r??this.hot.countRows()-1,-1)}getFirstRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,r=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());return e.getNearestNotHiddenIndex(r??0,1)}getLastRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,r=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());return e.getNearestNotHiddenIndex(r??this.hot.countCols()-1,-1)}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn())}getFirstPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow())}getLastPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow())}getFirstPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn())}getLastPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn())}getColumnHeadersCount(){return or(MR,this)}getRowHeadersCount(){return or(um,this)}getViewportWidth(){return this._wt.wtViewport.getViewportWidth()}getWorkspaceWidth(){return this._wt.wtViewport.getWorkspaceWidth()}getViewportHeight(){return this._wt.wtViewport.getViewportHeight()}getWorkspaceHeight(){return this._wt.wtViewport.getWorkspaceHeight()}getElementOverlayName(e){var r;return((r=this._wt.wtOverlays.getParentOverlay(e))!==null&&r!==void 0?r:this._wt).wtTable.name}getOverlayByName(e){return this._wt.getOverlayByName(e)}getActiveOverlayName(){return this._wt.activeOverlayName}isVisible(){return this._wt.wtTable.isVisible()}hasVerticalScroll(){return this._wt.wtViewport.hasVerticalScroll()}hasHorizontalScroll(){return this._wt.wtViewport.hasHorizontalScroll()}getTableWidth(){return this._wt.wtTable.getWidth()}getTableHeight(){return this._wt.wtTable.getHeight()}getTableOffset(){return this._wt.wtViewport.getWorkspaceOffset()}getRowHeaderWidth(){return this._wt.wtViewport.getRowHeaderWidth()}getColumnHeaderHeight(){return this._wt.wtViewport.getColumnHeaderHeight()}isVerticallyScrollableByWindow(){return this._wt.wtViewport.isVerticallyScrollableByWindow()}isHorizontallyScrollableByWindow(){return this._wt.wtViewport.isHorizontallyScrollableByWindow()}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function BD(){return parseInt(this.hot.rootElement.getAttribute(Ag()[0]),10)}function D5(t){const e=Uu(Qh,this,BD).call(this)+t;Pe(this.hot.rootElement,...Ag(e))}function k5(){const t=this.hot.rootElement;this.hasVerticalScroll()?oe(t,"htHasScrollY"):Ee(t,"htHasScrollY"),this.hasHorizontalScroll()?oe(t,"htHasScrollX"):Ee(t,"htHasScrollX")}var jD={},UD={},zD;function L5(){if(zD)return UD;zD=1;var t=bt(),e=ur(),r=wu(),n=ln(),i=hr(),o=Qi(),s=un(),a=Ws(),l=a("every",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{every:function(c){i(this);try{n(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return!r(h,function(f,g){if(!c(f,d++))return g()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),UD}var YD;function $5(){return YD||(YD=1,L5()),jD}$5();const GD="ABCDEFGHIJKLMNOPQRSTUVWXYZ".length;function F5(t){let e=t+1,r="",n;for(;e>0;)n=(e-1)%GD,r=String.fromCharCode(65+n)+r,e=parseInt((e-n)/GD,10);return r}function qD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=t;const n=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(r=[t]),r.forEach((i,o)=>{Array.isArray(i)?i.forEach((s,a)=>{n.push([o+e,a,s])}):Object.keys(i).forEach(s=>{n.push([o+e,s,i[s]])})}),n}function KD(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&$e(t[0])&&(e=ES(t[0]))),e}function V5(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function W5(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function ed(t,e,r){return(e=B5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B5(t){var e=j5(t,"string");return typeof e=="symbol"?e:e+""}function j5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class U5{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];ed(this,"hot",void 0),ed(this,"data",void 0),ed(this,"dataType","array"),ed(this,"colToProp",()=>{}),ed(this,"propToCol",()=>{}),this.hot=e,this.data=r}modifyRowData(e){let r;return this.hot.hasHook("modifyRowData")&&(r=this.hot.runHooks("modifyRowData",e)),r!==void 0&&!Number.isInteger(r)?r:this.data[e]}getData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return!this.data||this.data.length===0?this.data:this.getByRange(null,null,e)}setData(e){this.data=e}getAtColumn(e){const r=[];return k(this.data,(n,i)=>{const o=this.getAtCell(i,e);r.push(o)}),r}getAtRow(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const o=r===void 0&&n===void 0,{dataDotNotation:s}=this.hot.getSettings();let a=null,l=null;if(a=this.modifyRowData(e),Array.isArray(a))l=[],o?a.forEach((u,c)=>{l[c]=this.getAtPhysicalCell(e,c,a)}):Ce(r,n,u=>{l[u-r]=this.getAtPhysicalCell(e,u,a)});else if($e(a)||ht(a))if(i?l=[]:l={},!o||i){const c=this.countFirstRowKeys()-1;Ce(0,c,h=>{const d=this.colToProp(h);if(h>=(r||0)&&h<=(n||c)&&!Number.isInteger(d)){const f=this.getAtPhysicalCell(e,d,a);i?l.push(f):s?RS(l,d,f):l[d]=f}})}else Fe(a,(u,c)=>{const h=this.getAtPhysicalCell(e,c,a);s?RS(l,c,h):l[c]=h});return l}setAtCell(e,r,n){if(!(e>=this.countRows()||r>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const i=xn(n);this.hot.runHooks("modifySourceData",e,r,i,"set"),i.isTouched()&&(n=i.value)}["__proto__","constructor","prototype"].includes(e)||(Number.isInteger(r)?this.data[e][r]=n:RS(this.data[e],r,n))}}getAtPhysicalCell(e,r,n){let i=null;if(n)if(typeof r=="string"){const{dataDotNotation:o}=this.hot.getSettings();i=o?y3(n,r):n[r]}else typeof r=="function"?i=r(n):i=n[r];if(this.hot.hasHook("modifySourceData")){const o=xn(i);this.hot.runHooks("modifySourceData",e,r,o,"get"),o.isTouched()&&(i=o.value)}return i}getAtCell(e,r){const n=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(r),n)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=!1,o=null,s=null,a=null,l=null;e===null||r===null?(i=!0,o=0,a=this.countRows()-1):(o=Math.min(e.row,r.row),s=Math.min(e.col,r.col),a=Math.max(e.row,r.row),l=Math.max(e.col,r.col));const u=[];return Ce(o,a,c=>{u.push(i?this.getAtRow(c,void 0,void 0,n):this.getAtRow(c,s,l,n))}),u}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return KD(this.data)}destroy(){this.data=null,this.hot=null}}var XD={},ZD={},JD;function z5(){if(JD)return ZD;JD=1;var t=bt(),e=ur(),r=wu(),n=ln(),i=hr(),o=Qi(),s=un(),a=Ws(),l=a("some",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{some:function(c){i(this);try{n(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return r(h,function(f,g){if(c(f,d++))return g()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),ZD}var QD;function Y5(){return QD||(QD=1,z5()),XD}Y5();function ek(t,e,r){return(e=G5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G5(t){var e=q5(t,"string");return typeof e=="symbol"?e:e+""}function q5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cl{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;ek(this,"indexedValues",[]),ek(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const r=this.indexedValues;if(e<r.length)return r[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,r){return e<this.indexedValues.length?(this.indexedValues[e]=r,this.runLocalHooks("change"),!0):!1}clear(){this.setDefaultValues()}getLength(){return this.getValues().length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,ht(this.initValueOrFn)?Ce(e-1,r=>this.indexedValues.push(this.initValueOrFn(r))):Ce(e-1,()=>this.indexedValues.push(this.initValueOrFn)),this.runLocalHooks("change")}init(e){return this.setDefaultValues(e),this.runLocalHooks("init"),this}insert(){this.runLocalHooks("change")}remove(){this.runLocalHooks("change")}destroy(){this.clearLocalHooks(),this.indexedValues=null,this.initValueOrFn=null}}wt(cl,Ar);function OR(t,e,r,n){const i=r.length?r[0]:void 0;return[...t.slice(0,i),...r.map((o,s)=>ht(n)?n(o,s):n),...i===void 0?[]:t.slice(i)]}function xR(t,e){return za(t,(r,n)=>e.includes(n)===!1)}class Js extends cl{insert(e,r){this.indexedValues=OR(this.indexedValues,e,r,this.initValueOrFn),super.insert(e,r)}remove(e){this.indexedValues=xR(this.indexedValues,e),super.remove(e)}}class hm extends Js{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return hn(this.getValues(),(e,r,n)=>(r&&e.push(n),e),[])}}function AR(t,e,r){return[...t.slice(0,e),...r,...t.slice(e)]}function td(t,e){return za(t,r=>e.includes(r)===!1)}function HR(t,e){return qe(t,r=>r-e.filter(n=>n<r).length)}function NR(t,e){const r=e[0],n=e.length;return qe(t,i=>i>=r?i+n:i)}function K5(t,e,r){return(e=X5(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function X5(t){var e=Z5(t,"string");return typeof e=="symbol"?e:e+""}function Z5(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dm extends cl{constructor(){super(...arguments),K5(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.orderOfIndexes.length;return e<this.indexedValues.length?(this.indexedValues[e]=r,this.orderOfIndexes.includes(e)===!1&&this.orderOfIndexes.splice(n,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=td(this.orderOfIndexes,[e]),ht(this.initValueOrFn)?super.setValueAtIndex(e,this.initValueOrFn(e)):super.setValueAtIndex(e,this.initValueOrFn)}getLength(){return this.orderOfIndexes.length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,r){this.indexedValues=OR(this.indexedValues,e,r,this.initValueOrFn),this.orderOfIndexes=NR(this.orderOfIndexes,r),super.insert(e,r)}remove(e){this.indexedValues=xR(this.indexedValues,e),this.orderOfIndexes=td(this.orderOfIndexes,e),this.orderOfIndexes=HR(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class rd extends Js{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return hn(this.getValues(),(e,r,n)=>(r&&e.push(n),e),[])}}const tk=new Map([["indexesSequence",{getListWithInsertedItems:AR,getListWithRemovedItems:td}],["physicallyIndexed",{getListWithInsertedItems:OR,getListWithRemovedItems:xR}]]),rk=t=>{if(tk.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return tk.get(t)};class nk extends cl{constructor(){super(e=>e)}insert(e,r){const n=NR(this.indexedValues,r);this.indexedValues=AR(n,e,r),super.insert(e,r)}remove(e){const r=td(this.indexedValues,e);this.indexedValues=HR(r,e),super.remove(e)}}const ik=new Map([["hiding",hm],["index",cl],["linkedPhysicalIndexToValue",dm],["physicalIndexToValue",Js],["trimming",rd]]);function J5(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!ik.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(ik.get(t))(e)}function Q5(t,e,r){return(e=e9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function e9(t){var e=t9(t,"string");return typeof e=="symbol"?e:e+""}function t9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class DR{constructor(){Q5(this,"collection",new Map)}register(e,r){this.collection.has(e)===!1&&(this.collection.set(e,r),r.addLocalHook("change",()=>this.runLocalHooks("change",r)))}unregister(e){const r=this.collection.get(e);we(r)&&(r.destroy(),this.collection.delete(e),this.runLocalHooks("change",r))}unregisterAll(){this.collection.forEach((e,r)=>this.unregister(r)),this.collection.clear()}get(e){return $t(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(r=>{r.remove(e)})}insertToEvery(e,r){this.collection.forEach(n=>{n.insert(e,r)})}initEvery(e){this.collection.forEach(r=>{r.init(e)})}}wt(DR,Ar);function kR(t,e,r){return(e=r9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function r9(t){var e=n9(t,"string");return typeof e=="symbol"?e:e+""}function n9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ok extends DR{constructor(e,r){super(),kR(this,"mergedValuesCache",[]),kR(this,"aggregationFunction",void 0),kR(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=r}getMergedValues(){if((arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const r=qe(this.get(),o=>o.getValues()),n=[],i=we(r[0])&&r[0].length||0;for(let o=0;o<i;o+=1){const s=[];for(let a=0;a<this.getLength();a+=1)s.push(r[a][o]);n.push(s)}return qe(n,this.aggregationFunction)}getMergedValueAtIndex(e,r){const n=this.getMergedValues(r)[e];return we(n)?n:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function i9(t,e,r){o9(t,e),e.set(t,r)}function o9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function s9(t,e,r){return t.set(sk(t,e),r),r}function a9(t,e){return t.get(sk(t,e))}function sk(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var LR=new WeakMap;class ak{constructor(){i9(this,LR,[])}subscribe(e){return this.addLocalHook("change",e),this._write(a9(LR,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){s9(LR,this,e)}}wt(ak,Ar);function lk(t,e){const r=[];let n=0,i=0;for(;n<t.length&&i<e.length;n++,i++)t[n]!==e[i]&&r.push({op:"replace",index:i,oldValue:t[n],newValue:e[i]});for(;n<e.length;n++)r.push({op:"insert",index:n,oldValue:void 0,newValue:e[n]});for(;i<t.length;i++)r.push({op:"remove",index:i,oldValue:t[i],newValue:void 0});return r}function nd(t,e,r){l9(t,e),e.set(t,r)}function l9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ai(t,e){return t.get(uk(t,e))}function fm(t,e,r){return t.set(uk(t,e),r),r}function uk(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var gm=new WeakMap,id=new WeakMap,mm=new WeakMap,pm=new WeakMap,wm=new WeakMap;class u9{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nd(this,gm,new Set),nd(this,id,[]),nd(this,mm,[]),nd(this,pm,!1),nd(this,wm,!1),fm(wm,this,e??!1)}createObserver(){const e=new ak;return ai(gm,this).add(e),e.addLocalHook("unsubscribe",()=>{ai(gm,this).delete(e)}),e._writeInitialChanges(lk(ai(id,this),ai(mm,this))),e}emit(e){let r=ai(mm,this);(!ai(pm,this)||ai(id,this).length!==e.length)&&(e.length===0?e=new Array(r.length).fill(ai(wm,this)):fm(id,this,new Array(e.length).fill(ai(wm,this))),ai(pm,this)||(fm(pm,this,!0),r=ai(id,this)));const n=lk(r,e);ai(gm,this).forEach(i=>i._write(n)),fm(mm,this,e)}}function Zr(t,e,r){return(e=c9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c9(t){var e=h9(t,"string");return typeof e=="symbol"?e:e+""}function h9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $R{constructor(){Zr(this,"indexesSequence",new nk),Zr(this,"trimmingMapsCollection",new ok(e=>e.some(r=>r===!0),!1)),Zr(this,"hidingMapsCollection",new ok(e=>e.some(r=>r===!0),!1)),Zr(this,"variousMapsCollection",new DR),Zr(this,"hidingChangesObservable",new u9({initialIndexValue:!1})),Zr(this,"notTrimmedIndexesCache",[]),Zr(this,"notHiddenIndexesCache",[]),Zr(this,"isBatched",!1),Zr(this,"indexesSequenceChanged",!1),Zr(this,"indexesChangeSource",void 0),Zr(this,"trimmedIndexesChanged",!1),Zr(this,"hiddenIndexesChanged",!1),Zr(this,"renderablePhysicalIndexesCache",[]),Zr(this,"fromPhysicalToVisualIndexesCache",new Map),Zr(this,"fromVisualToRenderableIndexesCache",new Map),this.indexesSequence.addLocalHook("change",()=>{this.indexesSequenceChanged=!0,this.updateCache(),this.runLocalHooks("indexesSequenceChange",this.indexesChangeSource),this.runLocalHooks("change",this.indexesSequence,null)}),this.trimmingMapsCollection.addLocalHook("change",e=>{this.trimmedIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.trimmingMapsCollection)}),this.hidingMapsCollection.addLocalHook("change",e=>{this.hiddenIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.hidingMapsCollection)}),this.variousMapsCollection.addLocalHook("change",e=>{this.runLocalHooks("change",e,this.variousMapsCollection)})}suspendOperations(){this.isBatched=!0}resumeOperations(){this.isBatched=!1,this.updateCache()}createChangesObserver(e){if(e!=="hiding")throw new Error(`Unsupported index map type "${e}".`);return this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,r,n){return this.registerMap(e,J5(r,n))}registerMap(e,r){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);r instanceof rd?this.trimmingMapsCollection.register(e,r):r instanceof hm?this.hidingMapsCollection.register(e,r):this.variousMapsCollection.register(e,r);const n=this.getNumberOfIndexes();return n>0&&r.init(n),r}unregisterMap(e){this.trimmingMapsCollection.unregister(e),this.hidingMapsCollection.unregister(e),this.variousMapsCollection.unregister(e)}unregisterAll(){this.trimmingMapsCollection.unregisterAll(),this.hidingMapsCollection.unregisterAll(),this.variousMapsCollection.unregisterAll()}getPhysicalFromVisualIndex(e){const r=this.notTrimmedIndexesCache[e];return we(r)?r:null}getPhysicalFromRenderableIndex(e){const r=this.renderablePhysicalIndexesCache[e];return we(r)?r:null}getVisualFromPhysicalIndex(e){const r=this.fromPhysicalToVisualIndexesCache.get(e);return we(r)?r:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const r=this.fromVisualToRenderableIndexesCache.get(e);return we(r)?r:null}getNearestNotHiddenIndex(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.getPhysicalFromVisualIndex(e)===null)return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const o=Array.from(this.fromVisualToRenderableIndexesCache.keys());let s=-1;return r>0?s=o.findIndex(a=>a>e):s=o.reverse().findIndex(a=>a<e),s===-1?n?this.getNearestNotHiddenIndex(e,-r,!1):null:o[s]}initToLength(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...new Array(e).keys()],this.notHiddenIndexesCache=[...new Array(e).keys()],this.suspendOperations(),this.indexesChangeSource="init",this.indexesSequence.init(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.initEvery(e),this.resumeOperations(),this.suspendOperations(),this.hidingMapsCollection.initEvery(e),this.variousMapsCollection.initEvery(e),this.resumeOperations(),this.runLocalHooks("init")}fitToLength(e){const r=this.getNumberOfIndexes();if(e<r){const n=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(n)}else this.insertIndexes(r,e-r)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){this.indexesChangeSource===void 0&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),this.indexesChangeSource==="update"&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notTrimmedIndexesCache:this.getIndexesSequence().filter(n=>this.isTrimmed(n)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(n=>this.isHidden(n)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(n=>this.isHidden(n)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,r){typeof e=="number"&&(e=[e]);const n=qe(e,u=>this.getPhysicalFromVisualIndex(u)),i=this.getNotTrimmedIndexesLength(),o=e.length,s=td(this.getIndexesSequence(),n),a=s.filter(u=>this.isTrimmed(u)===!1);let l=s.indexOf(a[a.length-1])+1;if(r+o<i){const u=a[r];l=s.indexOf(u)}this.indexesChangeSource="move",this.setIndexesSequence(AR(s,l,n)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,r){const n=this.getNotTrimmedIndexes()[e],i=we(n)?n:this.getNumberOfIndexes(),o=this.getIndexesSequence().includes(n)?this.getIndexesSequence().indexOf(n):this.getNumberOfIndexes(),s=qe(new Array(r).fill(i),(a,l)=>a+l);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(o,s),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(o,s),this.hidingMapsCollection.insertToEvery(o,s),this.variousMapsCollection.insertToEvery(o,s),this.resumeOperations()}removeIndexes(e){this.suspendOperations(),this.indexesChangeSource="remove",this.indexesSequence.remove(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.removeFromEvery(e),this.hidingMapsCollection.removeFromEvery(e),this.variousMapsCollection.removeFromEvery(e),this.resumeOperations()}updateCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const r=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&r===!0)&&(this.trimmingMapsCollection.updateCache(),this.hidingMapsCollection.updateCache(),this.notTrimmedIndexesCache=this.getNotTrimmedIndexes(!1),this.notHiddenIndexesCache=this.getNotHiddenIndexes(!1),this.renderablePhysicalIndexesCache=this.getRenderableIndexes(!1),this.cacheFromPhysicalToVisualIndexes(),this.cacheFromVisualToRenderableIndexes(),this.hiddenIndexesChanged&&this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()),this.runLocalHooks("cacheUpdated",{indexesSequenceChanged:this.indexesSequenceChanged,trimmedIndexesChanged:this.trimmedIndexesChanged,hiddenIndexesChanged:this.hiddenIndexesChanged}),this.indexesSequenceChanged=!1,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1)}cacheFromPhysicalToVisualIndexes(){const e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let r=0;r<e;r+=1){const n=this.getPhysicalFromVisualIndex(r);this.fromPhysicalToVisualIndexesCache.set(n,r)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let r=0;r<e;r+=1){const n=this.getPhysicalFromRenderableIndex(r),i=this.getVisualFromPhysicalIndex(n);this.fromVisualToRenderableIndexesCache.set(i,r)}}}wt($R,Ar);function d9(t,e){return Fe(e,(r,n)=>{$t(t[n])&&(t[n]=r)}),t}function ck(t){const r=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return r?`${r[1].toLowerCase()}-${r[2].toUpperCase()}`:t}function hk(t){we(t)&&MS(at`Language with code "${t}" was not found. You should register particular language\x20
521
+ before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function f9(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:g9,getValues:m9}=Mi("phraseFormatters");function p9(t,e){g9(t,e)}function w9(){return m9()}p9("pluralize",f9);const dk="ContextMenu:items",Ae=dk,FR=`${Ae}.noItems`,VR=`${Ae}.insertRowAbove`,WR=`${Ae}.insertRowBelow`,BR=`${Ae}.insertColumnOnTheLeft`,jR=`${Ae}.insertColumnOnTheRight`,UR=`${Ae}.removeRow`,zR=`${Ae}.removeColumn`,YR=`${Ae}.undo`,GR=`${Ae}.redo`,vm=`${Ae}.readOnly`,qR=`${Ae}.clearColumn`,KR=`${Ae}.copy`,XR=`${Ae}.copyWithHeaders`,ZR=`${Ae}.copyWithGroupHeaders`,JR=`${Ae}.copyHeadersOnly`,QR=`${Ae}.cut`,eE=`${Ae}.freezeColumn`,tE=`${Ae}.unfreezeColumn`,rE=`${Ae}.mergeCells`,nE=`${Ae}.unmergeCells`,iE=`${Ae}.addComment`,oE=`${Ae}.editComment`,sE=`${Ae}.removeComment`,aE=`${Ae}.readOnlyComment`,lE=`${Ae}.align`,uE=`${Ae}.align.left`,cE=`${Ae}.align.center`,hE=`${Ae}.align.right`,dE=`${Ae}.align.justify`,fE=`${Ae}.align.top`,gE=`${Ae}.align.middle`,mE=`${Ae}.align.bottom`,pE=`${Ae}.borders`,wE=`${Ae}.borders.top`,vE=`${Ae}.borders.right`,yE=`${Ae}.borders.bottom`,CE=`${Ae}.borders.left`,bE=`${Ae}.borders.remove`,SE=`${Ae}.nestedHeaders.insertChildRow`,RE=`${Ae}.nestedHeaders.detachFromParent`,EE=`${Ae}.hideColumn`,TE=`${Ae}.showColumn`,_E=`${Ae}.hideRow`,ME=`${Ae}.showRow`,Jr="Filters:",Wt=`${Jr}conditions`,ym=`${Wt}.none`,PE=`${Wt}.isEmpty`,IE=`${Wt}.isNotEmpty`,OE=`${Wt}.isEqualTo`,xE=`${Wt}.isNotEqualTo`,AE=`${Wt}.beginsWith`,HE=`${Wt}.endsWith`,NE=`${Wt}.contains`,DE=`${Wt}.doesNotContain`,v9=`${Wt}.byValue`,kE=`${Wt}.greaterThan`,LE=`${Wt}.greaterThanOrEqualTo`,$E=`${Wt}.lessThan`,FE=`${Wt}.lessThanOrEqualTo`,VE=`${Wt}.isBetween`,WE=`${Wt}.isNotBetween`,BE=`${Wt}.after`,jE=`${Wt}.before`,UE=`${Wt}.today`,zE=`${Wt}.tomorrow`,YE=`${Wt}.yesterday`,GE=`${Jr}labels.filterByCondition`,qE=`${Jr}labels.filterByValue`,KE=`${Jr}labels.conjunction`,Cm=`${Jr}labels.disjunction`,bm=`${Jr}values.blankCells`,XE=`${Jr}buttons.selectAll`,ZE=`${Jr}buttons.clear`,JE=`${Jr}buttons.ok`,QE=`${Jr}buttons.cancel`,e0=`${Jr}buttons.placeholder.search`,t0=`${Jr}buttons.placeholder.value`,r0=`${Jr}buttons.placeholder.secondValue`,n0="CheckboxRenderer:",i0=`${n0}checked`,o0=`${n0}unchecked`,y9=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:i0,CHECKBOX_RENDERER_NAMESPACE:n0,CHECKBOX_UNCHECKED:o0,CONTEXTMENU_ITEMS_ADD_COMMENT:iE,CONTEXTMENU_ITEMS_ALIGNMENT:lE,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:mE,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:cE,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:dE,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:uE,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:gE,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:hE,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:fE,CONTEXTMENU_ITEMS_BORDERS:pE,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:yE,CONTEXTMENU_ITEMS_BORDERS_LEFT:CE,CONTEXTMENU_ITEMS_BORDERS_RIGHT:vE,CONTEXTMENU_ITEMS_BORDERS_TOP:wE,CONTEXTMENU_ITEMS_CLEAR_COLUMN:qR,CONTEXTMENU_ITEMS_COPY:KR,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:JR,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:ZR,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:XR,CONTEXTMENU_ITEMS_CUT:QR,CONTEXTMENU_ITEMS_EDIT_COMMENT:oE,CONTEXTMENU_ITEMS_FREEZE_COLUMN:eE,CONTEXTMENU_ITEMS_HIDE_COLUMN:EE,CONTEXTMENU_ITEMS_HIDE_ROW:_E,CONTEXTMENU_ITEMS_INSERT_LEFT:BR,CONTEXTMENU_ITEMS_INSERT_RIGHT:jR,CONTEXTMENU_ITEMS_MERGE_CELLS:rE,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:RE,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:SE,CONTEXTMENU_ITEMS_NO_ITEMS:FR,CONTEXTMENU_ITEMS_READ_ONLY:vm,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:aE,CONTEXTMENU_ITEMS_REDO:GR,CONTEXTMENU_ITEMS_REMOVE_BORDERS:bE,CONTEXTMENU_ITEMS_REMOVE_COLUMN:zR,CONTEXTMENU_ITEMS_REMOVE_COMMENT:sE,CONTEXTMENU_ITEMS_REMOVE_ROW:UR,CONTEXTMENU_ITEMS_ROW_ABOVE:VR,CONTEXTMENU_ITEMS_ROW_BELOW:WR,CONTEXTMENU_ITEMS_SHOW_COLUMN:TE,CONTEXTMENU_ITEMS_SHOW_ROW:ME,CONTEXTMENU_ITEMS_UNDO:YR,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:tE,CONTEXTMENU_ITEMS_UNMERGE_CELLS:nE,CONTEXT_MENU_ITEMS_NAMESPACE:dk,FILTERS_BUTTONS_CANCEL:QE,FILTERS_BUTTONS_CLEAR:ZE,FILTERS_BUTTONS_OK:JE,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:e0,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:r0,FILTERS_BUTTONS_PLACEHOLDER_VALUE:t0,FILTERS_BUTTONS_SELECT_ALL:XE,FILTERS_CONDITIONS_AFTER:BE,FILTERS_CONDITIONS_BEFORE:jE,FILTERS_CONDITIONS_BEGINS_WITH:AE,FILTERS_CONDITIONS_BETWEEN:VE,FILTERS_CONDITIONS_BY_VALUE:v9,FILTERS_CONDITIONS_CONTAINS:NE,FILTERS_CONDITIONS_EMPTY:PE,FILTERS_CONDITIONS_ENDS_WITH:HE,FILTERS_CONDITIONS_EQUAL:OE,FILTERS_CONDITIONS_GREATER_THAN:kE,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:LE,FILTERS_CONDITIONS_LESS_THAN:$E,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:FE,FILTERS_CONDITIONS_NAMESPACE:Wt,FILTERS_CONDITIONS_NONE:ym,FILTERS_CONDITIONS_NOT_BETWEEN:WE,FILTERS_CONDITIONS_NOT_CONTAIN:DE,FILTERS_CONDITIONS_NOT_EMPTY:IE,FILTERS_CONDITIONS_NOT_EQUAL:xE,FILTERS_CONDITIONS_TODAY:UE,FILTERS_CONDITIONS_TOMORROW:zE,FILTERS_CONDITIONS_YESTERDAY:YE,FILTERS_DIVS_FILTER_BY_CONDITION:GE,FILTERS_DIVS_FILTER_BY_VALUE:qE,FILTERS_LABELS_CONJUNCTION:KE,FILTERS_LABELS_DISJUNCTION:Cm,FILTERS_NAMESPACE:Jr,FILTERS_VALUES_BLANK_CELLS:bm},Symbol.toStringTag,{value:"Module"}));/**
522
+ * @preserve
523
+ * Authors: Handsoncode
524
+ * Last updated: Nov 15, 2017
525
+ *
526
+ * Description: Definition file for English - United States language-country.
527
+ */const fk={languageCode:"en-US",[FR]:"No available options",[VR]:"Insert row above",[WR]:"Insert row below",[BR]:"Insert column left",[jR]:"Insert column right",[UR]:["Remove row","Remove rows"],[zR]:["Remove column","Remove columns"],[YR]:"Undo",[GR]:"Redo",[vm]:"Read only",[qR]:"Clear column",[lE]:"Alignment",[uE]:"Left",[cE]:"Center",[hE]:"Right",[dE]:"Justify",[fE]:"Top",[gE]:"Middle",[mE]:"Bottom",[eE]:"Freeze column",[tE]:"Unfreeze column",[pE]:"Borders",[wE]:"Top",[vE]:"Right",[yE]:"Bottom",[CE]:"Left",[bE]:"Remove border(s)",[iE]:"Add comment",[oE]:"Edit comment",[sE]:"Delete comment",[aE]:"Read-only comment",[rE]:"Merge cells",[nE]:"Unmerge cells",[KR]:"Copy",[XR]:["Copy with header","Copy with headers"],[ZR]:["Copy with group header","Copy with group headers"],[JR]:["Copy header only","Copy headers only"],[QR]:"Cut",[SE]:"Insert child row",[RE]:"Detach from parent",[EE]:["Hide column","Hide columns"],[TE]:["Show column","Show columns"],[_E]:["Hide row","Hide rows"],[ME]:["Show row","Show rows"],[ym]:"None",[PE]:"Is empty",[IE]:"Is not empty",[OE]:"Is equal to",[xE]:"Is not equal to",[AE]:"Begins with",[HE]:"Ends with",[NE]:"Contains",[DE]:"Does not contain",[kE]:"Greater than",[LE]:"Greater than or equal to",[$E]:"Less than",[FE]:"Less than or equal to",[VE]:"Is between",[WE]:"Is not between",[BE]:"After",[jE]:"Before",[UE]:"Today",[zE]:"Tomorrow",[YE]:"Yesterday",[bm]:"Blank cells",[GE]:"Filter by condition",[qE]:"Filter by value",[KE]:"And",[Cm]:"Or",[XE]:"Select all",[ZE]:"Clear",[JE]:"OK",[QE]:"Cancel",[e0]:"Search",[t0]:"Value",[r0]:"Second value",[i0]:"Checked",[o0]:"Unchecked"},C9=y9,s0=fk.languageCode,{register:b9,getItem:gk,hasItem:S9,getValues:R9}=Mi("languagesDictionaries");mk(fk);function mk(t,e){let r=t,n=e;return $e(t)&&(n=t,r=n.languageCode),E9(r,n),b9(r,Kr(n)),Kr(n)}function E9(t,e){t!==s0&&d9(e,gk(s0))}function pk(t){return a0(t)?Kr(gk(t)):null}function a0(t){return S9(t)}function T9(){return R9()}function wk(t,e,r){const n=pk(t);if(n===null)return null;const i=n[e];if($t(i))return null;const o=_9(i,r);return Array.isArray(o)?o[0]:o}function _9(t,e){let r=t;return k(w9(),n=>{r=n(t,e)}),r}function M9(t){let e=ck(t);return a0(e)||(e=s0,hk(t)),e}function P9(t,e,r){return(e=I9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I9(t){var e=O9(t,"string");return typeof e=="symbol"?e:e+""}function O9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class as extends yD{constructor(e,r){super(e,null),P9(this,"visualCellRange",null),this.visualCellRange=r||null,this.commit()}add(e){return this.visualCellRange===null?this.visualCellRange=this.settings.createCellRange(e):this.visualCellRange.expand(e),this}clear(){return this.visualCellRange=null,super.clear()}trimToVisibleCellsRangeOnly(e){let{from:r,to:n}=e,i=this.getNearestNotHiddenCoords(r,1),o=this.getNearestNotHiddenCoords(n,-1);return i===null||o===null?null:((i.row>o.row||i.col>o.col)&&(i=r,o=n),this.settings.createCellRange(i,i,o))}getNearestNotHiddenCoords(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r;const i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,r);if(i===null)return null;const o=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,n);return o===null?null:this.settings.createCellCoords(i,o)}getNearestNotHiddenIndex(e,r,n){return r<0?r:e.getNearestNotHiddenIndex(r,n)}commit(){if(this.visualCellRange===null)return this;const e=this.trimToVisibleCellsRangeOnly(this.visualCellRange);return e===null?this.cellRange=null:this.cellRange=this.createRenderableCellRange(e.from,e.to),this}syncWith(e){const r=e.from.clone().normalize(),n=e.getVerticalDirection()==="N-S"?1:-1,i=e.getHorizontalDirection()==="W-E"?1:-1,o=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let s=null;if((o===null||o.col===null||o.row===null)&&(s=this.getNearestNotHiddenCoords(r,n,i)),s!==null&&e.overlaps(s)){const a=e.highlight.clone();if(a.row>=0&&(a.row=s.row),a.col>=0&&(a.col=s.col),this.cellRange===null){const l=this.settings.visualToRenderableCoords(a);this.cellRange=this.settings.createCellRange(l)}e.setHighlight(a)}return this.settings.selectionType==="focus"&&o!==null&&s===null&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:r}=this.cellRange;return[Math.min(e.row,r.row),Math.min(e.col,r.col),Math.max(e.row,r.row),Math.max(e.col,r.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),r=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,r.row,r.col]}createRenderableCellRange(e,r){const n=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(r);return n.row===null||n.col===null||i.row===null||i.col===null?null:this.settings.createCellRange(n,n,i)}}function l0(t){let{activeHeaderClassName:e,...r}=t;return new as({className:e,...r,selectionType:CD})}function x9(t){let{areaCornerVisible:e,...r}=t;return new as({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...r,selectionType:gR})}function A9(t){let{...e}=t;return new as({className:"highlight",...e,selectionType:gR})}function H9(t){let{columnClassName:e,...r}=t;return new as({className:e,...r,selectionType:G6})}function N9(t){let{cellCornerVisible:e,...r}=t;return new as({className:"current",headerAttributes:[mS()],border:{width:2,color:"#4b89ff",cornerVisible:e},...r,selectionType:qh})}function D9(t){let{border:e,visualCellRange:r,...n}=t;return new as({...e,...n,selectionType:q6},r)}function k9(t){let{...e}=t;return new as({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:z6})}function vk(t){let{headerClassName:e,...r}=t;return new as({className:e,...r,selectionType:fR})}function L9(t){let{rowClassName:e,...r}=t;return new as({className:e,...r,selectionType:Y6})}function $9(t,e){F9(t,e),e.add(t)}function F9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mn(t,e,r){return(e=V9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function V9(t){var e=W9(t,"string");return typeof e=="symbol"?e:e+""}function W9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ls(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var ho=new WeakSet;class B9{constructor(e){$9(this,ho),mn(this,"options",void 0),mn(this,"layerLevel",0),mn(this,"focus",void 0),mn(this,"fill",void 0),mn(this,"layeredAreas",new Map),mn(this,"areas",new Map),mn(this,"rowHeaders",new Map),mn(this,"columnHeaders",new Map),mn(this,"activeRowHeaders",new Map),mn(this,"activeColumnHeaders",new Map),mn(this,"activeCornerHeaders",new Map),mn(this,"rowHighlights",new Map),mn(this,"columnHighlights",new Map),mn(this,"customSelections",[]),this.options=e,this.focus=N9(e),this.fill=k9(e)}isEnabledFor(e,r){let n=e;e===qh&&(n="current");let i=this.options.disabledCellSelection(r.row,r.col);return typeof i=="string"&&(i=[i]),i===!1||Array.isArray(i)&&!i.includes(n)}useLayerLevel(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return ls(ho,this,us).call(this,this.layeredAreas,x9)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return ls(ho,this,us).call(this,this.areas,A9)}getAreas(){return[...this.areas.values()]}createRowHeader(){return ls(ho,this,us).call(this,this.rowHeaders,vk)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return ls(ho,this,us).call(this,this.columnHeaders,vk)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return ls(ho,this,us).call(this,this.activeRowHeaders,l0)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return ls(ho,this,us).call(this,this.activeColumnHeaders,l0)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return ls(ho,this,us).call(this,this.activeCornerHeaders,l0)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return ls(ho,this,us).call(this,this.rowHighlights,L9)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return ls(ho,this,us).call(this,this.columnHighlights,H9)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(D9({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),k(this.areas.values(),e=>void e.clear()),k(this.layeredAreas.values(),e=>void e.clear()),k(this.rowHeaders.values(),e=>void e.clear()),k(this.columnHeaders.values(),e=>void e.clear()),k(this.activeRowHeaders.values(),e=>void e.clear()),k(this.activeColumnHeaders.values(),e=>void e.clear()),k(this.activeCornerHeaders.values(),e=>void e.clear()),k(this.rowHighlights.values(),e=>void e.clear()),k(this.columnHighlights.values(),e=>void e.clear())}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}}function us(t,e){const r=this.layerLevel;if(t.has(r))return t.get(r);const n=e({layerLevel:r,...this.options});return t.set(r,n),n}function yk(t,e,r){return(e=j9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j9(t){var e=U9(t,"string");return typeof e=="symbol"?e:e+""}function U9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class z9{constructor(e){yk(this,"ranges",[]),yk(this,"createCellRange",void 0),this.createCellRange=e}isEmpty(){return this.size()===0}set(e){return this.clear(),this.ranges.push(this.createCellRange(e)),this}add(e){return this.ranges.push(this.createCellRange(e)),this}pop(){return this.ranges.pop(),this}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){return this.ranges.some(r=>r.includes(e))}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}peekByIndex(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,r;return e>=0&&e<this.size()&&(r=this.ranges[e]),r}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}}function Y9(t,e){Ck(t,e),e.add(t)}function u0(t,e,r){Ck(t,e),e.set(t,r)}function Ck(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function et(t,e){return t.get(wr(t,e))}function Sm(t,e,r){return t.set(wr(t,e),r),r}function wr(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Rm=new WeakMap,Tt=new WeakMap,Di=new WeakMap,Cr=new WeakSet;class c0{constructor(e,r){Y9(this,Cr),u0(this,Rm,void 0),u0(this,Tt,void 0),u0(this,Di,{x:0,y:0}),Sm(Rm,this,e),Sm(Tt,this,r)}transformStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=et(Tt,this).createCellCoords(e,r);let o=et(Rm,this).current().highlight;const s=et(Tt,this).visualToRenderableCoords(o);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),s.row!==null&&s.col!==null){const{width:u,height:c}=wr(Cr,this,Sk).call(this),{row:h,col:d}=wr(Cr,this,Rk).call(this,o),f=et(Tt,this).fixedRowsBottom(),g=et(Tt,this).minSpareRows(),w=et(Tt,this).minSpareCols(),v=et(Tt,this).autoWrapRow(),b=et(Tt,this).autoWrapCol(),p=et(Tt,this).createCellCoords(h+i.row,d+i.col);if(p.row>=c){const T=xn(n&&g>0&&f===0),M=p.col+1,P=et(Tt,this).createCellCoords(p.row-c,M>=u?M-u:M);this.runLocalHooks("beforeColumnWrap",T,wr(Cr,this,Yu).call(this,P),M>=u),T.value?this.runLocalHooks("insertRowRequire",et(Tt,this).countRenderableRows()):b&&p.assign(P)}else if(p.row<0){const T=xn(b),M=p.col-1,P=et(Tt,this).createCellCoords(c+p.row,M<0?u+M:M);this.runLocalHooks("beforeColumnWrap",T,wr(Cr,this,Yu).call(this,P),M<0),b&&p.assign(P)}if(p.col>=u){const T=xn(n&&w>0),M=p.row+1,P=et(Tt,this).createCellCoords(M>=c?M-c:M,p.col-u);this.runLocalHooks("beforeRowWrap",T,wr(Cr,this,Yu).call(this,P),M>=c),T.value?this.runLocalHooks("insertColRequire",et(Tt,this).countRenderableColumns()):v&&p.assign(P)}else if(p.col<0){const T=xn(v),M=p.row-1,P=et(Tt,this).createCellCoords(M<0?c+M:M,u+p.col);this.runLocalHooks("beforeRowWrap",T,wr(Cr,this,Yu).call(this,P),M<0),v&&p.assign(P)}const{rowDir:_,colDir:O}=wr(Cr,this,bk).call(this,p);a=_,l=O,o=wr(Cr,this,Yu).call(this,p)}return this.runLocalHooks("afterTransformStart",o,a,l),o}transformEnd(e,r){const n=et(Tt,this).createCellCoords(e,r),i=et(Rm,this).current(),o=et(Tt,this).visualToRenderableCoords(i.highlight),s=wr(Cr,this,h0).call(this,i.to.row,i.from.row),a=wr(Cr,this,d0).call(this,i.to.col,i.from.col),l=i.to.clone();let u=0,c=0;if(this.runLocalHooks("beforeTransformEnd",n),o.row!==null&&o.col!==null&&s!==null&&a!==null){const{row:h,col:d}=wr(Cr,this,Rk).call(this,i.highlight),f=et(Tt,this).createCellCoords(s+n.row,a+n.col),g=i.getTopStartCorner(),w=i.getTopEndCorner(),v=i.getBottomEndCorner();if(n.col<0&&a>=d&&f.col<d){const O=f.col-d;f.col=wr(Cr,this,d0).call(this,g.col,w.col)+O}else if(n.col>0&&a<=d&&f.col>d){const O=wr(Cr,this,d0).call(this,w.col,g.col),T=Math.max(f.col-O,1);f.col=O+T}if(n.row<0&&s>=h&&f.row<h){const O=f.row-h;f.row=wr(Cr,this,h0).call(this,g.row,v.row)+O}else if(n.row>0&&s<=h&&f.row>h){const O=wr(Cr,this,h0).call(this,v.row,g.row),T=Math.max(f.row-O,1);f.row=O+T}const{rowDir:b,colDir:p}=wr(Cr,this,bk).call(this,f);u=b,c=p;const _=wr(Cr,this,Yu).call(this,f);n.row===0&&n.col!==0?l.col=_.col:n.row!==0&&n.col===0?l.row=_.row:(l.row=_.row,l.col=_.col)}return this.runLocalHooks("afterTransformEnd",l,u,c),l}setOffsetSize(e){let{x:r,y:n}=e;Sm(Di,this,{x:r,y:n})}resetOffsetSize(){Sm(Di,this,{x:0,y:0})}}function bk(t){const{width:e,height:r}=wr(Cr,this,Sk).call(this);let n=0,i=0;return t.row<0?(n=-1,t.row=0):t.row>0&&t.row>=r&&(n=1,t.row=r-1),t.col<0?(i=-1,t.col=0):t.col>0&&t.col>=e&&(i=1,t.col=e-1),{rowDir:n,colDir:i}}function Sk(){return{width:et(Di,this).x+et(Tt,this).countRenderableColumns(),height:et(Di,this).y+et(Tt,this).countRenderableRows()}}function h0(t,e){const r=et(Tt,this).findFirstNonHiddenRenderableRow(t,e);return r===null?null:et(Di,this).y+r}function d0(t,e){const r=et(Tt,this).findFirstNonHiddenRenderableColumn(t,e);return r===null?null:et(Di,this).x+r}function Rk(t){const{row:e,col:r}=et(Tt,this).visualToRenderableCoords(t);if(e===null||r===null)throw new Error("Renderable coords are not visible.");return et(Tt,this).createCellCoords(et(Di,this).y+e,et(Di,this).x+r)}function Yu(t){const e=t.clone();return e.col=t.col-et(Di,this).x,e.row=t.row-et(Di,this).y,et(Tt,this).renderableToVisualCoords(e)}wt(c0,Ar);const Em=0,Tm=1,Ek=2,f0=3,G9=[f0,Ek],q9=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],g0=Symbol("root"),Tk=Symbol("child");function Gu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g0;if(e!==g0&&e!==Tk)throw new Error("The second argument is used internally only and cannot be overwritten.");const r=Array.isArray(t),n=e===g0;let i=Em;if(r){const o=t[0];t.length===0?i=Tm:n&&o instanceof Bh?i=f0:n&&Array.isArray(o)?i=Gu(o,Tk):t.length>=2&&t.length<=4&&!t.some((a,l)=>!q9[l].includes(typeof a))&&(i=Ek)}return i}function od(t){let{createCellCoords:e,createCellRange:r,keepDirection:n=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!G9.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const s=t===f0;let a=s?o.from.row:o[0],l=s?o.from.col:o[1],u=s?o.to.row:o[2],c=s?o.to.col:o[3];if(typeof i=="function"&&(typeof l=="string"&&(l=i(l)),typeof c=="string"&&(c=i(c))),$t(u)&&(u=a),$t(c)&&(c=l),!n){const f=a,g=l,w=u,v=c;a=Math.min(f,w),l=Math.min(g,v),u=Math.max(f,w),c=Math.max(g,v)}const h=e(a,l),d=e(u,c);return r(h,h,d)}}function K9(t){const e=Gu(t.getSelected());if(e===Em||e===Tm)return[];const r=od(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),n=new Set;k(t.getSelected(),s=>{const{from:a,to:l}=r(s),u=Math.max(a.col,0),c=l.col-u+1;k(Array.from(new Array(c),(h,d)=>u+d),h=>{n.has(h)||n.add(h)})});const i=Array.from(n).sort((s,a)=>s-a);return hn(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function X9(t){const e=Gu(t.getSelected());if(e===Em||e===Tm)return[];const r=od(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),n=new Set;k(t.getSelected(),s=>{const{from:a,to:l}=r(s),u=Math.max(a.row,0),c=l.row-u+1;k(Array.from(new Array(c),(h,d)=>u+d),h=>{n.has(h)||n.add(h)})});const i=Array.from(n).sort((s,a)=>s-a);return hn(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function qu(t,e,r){Z9(t,e),e.set(t,r)}function Z9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hl(t,e,r){return(e=J9(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J9(t){var e=Q9(t,"string");return typeof e=="symbol"?e:e+""}function Q9(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xt(t,e){return t.get(_k(t,e))}function fo(t,e,r){return t.set(_k(t,e),r),r}function _k(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Fr=new WeakMap,dl=new WeakMap,_m=new WeakMap,sd=new WeakMap,Mm=new WeakMap,ad=new WeakMap;class Mk{constructor(e,r){var n=this;hl(this,"settings",void 0),hl(this,"tableProps",void 0),hl(this,"inProgress",!1),hl(this,"selectedRange",new z9((i,o,s)=>this.tableProps.createCellRange(i,o,s))),hl(this,"highlight",void 0),qu(this,Fr,void 0),qu(this,dl,void 0),hl(this,"selectedByRowHeader",new Set),hl(this,"selectedByColumnHeader",new Set),qu(this,_m,!1),qu(this,sd,!1),qu(this,Mm,"unknown"),qu(this,ad,-1),this.settings=e,this.tableProps=r,this.highlight=new B9({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[mS()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(i,o)=>this.tableProps.isDisabledCellSelection(i,o),cellCornerVisible:function(){return n.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return n.isAreaCornerVisible(...arguments)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),createCellRange:(i,o,s)=>this.tableProps.createCellRange(i,o,s)}),fo(Fr,this,new c0(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return n.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return n.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),fo(dl,this,new c0(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,i.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,i.getOuterBottomEndCorner().col)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return n.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return n.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),xt(Fr,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("beforeModifyTransformStart",...o)}),xt(Fr,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("afterModifyTransformStart",...o)}),xt(Fr,this).addLocalHook("beforeTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("beforeModifyTransformEnd",...o)}),xt(Fr,this).addLocalHook("afterTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("afterModifyTransformEnd",...o)}),xt(Fr,this).addLocalHook("insertRowRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("insertRowRequire",...o)}),xt(Fr,this).addLocalHook("insertColRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("insertColRequire",...o)}),xt(Fr,this).addLocalHook("beforeRowWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("beforeRowWrap",...o)}),xt(Fr,this).addLocalHook("beforeColumnWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("beforeColumnWrap",...o)}),xt(dl,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("beforeModifyTransformFocus",...o)}),xt(dl,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("afterModifyTransformFocus",...o)})}getSelectedRange(){return this.selectedRange}markSource(e){fo(Mm,this,e)}markEndSource(){fo(Mm,this,"unknown")}getSelectionSource(){return xt(Mm,this)}setExpectedLayers(e){fo(ad,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,fo(ad,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const o=this.settings.selectionMode==="multiple",s=$t(r)?this.tableProps.getShortcutManager().isCtrlPressed():r,a=e.clone();fo(_m,this,!1),this.runLocalHooks(`beforeSetRangeStart${n?"Only":""}`,a),(!o||o&&!s&&$t(r))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(i.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),n||this.setRangeEnd(e)}setRangeStartOnly(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,r,!0,n)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const r=e.clone(),n=this.tableProps.countRows(),i=this.tableProps.countCols(),o=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((n>0||i>0)&&(n===0&&r.col<0&&!o||i===0&&r.row<0&&!o))return;this.runLocalHooks("beforeSetRangeEnd",r),this.begin();const s=this.selectedRange.current();if(this.settings.navigableHeaders||s.highlight.normalize(),this.settings.selectionMode==="single")s.setFrom(s.highlight),s.setTo(s.highlight);else{const l=s.getHorizontalDirection(),u=s.getVerticalDirection(),c=this.isMultiple();s.setTo(r),c&&(l!==s.getHorizontalDirection()||s.getWidth()===1&&!s.includes(s.highlight))&&s.from.assign({col:s.highlight.col}),c&&(u!==s.getVerticalDirection()||s.getHeight()===1&&!s.includes(s.highlight))&&s.from.assign({row:s.highlight.row})}n>0&&i>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!s.isSingleHeader())&&s.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.selectedRange.current().highlight),this.applyAndCommit();const a=xt(ad,this)===-1||this.selectedRange.size()===xt(ad,this);this.runLocalHooks("afterSetRangeEnd",e,a)}applyAndCommit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.selectedRange.current(),r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();const n=this.tableProps.countRows(),i=this.tableProps.countCols();r<this.highlight.layerLevel&&(k(this.highlight.getAreas(),g=>void g.clear()),k(this.highlight.getLayeredAreas(),g=>void g.clear()),k(this.highlight.getRowHeaders(),g=>void g.clear()),k(this.highlight.getColumnHeaders(),g=>void g.clear()),k(this.highlight.getActiveRowHeaders(),g=>void g.clear()),k(this.highlight.getActiveColumnHeaders(),g=>void g.clear()),k(this.highlight.getActiveCornerHeaders(),g=>void g.clear()),k(this.highlight.getRowHighlights(),g=>void g.clear()),k(this.highlight.getColumnHighlights(),g=>void g.clear())),this.highlight.useLayerLevel(r);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();if(o.clear(),s.clear(),a.clear(),l.clear(),u.clear(),c.clear(),h.clear(),d.clear(),f.clear(),this.highlight.isEnabledFor(gR,e.highlight)&&(this.isMultiple()||r>=1)&&(o.add(e.from).add(e.to).commit(),s.add(e.from).add(e.to).commit(),r===1)){const g=this.selectedRange.previous();this.highlight.useLayerLevel(r-1),this.highlight.createArea().add(g.from).commit().syncWith(g),this.highlight.createLayeredArea().add(g.from).commit().syncWith(g),this.highlight.useLayerLevel(r)}if(this.highlight.isEnabledFor(fR,e.highlight)){if(!e.isSingleHeader()){const v=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),b=this.tableProps.createCellCoords(e.to.row,-1),p=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),_=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(v).commit(),l.add(p).commit(),d.add(v).commit(),f.add(p).commit()):(a.add(v).add(b).commit(),l.add(p).add(_).commit(),d.add(v).add(b).commit(),f.add(p).add(_).commit())}const g=!xt(sd,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),w=!xt(sd,this)&&this.isEntireColumnSelected()&&(n>0&&n===e.getHeight()||n===0&&this.isSelectedByColumnHeader());g&&u.add(this.tableProps.createCellCoords(Math.max(e.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(e.to.row,0),-1)).commit(),w&&c.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(e.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(e.to.col,0))).commit(),g&&w&&h.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e){if(this.selectedRange.isEmpty())return;const r=this.selectedRange.current();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const n=this.highlight.getFocus();n.clear(),r.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(qh,r.highlight)&&n.add(r.highlight).commit().syncWith(r),this.inProgress||(fo(_m,this,!0),this.runLocalHooks("afterSetFocus",r.highlight))}transformStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.settings.navigableHeaders?xt(Fr,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):xt(Fr,this).resetOffsetSize(),this.setRangeStart(xt(Fr,this).transformStart(e,r,n))}transformEnd(e,r){this.settings.navigableHeaders?xt(Fr,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):xt(Fr,this).resetOffsetSize(),this.setRangeEnd(xt(Fr,this).transformEnd(e,r))}transformFocus(e,r){const n=this.selectedRange.current(),{row:i,col:o}=n.getOuterTopStartCorner(),s=this.tableProps.countRenderableColumnsInRange(0,o-1),a=this.tableProps.countRenderableRowsInRange(0,i-1);n.highlight.isHeader()?xt(dl,this).setOffsetSize({x:o<0?Math.abs(o):-s,y:i<0?Math.abs(i):-a}):xt(dl,this).setOffsetSize({x:o<0?0:-s,y:i<0?0:-a});const l=xt(dl,this).transformStart(e,r);this.setRangeFocus(l.normalize())}shiftRows(e,r){if(!this.isSelected())return;const n=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||n.getOuterTopStartCorner().row>=e){const{from:i,to:o,highlight:s}=n,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=u?-1:0,h=u?0:r;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(Ze(i.row+h,c,a-1),i.col),f=this.tableProps.createCellCoords(Ze(o.row+r,c,a-1),o.col);this.markSource("shift"),s.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(Ze(s.row+r,0,a-1),s.col)):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}shiftColumns(e,r){if(!this.isSelected())return;const n=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||n.getOuterTopStartCorner().col>=e){const{from:i,to:o,highlight:s}=n,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=l?-1:0,h=l?0:r;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(i.row,Ze(i.col+h,c,a-1)),f=this.tableProps.createCellCoords(o.row,Ze(o.col+r,c,a-1));this.markSource("shift"),s.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(s.row,Ze(s.col+r,0,a-1))):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=xn(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&xt(_m,this)}isSelectedByRowHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner(e)&&(e===-1?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const r=i=>{const{col:o}=i.getOuterTopStartCorner(),s=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(s>0&&o<0||s===0)&&i.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>r(i));const n=this.selectedRange.peekByIndex(e);return n?r(n):!1}isSelectedByColumnHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner()&&(e===-1?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const r=i=>{const{row:o}=i.getOuterTopStartCorner(),s=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(s>0&&o<0||s===0)&&i.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>r(i));const n=this.selectedRange.peekByIndex(e);return n?r(n):!1}isSelectedByAnyHeader(){return this.isSelectedByRowHeader(-1)||this.isSelectedByColumnHeader(-1)||this.isSelectedByCorner()}isSelectedByCorner(){return this.selectedByColumnHeader.has(this.getLayerLevel())&&this.selectedByRowHeader.has(this.getLayerLevel())}inInSelection(e){return this.selectedRange.includes(e)}isCellCornerVisible(){return this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&!this.isMultiple()}isCellVisible(e){const r=this.tableProps.visualToRenderableCoords(e);return r.row!==null&&r.col!==null}isAreaCornerVisible(e){return Number.isInteger(e)&&e!==this.getLayerLevel()?!1:this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&this.isMultiple()}clear(){this.selectedRange.clear(),this.highlight.clear()}deselect(){this.isSelected()&&(this.inProgress=!1,this.clear(),this.runLocalHooks("afterDeselect"))}selectAll(){var e;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const o=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),l=this.tableProps.countColHeaders(),u=n?-l:0,c=r?-a:0;if(u===0&&c===0&&(o===0||s===0))return;let h=(e=this.getSelectedRange().current())===null||e===void 0?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:f}=i;fo(sd,this,f),d&&Number.isInteger(d==null?void 0:d.row)&&Number.isInteger(d==null?void 0:d.col)&&(h=this.tableProps.createCellCoords(Ze(d.row,u,o-1),Ze(d.col,c,s-1)));const g=this.tableProps.createCellCoords(u,c),w=this.tableProps.createCellCoords(o-1,s-1);this.clear(),this.setRangeStartOnly(g,void 0,h),c<0&&this.selectedByRowHeader.add(this.getLayerLevel()),u<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(w),this.finish(),fo(sd,this,!1)}selectCells(e){var r=this;const n=Gu(e);if(n===Tm)return!1;if(n===Em)throw new Error(at`Unsupported format of the selection ranges was passed. To select cells pass\x20
528
+ the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
529
+ columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=od(n,{createCellCoords:function(){return r.tableProps.createCellCoords(...arguments)},createCellRange:function(){return r.tableProps.createCellRange(...arguments)},propToCol:l=>this.tableProps.propToCol(l),keepDirection:!0}),o=this.settings.navigableHeaders,s={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:o?this.tableProps.countRowHeaders():0,countColHeaders:o?this.tableProps.countColHeaders():0},a=!e.some(l=>{const u=i(l),c=u.isValid(s);return!(c&&!u.containsHeaders()||c&&u.containsHeaders()&&u.isSingleHeader())});return a&&(this.clear(),this.setExpectedLayers(e.length),k(e,l=>{const{from:u,to:c}=i(l);this.setRangeStartOnly(u.clone(),!1),this.setRangeEnd(c.clone())}),this.finish()),a}selectColumns(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=typeof e=="string"?this.tableProps.propToCol(e):e,o=typeof r=="string"?this.tableProps.propToCol(r):r,s=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),u=l===0?0:-l,c=this.tableProps.createCellCoords(u,i),h=this.tableProps.createCellCoords(s-1,o),d=this.tableProps.createCellRange(c,c,h).isValid({countRows:s,countCols:a,countRowHeaders:0,countColHeaders:l});if(d){let f=0,g=0;Number.isInteger(n==null?void 0:n.row)&&Number.isInteger(n==null?void 0:n.col)?(f=Ze(n.row,u,s-1),g=Ze(n.col,Math.min(i,o),Math.max(i,o))):(f=Ze(n,u,s-1),g=i);const w=this.tableProps.createCellCoords(f,g),v=l===0?0:Ze(w.row,u,-1),b=s-1,p=this.tableProps.createCellCoords(v,i),_=this.tableProps.createCellCoords(b,o);this.runLocalHooks("beforeSelectColumns",p,_,w),p.row=v,_.row=b,this.setRangeStartOnly(p,void 0,w),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(_),this.runLocalHooks("afterSelectColumns",p,_,w),this.finish()}return d}selectRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=this.tableProps.countRows(),o=this.tableProps.countCols(),s=this.tableProps.countRowHeaders(),a=s===0?0:-s,l=this.tableProps.createCellCoords(e,a),u=this.tableProps.createCellCoords(r,o-1),c=this.tableProps.createCellRange(l,l,u).isValid({countRows:i,countCols:o,countRowHeaders:s,countColHeaders:0});if(c){let h=0,d=0;Number.isInteger(n==null?void 0:n.row)&&Number.isInteger(n==null?void 0:n.col)?(h=Ze(n.row,Math.min(e,r),Math.max(e,r)),d=Ze(n.col,a,o-1)):(h=e,d=Ze(n,a,o-1));const f=this.tableProps.createCellCoords(h,d),g=s===0?0:Ze(f.col,a,-1),w=o-1,v=this.tableProps.createCellCoords(e,g),b=this.tableProps.createCellCoords(r,w);this.runLocalHooks("beforeSelectRows",v,b,f),v.col=g,b.col=w,this.setRangeStartOnly(v,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(b),this.runLocalHooks("afterSelectRows",v,b,f),this.finish()}return c}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),r=this.tableProps.countCols();if(e===0||r===0){this.deselect();return}const n=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:i,to:o,highlight:s}=n;this.clear(),s.assign({row:Ze(s.row,-1/0,e-1),col:Ze(s.col,-1/0,r-1)}),i.assign({row:Ze(i.row,-1/0,e-1),col:Ze(i.col,-1/0,r-1)}),o.assign({row:Ze(o.row,0,e-1),col:Ze(o.col,0,r-1)}),this.selectedRange.ranges.push(n),this.highlight.isEnabledFor(qh,this.selectedRange.current().highlight)&&this.highlight.getFocus().add(s).commit().syncWith(n),this.applyAndCommit(n)}commit(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const r=this.getLayerLevel(),n=this.selectedRange.current();this.highlight.isEnabledFor(qh,n.highlight)&&this.highlight.getFocus().commit().syncWith(n);for(let i=0;i<this.selectedRange.size();i+=1){this.highlight.useLayerLevel(i);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();o.commit(),s.commit(),a.commit(),l.commit(),u.commit(),c.commit(),h.commit(),d.commit(),f.commit()}this.highlight.useLayerLevel(r)}}wt(Mk,Ar);const Pk=/^(\r\n|\n\r|\r|\n)/,e8=/^[^\t\r\n]+/,Ik=/^\t/;function t8(t){const e=[[""]];if(t.length===0)return e;let r=0,n=0,i;for(;t.length>0&&i!==t.length;)if(i=t.length,t.match(Ik))t=t.replace(Ik,""),r+=1,e[n][r]="";else if(t.match(Pk))t=t.replace(Pk,""),r=0,n+=1,e[n]=[""];else{let o="";if(t.startsWith('"')){let s=0,a=!0;for(;a;){const l=t.slice(0,1);l==='"'&&(s+=1),o+=l,t=t.slice(1),(t.length===0||t.match(/^[\t\r\n]/)&&s%2===0)&&(a=!1)}o=o.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,l=>new Array(Math.floor(l.length/2)).fill('"').join(""))}else{const s=t.match(e8);o=s?s[0]:"",t=t.slice(o.length)}e[n][r]=o}return e}function ld(t){let e,r,n,i,o="",s;for(e=0,r=t.length;e<r;e+=1){for(i=t[e].length,n=0;n<i;n+=1)n>0&&(o+=" "),s=t[e][n],typeof s=="string"?s.indexOf(`
530
+ `)>-1?o+=`"${s.replace(/"/g,'""')}"`:o+=s:s==null?o+="":o+=s;e!==r-1&&(o+=`
531
+ `)}return o}function fl(t,e,r){return(e=r8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function r8(t){var e=n8(t,"string");return typeof e=="symbol"?e:e+""}function n8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ku{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,r,n){fl(this,"hot",void 0),fl(this,"metaManager",void 0),fl(this,"tableMeta",void 0),fl(this,"dataSource",void 0),fl(this,"duckSchema",void 0),fl(this,"colToPropCache",void 0),fl(this,"propToColCache",void 0),this.hot=e,this.metaManager=n,this.tableMeta=n.getTableMeta(),this.dataSource=r,this.refreshDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();if(typeof e>"u")throw new Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");const r=this.tableMeta.columns;let n;if(this.colToPropCache=[],this.propToColCache=new Map,r){let i=0,o=0,s=!1;if(typeof r=="function"){const a=ES(e);i=a>0?a:this.countFirstRowKeys(),s=!0}else{const a=this.tableMeta.maxCols;i=Math.min(a,r.length)}for(n=0;n<i;n++){const a=s?r(n):r[n];if($e(a)){if(typeof a.data<"u"){const l=s?o:n;this.colToPropCache[l]=a.data,this.propToColCache.set(a.data,l)}o+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return KD(this.dataSource)}recursiveDuckColumns(e,r,n){let i=r,o=n,s;return typeof i>"u"&&(i=0,o=""),typeof e=="object"&&!Array.isArray(e)&&Fe(e,(a,l)=>{a===null?(s=o+l,this.colToPropCache.push(s),this.propToColCache.set(s,i),i+=1):i=this.recursiveDuckColumns(a,i,`${l}.`)}),i}colToProp(e){if(Number.isInteger(e)===!1)return e;const r=this.hot.toPhysicalColumn(e);return r===null?e:this.colToPropCache&&we(this.colToPropCache[r])?this.colToPropCache[r]:r}propToCol(e){const r=this.propToColCache.get(e);if(we(r))return this.hot.toVisualColumn(r);const n=this.hot.toVisualColumn(e);return n===null?e:n}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?xh(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:n,mode:i="above"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.hot.countSourceRows();let s=o,a=0,l=e;if((typeof l!="number"||l>=o)&&(l=o),l<this.hot.countRows()&&(s=this.hot.toPhysicalRow(l)),this.hot.runHooks("beforeCreateRow",l,r,n)===!1||s===null)return{delta:0};const c=this.tableMeta.maxRows,h=this.getSchema().length,d=[];for(;a<r&&o+a<c;){let g=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?g=Kr(this.getSchema()):(g=[],Ce(h-1,()=>g.push(null))):this.hot.dataType==="function"?g=this.tableMeta.dataSchema(l+a):(g={},Wg(g,this.getSchema())),d.push(g),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(s=Math.min(s+1,o)),this.spliceData(s,0,d);const f=this.hot.toVisualRow(s);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),a>0&&(e==null?this.metaManager.createRow(null,a):n!=="auto"&&this.metaManager.createRow(s,r)),this.hot.runHooks("afterCreateRow",f,a,n),{delta:a,startPhysicalIndex:s}}createCol(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:n,mode:i="start"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");const o=this.dataSource,s=this.tableMeta.maxCols,a=this.hot.countSourceCols();let l=e;if((typeof l!="number"||l>=a)&&(l=a),this.hot.runHooks("beforeCreateCol",l,r,n)===!1)return{delta:0};let c=a;l<this.hot.countCols()&&(c=this.hot.toPhysicalColumn(l));const h=this.hot.countSourceRows();let d=this.hot.countCols(),f=0,g=c;i==="end"&&(g=Math.min(g+1,a));const w=g;for(;f<r&&d<s;){if(typeof l!="number"||l>=d)if(h>0)for(let b=0;b<h;b+=1)typeof o[b]>"u"&&(o[b]=[]),o[b].push(null);else o.push([null]);else for(let b=0;b<h;b++)o[b].splice(g,0,null);f+=1,g+=1,d+=1}this.hot.columnIndexMapper.insertIndexes(l,f),f>0&&(e==null?this.metaManager.createColumn(null,f):n!=="auto"&&this.metaManager.createColumn(w,r));const v=this.hot.toVisualColumn(w);return this.hot.runHooks("afterCreateCol",v,f,n),this.refreshDuckSchema(),{delta:f,startPhysicalIndex:w}}removeRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0,i=Number.isInteger(e)?e:-r;const o=this.visualRowsToPhysical(i,r),s=this.hot.countSourceRows();if(i=(s+i)%s,this.hot.runHooks("beforeRemoveRow",i,o.length,o,n)===!1)return!1;const l=o.length;if(this.filterData(i,l,o),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(o);const c=we(this.tableMeta.columns)||we(this.tableMeta.dataSchema)||this.tableMeta.colHeaders;this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&!c&&this.hot.columnIndexMapper.setIndexesSequence([])}return o.slice(0).sort((c,h)=>h-c).forEach(c=>{this.metaManager.removeRow(c,1)}),this.hot.runHooks("afterRemoveRow",i,l,o,n),!0}removeCol(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;if(this.hot.dataType==="object"||this.tableMeta.columns)throw new Error("cannot remove column with object data source or columns option specified");let i=typeof e!="number"?-r:e;i=(this.hot.countCols()+i)%this.hot.countCols();const o=this.visualColumnsToPhysical(i,r),s=o.slice(0).sort((h,d)=>d-h);if(this.hot.runHooks("beforeRemoveCol",i,r,o,n)===!1)return!1;let l=!0;const u=s.length,c=this.dataSource;for(let h=0;h<u;h++)l&&o[0]!==o[h]-h&&(l=!1);if(l)for(let h=0,d=this.hot.countSourceRows();h<d;h++)c[h].splice(o[0],r),h===0&&this.metaManager.removeColumn(o[0],r);else for(let h=0,d=this.hot.countSourceRows();h<d;h++)for(let f=0;f<u;f++)c[h].splice(s[f],1),h===0&&this.metaManager.removeColumn(s[f],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(o),!this.tableMeta.rowHeaders&&this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,r,o,n),this.refreshDuckSchema(),!0}spliceCol(e,r,n){const i=this.hot.getDataAtCol(e),o=i.slice(r,r+n),s=i.slice(r+n);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];lH(l,s);let c=0;for(;c<n;)l.push(null),c+=1;return MK(l),this.hot.populateFromArray(r,e,l,null,null,"spliceCol"),o}spliceRow(e,r,n){const i=this.hot.getSourceDataAtRow(e),o=i.slice(r,r+n),s=i.slice(r+n);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];lH(l,s);let c=0;for(;c<n;)l.push(null),c+=1;return this.hot.populateFromArray(e,r,[l],null,null,"spliceRow"),o}spliceData(e,r,n){if(this.hot.runHooks("beforeDataSplice",e,r,n)!==!1){const o=[...this.dataSource.slice(0,e),...n,...this.dataSource.slice(e)];this.dataSource.length=0,o.forEach(s=>this.dataSource.push(s))}}filterData(e,r,n){let i=this.hot.runHooks("filterData",e,r,n);Array.isArray(i)===!1&&(i=this.dataSource.filter((o,s)=>n.indexOf(s)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,r){const n=this.hot.toPhysicalRow(e);let i=this.dataSource[n];const o=this.hot.runHooks("modifyRowData",n);i=isNaN(o)?o:i;const{dataDotNotation:s}=this.hot.getSettings();let a=null;if(i&&i.hasOwnProperty&&gr(i,r))a=i[r];else if(s&&typeof r=="string"&&r.indexOf(".")>-1){let l=i;if(!l)return null;const u=r.split(".");for(let c=0,h=u.length;c<h;c++)if(l=l[u[c]],typeof l>"u")return null;a=l}else typeof r=="function"&&(a=r(this.dataSource.slice(n,n+1)[0]));if(this.hot.hasHook("modifyData")){const l=xn(a);this.hot.runHooks("modifyData",n,this.propToCol(r),l,"get"),l.isTouched()&&(a=l.value)}return a}getCopyable(e,r){return this.hot.getCellMeta(e,this.propToCol(r)).copyable?this.get(e,r):""}set(e,r,n){const i=this.hot.toPhysicalRow(e);let o=n,s=this.dataSource[i];const a=this.hot.runHooks("modifyRowData",i);if(s=isNaN(a)?a:s,this.hot.hasHook("modifyData")){const u=xn(o);this.hot.runHooks("modifyData",i,this.propToCol(r),u,"set"),u.isTouched()&&(o=u.value)}const{dataDotNotation:l}=this.hot.getSettings();if(s&&s.hasOwnProperty&&gr(s,r))s[r]=o;else if(l&&typeof r=="string"&&r.indexOf(".")>-1){let u=s,c=0,h;const d=r.split(".");for(c=0,h=d.length-1;c<h;c++){if(d[c]==="__proto__"||d[c]==="constructor"||d[c]==="prototype")return;typeof u[d[c]]>"u"&&(u[d[c]]={}),u=u[d[c]]}u[d[c]]=o}else if(typeof r=="function")r(this.dataSource.slice(i,i+1)[0],o);else{if(r==="__proto__"||r==="constructor"||r==="prototype")return;s[r]=o}}visualRowsToPhysical(e,r){const n=this.hot.countSourceRows(),i=[];let o=(n+e)%n,s=r,a;for(;o<n&&s;)a=this.hot.toPhysicalRow(o),i.push(a),s-=1,o+=1;return i}visualColumnsToPhysical(e,r){const n=this.hot.countCols(),i=[];let o=(n+e)%n,s=r;for(;o<n&&s;){const a=this.hot.toPhysicalColumn(o);i.push(a),s-=1,o+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let r=0;r<this.hot.countCols();r++)this.set(e,this.colToProp(r),"")}getLength(){const e=this.tableMeta.maxRows;let r;e<0||e===0?r=0:r=e||1/0;const n=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(n,r)}getAll(){const e={row:0,col:0},r={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-r.row===0&&!this.hot.countSourceRows()?[]:this.getRange(e,r,Ku.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,r,n){const i=[];let o,s,a;const l=this.tableMeta.maxRows,u=this.tableMeta.maxCols;if(l===0||u===0)return[];const c=n===Ku.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(l-1,0),Math.max(e.row,r.row)),d=Math.min(Math.max(u-1,0),Math.max(e.col,r.col));for(o=Math.min(e.row,r.row);o<=h;o++){a=[];const f=o>=0?this.hot.toPhysicalRow(o):o;for(s=Math.min(e.col,r.col);s<=d&&f!==null;s++)a.push(c.call(this,o,this.colToProp(s)));f!==null&&i.push(a)}return i}getText(e,r){return ld(this.getRange(e,r,Ku.DESTINATION_RENDERER))}getCopyableText(e,r){return ld(this.getRange(e,r,Ku.DESTINATION_CLIPBOARD_GENERATOR))}destroy(){this.hot=null,this.metaManager=null,this.dataSource=null,this.duckSchema=null,this.colToPropCache.length=0,this.propToColCache.clear(),this.propToColCache=void 0}}const{register:i8,getItem:o8,hasItem:Ok,getNames:hme,getValues:dme}=Mi("cellTypes");function s8(t){if(!Ok(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
532
+ Cell type must be an object or a string mapped to an object registered by
533
+ "Handsontable.cellTypes.registerCellType" method`);return o8(t)}function ki(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:r,renderer:n,validator:i}=e;r&&Hn(t,r),n&&ri(t,n),i&&Nu(t,i),i8(t,e)}function a8(t,e){var r;return t==="CELL_TYPE"?!1:((r=e._automaticallyAssignedMetaProps)===null||r===void 0?void 0:r.has(t))||!gr(e,t)}function Pm(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const n=typeof e.type=="string"?s8(e.type):e.type;if(t._automaticallyAssignedMetaProps&&Fe(e,(o,s)=>void t._automaticallyAssignedMetaProps.delete(s)),!$e(n))return;r===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};Fe(n,(o,s)=>{if(a8(s,r)){var a;i[s]=o,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(s)}}),fr(t,i)}function l8(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function r(){}v3(r,t);for(let n=0;n<e.length;n++)r.prototype[e[n]]=void 0;return r}function Im(t){return Number.isInteger(t)&&t>=0}function Om(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function xm(t){return t==null}const xk=()=>({_automaticallyAssignedMetaProps:void 0,activeHeaderClassName:"ht__active_highlight",allowEmpty:!0,allowHtml:!1,allowInsertColumn:!0,allowInsertRow:!0,allowInvalid:!0,allowRemoveColumn:!0,allowRemoveRow:!0,ariaTags:!0,autoColumnSize:void 0,autoRowSize:void 0,autoWrapCol:!1,autoWrapRow:!1,bindRowsWithHeaders:void 0,cell:[],cells:void 0,checkedTemplate:void 0,className:void 0,colHeaders:null,collapsibleColumns:void 0,columnHeaderHeight:void 0,columns:void 0,columnSorting:void 0,columnSummary:void 0,colWidths:void 0,commentedCellClassName:"htCommentCell",comments:!1,contextMenu:void 0,copyable:!0,copyPaste:!0,correctFormat:!1,currentColClassName:void 0,currentHeaderClassName:"ht__highlight",currentRowClassName:void 0,customBorders:!1,data:void 0,dataDotNotation:!0,dataSchema:void 0,dateFormat:"DD/MM/YYYY",timeFormat:"h:mm:ss a",datePickerConfig:void 0,defaultDate:void 0,disableVisualSelection:!1,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,enterBeginsEditing:!0,enterMoves:{col:0,row:1},fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,fixedColumnsLeft:0,fixedColumnsStart:0,fixedRowsBottom:0,fixedRowsTop:0,formulas:void 0,fragmentSelection:!1,headerClassName:void 0,height:void 0,hiddenColumns:void 0,hiddenRows:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(t){let e,r,n;for(e=0,r=this.countRows();e<r;e++)if(n=this.getDataAtCell(e,t),qt(n)===!1)return!1;return!0},isEmptyRow(t){let e,r,n,i;for(e=0,r=this.countCols();e<r;e++)if(n=this.getDataAtCell(t,e),qt(n)===!1)return typeof n=="object"?(i=this.getCellMeta(t,e),SS(this.getSchema()[i.prop],n)):!1;return!0},label:void 0,language:"en-US",layoutDirection:"inherit",licenseKey:void 0,locale:"en-US",manualColumnFreeze:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,maxCols:1/0,maxRows:1/0,mergeCells:!1,minCols:0,minRows:0,minSpareCols:0,minSpareRows:0,multiColumnSorting:void 0,navigableHeaders:!1,tabNavigation:!0,nestedHeaders:void 0,nestedRows:void 0,noWordWrapClassName:"htNoWrap",numericFormat:void 0,observeDOMVisibility:!0,outsideClickDeselects:!0,persistentState:void 0,placeholder:void 0,placeholderCellClassName:"htPlaceholder",preventOverflow:!1,preventWheel:!1,readOnly:!1,readOnlyCellClassName:"htDimmed",renderAllRows:!1,renderAllColumns:!1,renderer:void 0,rowHeaders:void 0,rowHeaderWidth:void 0,rowHeights:void 0,search:!1,selectionMode:"multiple",selectOptions:void 0,skipColumnOnPaste:!1,skipRowOnPaste:!1,sortByRelevance:!0,source:void 0,startCols:5,startRows:5,stretchH:"none",strict:void 0,tableClassName:void 0,themeName:void 0,tabMoves:{row:0,col:1},title:void 0,trimDropdown:!0,trimRows:void 0,trimWhitespace:!0,type:"text",uncheckedTemplate:void 0,undo:!0,validator:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",viewportColumnRenderingThreshold:0,viewportRowRenderingThreshold:0,visibleRows:10,width:void 0,wordWrap:!0});function Ak(t,e,r){return(e=u8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u8(t){var e=c8(t,"string");return typeof e=="symbol"?e:e+""}function c8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function h8(){return class{}}class d8{constructor(e){Ak(this,"metaCtor",h8()),Ak(this,"meta",void 0),this.meta=this.metaCtor.prototype,fr(this.meta,xk()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var r;fr(this.meta,e),Pm(this.meta,{...e,type:(r=e.type)!==null&&r!==void 0?r:this.meta.type},e)}}function f8(t,e,r){return(e=g8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g8(t){var e=m8(t,"string");return typeof e=="symbol"?e:e+""}function m8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class p8{constructor(e){f8(this,"meta",void 0);const r=e.getMetaConstructor();this.meta=new r}getMeta(){return this.meta}updateMeta(e){fr(this.meta,e),Pm(this.meta,e,e)}}function Am(t,e,r){return(e=w8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w8(t){var e=v8(t,"string");return typeof e=="symbol"?e:e+""}function v8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Hm{constructor(e){Am(this,"valueFactory",void 0),Am(this,"data",[]),Am(this,"index",[]),Am(this,"holes",new Set),this.valueFactory=e}obtain(e){Om(()=>Im(e),"Expecting an unsigned number.");const r=this._getStorageIndexByKey(e);let n;if(r>=0)n=this.data[r],n===void 0&&(n=this.valueFactory(e),this.data[r]=n);else if(n=this.valueFactory(e),this.holes.size>0){const i=this.holes.values().next().value;this.holes.delete(i),this.data[i]=n,this.index[e]=i}else this.data.push(n),this.index[e]=this.data.length-1;return n}insert(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Om(()=>Im(e)||xm(e),"Expecting an unsigned number or null/undefined argument.");const n=[],i=this.data.length;for(let s=0;s<r;s++)n.push(i+s),this.data.push(void 0);const o=xm(e)?this.index.length:e;this.index=[...this.index.slice(0,o),...n,...this.index.slice(o)]}remove(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Om(()=>Im(e)||xm(e),"Expecting an unsigned number or null/undefined argument.");const n=this.index.splice(xm(e)?this.index.length-r:e,r);for(let i=0;i<n.length;i++){const o=n[i];typeof o=="number"&&this.holes.add(o)}}size(){return this.data.length-this.holes.size}values(){return this.data.filter((e,r)=>e!==void 0&&!this.holes.has(r))[Symbol.iterator]()}entries(){const e=[];for(let n=0;n<this.data.length;n++){const i=this._getKeyByStorageIndex(n);i!==-1&&this.data[n]!==void 0&&e.push([i,this.data[n]])}let r=0;return{next:()=>{if(r<e.length){const n=e[r];return r+=1,{value:n,done:!1}}return{done:!0}}}}clear(){this.data=[],this.index=[],this.holes.clear()}_getStorageIndexByKey(e){return this.index.length>e?this.index[e]:-1}_getKeyByStorageIndex(e){return this.index.indexOf(e)}[Symbol.iterator](){return this.entries()}}function Hk(t,e,r){return(e=y8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y8(t){var e=C8(t,"string");return typeof e=="symbol"?e:e+""}function C8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const b8=["data","width"];class S8{constructor(e){Hk(this,"globalMeta",void 0),Hk(this,"metas",new Hm(()=>this._createMeta())),this.globalMeta=e,this.metas=new Hm(()=>this._createMeta())}updateMeta(e,r){const n=this.getMeta(e);fr(n,r),Pm(n,r)}createColumn(e,r){this.metas.insert(e,r)}removeColumn(e,r){this.metas.remove(e,r)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return l8(this.globalMeta.getMetaConstructor(),b8).prototype}}function Nk(t,e,r){return(e=R8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function R8(t){var e=E8(t,"string");return typeof e=="symbol"?e:e+""}function E8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class T8{constructor(e){Nk(this,"columnMeta",void 0),Nk(this,"metas",new Hm(()=>this._createRow())),this.columnMeta=e}updateMeta(e,r,n){const i=this.getMeta(e,r);fr(i,n),Pm(i,n)}createRow(e,r){this.metas.insert(e,r)}createColumn(e,r){for(let n=0;n<this.metas.size();n++)this.metas.obtain(n).insert(e,r)}removeRow(e,r){this.metas.remove(e,r)}removeColumn(e,r){for(let n=0;n<this.metas.size();n++)this.metas.obtain(n).remove(e,r)}getMeta(e,r,n){const i=this.metas.obtain(e).obtain(r);return n===void 0?i:i[n]}setMeta(e,r,n,i){var o;const s=this.metas.obtain(e).obtain(r);(o=s._automaticallyAssignedMetaProps)===null||o===void 0||o.delete(n),s[n]=i}removeMeta(e,r,n){const i=this.metas.obtain(e).obtain(r);delete i[n]}getMetas(){const e=[],r=Array.from(this.metas.values());for(let n=0;n<r.length;n++)we(r[n])&&e.push(...r[n].values());return e}getMetasAtRow(e){Om(()=>Im(e),"Expecting an unsigned number.");const r=new Map(this.metas);return r.has(e)?Array.from(r.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new Hm(e=>this._createMeta(e))}_createMeta(e){const r=this.columnMeta.getMetaConstructor(e);return new r}}class Dk{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];this.hot=e,this.globalMeta=new d8(e),this.tableMeta=new p8(this.globalMeta),this.columnMeta=new S8(this.globalMeta),this.cellMeta=new T8(this.columnMeta),n.forEach(i=>new i(this)),this.globalMeta.updateMeta(r)}getGlobalMeta(){return this.globalMeta.getMeta()}updateGlobalMeta(e){this.globalMeta.updateMeta(e)}getTableMeta(){return this.tableMeta.getMeta()}updateTableMeta(e){this.tableMeta.updateMeta(e)}getColumnMeta(e){return this.columnMeta.getMeta(e)}updateColumnMeta(e,r){this.columnMeta.updateMeta(e,r)}getCellMeta(e,r,n){const i=this.cellMeta.getMeta(e,r);return i.visualRow=n.visualRow,i.visualCol=n.visualColumn,i.row=e,i.col=r,n.skipMetaExtension||this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,r,n){if(typeof n!="string")throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,r,n)}setCellMeta(e,r,n,i){this.cellMeta.setMeta(e,r,n,i)}updateCellMeta(e,r,n){this.cellMeta.updateMeta(e,r,n)}removeCellMeta(e,r,n){this.cellMeta.removeMeta(e,r,n)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createRow(e,r)}removeRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeRow(e,r)}createColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createColumn(e,r),this.columnMeta.createColumn(e,r)}removeColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeColumn(e,r),this.columnMeta.removeColumn(e,r)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}wt(Dk,Ar);function kk(t,e,r,n){const{hotInstance:i,dataMap:o,dataSource:s,internalSource:a,source:l,metaManager:u,firstRun:c}=n,h=Ti(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":ht(d.dataSchema)?i.dataType="function":i.dataType="object",o&&o.destroy(),t=i.runHooks(`before${h}`,t,c,l);const f=new Ku(i,t,u);if(e(f),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const g=f.getSchema();t=[];let w,v=0,b=0;for(v=0,b=d.startRows;v<b;v++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)w=Kr(g),t.push(w);else if(i.dataType==="array")w=Kr(g[0]),t.push(w);else{w=[];for(let p=0,_=d.startCols;p<_;p++)w.push(null);t.push(w)}}else throw new Error(`${a} only accepts array of objects or array of arrays (${typeof t} given)`);Array.isArray(t[0])&&(i.dataType="array"),d.data=t,f.dataSource=t,s.data=t,s.dataType=i.dataType,s.colToProp=f.colToProp.bind(f),s.propToCol=f.propToCol.bind(f),s.countCachedColumns=f.countCachedColumns.bind(f),r(f),i.runHooks(`after${h}`,t,c,l),c||(i.runHooks("afterChange",null,a),i.render()),i.getSettings().ariaTags&&Pe(i.rootElement,[SH(-1),Ag(i.countCols()+(i.view?i.countRowHeaders():0))])}function Lk(t,e,r){return(e=_8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _8(t){var e=M8(t,"string");return typeof e=="symbol"?e:e+""}function M8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class P8{constructor(e){var r=this;Lk(this,"metaManager",void 0),Lk(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",function(){return r.extendCellMeta(...arguments)}),de.getSingleton().add("beforeRender",n=>{n&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var r;const{row:n,col:i}=e;if((r=this.metaSyncMemo.get(n))!==null&&r!==void 0&&r.has(i))return;const{visualRow:o,visualCol:s}=e,a=this.metaManager.hot,l=a.colToProp(s);e.prop=l,a.runHooks("beforeGetCellMeta",o,s,e);const u=gr(e,"type")?e.type:null;let c=ht(e.cells)?e.cells(n,i,l):null;if(u)if(c){var h;c.type=(h=c.type)!==null&&h!==void 0?h:u}else c={type:u};c&&this.metaManager.updateCellMeta(n,i,c),a.runHooks("afterGetCellMeta",o,s,e),this.metaSyncMemo.has(n)||this.metaSyncMemo.set(n,new Set),this.metaSyncMemo.get(n).add(i)}}function I8(t,e,r){O8(t,e),e.set(t,r)}function O8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function m0(t,e,r){return(e=x8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x8(t){var e=A8(t,"string");return typeof e=="symbol"?e:e+""}function A8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function H8(t,e){return t.get(N8(t,e))}function N8(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var $k=new WeakMap;class D8{constructor(e){m0(this,"metaManager",void 0),m0(this,"usageTracker",new Set),m0(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(r){if(this.metaManager.hot.isRtl()&&r==="fixedColumnsLeft")throw new Error("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`.");if(this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart"))throw new Error("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["layoutDirection",{initOnly:!0}],["renderAllColumns",{initOnly:!0}],["renderAllRows",{initOnly:!0}]])),I8(this,$k,(r,n,i)=>{if(!i)throw new Error(`The \`${r}\` option can not be updated after the Handsontable is initialized.`)}),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,r)=>{const{initOnly:n,target:i,onChange:o}=e,s=typeof i=="string",a=s?i:r,l=`_${a}`;this.metaManager.globalMeta.meta[l]=this.metaManager.globalMeta.meta[a],o?(this.installPropWatcher(r,l,o),s&&this.installPropWatcher(i,l,o)):n&&(this.installPropWatcher(r,l,H8($k,this)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(r))})}installPropWatcher(e,r,n){const i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[r]},set(o){const s=!i.usageTracker.has(e);i.usageTracker.add(e),n.call(i,e,o,s),this[r]=o},enumerable:!0,configurable:!0})}}const Fk="gridDefault",Qs="editorManager.handlingEditor",k8={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},L8="hooksRefRegisterer",Vk={_hooksStorage:Object.create(null),addHook(t,e){return this._hooksStorage[t]||(this._hooksStorage[t]=[]),this.hot.addHook(t,e),this._hooksStorage[t].push(e),this},removeHooksByKey(t){k(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){Fe(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};Qo(Vk,"MIXIN_NAME",L8,{writable:!1,enumerable:!1});function Li(t,e,r){return(e=$8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $8(t){var e=F8(t,"string");return typeof e=="symbol"?e:e+""}function F8(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const V8="base",Kt=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class Xu{static get EDITOR_TYPE(){return V8}constructor(e){Li(this,"hot",void 0),Li(this,"state",Kt.VIRGIN),Li(this,"_opened",!1),Li(this,"_fullEditMode",!1),Li(this,"_closeCallback",null),Li(this,"TD",null),Li(this,"row",null),Li(this,"col",null),Li(this,"prop",null),Li(this,"originalValue",null),Li(this,"cellProperties",null),this.hot=e,this.init()}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){throw Error("Editor getValue() method unimplemented")}setValue(){throw Error("Editor setValue() method unimplemented")}open(){throw Error("Editor open() method unimplemented")}close(){throw Error("Editor close() method unimplemented")}prepare(e,r,n,i,o,s){this.TD=i,this.row=e,this.col=r,this.prop=n,this.originalValue=o,this.cellProperties=s,this.state=this.isOpened()?this.state:Kt.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,r){let n,i,o,s;if(r){const l=this.hot.getSelectedLast();n=Math.max(Math.min(l[0],l[2]),0),i=Math.max(Math.min(l[1],l[3]),0),o=Math.max(l[0],l[2]),s=Math.max(l[1],l[3])}else[n,i,o,s]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",n,i,!1,"meta");Array.isArray(a)&&([n,i]=a),this.hot.populateFromArray(n,i,e,o,s,"edit")}beginEditing(e,r){if(this.state!==Kt.VIRGIN)return;const n=this.hot,i=n.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=n.columnIndexMapper.getRenderableFromVisualIndex(this.col),s=()=>{if(this.state=Kt.EDITING,this.isInFullEditMode()){const l=typeof e=="string"?e:Lt(this.originalValue);this.setValue(l)}this.open(r),this._opened=!0,this.focus(),n.view.render(),n.runHooks("afterBeginEditing",this.row,this.col)};this.hot.addHookOnce("afterScroll",s),n.view.scrollViewport(n._createCellCoords(i,o))||(this.hot.removeHook("afterScroll",s),s())}finishEditing(e,r,n){let i;if(n){const o=this._closeCallback;this._closeCallback=s=>{o&&o(s),n(s),this.hot.view.render()}}if(!this.isWaiting()){if(this.state===Kt.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Kt.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}const o=this.getValue();this.cellProperties.trimWhitespace?i=[[typeof o=="string"?String.prototype.trim.call(o||""):o]]:i=[[o]],this.state=Kt.WAITING,this.saveValue(i,r),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",s=>{this.state=Kt.FINISHED,this.discardEditor(s)}):(this.state=Kt.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Kt.FINISHED,this.discardEditor()}discardEditor(e){this.state===Kt.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Kt.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Kt.VIRGIN,this._fireCallbacks(!0),this.hot.getShortcutManager().setActiveContextName("grid")))}enableFullEditMode(){this._fullEditMode=!0}isInFullEditMode(){return this._fullEditMode}isOpened(){return this._opened}isWaiting(){return this.state===Kt.WAITING}getEditedCellRect(){var e;const r=this.getEditedCell();if(!r)return;const{wtOverlays:n,wtViewport:i}=this.hot.view._wt,o=this.hot.rootWindow,s=kr(r),a=ir(r),l=kr(this.hot.rootElement),u=ir(this.hot.rootElement),c=n.topOverlay.holder,h=n.inlineStartOverlay.holder,d=c!==o?c.scrollTop:0,f=h!==o?h.scrollLeft:0,g=o.innerWidth-l.left-u,{wtTable:w}=(e=n.getParentOverlay(r))!==null&&e!==void 0?e:this.hot.view._wt,v=w.name,b=["master","inline_start"].includes(v)?d:0,p=["master","top","bottom"].includes(v)?f:0,_=s.top===l.top?0:1;let O=s.top-l.top-_-b,T=0;this.hot.isRtl()?T=o.innerWidth-s.left-a-g-1+p:T=s.left-l.left-1-p,["top","top_inline_start_corner"].includes(v)&&(O+=n.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(v)&&(T+=Math.abs(n.inlineStartOverlay.getOverlayOffset()));const M=this.hot.hasColHeaders(),P=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),G=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),A=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(M&&P<=0||P===A)&&(O+=1),G<=0&&(T+=1);const q=i.rowsRenderCalculator.startPosition,Q=i.columnsRenderCalculator.startPosition,ue=Math.abs(n.inlineStartOverlay.getScrollPosition()),J=n.topOverlay.getScrollPosition(),Z=_r(this.hot.rootDocument);let ie=r.offsetTop;if(["inline_start","master"].includes(v)&&(ie+=q-J),["bottom","bottom_inline_start_corner"].includes(v)){const{wtViewport:B,wtTable:Y}=n.bottomOverlay.clone;ie+=B.getWorkspaceHeight()-Y.getHeight()-Z}let ee=r.offsetLeft;this.hot.isRtl()?(ee>=0?ee=w.getWidth()-r.offsetLeft:ee=Math.abs(ee),ee+=Q-ue-a):["top","master","bottom"].includes(v)&&(ee+=Q-ue);const te=o.getComputedStyle(this.TD),ae=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",z=parseInt(te[ae],10)>0?0:1,$=parseInt(te.borderTopWidth,10)>0?0:1,m=ir(r)+z,C=dr(r)+$,y=DH(c)?Z:0,I=kH(h)?Z:0,x=this.hot.view.maximumVisibleElementWidth(ee)-y+z,N=Math.max(this.hot.view.maximumVisibleElementHeight(ie)-I+$,this.hot.view.getDefaultRowHeight());return{top:O,start:T,height:C,maxHeight:N,width:m,maxWidth:x}}getEditedCellsLayerClass(){switch(this.checkEditorSection()){case"inline-start":return"ht_clone_left ht_clone_inline_start";case"bottom":return"ht_clone_bottom";case"bottom-inline-start-corner":return"ht_clone_bottom_left_corner ht_clone_bottom_inline_start_corner";case"top":return"ht_clone_top";case"top-inline-start-corner":return"ht_clone_top_left_corner ht_clone_top_inline_start_corner";default:return"ht_clone_master"}}getEditedCell(){return this.hot.getCell(this.row,this.col,!0)}checkEditorSection(){const e=this.hot.countRows();let r="";return this.row<this.hot.getSettings().fixedRowsTop?this.col<this.hot.getSettings().fixedColumnsStart?r="top-inline-start-corner":r="top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?this.col<this.hot.getSettings().fixedColumnsStart?r="bottom-inline-start-corner":r="bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(r="inline-start"),r}}wt(Xu,Vk);const W8={name:"editorCloseAndSaveByArrowKeys",callback(t,e,r){const n=t._getEditorManager(),i=n.getActiveEditor();i.isInFullEditMode()&&i.state===Kt.EDITING||(n.closeEditorAndSaveChanges(),t.getSelected()&&(r.includes("arrowdown")?t.selection.transformStart(1,0):r.includes("arrowup")?t.selection.transformStart(-1,0):r.includes("arrowleft")?t.selection.transformStart(0,-1*t.getDirectionFactor()):r.includes("arrowright")&&t.selection.transformStart(0,t.getDirectionFactor())),e.preventDefault())}},B8={name:"editorCloseAndSaveByEnter",callback(t,e){const r=t._getEditorManager();r.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),r.moveSelectionAfterEnter(e)}},j8={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},U8={name:"editorFastOpen",callback(t,e){const{highlight:r}=t.getSelectedRangeLast();r.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},z8={name:"editorOpen",callback(t,e,r){const n=t._getEditorManager(),i=t.getSelectedRangeLast(),{highlight:o}=i;if(t.selection.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0){const s=t.getSettings(),a=typeof s.enterMoves=="function"?s.enterMoves(e):s.enterMoves;r.includes("shift")?t.selection.transformFocus(-a.row,-a.col):t.selection.transformFocus(a.row,a.col);return}o.isHeader()||(t.getSettings().enterBeginsEditing?n.cellProperties.readOnly?n.moveSelectionAfterEnter(e):n.openEditor(null,e,!0):n.moveSelectionAfterEnter(e),_i(e))}};function Y8(){return[k8,W8,B8,j8,U8,z8]}const G8={name:"extendCellsSelectionDown",callback(t){const{selection:e}=t,{highlight:r}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(1,0),e.markEndSource())}},q8={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{selection:e,rowIndexMapper:r}=t,{to:n}=t.getSelectedRangeLast(),i=Math.min(n.row+t.countVisibleRows(),t.countRows()-1),o=r.getNearestNotHiddenIndex(i,-1);if(o!==null){const s=t._createCellCoords(o,n.col),a=n.row-t.getFirstFullyVisibleRow(),l=Math.min(s.row-a,t.countRows()-1);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}},K8={name:"extendCellsSelectionLeft",callback(t){const{selection:e}=t,{highlight:r}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,-1*t.getDirectionFactor()),e.markEndSource())}},X8={name:"extendCellsSelectionRight",callback(t){const{selection:e}=t,{highlight:r}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,t.getDirectionFactor()),e.markEndSource())}},Z8={name:"extendCellsSelectionToColumns",callback(t){const{selection:e}=t,{highlight:r,from:n,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByRowHeader()?e.selectAll(!0,!0):t.selectColumns(n.col,i.col,r),e.markEndSource()}},J8={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast(),s=n.isHeader()&&e.isSelectedByRowHeader();if(n.isCell()||s){const a=r.getNearestNotHiddenIndex(t.countRows()-1,-1),l=i.clone();l.row=n.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,n.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},Q8={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&n.isCell()){const s=r.getNearestNotHiddenIndex(t.countCols()-1,-1),a=i.clone();a.col=n.col,e.markSource("keyboard"),e.setRangeStart(a,void 0,!1,n.clone()),e.setRangeEnd(t._createCellCoords(o.row,s)),e.markEndSource()}}},e7={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&n.isCell()){const s=parseInt(t.getSettings().fixedColumnsStart,10),a=r.getNearestNotHiddenIndex(s,1),l=i.clone();l.col=n.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,n.clone()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},t7={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast(),s=n.isHeader()&&e.isSelectedByColumnHeader();if(n.isCell()||s){const a=r.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]),l=i.clone();l.col=n.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,n.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},r7={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast(),s=n.isHeader()&&e.isSelectedByColumnHeader();if(n.isCell()||s){const a=r.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]),l=i.clone();l.col=n.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,n.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},n7={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:r}=t,{highlight:n,from:i,to:o}=t.getSelectedRangeLast(),s=n.isHeader()&&e.isSelectedByRowHeader();if(n.isCell()||s){const a=r.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=n.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,n.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},i7={name:"extendCellsSelectionToRows",callback(t){const{selection:e}=t,{highlight:r,from:n,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByColumnHeader()?e.selectAll(!0,!0):t.selectRows(n.row,i.row,r),e.markEndSource()}},o7={name:"extendCellsSelectionUp",callback(t){const{selection:e}=t,{highlight:r}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(r.isCell()||r.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(-1,0),e.markEndSource())}},s7={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{selection:e,rowIndexMapper:r}=t,{to:n}=t.getSelectedRangeLast(),i=Math.max(n.row-t.countVisibleRows(),0),o=r.getNearestNotHiddenIndex(i,1);if(o!==null){const s=t._createCellCoords(o,n.col),a=n.row-t.getFirstFullyVisibleRow(),l=Math.max(s.row-a,0);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}};function a7(){return[G8,q8,K8,X8,Z8,J8,Q8,e7,t7,r7,n7,i7,o7,s7]}const l7={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(1,0),e.markEndSource()}},u7={name:"moveCellSelectionDownByViewportHeight",callback(t){const{selection:e}=t,{navigableHeaders:r}=t.getSettings(),n=r?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+n;o=o===0?1:o,i===t.countRows()-1?o=1:i+o>t.countRows()&&(o=t.countRows()-i-1),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},c7={name:"moveCellSelectionInlineEnd",callback(t,e){const{selection:r}=t,n=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof n.tabMoves=="function"?n.tabMoves(e):n.tabMoves;r.markSource("keyboard"),r.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?r.transformFocus(-o.row,-o.col):r.transformStart(-o.row,-o.col),r.markEndSource()}},h7={name:"moveCellSelectionInlineStart",callback(t,e){const{selection:r}=t,n=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof n.tabMoves=="function"?n.tabMoves(e):n.tabMoves;r.markSource("keyboard"),r.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?r.transformFocus(o.row,o.col):r.transformStart(o.row,o.col),r.markEndSource()}},d7={name:"moveCellSelectionLeft",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,-1*t.getDirectionFactor()),e.markEndSource()}},f7={name:"moveCellSelectionRight",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,t.getDirectionFactor()),e.markEndSource()}},g7={name:"moveCellSelectionToMostBottom",callback(t){const{selection:e}=t,{col:r}=t.getSelectedRangeLast().highlight;let n=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);n===null&&(n=-1),e.setRangeStart(t._createCellCoords(n,r))}},m7={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:r,columnIndexMapper:n}=t,i=parseInt(t.getSettings().fixedRowsBottom,10),o=r.getNearestNotHiddenIndex(t.countRows()-i-1,-1),s=n.getNearestNotHiddenIndex(t.countCols()-1,-1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(o,s)),e.markEndSource()}},p7={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:r}=t;e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,r.getNearestNotHiddenIndex(t.countCols()-1,-1))),e.markEndSource()}},w7={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:r}=t,n=parseInt(t.getSettings().fixedColumnsStart,10),i=t.getSelectedRangeLast().highlight.row,o=r.getNearestNotHiddenIndex(n,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(i,o)),e.markEndSource()}},v7={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:r}=t,n=t.getSelectedRangeLast().highlight.row;let i=r.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);i===null&&(i=t.isRtl()?-1:-t.countRowHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(n,i)),e.markEndSource()}},y7={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:r}=t,{row:n}=t.getSelectedRangeLast().highlight;let i=r.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);i===null&&(i=t.isRtl()?-t.countRowHeaders():-1),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(n,i)),e.markEndSource()}},C7={name:"moveCellSelectionToMostTop",callback(t){const{selection:e}=t,{col:r}=t.getSelectedRangeLast().highlight;let n=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);n===null&&(n=-t.countColHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(n,r)),e.markEndSource()}},b7={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:r,columnIndexMapper:n}=t,i=parseInt(t.getSettings().fixedRowsTop,10),o=parseInt(t.getSettings().fixedColumnsStart,10),s=r.getNearestNotHiddenIndex(i,1),a=n.getNearestNotHiddenIndex(o,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(s,a)),e.markEndSource()}},S7={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(-1,0),e.markEndSource()}},R7={name:"moveCellSelectionUpByViewportHight",callback(t){const{selection:e}=t,{navigableHeaders:r}=t.getSettings(),n=r?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+n;o=o===0?-1:-o,i===-n?o=-1:i+o<n&&(o=-(i+n)),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function E7(){return[l7,u7,c7,h7,d7,f7,g7,m7,p7,w7,v7,y7,C7,b7,S7,R7]}const T7={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},_7={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeLast(),r=t.getFirstFullyVisibleRow()-1,n=t.getFirstFullyVisibleColumn()-1,i=t.getLastFullyVisibleRow()+1,o=t.getLastFullyVisibleColumn()+1,s=t._createCellCoords(r,n),a=t._createCellCoords(i,o);if(!t._createCellRange(s,s,a).includes(e)&&(e.row>=0||e.col>=0)){const u={};if(e.col>=0){const c=Math.floor(t.countVisibleCols()/2);u.col=Math.max(e.col-c,0)}if(e.row>=0){const c=Math.floor(t.countVisibleRows()/2);u.row=Math.max(e.row-c,0)}t.scrollViewportTo({...u,verticalSnap:"top",horizontalSnap:"start"})}}},M7={name:"selectAllCells",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!0}),e.markEndSource()}},P7={name:"selectAllCellsAndHeaders",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!1}),e.markEndSource()}},I7={name:"populateSelectedCellsData",callback(t){const e=t.getSelectedRange(),{row:r,col:n}=e[e.length-1].highlight.normalize(),i=t.getDataAtCell(r,n),o=new Map;for(let s=0;s<e.length;s++)e[s].forAll((a,l)=>{if(a>=0&&l>=0&&(a!==r||l!==n)){const{readOnly:u}=t.getCellMeta(a,l);u||o.set(`${a}x${l}`,[a,l,i])}});t.setDataAtCell(Array.from(o.values()))}},O7=[...Y8(),...a7(),...E7(),T7,_7,M7,P7,I7];function Wk(t){const e={};return O7.forEach(r=>{let{name:n,callback:i}=r;e[n]=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i(t,...s)}}),e}function x7(t){const e=t.getShortcutManager().addContext("editor"),r=Wk(t),n={group:Qs};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>r.editorCloseAndSaveByEnter(i,o)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,o)=>r.editorCloseAndSaveByEnter(i,o)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:(i,o)=>r.editorCloseAndSave(i,o)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(i,o)=>r.editorCloseAndSaveByArrowKeys(i,o)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>r.editorCloseWithoutSaving()}],n)}function A7(t){const e=t.getShortcutManager().addContext("grid"),r=Wk(t),n={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return we(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:Fk};e.addShortcuts([{keys:[["F2"]],callback:i=>r.editorFastOpen(i)},{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>r.editorOpen(i,o)},{keys:[["Backspace"],["Delete"]],callback:()=>r.emptySelectedCells()}],{group:Qs,runOnlyIf:()=>we(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>r.selectAllCells(),runOnlyIf:()=>{var i;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())}},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>{var i;return(i=t.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isHeader()},preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>r.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>r.populateSelectedCellsData(),runOnlyIf:()=>{var i,o;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())&&((o=t.getSelectedRangeLast())===null||o===void 0?void 0:o.getCellsCount())>1}},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>r.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>r.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>r.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostTop(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>r.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>r.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostBottom(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>r.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>r.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostLeft(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>r.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>r.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostRight(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>r.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>r.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>r.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>r.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:i=>r.moveCellSelectionInlineStart(i)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:i=>r.moveCellSelectionInlineEnd(i)},{keys:[["Control/Meta","Backspace"]],callback:()=>r.scrollToFocusedCell()}],n)}function H7(t){[A7,x7].forEach(e=>e(t))}function N7(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=t.rootElement,n=Bk(t),i=Bk(t);return n.addEventListener("focus",()=>e==null?void 0:e.onFocusFromTop()),i.addEventListener("focus",()=>e==null?void 0:e.onFocusFromBottom()),r.firstChild.before(n),r.lastChild.after(i),{activate(){t._registerTimeout(()=>{n.tabIndex=0,i.tabIndex=0},10)},deactivate(){t._registerTimeout(()=>{n.tabIndex=-1,i.tabIndex=-1},10)}}}function Bk(t){const r=t.rootDocument.createElement("input");return r.type="text",r.name="__htFocusCatcher",r.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&Pe(r,[Ph("Focus catcher")]),r}function D7(t){const e=k7(t);let r;const{activate:n,deactivate:i}=N7(t,{onFocusFromTop(){var h;const d=(h=e(r))!==null&&h!==void 0?h:p0(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_above",d),t.selectCell(d.row,d.col)),t.listen()},onFocusFromBottom(){var h;const d=(h=e(r))!==null&&h!==void 0?h:w0(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_below",d),t.selectCell(d.row,d.col)),t.listen()}}),o={wrapped:!1,flipped:!1};let s=!0,a=!1,l=!1;t.addHook("afterListen",()=>i()),t.addHook("afterUnlisten",()=>n()),t.addHook("afterSelection",(h,d,f,g,w)=>{if(a&&(o.wrapped&&o.flipped||l)&&(l=!1,w.value=!0),s){var v;r=(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight}}),t.addHook("beforeRowWrap",(h,d,f)=>{o.wrapped=!0,o.flipped=f});function u(){o.wrapped=!1,o.flipped=!1,t.deselectCell(),t.unlisten()}const c={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:Fk,group:"focusCatcher"};t.getShortcutManager().getContext("grid").addShortcuts([{...c,callback:()=>{const{tabNavigation:h}=t.getSettings();a=!0,t.getSelectedRangeLast()&&!h&&(s=!1),h||(l=!0)},position:"before"},{...c,callback:h=>{const{tabNavigation:d,autoWrapRow:f}=t.getSettings();if(a=!1,s=!0,!d||!t.selection.isSelected()||f&&o.wrapped&&o.flipped||!f&&o.wrapped)return f&&o.wrapped&&o.flipped&&(r=h.shiftKey?p0(t):w0(t)),u(),!1;h.preventDefault()},position:"after"}])}function p0(t){const{rowIndexMapper:e,columnIndexMapper:r}=t,{navigableHeaders:n}=t.getSettings();let i=n&&t.countColHeaders()>0?-t.countColHeaders():0,o=n&&t.countRowHeaders()>0?-t.countRowHeaders():0;return i===0&&(i=e.getVisualFromRenderableIndex(i)),o===0&&(o=r.getVisualFromRenderableIndex(o)),i===null||o===null?null:t._createCellCoords(i,o)}function w0(t){var e,r;const{rowIndexMapper:n,columnIndexMapper:i}=t,{navigableHeaders:o}=t.getSettings();let s=n.getRenderableIndexesLength()-1,a=i.getRenderableIndexesLength()-1;if(s<0){if(!o||t.countColHeaders()===0)return null;s=-1}if(a<0){if(!o||t.countColHeaders()===0)return null;a=-1}return t._createCellCoords((e=n.getVisualFromRenderableIndex(s))!==null&&e!==void 0?e:s,(r=i.getVisualFromRenderableIndex(a))!==null&&r!==void 0?r:a)}function k7(t){return e=>{if(!e)return null;const r=p0(t),n=w0(t);return e.col<r.col&&(e.col=r.col),e.col>n.col&&(e.col=n.col),e.row<r.row&&(e.row=r.row),e.row>n.row&&(e.row=n.row),e}}function Zu(t){Jo(t)&&t.scrollIntoView({block:"nearest",inline:"nearest"})}function Nm(t){const{selection:e,view:r}=t,n=t.getSelectedRangeLast(),i=e.getSelectionSource(),o=r.getFirstFullyVisibleColumn(),s=r.getLastFullyVisibleColumn(),a=n.getTopStartCorner().col,l=n.getBottomEndCorner().col,u=a<=o,c=l>=s,h=r.getFirstFullyVisibleRow(),d=r.getLastFullyVisibleRow(),f=n.getTopStartCorner().row,g=n.getBottomEndCorner().row,w=f<=h,v=g>=d;return{getComputedColumnTarget(b){return i==="mouse"||i==="keyboard"?b.col:u&&c?n.highlight.col:u?a:c?l:b.col},getComputedRowTarget(b){return i==="mouse"||i==="keyboard"?b.row:w&&v?n.highlight.row:w?f:v?g:b.row}}}function L7(t){return e=>{const r=Nm(t).getComputedColumnTarget(e);t.scrollViewportTo({col:r},()=>{const n=!!t.getSettings().colHeaders;Zu(t.getCell(n?-1:0,r,!0))})}}function $7(){return()=>{}}function F7(t){return e=>{t.scrollViewportTo(e.toObject(),()=>{const{row:r,col:n}=t.getSelectedRangeLast().highlight;Zu(t.getCell(r,n,!0))})}}function V7(t){return e=>{const r=Nm(t),n={row:r.getComputedRowTarget(e),col:r.getComputedColumnTarget(e)};t.scrollViewportTo(n,()=>{const{row:i,col:o}=n;Zu(t.getCell(i,o,!0))})}}function W7(t){return e=>{const r=Nm(t),n={row:r.getComputedRowTarget(e),col:r.getComputedColumnTarget(e)};t.scrollViewportTo(n,()=>{const{row:i,col:o}=n;Zu(t.getCell(i,o,!0))})}}function B7(t){return e=>{const r=Nm(t).getComputedRowTarget(e);t.scrollViewportTo({row:r},()=>{const n=!!t.getSettings().rowHeaders;Zu(t.getCell(r,n?-1:0,!0))})}}function j7(t){return e=>{const r=t.selection.getSelectionSource(),{row:n,col:i}=e,o=()=>{Zu(t.getCell(n,i,!0))};if(n<0&&i>=0)t.scrollViewportTo({col:i},o);else if(i<0&&n>=0)t.scrollViewportTo({row:n},o);else{if(r==="mouse"&&(i===t.view.getLastPartiallyVisibleColumn()||n===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:n,col:i},o)}}}function U7(t){const{selection:e}=t;let r=!1,n=!1;return{resume(){n=!1},suspend(){n=!0},skipNextScrollCycle(){r=!0},scrollTo(i){var o;if(r||n){r=!1;return}let s;e.isFocusSelectionChanged()?s=F7(t):e.isSelectedByCorner()?s=$7():e.isSelectedByRowHeader()?s=B7(t):e.isSelectedByColumnHeader()?s=L7(t):e.getSelectedRange().size()===1&&e.isMultiple()?s=V7(t):e.getSelectedRange().size()===1&&!e.isMultiple()?s=j7(t):e.getSelectedRange().size()>1&&(s=W7(t)),(o=s)===null||o===void 0||o(i)}}}const jk=new Map([[" ","space"],["spacebar","space"],["scroll","scrolllock"],["del","delete"],["esc","escape"],["medianexttrack","mediatracknext"],["mediaprevioustrack","mediatrackprevious"],["volumeup","audiovolumeup"],["volumedown","audiovolumedown"],["volumemute","audiovolumemute"],["multiply","*"],["add","+"],["divide","/"],["subtract","-"],["left","arrowleft"],["right","arrowright"],["up","arrowup"],["down","arrowdown"]]),Dm=t=>t.map(e=>{const r=e.toLowerCase();return jk.has(r)?jk.get(r):r}).sort().join("+"),z7=t=>t.split("+"),Uk=new Map([[96,"numpad0"],[97,"numpad1"],[98,"numpad2"],[99,"numpad3"],[100,"numpad4"],[101,"numpad5"],[102,"numpad6"],[103,"numpad7"],[104,"numpad8"],[105,"numpad9"],[106,"multiply"],[107,"add"],[108,"decimal"],[109,"subtract"],[110,"decimal"],[111,"divide"],[112,"f1"],[113,"f2"],[114,"f3"],[115,"f4"],[116,"f5"],[117,"f6"],[118,"f7"],[119,"f8"],[120,"f9"],[121,"f10"],[122,"f11"],[123,"f12"],[186,"semicolon"],[187,"equal"],[188,"comma"],[189,"minus"],[190,"period"],[191,"slash"],[192,"backquote"],[219,"bracketleft"],[220,"backslash"],[221,"bracketright"],[222,"quote"]]),v0=t=>{let{which:e,key:r}=t;if(Uk.has(e))return Uk.get(e);const n=String.fromCharCode(e).toLowerCase();return/^[a-z0-9]$/.test(n)?n:r.toLowerCase()},zk=Symbol("shortcut-context");function Yk(t){return $e(t)&&t.__kindOf===zk}const Y7=t=>{const e=Jg({errorIdExists:l=>`The "${l}" shortcut is already registered in the "${t}" context.`}),r=function(){let{keys:l,callback:u,group:c,runOnlyIf:h=()=>!0,captureCtrl:d=!1,preventDefault:f=!0,stopPropagation:g=!1,relativeToGroup:w,position:v,forwardToContext:b}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if($t(c))throw new Error("You need to define the shortcut's group.");if(ht(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(at`Pass the shortcut\'s keys as an array of arrays,\x20
534
+ using the KeyboardEvent.key properties:\x20
535
+ https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const p={callback:u,group:c,runOnlyIf:h,captureCtrl:d,preventDefault:f,stopPropagation:g};we(w)&&(p.relativeToGroup=w,p.position=v),Yk(b)&&(p.forwardToContext=b),l.forEach(_=>{const O=Dm(_);if(e.hasItem(O)){const M=e.getItem(O);let P=M.findIndex(G=>G.group===w);P!==-1?v==="before"?P-=1:P+=1:P=M.length,M.splice(P,0,p)}else e.addItem(O,[p])})},n=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(c=>{Fe(u,(h,d)=>{Object.prototype.hasOwnProperty.call(c,d)===!1&&(c[d]=u[d])}),r(c)})},i=l=>{const u=Dm(l);e.removeItem(u)};return{__kindOf:zk,addShortcut:r,addShortcuts:n,getShortcuts:l=>{const u=Dm(l),c=e.getItem(u);return we(c)?c.slice():[]},hasShortcut:l=>{const u=Dm(l);return e.hasItem(u)},removeShortcutsByKeys:i,removeShortcutsByGroup:l=>{e.getItems().forEach(c=>{let[h,d]=c;const f=d.filter(g=>g.group!==l);f.length===0?i(z7(h)):(d.length=0,d.push(...f))})}}};function G7(){const t=new Set;return{press(e){t.add(e)},release(e){t.delete(e)},releaseAll(){t.clear()},isPressed(e){return t.has(e)}}}const q7=["meta","alt","shift","control"],ud=G7(),cd=[];let km=0;function K7(t,e,r,n,i){const o=f=>q7.includes(f),s=function(f){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const w=[];return f.altKey&&w.push("alt"),g&&(f.ctrlKey||f.metaKey)?w.push("control/meta"):(f.ctrlKey&&w.push("control"),f.metaKey&&w.push("meta")),f.shiftKey&&w.push("shift"),w},a=f=>{if(e(f)===!1||r(f)===!1||f.keyCode===229||typeof f.key!="string"||Ja(f))return;const w=v0(f);let v=[];o(w)||(v=s(f));const b=[w].concat(v);!i(f,b)&&(XH()&&v.includes("meta")||!XH()&&v.includes("control"))&&i(f,[w].concat(s(f,!0))),n(f)},l=f=>{if(typeof f.key=="string"){const g=v0(f);o(g)&&ud.press(g)}},u=f=>{if(typeof f.key=="string"){const g=v0(f);o(g)&&ud.release(g)}},c=()=>{ud.releaseAll()};return{mount:()=>{let f=t;for(km+=1;f;)km===1&&(f.document.documentElement.addEventListener("keydown",l),cd.push({event:"keydown",listener:l}),f.document.documentElement.addEventListener("keyup",u),cd.push({event:"keyup",listener:u})),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",c),f=Mu(f)},unmount:()=>{let f=t;for(km-=1;f;){if(km===0){for(let g=0;g<cd.length;g++){const{event:w,listener:v}=cd[g];f.document.documentElement.removeEventListener(w,v)}cd.length=0}f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",c),f=Mu(f)}},isPressed:f=>ud.isPressed(f),releasePressedKeys:()=>ud.releaseAll()}}const X7=t=>{let{ownerWindow:e,handleEvent:r,beforeKeyDown:n,afterKeyDown:i}=t;const o=Jg({errorIdExists:g=>`The "${g}" context name is already registered.`});let s="grid";const a=g=>{const w=Y7(g);return o.addItem(g,w),w},l=()=>s,u=g=>o.getItem(g),c=g=>{if(!o.hasItem(g))throw new Error(at`You've tried to activate the "${g}" shortcut context\x20
536
+ that does not exist. Before activation, register the context using the "addContext" method.`);s=g};let h=!1;const d=function(g,w){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const b=Yk(v)?v:u(v);let p=!1;if(!b.hasShortcut(w))return p;const _=b.getShortcuts(w);for(let O=0;O<_.length;O++){const{callback:T,runOnlyIf:M,preventDefault:P,stopPropagation:G,captureCtrl:j,forwardToContext:A}=_[O];if(M(g)===!0){if(h=j,p=T(g,w)===!1,h=!1,P&&g.preventDefault(),G&&(_i(g),g.stopPropagation()),p)break;A&&d(g,w,A)}}return p},f=K7(e,r,n,i,d);return f.mount(),{addContext:a,getActiveContextName:l,getContext:u,setActiveContextName:c,isCtrlPressed:()=>!h&&(f.isPressed("control")||f.isPressed("meta")),releasePressedKeys:()=>f.releasePressedKeys(),destroy:()=>f.unmount()}};function Gk(t){const{classNames:e}=o3(t,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}let y0=null;const C0=new Map;function qk(t,e){var r,n=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this;const s=new Pi(o);let a,l,u,c,h,d,f=!0;O5(i)&&I5(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const g=(r=e==null?void 0:e.layoutDirection)!==null&&r!==void 0?r:"inherit",w=["rtl","ltr"].includes(g)?g:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",w),this.isRtl=function(){return w==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1},e.language=M9(e.language);const v=Object.fromEntries(Object.entries(e).filter(m=>{let[C]=m;return!(de.getSingleton().isRegistered(C)||de.getSingleton().isDeprecated(C))})),b=new Dk(o,v,[P8,D8]),p=b.getTableMeta(),_=b.getGlobalMeta(),O=Jg();this.container=this.rootDocument.createElement("div"),t.insertBefore(this.container,t.firstChild),lm(this)&&(AK(e.licenseKey,t),oe(t,"ht-wrapper")),this.guid=`ht_${mH()}`,C0.set(this.guid,this),this.columnIndexMapper=new $R,this.rowIndexMapper=new $R,this.columnIndexMapper.addLocalHook("indexesSequenceChange",m=>{o.runHooks("afterColumnSequenceChange",m)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",m=>{o.runHooks("afterRowSequenceChange",m)}),s.addEventListener(this.rootDocument.documentElement,"compositionstart",m=>{o.runHooks("beforeCompositionStart",m)}),l=new U5(o),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const T=m=>{const{row:C,col:y}=m;return o._createCellCoords(C>=0?o.rowIndexMapper.getRenderableFromVisualIndex(C):C,y>=0?o.columnIndexMapper.getRenderableFromVisualIndex(y):y)},M=m=>{const{row:C,col:y}=m;return o._createCellCoords(C>=0?o.rowIndexMapper.getVisualFromRenderableIndex(C):C,y>=0?o.columnIndexMapper.getVisualFromRenderableIndex(y):y)},P=(m,C)=>{const y=C>m?1:-1,I=Math.min(m,C),x=Math.max(m,C),N=o.rowIndexMapper.getNearestNotHiddenIndex(m,y);return N===null||y===1&&N>x||y===-1&&N<I?null:N>=0?o.rowIndexMapper.getRenderableFromVisualIndex(N):N},G=(m,C)=>{const y=C>m?1:-1,I=Math.min(m,C),x=Math.max(m,C),N=o.columnIndexMapper.getNearestNotHiddenIndex(m,y);return N===null||y===1&&N>x||y===-1&&N<I?null:N>=0?o.columnIndexMapper.getRenderableFromVisualIndex(N):N};let j=new Mk(p,{rowIndexMapper:o.rowIndexMapper,columnIndexMapper:o.columnIndexMapper,countCols:()=>o.countCols(),countRows:()=>o.countRows(),propToCol:m=>a.propToCol(m),isEditorOpened:()=>o.getActiveEditor()?o.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:function(){return n.view.countRenderableRowsInRange(...arguments)},countRenderableColumnsInRange:function(){return n.view.countRenderableColumnsInRange(...arguments)},getShortcutManager:()=>o.getShortcutManager(),createCellCoords:(m,C)=>o._createCellCoords(m,C),createCellRange:(m,C,y)=>o._createCellRange(m,C,y),visualToRenderableCoords:T,renderableToVisualCoords:M,findFirstNonHiddenRenderableRow:P,findFirstNonHiddenRenderableColumn:G,isDisabledCellSelection:(m,C)=>m<0||C<0?o.getSettings().disableVisualSelection:o.getCellMeta(m,C).disableVisualSelection});this.selection=j;const A=m=>{let{hiddenIndexesChanged:C}=m;this.forceFullRender=!0,C&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",A),this.rowIndexMapper.addLocalHook("cacheUpdated",A),this.selection.addLocalHook("afterSetRangeEnd",(m,C)=>{const y=xn(!1),I=this.selection.getSelectedRange(),{from:x,to:N}=I.current(),B=I.size()-1;this.runHooks("afterSelection",x.row,x.col,N.row,N.col,y,B),this.runHooks("afterSelectionByProp",x.row,o.colToProp(x.col),N.row,o.colToProp(N.col),y,B),C&&(!y.isTouched()||y.isTouched()&&!y.value)&&d.scrollTo(m);const Y=j.isSelectedByRowHeader(),R=j.isSelectedByColumnHeader();Y&&R?oe(this.rootElement,["ht__selection--rows","ht__selection--columns"]):Y?(Ee(this.rootElement,"ht__selection--columns"),oe(this.rootElement,"ht__selection--rows")):R?(Ee(this.rootElement,"ht__selection--rows"),oe(this.rootElement,"ht__selection--columns")):Ee(this.rootElement,["ht__selection--rows","ht__selection--columns"]),j.getSelectionSource()!=="shift"&&c.closeEditor(null),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("beforeSetFocus",m=>{this.runHooks("beforeSelectionFocusSet",m.row,m.col)}),this.selection.addLocalHook("afterSetFocus",m=>{const C=xn(!1);this.runHooks("afterSelectionFocusSet",m.row,m.col,C),(!C.isTouched()||C.isTouched()&&!C.value)&&d.scrollTo(m),c.closeEditor(),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",m=>{const C=m.length-1,{from:y,to:I}=m[C];this.runHooks("afterSelectionEnd",y.row,y.col,I.row,I.col,C),this.runHooks("afterSelectionEndByProp",y.row,o.colToProp(y.col),I.row,o.colToProp(I.col),C)}),this.selection.addLocalHook("afterIsMultipleSelection",m=>{const C=this.runHooks("afterIsMultipleSelection",m.value);m.value&&(m.value=C)}),this.selection.addLocalHook("afterDeselect",()=>{c.closeEditor(),o.view.render(),Ee(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeSetRangeStart",...C)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeSetRangeStartOnly",...C)}).addLocalHook("beforeSetRangeEnd",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeSetRangeEnd",...C)}).addLocalHook("beforeSelectColumns",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeSelectColumns",...C)}).addLocalHook("afterSelectColumns",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("afterSelectColumns",...C)}).addLocalHook("beforeSelectRows",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeSelectRows",...C)}).addLocalHook("afterSelectRows",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("afterSelectRows",...C)}).addLocalHook("beforeModifyTransformStart",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("modifyTransformStart",...C)}).addLocalHook("afterModifyTransformStart",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("afterModifyTransformStart",...C)}).addLocalHook("beforeModifyTransformFocus",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("modifyTransformFocus",...C)}).addLocalHook("afterModifyTransformFocus",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("afterModifyTransformFocus",...C)}).addLocalHook("beforeModifyTransformEnd",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("modifyTransformEnd",...C)}).addLocalHook("afterModifyTransformEnd",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("afterModifyTransformEnd",...C)}).addLocalHook("beforeRowWrap",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeRowWrap",...C)}).addLocalHook("beforeColumnWrap",function(){for(var m=arguments.length,C=new Array(m),y=0;y<m;y++)C[y]=arguments[y];return n.runHooks("beforeColumnWrap",...C)}).addLocalHook("insertRowRequire",m=>this.alter("insert_row_above",m,1,"auto")).addLocalHook("insertColRequire",m=>this.alter("insert_col_start",m,1,"auto")),u={alter(m,C){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,I=arguments.length>3?arguments[3]:void 0,x=arguments.length>4?arguments[4]:void 0;const N=B=>{if(B.length===0)return[];const Y=[...B];return Y.sort((E,S)=>{let[D]=E,[H]=S;return D===H?0:D>H?1:-1}),hn(Y,(E,S)=>{let[D,H]=S;const F=E[E.length-1],[X,L]=F,W=X+L;if(D<=W){const K=Math.max(H-(W-D),0);F[1]+=K}else E.push([D,H]);return E},[Y[0]])};switch(m){case"insert_row_below":case"insert_row_above":const B=o.countSourceRows();if(p.maxRows===B)return;const Y=m==="insert_row_below"?"below":"above";C=C??(Y==="below"?B:0);const{delta:R,startPhysicalIndex:E}=a.createRow(C,y,{source:I,mode:Y});j.shiftRows(o.toVisualRow(E),R);break;case"insert_col_start":case"insert_col_end":const S=m==="insert_col_end"?"end":"start";C=C??(S==="end"?o.countSourceCols():0);const{delta:D,startPhysicalIndex:H}=a.createCol(C,y,{source:I,mode:S});if(D){if(Array.isArray(p.colHeaders)){const L=[o.toVisualColumn(H),0];L.length+=D,Array.prototype.splice.apply(p.colHeaders,L)}j.shiftColumns(o.toVisualColumn(H),D)}break;case"remove_row":const F=L=>{let W=0;k(L,K=>{let[U,re]=K;const me=qt(U)?o.countRows()-1:Math.max(U-W,0);if(Number.isInteger(U)&&(U=Math.max(U-W,0)),!a.removeRow(U,re,I))return;if(j.isSelected()){const{row:Ie}=o.getSelectedRangeLast().highlight;Ie>=U&&Ie<=U+re-1&&c.closeEditor(!0)}const xe=o.countRows(),Be=p.fixedRowsTop;Be>=me+1&&(p.fixedRowsTop-=Math.min(re,Be-me));const Ke=p.fixedRowsBottom;Ke&&me>=xe-Ke&&(p.fixedRowsBottom-=Math.min(re,Ke)),xe===0?j.deselect():I==="ContextMenu.removeRow"?j.refresh():j.shiftRows(U,-re),W+=re})};Array.isArray(C)?F(N(C)):F([[C,y]]);break;case"remove_col":const X=L=>{let W=0;k(L,K=>{let[U,re]=K;const me=qt(U)?o.countCols()-1:Math.max(U-W,0);let ye=o.toPhysicalColumn(me);if(Number.isInteger(U)&&(U=Math.max(U-W,0)),!a.removeCol(U,re,I))return;if(j.isSelected()){const{col:Ie}=o.getSelectedRangeLast().highlight;Ie>=U&&Ie<=U+re-1&&c.closeEditor(!0)}o.countCols()===0?j.deselect():I==="ContextMenu.removeColumn"?j.refresh():j.shiftColumns(U,-re);const Ke=p.fixedColumnsStart;Ke>=me+1&&(p.fixedColumnsStart-=Math.min(re,Ke-me)),Array.isArray(p.colHeaders)&&(typeof ye>"u"&&(ye=-1),p.colHeaders.splice(ye,re)),W+=re})};Array.isArray(C)?X(N(C)):X([[C,y]]);break;default:throw new Error(`There is no such action "${m}"`)}x||u.adjustRowsAndCols(),o.view.render(),o.view.adjustElementsSize()},adjustRowsAndCols(){const m=p.minRows,C=p.minSpareRows,y=p.minCols,I=p.minSpareCols;if(m){const x=o.countRows();x<m&&a.createRow(x,m-x,{source:"auto"})}if(C){const x=o.countEmptyRows(!0);if(x<C){const N=C-x,B=Math.min(N,p.maxRows-o.countSourceRows());a.createRow(o.countRows(),B,{source:"auto"})}}{let x;(y||I)&&(x=o.countEmptyCols(!0));let N=o.countCols();if(y&&!p.columns&&N<y){const B=y-N;x+=B,a.createCol(N,B,{source:"auto"})}if(I&&!p.columns&&o.dataType==="array"&&x<I){N=o.countCols();const B=I-x,Y=Math.min(B,p.maxCols-N);a.createCol(N,Y,{source:"auto"})}}},populateFromArray(m,C,y,I,x){let N,B,Y,R;const E=[],S={},D=[],H=m.row,F=m.col;if(B=C.length,B===0)return!1;let X=0,L=0;switch($e(y)&&(X=y.col-F+1,L=y.row-H+1),x){case"shift_down":const W=Og(C),K=W.length,U=Math.max(K,X),re=o.getData().slice(H),me=Og(re).slice(F,F+U);for(Y=0;Y<U;Y+=1)if(Y<K){for(N=0,B=W[Y].length;N<L-B;N+=1)W[Y].push(W[Y][N%B]);Y<me.length?D.push(W[Y].concat(me[Y])):D.push(W[Y].concat(new Array(re.length).fill(null)))}else D.push(W[Y%K].concat(me[Y]));o.populateFromArray(H,F,Og(D));break;case"shift_right":const ye=C.length,xe=Math.max(ye,L),Be=o.getData().slice(H).map(Nt=>Nt.slice(F));for(N=0;N<xe;N+=1)if(N<ye){for(Y=0,R=C[N].length;Y<X-R;Y+=1)C[N].push(C[N][Y%R]);if(N<Be.length)for(let Nt=0;Nt<Be[N].length;Nt+=1)C[N].push(Be[N][Nt]);else C[N].push(...new Array(Be[0].length).fill(null))}else C.push(C[N%B].slice(0,xe).concat(Be[N]));o.populateFromArray(H,F,C);break;case"overwrite":default:S.row=m.row,S.col=m.col;let Ke=0,Ie=0,ze=!0,Ht;const qi=function(vr){let _t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const Dt=C[vr%C.length];return _t!==null?Dt[_t%Dt.length]:Dt},As=C.length,pi=y?y.row-m.row+1:0;for(y?B=pi:B=Math.max(As,pi),N=0;N<B&&!(y&&S.row>y.row&&pi>As||!p.allowInsertRow&&S.row>o.countRows()-1||S.row>=p.maxRows);N++){const Nt=N-Ke,vr=qi(Nt).length,_t=y?y.col-m.col+1:0;if(y?R=_t:R=Math.max(vr,_t),S.col=m.col,Ht=o.getCellMeta(S.row,S.col),(I==="CopyPaste.paste"||I==="Autofill.fill")&&Ht.skipRowOnPaste){Ke+=1,S.row+=1,B+=1;continue}for(Ie=0,Y=0;Y<R&&!(y&&S.col>y.col&&_t>vr||!p.allowInsertColumn&&S.col>o.countCols()-1||S.col>=p.maxCols);Y++){if(Ht=o.getCellMeta(S.row,S.col),(I==="CopyPaste.paste"||I==="Autofill.fill")&&Ht.skipColumnOnPaste){Ie+=1,S.col+=1,R+=1;continue}if(Ht.readOnly&&I!=="UndoRedo.undo"){S.col+=1;continue}const Dt=Y-Ie;let Ye=qi(Nt,Dt),wi=o.getDataAtCell(S.row,S.col);if(Ye!==null&&typeof Ye=="object")if(Array.isArray(Ye)&&wi===null&&(wi=[]),wi===null||typeof wi!="object")ze=!1;else{const nu=xh(Array.isArray(wi)?wi:wi[0]||wi),iu=xh(Array.isArray(Ye)?Ye:Ye[0]||Ye);SS(nu,iu)||Array.isArray(nu)&&Array.isArray(iu)?Ye=Kr(Ye):ze=!1}else wi!==null&&typeof wi=="object"&&(ze=!1);ze&&E.push([S.row,S.col,Ye]),ze=!0,S.col+=1}S.row+=1}o.setDataAtCell(E,null,null,I||"populateFromArray");break}}};function q(m){const C=ck(m);a0(C)?(o.runHooks("beforeLanguageChange",C),_.language=C,o.runHooks("afterLanguageChange",C)):hk(m)}function Q(m,C){const y=m==="className"?o.rootElement:o.table;if(f)oe(y,C);else{let I=[],x=[];_[m]&&(I=Array.isArray(_[m])?_[m]:cH(_[m])),C&&(x=Array.isArray(C)?C:cH(C));const N=uH(I,x),B=uH(x,I);N.length&&Ee(y,N),B.length&&oe(y,B)}_[m]=C}this.init=function(){l.setData(p.data),o.runHooks("beforeInit"),(es()||qH())&&oe(o.rootElement,"mobile"),this.updateSettings(e,!0),this.view=new N5(this);const m=p.themeName||Gk(o.rootElement);o.useTheme(m),o.view.addClassNameToLicenseElement(o.getCurrentThemeName()),c=VS.getInstance(o,p,j),d=U7(o),h=new n4(o),lm(this)&&D7(o),o.runHooks("init"),this.render(),f&&o.rootElement.offsetParent===null&&f3(o.rootElement,()=>{o.view._wt.wtOverlays.updateLastSpreaderSize(),o.render(),o.view.adjustElementsSize()}),typeof f=="object"&&(o.runHooks("afterChange",f[0],f[1]),f=!1),o.runHooks("afterInit")};function ue(){let m=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,m=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&m===!1&&(m=!0,this.onQueueEmpty(this.valid))}}}function J(m){const C=m.replace(",",".");return isNaN(parseFloat(C))===!1?parseFloat(C):m}function Z(m,C,y){if(!m.length){y();return}const I=o.getActiveEditor(),x=new ue;let N=!0;x.onQueueEmpty=()=>{I&&N&&I.cancelChanges(),y()};for(let B=m.length-1;B>=0;B--){const[Y,R]=m[B],E=a.propToCol(R);let S;Number.isInteger(E)?S=o.getCellMeta(Y,E):S={...Object.getPrototypeOf(p),...p},o.getCellValidator(S)&&(x.addValidatorToQueue(),o.validateCell(m[B][3],S,function(D,H){return function(F){if(typeof F!="boolean")throw new Error("Validation error: result is not boolean");F===!1&&H.allowInvalid===!1&&(N=!1,m.splice(D,1),H.valid=!0),x.removeValidatorFormQueue()}}(B,S),C))}x.checkIfQueueIsEmpty()}function ie(m,C){for(let I=m.length-1;I>=0;I--){let x=!1;if(m[I]===null){m.splice(I,1);continue}if(!((m[I][2]===null||m[I][2]===void 0)&&(m[I][3]===null||m[I][3]===void 0))){if(p.allowInsertRow)for(;m[I][0]>o.countRows()-1;){const{delta:N}=a.createRow(void 0,void 0,{source:"auto"});if(N===0){x=!0;break}}if(o.dataType==="array"&&(!p.columns||p.columns.length===0)&&p.allowInsertColumn)for(;a.propToCol(m[I][1])>o.countCols()-1;){const{delta:N}=a.createCol(void 0,void 0,{source:"auto"});if(N===0){x=!0;break}}x||a.set(m[I][0],m[I][1],m[I][3])}}if(m.length>0){u.adjustRowsAndCols(),o.runHooks("beforeChangeRender",m,C),c.closeEditor(),o.render(),c.prepareEditor(),o.view.adjustElementsSize(),o.runHooks("afterChange",m,C||"edit");const I=o.getActiveEditor();I&&we(I.refreshValue)&&I.refreshValue()}else o.render()}this._createCellCoords=function(m,C){return o.view._wt.createCellCoords(m,C)},this._createCellRange=function(m,C,y){return o.view._wt.createCellRange(m,C,y)},this.validateCell=function(m,C,y,I){let x=o.getCellValidator(C);function N(B){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||C.hidden===!0){y(B);return}const R=C.visualCol,E=C.visualRow,S=o.getCell(E,R,!0);if(S&&S.nodeName!=="TH"){const D=o.rowIndexMapper.getRenderableFromVisualIndex(E),H=o.columnIndexMapper.getRenderableFromVisualIndex(R);o.view._wt.getSetting("cellRenderer",D,H,S)}y(B)}IK(x)&&(x=function(B){return function(Y,R){R(B.test(Y))}}(x)),ht(x)?(m=o.runHooks("beforeValidate",m,C.visualRow,C.prop,I),o._registerImmediate(()=>{x.call(C,m,B=>{o&&(B=o.runHooks("afterValidate",B,m,C.visualRow,C.prop,I),C.valid=B,N(B),o.runHooks("postAfterValidate",B,m,C.visualRow,C.prop,I))})})):o._registerImmediate(()=>{C.valid=!0,N(C.valid,!1)})};function ee(m,C,y){return Array.isArray(m)?m:[[m,C,y]]}function te(m,C){const y=o.runHooks("beforeChange",m,C||"edit"),I=m.filter(N=>N!==null);if(y===!1||I.length===0){var x;return(x=o.getActiveEditor())===null||x===void 0||x.cancelChanges(),[]}for(let N=I.length-1;N>=0;N--){const[B,Y,,R]=I[N],E=a.propToCol(Y);let S;Number.isInteger(E)?S=o.getCellMeta(B,E):S={...Object.getPrototypeOf(p),...p};const{type:D,checkedTemplate:H,uncheckedTemplate:F}=S;if(D==="numeric"&&typeof R=="string"&&w4(R)&&(I[N][3]=J(R)),D==="checkbox"){const X=Lt(R),L=X===Lt(H),W=X===Lt(F);(L||W)&&(I[N][3]=L?H:F)}}return I}this.setDataAtCell=function(m,C,y,I){const x=ee(m,C,y),N=[];let B=I,Y,R,E;for(Y=0,R=x.length;Y<R;Y++){if(typeof x[Y]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof x[Y][1]!="number")throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");x[Y][1]>=this.countCols()?E=x[Y][1]:E=a.colToProp(x[Y][1]),N.push([x[Y][0],E,l.getAtCell(this.toPhysicalRow(x[Y][0]),x[Y][1]),x[Y][2]])}!B&&typeof m=="object"&&(B=C);const S=te(N,B);o.runHooks("afterSetDataAtCell",S,B),Z(S,B,()=>{ie(S,B)})},this.setDataAtRowProp=function(m,C,y,I){const x=ee(m,C,y),N=[];let B=I,Y,R;for(Y=0,R=x.length;Y<R;Y++)N.push([x[Y][0],x[Y][1],l.getAtCell(this.toPhysicalRow(x[Y][0]),x[Y][1]),x[Y][2]]);!B&&typeof m=="object"&&(B=C);const E=te(N,I);o.runHooks("afterSetDataAtRowProp",E,B),Z(E,B,()=>{ie(E,B)})},this.listen=function(){o&&!o.isListening()&&(C0.forEach(m=>{o!==m&&m.unlisten()}),y0=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(y0=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return y0===o.guid},this.destroyEditor=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c.closeEditor(m),o.view.render(),C&&j.isSelected()&&c.prepareEditor()},this.populateFromArray=function(m,C,y,I,x,N,B){if(!(typeof y=="object"&&typeof y[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const Y=typeof I=="number"?o._createCellCoords(I,x):null;return u.populateFromArray(o._createCellCoords(m,C),y,Y,N,B)},this.spliceCol=function(m,C,y){for(var I=arguments.length,x=new Array(I>3?I-3:0),N=3;N<I;N++)x[N-3]=arguments[N];return a.spliceCol(m,C,y,...x)},this.spliceRow=function(m,C,y){for(var I=arguments.length,x=new Array(I>3?I-3:0),N=3;N<I;N++)x[N-3]=arguments[N];return a.spliceRow(m,C,y,...x)},this.getSelected=function(){if(j.isSelected())return qe(j.getSelectedRange(),m=>{let{from:C,to:y}=m;return[C.row,C.col,y.row,y.col]})},this.getSelectedLast=function(){const m=this.getSelected();let C;return m&&m.length>0&&(C=m[m.length-1]),C},this.getSelectedRange=function(){if(j.isSelected())return Array.from(j.getSelectedRange())},this.getSelectedRangeLast=function(){const m=this.getSelectedRange();let C;return m&&m.length>0&&(C=m[m.length-1]),C},this.emptySelectedCells=function(m){if(!j.isSelected()||this.countRows()===0||this.countCols()===0)return;const C=[];k(j.getSelectedRange(),y=>{if(y.isSingleHeader())return;const I=y.getTopStartCorner(),x=y.getBottomEndCorner();Ce(I.row,x.row,N=>{Ce(I.col,x.col,B=>{this.getCellMeta(N,B).readOnly||C.push([N,B,null])})})}),C.length>0&&this.setDataAtCell(C,m)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const m=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(m,0),!this.isRenderSuspended()&&m===this.renderSuspendedCounter&&o.view.render()},this.render=function(){this.view&&(this.forceFullRender=!0,this.isRenderSuspended()||o.view.render())},this.batchRender=function(m){this.suspendRender();const C=m();return this.resumeRender(),C},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const C=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(C,0),(!this.isExecutionSuspended()&&C===this.executionSuspendedCounter||m)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const y=m();return this.resumeExecution(C),y},this.batch=function(m){this.suspendRender(),this.suspendExecution();const C=m();return this.resumeExecution(),this.resumeRender(),C},this.refreshDimensions=function(){if(!o.view)return;const m=o.view,{width:C,height:y}=m.getLastSize(),{width:I,height:x}=o.rootElement.getBoundingClientRect(),N=I!==C||x!==y;o.runHooks("beforeRefreshDimensions",{width:C,height:y},{width:I,height:x},N)!==!1&&((N||m._wt.wtOverlays.scrollableElement===o.rootWindow)&&(m.setLastSize(I,x),o.render(),m.adjustElementsSize()),o.runHooks("afterRefreshDimensions",{width:C,height:y},{width:I,height:x},N))},this.updateData=function(m,C){kk(m,y=>{a=y},y=>{a=y,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols(),j.refresh()},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"updateData",source:C,metaManager:b,firstRun:f})},this.loadData=function(m,C){kk(m,y=>{a=y},()=>{b.clearCellsCache(),o.initIndexMappers(),u.adjustRowsAndCols(),j.refresh(),f&&(f=[null,"loadData"])},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"loadData",source:C,metaManager:b,firstRun:f})},this.getInitialColumnCount=function(){const m=p.columns;let C=0;if(Array.isArray(m))C=m.length;else if(ht(m))if(o.dataType==="array"){const y=this.countSourceCols();for(let I=0;I<y;I+=1)m(I)&&(C+=1)}else(o.dataType==="object"||o.dataType==="function")&&(C=a.colToPropCache.length);else if(we(p.dataSchema)){const y=a.getSchema();C=Array.isArray(y)?y.length:ES(y)}else C=this.countSourceCols();return C},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(m,C,y,I){return $t(m)?a.getAll():a.getRange(o._createCellCoords(m,C),o._createCellCoords(y,I),a.DESTINATION_RENDERER)},this.getCopyableText=function(m,C,y,I){return a.getCopyableText(o._createCellCoords(m,C),o._createCellCoords(y,I))},this.getCopyableData=function(m,C){return a.getCopyable(m,a.colToProp(C))},this.getSchema=function(){return a.getSchema()},this.updateSettings=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const y=(f?o.loadData:o.updateData).bind(this);let I=!1,x,N;if(we(m.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(we(m.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(we(m.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');m.language&&q(m.language);for(x in m)if(!(x==="data"||x==="language"))if(x==="className")Q("className",m.className);else if(x==="tableClassName"&&o.table)Q("tableClassName",m.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames();else if(de.getSingleton().isRegistered(x)||de.getSingleton().isDeprecated(x)){const S=m[x];ht(S)?(de.getSingleton().addAsFixed(x,S,o),p[x]=S):Array.isArray(S)&&(de.getSingleton().add(x,S,o),p[x]=S)}else!C&&gr(m,x)&&(_[x]=m[x]);m.data===void 0&&p.data===void 0?y(null,"updateSettings"):m.data!==void 0?y(m.data,"updateSettings"):m.columns!==void 0&&(a.createMap(),o.initIndexMappers());const B=o.countCols(),Y=p.columns;if(Y&&ht(Y)&&(I=!0),(m.cell!==void 0||m.cells!==void 0||m.columns!==void 0)&&b.clearCache(),B>0)for(x=0,N=0;x<B;x++){if(Y){const S=I?Y(x):Y[N];S&&b.updateColumnMeta(N,S)}N+=1}we(m.cell)&&Fe(m.cell,S=>{o.setCellMetaObject(S.row,S.col,S)}),o.runHooks("afterCellMetaReset");let R=o.rootElement.style.height;R!==""&&(R=parseInt(o.rootElement.style.height,10));let E=m.height;if(ht(E)&&(E=E()),C&&o.rootElement.getAttribute("style")&&o.rootElement.setAttribute("data-initialstyle",o.rootElement.getAttribute("style")),E===null){const S=o.rootElement.getAttribute("data-initialstyle");S&&(S.indexOf("height")>-1||S.indexOf("overflow")>-1)?o.rootElement.setAttribute("style",S):(o.rootElement.style.height="",o.rootElement.style.overflow="")}else E!==void 0&&(o.rootElement.style.height=isNaN(E)?`${E}`:`${E}px`,o.rootElement.style.overflow="hidden");if(typeof m.width<"u"){let S=m.width;ht(S)&&(S=S()),o.rootElement.style.width=isNaN(S)?`${S}`:`${S}px`}if(!C){if(o.view){o.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),o.view._wt.exportSettingsAsClassNames();const S=o.getCurrentThemeName(),D=gr(m,"themeName");S&&D&&S!==m.themeName&&(o.view.getStylesHandler().removeClassNames(),o.view.removeClassNameFromLicenseElement(S));const H=D&&m.themeName||Gk(o.rootElement);o.useTheme(H),o.view.addClassNameToLicenseElement(o.getCurrentThemeName())}o.runHooks("afterUpdateSettings",m)}u.adjustRowsAndCols(),o.view&&!f&&(o.render(),o.view._wt.wtOverlays.adjustElementsSize()),!C&&o.view&&(R===""||E===""||E===void 0)&&R!==E&&o.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const m=o.getSelectedLast();if(p.getValue){if(ht(p.getValue))return p.getValue.call(o);if(m)return o.getData()[m[0][0]][p.getValue]}else if(m)return o.getDataAtCell(m[0],m[1])},this.getSettings=function(){return p},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(m,C,y,I,x){u.alter(m,C,y,I,x)},this.getCell=function(m,C){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,I=C,x=m;if(C>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(C)))return null;I=this.columnIndexMapper.getRenderableFromVisualIndex(C)}if(m>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(m)))return null;x=this.rowIndexMapper.getRenderableFromVisualIndex(m)}return x===null||I===null||x===void 0||I===void 0?null:o.view.getCellAtCoords(o._createCellCoords(x,I),y)},this.getCoords=function(m){const C=this.view._wt.wtTable.getCoords(m);if(C===null)return null;const{row:y,col:I}=C;let x=y,N=I;return y>=0&&(x=this.rowIndexMapper.getVisualFromRenderableIndex(y)),I>=0&&(N=this.columnIndexMapper.getVisualFromRenderableIndex(I)),o._createCellCoords(x,N)},this.colToProp=function(m){return a.colToProp(m)},this.propToCol=function(m){return a.propToCol(m)},this.toVisualRow=m=>this.rowIndexMapper.getVisualFromPhysicalIndex(m),this.toVisualColumn=m=>this.columnIndexMapper.getVisualFromPhysicalIndex(m),this.toPhysicalRow=m=>this.rowIndexMapper.getPhysicalFromVisualIndex(m),this.toPhysicalColumn=m=>this.columnIndexMapper.getPhysicalFromVisualIndex(m),this.getDataAtCell=function(m,C){return a.get(m,a.colToProp(C))},this.getDataAtRowProp=function(m,C){return a.get(m,C)},this.getDataAtCol=function(m){const C=[],y=a.getRange(o._createCellCoords(0,m),o._createCellCoords(p.data.length-1,m),a.DESTINATION_RENDERER);for(let I=0;I<y.length;I+=1)for(let x=0;x<y[I].length;x+=1)C.push(y[I][x]);return C},this.getDataAtProp=function(m){const C=[],y=a.getRange(o._createCellCoords(0,a.propToCol(m)),o._createCellCoords(p.data.length-1,a.propToCol(m)),a.DESTINATION_RENDERER);for(let I=0;I<y.length;I+=1)for(let x=0;x<y[I].length;x+=1)C.push(y[I][x]);return C},this.getSourceData=function(m,C,y,I){let x;return m===void 0?x=l.getData():x=l.getByRange(o._createCellCoords(m,C),o._createCellCoords(y,I)),x},this.getSourceDataArray=function(m,C,y,I){let x;return m===void 0?x=l.getData(!0):x=l.getByRange(o._createCellCoords(m,C),o._createCellCoords(y,I),!0),x},this.getSourceDataAtCol=function(m){return l.getAtColumn(m)},this.setSourceDataAtCell=function(m,C,y,I){const x=ee(m,C,y),N=this.hasHook("afterSetSourceDataAtCell"),B=[];N&&k(x,R=>{let[E,S,D]=R;B.push([E,S,l.getAtCell(E,S),D])}),k(x,R=>{let[E,S,D]=R;l.setAtCell(E,S,D)}),N&&this.runHooks("afterSetSourceDataAtCell",B,I),this.render();const Y=o.getActiveEditor();Y&&we(Y.refreshValue)&&Y.refreshValue()},this.getSourceDataAtRow=function(m){return l.getAtRow(m)},this.getSourceDataAtCell=function(m,C){return l.getAtCell(m,C)},this.getDataAtRow=function(m){return a.getRange(o._createCellCoords(m,0),o._createCellCoords(m,this.countCols()-1),a.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(m,C,y,I){const x=m===void 0?[0,0,this.countRows(),this.countCols()]:[m,C,y,I],[N,B]=x;let[,,Y,R]=x,E=null,S=null;Y===void 0&&(Y=N),R===void 0&&(R=B);let D="mixed";return Ce(Math.max(Math.min(N,Y),0),Math.max(N,Y),H=>{let F=!0;return Ce(Math.max(Math.min(B,R),0),Math.max(B,R),X=>(S=this.getCellMeta(H,X).type,E?F=E===S:E=S,F)),D=F?S:"mixed",F}),D},this.removeCellMeta=function(m,C,y){const[I,x]=[this.toPhysicalRow(m),this.toPhysicalColumn(C)];let N=b.getCellMetaKeyValue(I,x,y);o.runHooks("beforeRemoveCellMeta",m,C,y,N)!==!1&&(b.removeCellMeta(I,x,y),o.runHooks("afterRemoveCellMeta",m,C,y,N)),N=null},this.spliceCellsMeta=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var y=arguments.length,I=new Array(y>2?y-2:0),x=2;x<y;x++)I[x-2]=arguments[x];if(I.length>0&&!Array.isArray(I[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");C>0&&b.removeRow(this.toPhysicalRow(m),C),I.length>0&&k(I.reverse(),N=>{b.createRow(this.toPhysicalRow(m)),k(N,(B,Y)=>this.setCellMetaObject(m,Y,B))}),o.render()},this.setCellMetaObject=function(m,C,y){typeof y=="object"&&Fe(y,(I,x)=>{this.setCellMeta(m,C,x,I)})},this.setCellMeta=function(m,C,y,I){if(o.runHooks("beforeSetCellMeta",m,C,y,I)===!1)return;let N=m,B=C;m<this.countRows()&&(N=this.toPhysicalRow(m)),C<this.countCols()&&(B=this.toPhysicalColumn(C)),b.setCellMeta(N,B,y,I),o.runHooks("afterSetCellMeta",m,C,y,I)},this.getCellsMeta=function(){return b.getCellsMeta()},this.getCellMeta=function(m,C){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipMetaExtension:!1},I=this.toPhysicalRow(m),x=this.toPhysicalColumn(C);return I===null&&(I=m),x===null&&(x=C),b.getCellMeta(I,x,{visualRow:m,visualColumn:C,...y})},this.getColumnMeta=function(m){return b.getColumnMeta(this.toPhysicalColumn(m))},this.getCellMetaAtRow=function(m){return b.getCellsMetaAtRow(m)},this.isColumnModificationAllowed=function(){return!(o.dataType==="object"||p.columns)},this.getCellRenderer=function(m,C){const y=typeof m=="number"?o.getCellMeta(m,C).renderer:m.renderer;return typeof y=="string"?ZS(y):$t(y)?ZS("text"):y},this.getCellEditor=function(m,C){const y=typeof m=="number"?o.getCellMeta(m,C).editor:m.editor;return typeof y=="string"?$S(y):$t(y)?$S("text"):y},this.getCellValidator=function(m,C){const y=typeof m=="number"?o.getCellMeta(m,C).validator:m.validator;return typeof y=="string"?A4(y):y},this.validateCells=function(m){this._validateCells(m)},this.validateRows=function(m,C){if(!Array.isArray(m))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(C,m)},this.validateColumns=function(m,C){if(!Array.isArray(m))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(C,void 0,m)},this._validateCells=function(m,C,y){const I=new ue;m&&(I.onQueueEmpty=m);let x=o.countRows()-1;for(;x>=0;){if(C!==void 0&&C.indexOf(x)===-1){x-=1;continue}let N=o.countCols()-1;for(;N>=0;){if(y!==void 0&&y.indexOf(N)===-1){N-=1;continue}I.addValidatorToQueue(),o.validateCell(o.getDataAtCell(x,N),o.getCellMeta(x,N),B=>{if(typeof B!="boolean")throw new Error("Validation error: result is not boolean");B===!1&&(I.valid=!1),I.removeValidatorFormQueue()},"validateCells"),N-=1}x-=1}I.checkIfQueueIsEmpty()},this.getRowHeader=function(m){let C=p.rowHeaders,y=m;return y!==void 0&&(y=o.runHooks("modifyRowHeader",y)),y===void 0?(C=[],Ce(o.countRows()-1,I=>{C.push(o.getRowHeader(I))})):Array.isArray(C)&&C[y]!==void 0?C=C[y]:ht(C)?C=C(y):C&&typeof C!="string"&&typeof C!="number"&&(C=y+1),C},this.hasRowHeaders=function(){return!!p.rowHeaders},this.hasColHeaders=function(){if(p.colHeaders!==void 0&&p.colHeaders!==null)return!!p.colHeaders;for(let m=0,C=o.countCols();m<C;m++)if(o.getColHeader(m))return!0;return!1},this.getColHeader=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const y=o.runHooks("modifyColHeader",m);if(y===void 0){const Y=[],R=o.countCols();for(let E=0;E<R;E++)Y.push(o.getColHeader(E));return Y}let I=p.colHeaders;const x=function(Y){const R=[],E=o.countCols();let S=0;for(;S<E;S++)ht(p.columns)&&p.columns(S)&&R.push(S);return R[Y]},N=o.toPhysicalColumn(y),B=x(N);return p.colHeaders===!1?I=null:p.columns&&ht(p.columns)&&p.columns(B)&&p.columns(B).title?I=p.columns(B).title:p.columns&&p.columns[N]&&p.columns[N].title?I=p.columns[N].title:Array.isArray(p.colHeaders)&&p.colHeaders[N]!==void 0?I=p.colHeaders[N]:ht(p.colHeaders)?I=p.colHeaders(N):p.colHeaders&&typeof p.colHeaders!="string"&&typeof p.colHeaders!="number"&&(I=F5(y)),I=o.runHooks("modifyColumnHeaderValue",I,m,C),I},this._getColWidthFromSettings=function(m){let C;if(m>=0&&(C=o.getCellMeta(0,m).width),(C===void 0||C===p.width)&&(C=p.colWidths),C!=null){switch(typeof C){case"object":C=C[m];break;case"function":C=C(m);break}typeof C=="string"&&(C=parseInt(C,10))}return C},this.getColWidth=function(m,C){let y=o._getColWidthFromSettings(m);return y=o.runHooks("modifyColWidth",y,m,C),y===void 0&&(y=Du),y},this._getRowHeightFromSettings=function(m){const C=this.view.getDefaultRowHeight();let y=p.rowHeights;if(y!=null){switch(typeof y){case"object":y=y[m];break;case"function":y=y(m);break}typeof y=="string"&&(y=parseInt(y,10))}return y!=null&&y<C?C:y},this.getRowHeight=function(m,C){let y=o._getRowHeightFromSettings(m);return y=o.runHooks("modifyRowHeight",y,m,C),y},this.countSourceRows=function(){return l.countRows()},this.countSourceCols=function(){return l.countFirstRowKeys()},this.countRows=function(){return a.getLength()},this.countCols=function(){const m=p.maxCols,C=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(m,C)},this.countRenderedRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,C=0;return AN(o.countRows()-1,y=>{if(o.isEmptyRow(y))C+=1;else if(m===!0)return!1}),C},this.countEmptyCols=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,C=0;return AN(o.countCols()-1,y=>{if(o.isEmptyCol(y))C+=1;else if(m===!0)return!1}),C},this.isEmptyRow=function(m){return p.isEmptyRow.call(o,m)},this.isEmptyCol=function(m){return p.isEmptyCol.call(o,m)},this.selectCell=function(m,C,y,I){let x=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,N=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return $t(m)||$t(C)?!1:this.selectCells([[m,C,y,I]],x,N)},this.selectCells=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;C===!1&&d.suspend();const I=j.selectCells(m);return I&&y&&o.listen(),d.resume(),I},this.selectColumns=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,y=arguments.length>2?arguments[2]:void 0;return j.selectColumns(m,C,y)},this.selectRows=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,y=arguments.length>2?arguments[2]:void 0;return j.selectRows(m,C,y)},this.deselectCell=function(){j.deselect()},this.selectAll=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,y=arguments.length>2?arguments[2]:void 0;d.skipNextScrollCycle(),j.selectAll(m,C,y)};const ae=(m,C)=>m.getNearestNotHiddenIndex(C,1,!0);this.scrollViewportTo=function(m,C){if(typeof m=="number"){var y;m={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(y=arguments[4])!==null&&y!==void 0?y:!0}}const{row:I,col:x,considerHiddenIndexes:N}=m??{};let B=I,Y=x;if(ht(C)&&this.addHookOnce("afterScroll",C),N===void 0||N){const D=Number.isInteger(I)&&I>=0,H=Number.isInteger(x)&&x>=0,F=D?ae(this.rowIndexMapper,I):void 0,X=H?ae(this.columnIndexMapper,x):void 0;if(F===null||X===null)return!1;B=D?o.rowIndexMapper.getRenderableFromVisualIndex(F):I,Y=H?o.columnIndexMapper.getRenderableFromVisualIndex(X):x}const R=Number.isInteger(B),E=Number.isInteger(Y);let S=!1;return R&&B>=0&&E&&Y>=0?S=o.view.scrollViewport(o._createCellCoords(B,Y),m.horizontalSnap,m.verticalSnap):R&&B>=0&&(E&&Y<0||!E)?S=o.view.scrollViewportVertically(B,m.verticalSnap):E&&Y>=0&&(R&&B<0||!R)&&(S=o.view.scrollViewportHorizontally(Y,m.horizontalSnap)),ht(C)&&(S?this.view.render():(this.removeHook("afterScroll",C),this._registerMicrotask(()=>C()))),S},this.scrollToFocusedCell=function(m){if(!this.selection.isSelected())return!1;ht(m)&&this.addHookOnce("afterScroll",m);const{highlight:C}=this.getSelectedRangeLast(),y=this.scrollViewportTo(C.toObject());return y?this.view.render():ht(m)&&(this.removeHook("afterScroll",m),this._registerMicrotask(()=>m())),y},this.destroy=function(){if(o._clearTimeouts(),o._clearImmediates(),o.view&&o.view.destroy(),l&&l.destroy(),l=null,this.getShortcutManager().destroy(),b.clearCache(),C0.delete(this.guid),lm(o)){const m=this.rootDocument.querySelector(".hot-display-license-info");m&&m.parentNode.removeChild(m)}Zo(o.rootElement),s.destroy(),c&&c.destroy(),o.batchExecution(()=>{o.rowIndexMapper.unregisterAll(),o.columnIndexMapper.unregisterAll(),O.getItems().forEach(m=>{let[,C]=m;C.destroy()}),O.clear(),o.runHooks("afterDestroy")},!0),de.getSingleton().destroy(o),Fe(o,(m,C,y)=>{ht(m)?y[C]=z(C):C!=="guid"&&(y[C]=null)}),o.isDestroyed=!0,a&&a.destroy(),a=null,u=null,j=null,c=null,o=null};function z(m){return()=>{throw new Error(`The "${m}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return c.getActiveEditor()},this.getFirstRenderedVisibleRow=function(){return o.view.getFirstRenderedVisibleRow()},this.getLastRenderedVisibleRow=function(){return o.view.getLastRenderedVisibleRow()},this.getFirstRenderedVisibleColumn=function(){return o.view.getFirstRenderedVisibleColumn()},this.getLastRenderedVisibleColumn=function(){return o.view.getLastRenderedVisibleColumn()},this.getFirstFullyVisibleRow=function(){return o.view.getFirstFullyVisibleRow()},this.getLastFullyVisibleRow=function(){return o.view.getLastFullyVisibleRow()},this.getFirstFullyVisibleColumn=function(){return o.view.getFirstFullyVisibleColumn()},this.getLastFullyVisibleColumn=function(){return o.view.getLastFullyVisibleColumn()},this.getFirstPartiallyVisibleRow=function(){return o.view.getFirstPartiallyVisibleRow()},this.getLastPartiallyVisibleRow=function(){return o.view.getLastPartiallyVisibleRow()},this.getFirstPartiallyVisibleColumn=function(){return o.view.getFirstPartiallyVisibleColumn()},this.getLastPartiallyVisibleColumn=function(){return o.view.getLastPartiallyVisibleColumn()},this.getPlugin=function(m){return O.getItem(Ti(m))},this.getPluginName=function(m){return m===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:O.getId(m)},this.getInstance=function(){return o},this.addHook=function(m,C,y){de.getSingleton().add(m,C,o,y)},this.hasHook=function(m){return de.getSingleton().has(m,o)||de.getSingleton().has(m)},this.addHookOnce=function(m,C,y){de.getSingleton().once(m,C,o,y)},this.removeHook=function(m,C){de.getSingleton().remove(m,C,o)},this.runHooks=function(m,C,y,I,x,N,B){return de.getSingleton().run(o,m,C,y,I,x,N,B)},this.getTranslatedPhrase=function(m,C){return wk(p.language,m,C)},this.toHTML=()=>ON(this),this.toTableElement=()=>{const m=this.rootDocument.createElement("div");return m.insertAdjacentHTML("afterbegin",ON(this)),m.firstElementChild},this.timeouts=[],this.useTheme=m=>{this.view.getStylesHandler().useTheme(m),this.runHooks("afterSetTheme",m,!!f)},this.getCurrentThemeName=()=>this.view.getStylesHandler().getThemeName(),this._registerTimeout=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,y=m;typeof y=="function"&&(y=setTimeout(y,C)),this.timeouts.push(y)},this._clearTimeouts=function(){k(this.timeouts,m=>{clearTimeout(m)})},this.immediates=[],this._registerImmediate=function(m){this.immediates.push(setImmediate(m))},this._clearImmediates=function(){k(this.immediates,m=>{clearImmediate(m)})},this._registerMicrotask=function(m){this.rootWindow.queueMicrotask(()=>{this.isDestroyed||m()})},this._getEditorManager=function(){return c};const $=X7({handleEvent(){return o.isListening()},beforeKeyDown:m=>this.runHooks("beforeKeyDown",m),afterKeyDown:m=>{this.isDestroyed||o.runHooks("afterDocumentKeyDown",m)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",m=>{m.ctrlKey===!1&&m.metaKey===!1&&$.releasePressedKeys()}),this.getShortcutManager=function(){return $},this.getFocusManager=function(){return h},LN().forEach(m=>{const C=XS(m);O.addItem(m,new C(this))}),H7(o),$.setActiveContextName("grid"),de.getSingleton().run(o,"construct")}function Kk(t,e,r){t.addEventListener(e,r,!1)}function Xk(t,e,r){t.removeEventListener(e,r,!1)}function Lm(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function Zk(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300,textContent:h=>h.value,...e},n=t.body,i=t.createTextNode(""),o=t.createElement("span");let s;function a(){var h,d;i.textContent=r.textContent(s),o.style.position="absolute",o.style.fontSize=Lm(s).fontSize,o.style.fontFamily=Lm(s).fontFamily,o.style.whiteSpace="pre",n.appendChild(o);const f=parseInt(((h=Lm(s))===null||h===void 0?void 0:h.paddingInlineStart)||0,10),g=parseInt(((d=Lm(s))===null||d===void 0?void 0:d.paddingInlineEnd)||0,10),w=o.clientWidth+f+g+1;n.removeChild(o);const v=s.style;v.height=`${r.minHeight}px`,r.minWidth>w?v.width=`${r.minWidth}px`:w>r.maxWidth?v.width=`${r.maxWidth}px`:v.width=`${w}px`;const b=s.scrollHeight?s.scrollHeight-1:0;r.minHeight>b?v.height=`${r.minHeight}px`:r.maxHeight<b?(v.height=`${r.maxHeight}px`,v.overflowY="visible"):v.height=`${b}px`}function l(){t.defaultView.setTimeout(a,0)}function u(h){if(h&&h.minHeight)if(h.minHeight==="inherit")r.minHeight=s.clientHeight;else{const d=parseInt(h.minHeight,10);isNaN(d)||(r.minHeight=d)}if(h&&h.maxHeight)if(h.maxHeight==="inherit")r.maxHeight=s.clientHeight;else{const d=parseInt(h.maxHeight,10);isNaN(d)||(r.maxHeight=d)}if(h&&h.minWidth)if(h.minWidth==="inherit")r.minWidth=s.clientWidth;else{const d=parseInt(h.minWidth,10);isNaN(d)||(r.minWidth=d)}if(h&&h.maxWidth)if(h.maxWidth==="inherit")r.maxWidth=s.clientWidth;else{const d=parseInt(h.maxWidth,10);isNaN(d)||(r.maxWidth=d)}o.firstChild||(o.className="autoResize",o.style.display="inline-block",o.appendChild(i))}function c(h,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s=h,u(d),s.nodeName==="TEXTAREA"&&(s.style.resize="none",s.style.height=`${r.minHeight}px`,s.style.minWidth=`${r.minWidth}px`,s.style.maxWidth=`${r.maxWidth}px`,s.style.overflowY="hidden"),f&&(Kk(s,"input",a),Kk(s,"keydown",l)),a()}return{init:c,resize:a,unObserve(){Xk(s,"input",a),Xk(s,"keydown",l)}}}function Jk(t,e){const r=HH(e),n=e.value.split(`
537
+ `);let i=r,o=0;for(let s=0;s<n.length;s++){const a=n[s];s!==0&&(o+=n[s-1].length+1);const l=o+a.length;if(t==="home"?i=o:t==="end"&&(i=l),r<=l)break}Lg(e,i)}function gl(t,e,r){return(e=Z7(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z7(t){var e=J7(t,"string");return typeof e=="symbol"?e:e+""}function J7(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Q7="ht_editor_visible",$m="ht_editor_hidden",Qk="textEditor",eZ="text";class ml extends Xu{static get EDITOR_TYPE(){return eZ}constructor(e){super(e),gl(this,"eventManager",new Pi(this)),gl(this,"autoResize",Zk(this.hot.rootDocument)),gl(this,"TEXTAREA",void 0),gl(this,"textareaStyle",void 0),gl(this,"TEXTAREA_PARENT",void 0),gl(this,"textareaParentStyle",void 0),gl(this,"layerClass",void 0),this.eventManager=new Pi(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this.autoResize.unObserve(),Hg(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,r,n,i,o,s){const a=this.state;if(super.prepare(e,r,n,i,o,s),!s.readOnly){this.refreshDimensions(!0);const{allowInvalid:l}=s;l&&!this.isOpened()&&(this.TEXTAREA.value=""),a!==Kt.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,r){this.state===Kt.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,r))}focus(){this.TEXTAREA.select(),Lg(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),Pe(this.TEXTAREA,[["data-hot-input",""],Ya(-1)]),oe(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.textareaStyle.overflowY="visible",this.TEXTAREA_PARENT=e.createElement("DIV"),oe(this.TEXTAREA_PARENT,"handsontableInputHolder"),_e(this.TEXTAREA_PARENT,this.layerClass)&&Ee(this.TEXTAREA_PARENT,this.layerClass),oe(this.TEXTAREA_PARENT,$m),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){_3()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",Ee(this.TEXTAREA_PARENT,this.layerClass),oe(this.TEXTAREA_PARENT,$m)}showEditableElement(){this.textareaParentStyle.height="",this.textareaParentStyle.overflow="",this.textareaParentStyle.position="",this.textareaParentStyle[this.hot.isRtl()?"left":"right"]="auto",this.textareaParentStyle.opacity="1",this.textareaStyle.textIndent="";const e=this.TEXTAREA_PARENT.childNodes;let r=!1;Ce(e.length-1,n=>{const i=e[n];if(_e(i,"handsontableEditor"))return r=!0,!1}),_e(this.TEXTAREA_PARENT,$m)&&Ee(this.TEXTAREA_PARENT,$m),r?(this.layerClass=Q7,oe(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),oe(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),r=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=r,this.setValue(r),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.state!==Kt.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:r,start:n,width:i,maxWidth:o,height:s,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${r}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${n}px`,this.showEditableElement();const l=this.hot.rootWindow.getComputedStyle(this.TD);this.TEXTAREA.style.fontSize=l.fontSize,this.TEXTAREA.style.fontFamily=l.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor,this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(i,o),minHeight:Math.min(s,a),maxWidth:o,maxHeight:a},!0)}bindEvents(){GH()&&this.eventManager.addEventListener(this.TEXTAREA,"focusout",()=>this.finishEditing(!1)),this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>{this.refreshDimensions(),this.state===Kt.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Kt.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("editor"),n={runOnlyIf:()=>we(this.hot.getSelected()),group:Qk},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
538
+ `)};r.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(i(),!1),runOnlyIf:o=>!this.hot.selection.isMultiple()&&!o.altKey},{keys:[["Meta","Enter"]],callback:()=>(i(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(i(),!1)},{keys:[["Home"]],callback:(o,s)=>{let[a]=s;Jk(a,this.TEXTAREA)}},{keys:[["End"]],callback:(o,s)=>{let[a]=s;Jk(a,this.TEXTAREA)}}],n)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(Qk)}}const tZ="base";function hd(t,e,r,n,i,o,s){const a=s.ariaTags,l=[],u=[],c=[],h=[];s.className&&oe(e,s.className),s.readOnly?(l.push(s.readOnlyCellClassName),a&&h.push(EH())):a&&c.push(EH()[0]),s.valid===!1&&s.invalidCellClassName?(l.push(s.invalidCellClassName),a&&h.push(TH())):(u.push(s.invalidCellClassName),a&&c.push(TH()[0])),s.wordWrap===!1&&s.noWordWrapClassName&&l.push(s.noWordWrapClassName),!o&&s.placeholder&&l.push(s.placeholderCellClassName),Ee(e,u),oe(e,l),Pu(e,c),Pe(e,h)}hd.RENDERER_TYPE=tZ;const rZ="text";function cs(t,e,r,n,i,o,s){hd.apply(this,[t,e,r,n,i,o,s]);let a=o;!a&&s.placeholder&&(a=s.placeholder),a=Lt(a),s.trimWhitespace&&(a=a.trim()),Za(e,a)}cs.RENDERER_TYPE=rZ;const eL={CELL_TYPE:"text",editor:ml,renderer:cs};ki(eL),pn.editors={BaseEditor:Xu};function pn(t,e){const r=new qk(t,e||{},_R);return r.init(),r}pn.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new qk(t,e,_R)},pn.DefaultSettings=xk(),pn.hooks=de.getSingleton(),pn.CellCoords=rl,pn.CellRange=Bh,pn.packageName="handsontable",pn.buildDate="24/04/2025 10:59:00",pn.version="15.3.0",pn.languages={dictionaryKeys:C9,getLanguageDictionary:pk,getLanguagesDictionaries:T9,registerLanguageDictionary:mk,getTranslatedPhrase:wk};var b0=null,nZ="Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.",iZ="Providing a component-based renderer using `hot-renderer`-annotated component is no longer supported. Pass your component using `renderer` prop of the `HotTable` or `HotColumn` component instead.",oZ="Providing a component-based editor using `hot-editor`-annotated component is no longer supported. Pass your component using `editor` prop of the `HotTable` or `HotColumn` component instead.",sZ="Unexpected children nodes found in HotTable component. Only HotColumn components are allowed.",aZ="Unexpected children nodes found in HotColumn component. HotColumn components do not support any children.",lZ="The Handsontable instance bound to this component was destroyed and cannot be used properly.",uZ="hot-wrapper-editor-container";function dd(){if(typeof console<"u"){var t;(t=console).warn.apply(t,arguments)}}function S0(t){return tL(t,"hot-renderer")?(dd(iZ),!0):tL(t,"hot-editor")?(dd(oZ),!0):!1}function cZ(t,e){var r=ne.Children.toArray(t);return r.some(function(n){return n.type!==e})?(dd(sZ),!0):!1}function hZ(t){var e=ne.Children.toArray(t);return e.length?(dd(aZ),!0):!1}function tL(t,e){var r=ne.Children.toArray(t);return r.some(function(n){return n.props[e]!==void 0})}function rL(t,e){if(!t||!e||typeof e=="boolean")return null;var r=ne.createElement(e,null),n=nL({},!1);return n.className="".concat(uZ," ").concat(n.className),Ds.createPortal(ne.createElement("div",Object.assign({},n),r),t.body)}function dZ(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;e||(e=document),b0||(b0=e.createDocumentFragment());var i=n??e.createElement("DIV");return b0.appendChild(i),{portal:Ds.createPortal(t,i,r),portalContainer:i}}function nL(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{id:t.id||(e?"hot-"+Math.random().toString(36).substring(5):void 0),className:t.className||"",style:t.style||{}}}function fZ(){return typeof window<"u"}function gZ(t,e){var r=ne.useRef(!1);ne.useEffect(function(){if(r.current)return t();r.current=!0},e)}function R0(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function mZ(t){if(Array.isArray(t))return t}function pZ(t){if(Array.isArray(t))return R0(t)}function wZ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vZ(t,e,r){return e=Fm(e),_Z(t,aL()?Reflect.construct(e,r||[],Fm(t).constructor):e.apply(t,r))}function iL(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oL(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,OZ(n.key),n)}}function sL(t,e,r){return e&&oL(t.prototype,e),r&&oL(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Fm(t){return Fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fm(t)}function yZ(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E0(t,e)}function aL(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aL=function(){return!!t})()}function CZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],l=!0,u=!1;try{if(o=(r=r.call(t)).next,e!==0)for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function SZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
539
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
540
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EZ(t,e){if(t==null)return{};var r,n,i=TZ(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function TZ(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function _Z(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wZ(t)}function E0(t,e){return E0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},E0(t,e)}function MZ(t,e){return mZ(t)||bZ(t,e)||lL(t,e)||SZ()}function PZ(t){return pZ(t)||CZ(t)||lL(t)||RZ()}function IZ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function OZ(t){var e=IZ(t,"string");return typeof e=="symbol"?e:e+""}function Nn(t){"@babel/helpers - typeof";return Nn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nn(t)}function lL(t,e){if(t){if(typeof t=="string")return R0(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R0(t,e):void 0}}var uL=function(){function t(){iL(this,t)}return sL(t,null,[{key:"getSettings",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.prevProps,o=i===void 0?{}:i,s=n.isInit,a=s===void 0?!1:s,l=n.initOnlySettingKeys,u=l===void 0?[]:l,c=function(g){return!a&&u.includes(g)?o[g]===r[g]:!1},h={};for(var d in r)d!=="children"&&!c(d)&&r.hasOwnProperty(d)&&(h[d]=r[d]);return h}}])}(),cL=ne.createContext(void 0),xZ=function(e){var r=e.children,n=ne.useRef([]),i=ne.useCallback(function(v,b){n.current[b]=v},[]),o=ne.useRef(new Map),s=ne.useRef(new Map),a=ne.useCallback(function(){return s.current.clear()},[]),l=ne.useRef(new Map),u=ne.useCallback(function(){return l.current.clear()},[]),c=ne.useRef(new Map),h=ne.useCallback(function(v){return function(p,_,O,T,M,P,G){var j="".concat(O,"-").concat(T),A=p.guid,q="".concat(A,"-").concat(j),Q="".concat(j,"-").concat(A);if(s.current.has(j)&&(_.innerHTML=s.current.get(j).innerHTML),_&&!_.getAttribute("ghost-table")){for(var ue=l.current.get(Q),J=c.current.get(q);_.firstChild;)_.removeChild(_.firstChild);if(ue&&J)_.appendChild(J);else{var Z=ne.createElement(v,{instance:p,TD:_,row:O,col:T,prop:M,value:P,cellProperties:G}),ie=dZ(Z,_.ownerDocument,Q,J),ee=ie.portal,te=ie.portalContainer;c.current.set(q,te),_.appendChild(te),l.current.set(Q,ee)}}return s.current.set("".concat(O,"-").concat(T),_),_}},[]),d=ne.useRef(function(){}),f=ne.useCallback(function(v){d.current=v},[]),g=ne.useCallback(function(){d.current(PZ(l.current.values()))},[]),w=ne.useMemo(function(){return{componentRendererColumns:o.current,columnsSettings:n.current,emitColumnSettings:i,getRendererWrapper:h,clearPortalCache:u,clearRenderedCellCache:a,setRenderersPortalManagerRef:f,pushCellPortalsIntoPortalManager:g}},[i,h,a,f,g]);return ne.createElement(cL.Provider,{value:w},r)};function hL(){return ne.useContext(cL)}var dL=ne.createContext(void 0),AZ=function(e){var r=e.columnIndex,n=e.getOwnerDocument,i=e.children,o=ne.useMemo(function(){return{columnIndex:r,getOwnerDocument:n}},[r,n]);return ne.createElement(dL.Provider,{value:o},i)},HZ=function(){return ne.useContext(dL)},NZ=["close","focus","open"],DZ=["getValue","setValue"],T0={open:"onOpen",close:"onClose",prepare:"onPrepare",focus:"onFocus"};function fL(t,e){return function(r){function n(i){var o;return iL(this,n),o=vZ(this,n,[i]),e.current=o,Object.getOwnPropertyNames(pn.editors.BaseEditor.prototype).forEach(function(s){if(!(s==="constructor"||DZ.includes(s))){var a=pn.editors.BaseEditor.prototype[s];n.prototype[s]=(function(){for(var l,u,c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];if(NZ.includes(s)||(u=a.call.apply(a,[this].concat(h))),T0[s]&&(l=t.current)!==null&&l!==void 0&&l[T0[s]]){var f;u=(f=t.current[T0[s]]).call.apply(f,[this].concat(h))}return u}).bind(o)}}),o}return yZ(n,r),sL(n,[{key:"focus",value:function(){}},{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(o){this.value=o}},{key:"open",value:function(){}},{key:"close",value:function(){}}])}(pn.editors.BaseEditor)}var kZ=ne.createContext(void 0),gL=function(e){var r=e.hooksRef,n=e.hotCustomEditorInstanceRef,i=e.children;return ne.createElement(kZ.Provider,{value:{hooksRef:r,hotCustomEditorInstanceRef:n}},i)},LZ=function(e){return e.type===_0},$Z=["_columnIndex","_getOwnerDocument","children"],_0=function(e){var r=hL(),n=r.componentRendererColumns,i=r.emitColumnSettings,o=r.getRendererWrapper,s=HZ(),a=s.columnIndex,l=s.getOwnerDocument,u=ne.useRef(null),c=ne.useRef(null);ne.useEffect(function(){var d=function(){return Object.keys(e).filter(function(v){return!$Z.includes(v)}).reduce(function(v,b){return v[b]=e[b],v},{})},f=function(){var v=uL.getSettings(d());return e.renderer?(v.renderer=o(e.renderer),n.set(a,!0)):e.hotRenderer&&(v.renderer=e.hotRenderer),e.editor?v.editor=fL(u,c):e.hotEditor&&(v.editor=e.hotEditor),v},g=f();i(g,a),S0(e.children)||hZ(e.children)});var h=rL(l(),e.editor);return ne.createElement(gL,{hooksRef:u,hotCustomEditorInstanceRef:c},h)},FZ="15.3.0",VZ=ne.forwardRef(function(t,e){var r=ne.useState([]),n=MZ(r,2),i=n[0],o=n[1];return ne.useImperativeHandle(e,function(){return o}),ne.createElement(ne.Fragment,null,i)});function WZ(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var M0={exports:{}},Vm={exports:{}},dt={},mL;function BZ(){if(mL)return dt;mL=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,g=t?Symbol.for("react.lazy"):60116,w=t?Symbol.for("react.block"):60121,v=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,p=t?Symbol.for("react.scope"):60119;function _(T){if(Nn(T)==="object"&&T!==null){var M=T.$$typeof;switch(M){case e:switch(T=T.type,T){case l:case u:case n:case o:case i:case h:return T;default:switch(T=T&&T.$$typeof,T){case a:case c:case g:case f:case s:return T;default:return M}}case r:return M}}}function O(T){return _(T)===u}return dt.AsyncMode=l,dt.ConcurrentMode=u,dt.ContextConsumer=a,dt.ContextProvider=s,dt.Element=e,dt.ForwardRef=c,dt.Fragment=n,dt.Lazy=g,dt.Memo=f,dt.Portal=r,dt.Profiler=o,dt.StrictMode=i,dt.Suspense=h,dt.isAsyncMode=function(T){return O(T)||_(T)===l},dt.isConcurrentMode=O,dt.isContextConsumer=function(T){return _(T)===a},dt.isContextProvider=function(T){return _(T)===s},dt.isElement=function(T){return Nn(T)==="object"&&T!==null&&T.$$typeof===e},dt.isForwardRef=function(T){return _(T)===c},dt.isFragment=function(T){return _(T)===n},dt.isLazy=function(T){return _(T)===g},dt.isMemo=function(T){return _(T)===f},dt.isPortal=function(T){return _(T)===r},dt.isProfiler=function(T){return _(T)===o},dt.isStrictMode=function(T){return _(T)===i},dt.isSuspense=function(T){return _(T)===h},dt.isValidElementType=function(T){return typeof T=="string"||typeof T=="function"||T===n||T===u||T===o||T===i||T===h||T===d||Nn(T)==="object"&&T!==null&&(T.$$typeof===g||T.$$typeof===f||T.$$typeof===s||T.$$typeof===a||T.$$typeof===c||T.$$typeof===v||T.$$typeof===b||T.$$typeof===p||T.$$typeof===w)},dt.typeOf=_,dt}var ft={},pL;function jZ(){return pL||(pL=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,g=t?Symbol.for("react.lazy"):60116,w=t?Symbol.for("react.block"):60121,v=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,p=t?Symbol.for("react.scope"):60119;function _(S){return typeof S=="string"||typeof S=="function"||S===n||S===u||S===o||S===i||S===h||S===d||Nn(S)==="object"&&S!==null&&(S.$$typeof===g||S.$$typeof===f||S.$$typeof===s||S.$$typeof===a||S.$$typeof===c||S.$$typeof===v||S.$$typeof===b||S.$$typeof===p||S.$$typeof===w)}function O(S){if(Nn(S)==="object"&&S!==null){var D=S.$$typeof;switch(D){case e:var H=S.type;switch(H){case l:case u:case n:case o:case i:case h:return H;default:var F=H&&H.$$typeof;switch(F){case a:case c:case g:case f:case s:return F;default:return D}}case r:return D}}}var T=l,M=u,P=a,G=s,j=e,A=c,q=n,Q=g,ue=f,J=r,Z=o,ie=i,ee=h,te=!1;function ae(S){return te||(te=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),z(S)||O(S)===l}function z(S){return O(S)===u}function $(S){return O(S)===a}function m(S){return O(S)===s}function C(S){return Nn(S)==="object"&&S!==null&&S.$$typeof===e}function y(S){return O(S)===c}function I(S){return O(S)===n}function x(S){return O(S)===g}function N(S){return O(S)===f}function B(S){return O(S)===r}function Y(S){return O(S)===o}function R(S){return O(S)===i}function E(S){return O(S)===h}ft.AsyncMode=T,ft.ConcurrentMode=M,ft.ContextConsumer=P,ft.ContextProvider=G,ft.Element=j,ft.ForwardRef=A,ft.Fragment=q,ft.Lazy=Q,ft.Memo=ue,ft.Portal=J,ft.Profiler=Z,ft.StrictMode=ie,ft.Suspense=ee,ft.isAsyncMode=ae,ft.isConcurrentMode=z,ft.isContextConsumer=$,ft.isContextProvider=m,ft.isElement=C,ft.isForwardRef=y,ft.isFragment=I,ft.isLazy=x,ft.isMemo=N,ft.isPortal=B,ft.isProfiler=Y,ft.isStrictMode=R,ft.isSuspense=E,ft.isValidElementType=_,ft.typeOf=O}()),ft}var wL;function vL(){return wL||(wL=1,process.env.NODE_ENV==="production"?Vm.exports=BZ():Vm.exports=jZ()),Vm.exports}/*
541
+ object-assign
542
+ (c) Sindre Sorhus
543
+ @license MIT
544
+ */var P0,yL;function UZ(){if(yL)return P0;yL=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(c){return s[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return P0=i()?Object.assign:function(o,s){for(var a,l=n(o),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var h in a)e.call(a,h)&&(l[h]=a[h]);if(t){u=t(a);for(var d=0;d<u.length;d++)r.call(a,u[d])&&(l[u[d]]=a[u[d]])}}return l},P0}var I0,CL;function O0(){if(CL)return I0;CL=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return I0=t,I0}var x0,bL;function SL(){return bL||(bL=1,x0=Function.call.bind(Object.prototype.hasOwnProperty)),x0}var A0,RL;function zZ(){if(RL)return A0;RL=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=O0(),r={},n=SL();t=function(s){var a="Warning: "+s;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var c in o)if(n(o,c)){var h;try{if(typeof o[c]!="function"){var d=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Nn(o[c])+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}h=o[c](s,c,l,a,null,e)}catch(g){h=g}if(h&&!(h instanceof Error)&&t((l||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+Nn(h)+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in r)){r[h.message]=!0;var f=u?u():"";t("Failed "+a+" type: "+h.message+(f??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},A0=i,A0}var H0,EL;function YZ(){if(EL)return H0;EL=1;var t=vL(),e=UZ(),r=O0(),n=SL(),i=zZ(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(l){var u="Warning: "+l;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function s(){return null}return H0=function(l,u){var c=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function d($){var m=$&&(c&&$[c]||$[h]);if(typeof m=="function")return m}var f="<<anonymous>>",g={array:p("array"),bigint:p("bigint"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:_(),arrayOf:O,element:T(),elementType:M(),instanceOf:P,node:q(),objectOf:j,oneOf:G,oneOfType:A,shape:ue,exact:J};function w($,m){return $===m?$!==0||1/$===1/m:$!==$&&m!==m}function v($,m){this.message=$,this.data=m&&Nn(m)==="object"?m:{},this.stack=""}v.prototype=Error.prototype;function b($){if(process.env.NODE_ENV!=="production")var m={},C=0;function y(x,N,B,Y,R,E,S){if(Y=Y||f,E=E||B,S!==r){if(u){var D=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw D.name="Invariant Violation",D}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var H=Y+":"+B;!m[H]&&C<3&&(o("You are manually calling a React.PropTypes validation function for the `"+E+"` prop on `"+Y+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),m[H]=!0,C++)}}return N[B]==null?x?N[B]===null?new v("The "+R+" `"+E+"` is marked as required "+("in `"+Y+"`, but its value is `null`.")):new v("The "+R+" `"+E+"` is marked as required in "+("`"+Y+"`, but its value is `undefined`.")):null:$(N,B,Y,R,E)}var I=y.bind(null,!1);return I.isRequired=y.bind(null,!0),I}function p($){function m(C,y,I,x,N,B){var Y=C[y],R=ee(Y);if(R!==$){var E=te(Y);return new v("Invalid "+x+" `"+N+"` of type "+("`"+E+"` supplied to `"+I+"`, expected ")+("`"+$+"`."),{expectedType:$})}return null}return b(m)}function _(){return b(s)}function O($){function m(C,y,I,x,N){if(typeof $!="function")return new v("Property `"+N+"` of component `"+I+"` has invalid PropType notation inside arrayOf.");var B=C[y];if(!Array.isArray(B)){var Y=ee(B);return new v("Invalid "+x+" `"+N+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected an array."))}for(var R=0;R<B.length;R++){var E=$(B,R,I,x,N+"["+R+"]",r);if(E instanceof Error)return E}return null}return b(m)}function T(){function $(m,C,y,I,x){var N=m[C];if(!l(N)){var B=ee(N);return new v("Invalid "+I+" `"+x+"` of type "+("`"+B+"` supplied to `"+y+"`, expected a single ReactElement."))}return null}return b($)}function M(){function $(m,C,y,I,x){var N=m[C];if(!t.isValidElementType(N)){var B=ee(N);return new v("Invalid "+I+" `"+x+"` of type "+("`"+B+"` supplied to `"+y+"`, expected a single ReactElement type."))}return null}return b($)}function P($){function m(C,y,I,x,N){if(!(C[y]instanceof $)){var B=$.name||f,Y=z(C[y]);return new v("Invalid "+x+" `"+N+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected ")+("instance of `"+B+"`."))}return null}return b(m)}function G($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function m(C,y,I,x,N){for(var B=C[y],Y=0;Y<$.length;Y++)if(w(B,$[Y]))return null;var R=JSON.stringify($,function(S,D){var H=te(D);return H==="symbol"?String(D):D});return new v("Invalid "+x+" `"+N+"` of value `"+String(B)+"` "+("supplied to `"+I+"`, expected one of "+R+"."))}return b(m)}function j($){function m(C,y,I,x,N){if(typeof $!="function")return new v("Property `"+N+"` of component `"+I+"` has invalid PropType notation inside objectOf.");var B=C[y],Y=ee(B);if(Y!=="object")return new v("Invalid "+x+" `"+N+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected an object."));for(var R in B)if(n(B,R)){var E=$(B,R,I,x,N+"."+R,r);if(E instanceof Error)return E}return null}return b(m)}function A($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var m=0;m<$.length;m++){var C=$[m];if(typeof C!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ae(C)+" at index "+m+"."),s}function y(I,x,N,B,Y){for(var R=[],E=0;E<$.length;E++){var S=$[E],D=S(I,x,N,B,Y,r);if(D==null)return null;D.data&&n(D.data,"expectedType")&&R.push(D.data.expectedType)}var H=R.length>0?", expected one of type ["+R.join(", ")+"]":"";return new v("Invalid "+B+" `"+Y+"` supplied to "+("`"+N+"`"+H+"."))}return b(y)}function q(){function $(m,C,y,I,x){return Z(m[C])?null:new v("Invalid "+I+" `"+x+"` supplied to "+("`"+y+"`, expected a ReactNode."))}return b($)}function Q($,m,C,y,I){return new v(($||"React class")+": "+m+" type `"+C+"."+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+I+"`.")}function ue($){function m(C,y,I,x,N){var B=C[y],Y=ee(B);if(Y!=="object")return new v("Invalid "+x+" `"+N+"` of type `"+Y+"` "+("supplied to `"+I+"`, expected `object`."));for(var R in $){var E=$[R];if(typeof E!="function")return Q(I,x,N,R,te(E));var S=E(B,R,I,x,N+"."+R,r);if(S)return S}return null}return b(m)}function J($){function m(C,y,I,x,N){var B=C[y],Y=ee(B);if(Y!=="object")return new v("Invalid "+x+" `"+N+"` of type `"+Y+"` "+("supplied to `"+I+"`, expected `object`."));var R=e({},C[y],$);for(var E in R){var S=$[E];if(n($,E)&&typeof S!="function")return Q(I,x,N,E,te(S));if(!S)return new v("Invalid "+x+" `"+N+"` key `"+E+"` supplied to `"+I+"`.\nBad object: "+JSON.stringify(C[y],null," ")+`
545
+ Valid keys: `+JSON.stringify(Object.keys($),null," "));var D=S(B,E,I,x,N+"."+E,r);if(D)return D}return null}return b(m)}function Z($){switch(Nn($)){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(Z);if($===null||l($))return!0;var m=d($);if(m){var C=m.call($),y;if(m!==$.entries){for(;!(y=C.next()).done;)if(!Z(y.value))return!1}else for(;!(y=C.next()).done;){var I=y.value;if(I&&!Z(I[1]))return!1}}else return!1;return!0;default:return!1}}function ie($,m){return $==="symbol"?!0:m?m["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&m instanceof Symbol:!1}function ee($){var m=Nn($);return Array.isArray($)?"array":$ instanceof RegExp?"object":ie(m,$)?"symbol":m}function te($){if(typeof $>"u"||$===null)return""+$;var m=ee($);if(m==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return m}function ae($){var m=te($);switch(m){case"array":case"object":return"an "+m;case"boolean":case"date":case"regexp":return"a "+m;default:return m}}function z($){return!$.constructor||!$.constructor.name?f:$.constructor.name}return g.checkPropTypes=i,g.resetWarningCache=i.resetWarningCache,g.PropTypes=g,g},H0}var N0,TL;function GZ(){if(TL)return N0;TL=1;var t=O0();function e(){}function r(){}return r.resetWarningCache=e,N0=function(){function i(a,l,u,c,h,d){if(d!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function o(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return s.PropTypes=s,s},N0}if(process.env.NODE_ENV!=="production"){var qZ=vL(),KZ=!0;M0.exports=YZ()(qZ.isElement,KZ)}else M0.exports=GZ()();var XZ=M0.exports,D0=WZ(XZ),_L=ne.forwardRef(function(t,e){var r=ne.useRef(null),n=ne.useRef(null),i=ne.useRef(null),o=ne.useRef(null),s=ne.useRef(),a=hL(),l=ne.useCallback(function(){return!r.current||!r.current.isDestroyed?r.current:(console.warn(lZ),null)},[r]),u=ne.useCallback(function(){return!r.current||r.current.isDestroyed},[r]),c=ne.useCallback(function(){a.clearRenderedCellCache(),a.componentRendererColumns.clear()},[a]),h=ne.useCallback(function(){return fZ()?n.current?n.current.ownerDocument:document:null},[n]),d=function(){var p,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=u()?[]:((p=l())===null||p===void 0||(p=p.getSettings())===null||p===void 0?void 0:p._initOnlySettings)||[],M=uL.getSettings(t,{prevProps:O,isInit:_,initOnlySettingKeys:T});return M.columns=a.columnsSettings.length?a.columnsSettings:M.columns,t.renderer?(M.renderer=a.getRendererWrapper(t.renderer),a.componentRendererColumns.set("global",!0)):M.renderer=t.hotRenderer||ZS("text"),t.editor?M.editor=fL(i,o):M.editor=t.hotEditor||$S("text"),M},f=function(p){var _,O;p&&((_=p.getPlugin("autoRowSize"))!==null&&_!==void 0&&_.enabled||(O=p.getPlugin("autoColumnSize"))!==null&&O!==void 0&&O.enabled)&&a.componentRendererColumns.size>0&&dd(nZ)};ne.useEffect(function(){var b=d(!0);return s.current=t,r.current=new pn.Core(n.current,b),r.current.addHook("beforeViewRender",function(){a.clearPortalCache(),a.clearRenderedCellCache()}),r.current.addHook("afterViewRender",function(){a.pushCellPortalsIntoPortalManager()}),r.current.init(),f(r.current),S0(t.children)||cZ(t.children,_0),function(){var p;c(),(p=l())===null||p===void 0||p.destroy()}},[]),gZ(function(){c();var b=l(),p=d(!1,s.current);s.current=t,b==null||b.updateSettings(p,!1),f(b),S0(t.children)}),ne.useImperativeHandle(e,function(){return{get hotElementRef(){return n.current},get hotInstance(){return l()}}});var g=ne.Children.toArray(t.children).filter(LZ).map(function(b,p){return ne.createElement(AZ,{columnIndex:p,getOwnerDocument:h,key:p},b)}),w=nL(t),v=rL(h(),t.editor);return ne.createElement(ne.Fragment,null,ne.createElement("div",Object.assign({ref:n},w),g),ne.createElement(VZ,{ref:a.setRenderersPortalManagerRef}),ne.createElement(gL,{hooksRef:i,hotCustomEditorInstanceRef:o},v))});_L.propTypes={style:D0.object,id:D0.string,className:D0.string};var ZZ=["children"],ML=ne.forwardRef(function(t,e){var r,n=t.children,i=EZ(t,ZZ),o=(r=i.id)!==null&&r!==void 0?r:ne.useId();return ne.createElement(xZ,null,ne.createElement(_L,Object.assign({id:o},i,{ref:e}),n))});ML.version=FZ;const PL="handsontableEditor",JZ="handsontable";class k0 extends ml{static get EDITOR_TYPE(){return JZ}open(){super.open();const e=this.htContainer.style;this.htEditor&&(this.htEditor.destroy(),e.width="",e.height="",e.overflow=""),e.display==="none"&&(e.display=""),this.htEditor=new this.hot.constructor(this.htContainer,this.htOptions),this.htEditor.init(),this.htEditor.rootElement.style.display="",this.cellProperties.strict?this.htEditor.selectCell(0,0):this.htEditor.deselectCell(),Lg(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),this.refreshDimensions()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,r,n,i,o,s){super.prepare(e,r,n,i,o,s);const a=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,autoWrapCol:!1,autoWrapRow:!1,ariaTags:!1,themeName:this.hot.getCurrentThemeName(),afterOnCellMouseDown(u,c){const h=this.getSourceData(c.row,c.col);h!==void 0&&a.setValue(h),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&fr(l,s.handsontable),this.htOptions=l}beginEditing(e,r){const n=this.hot.getSettings().onBeginEditing;n&&n()===!1||super.beginEditing(e,r)}createElements(){super.createElements();const e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,r,n){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const i=this.htEditor.getValue();i!==void 0&&this.setValue(i)}super.finishEditing(e,r,n)}getHeight(){return this.htEditor.view.getTableHeight()+1}getWidth(){return this.htEditor.view.getTableWidth()}assignHooks(){this.hot.addHook("afterDestroy",()=>{var e;(e=this.htEditor)===null||e===void 0||e.destroy()}),this.hot.addHook("afterSetTheme",(e,r)=>{if(!r){var n;(n=this.htEditor)===null||n===void 0||n.useTheme(e)}})}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const n={group:PL,relativeToGroup:Qs,position:"before"},i=(o,s)=>{const a=this.htEditor;if(o!==void 0&&(o<0||a.flipped&&o>a.countRows()-1?a.deselectCell():a.selectCell(o,0),a.getData().length))return s.preventDefault(),_i(s),this.hot.listen(),this.TEXTAREA.focus(),!1};r.addShortcuts([{keys:[["ArrowUp"]],callback:o=>{const s=this.htEditor;let a,l;return!s.getSelectedLast()&&s.flipped?a=s.countRows()-1:s.getSelectedLast()&&(s.flipped?(l=s.getSelectedLast()[0],a=Math.max(0,l-1)):(l=s.getSelectedLast()[0],a=l-1)),i(a,o)},preventDefault:!1},{keys:[["ArrowDown"]],callback:o=>{const s=this.htEditor;let a,l;if(!s.getSelectedLast()&&!s.flipped)a=0;else if(s.getSelectedLast()){if(s.flipped)a=s.getSelectedLast()[0]+1;else if(!s.flipped){const u=s.countRows()-1;l=s.getSelectedLast()[0],a=Math.min(u,l+1)}}return i(a,o)},preventDefault:!1}],n)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(PL)}}function QZ(t,e){OL(t,e),e.add(t)}function IL(t,e,r){OL(t,e),e.set(t,r)}function OL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wm(t,e,r){return(e=eJ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eJ(t){var e=tJ(t,"string");return typeof e=="symbol"?e:e+""}function tJ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function L0(t,e){return t.get($0(t,e))}function $0(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const rJ="autocomplete";var F0=new WeakMap,xL=new WeakMap,V0=new WeakSet;class W0 extends k0{constructor(){super(...arguments),QZ(this,V0),Wm(this,"query",null),Wm(this,"strippedChoices",[]),Wm(this,"rawChoices",[]),IL(this,F0,this.hot.guid.slice(0,9)),IL(this,xL,Vg(()=>{this.focus()},100)),Wm(this,"sortByRelevance",function(e,r,n){const i=[],o=[],s=e.length;let a=r.length,l,u,c,h;if(s===0){for(c=0;c<a;c++)o.push(c);return o}for(c=0;c<a;c++){if(u=vH(Lt(r[c])),n)h=u.indexOf(e);else{const d=this.cellProperties.locale;h=u.toLocaleLowerCase(d).indexOf(e.toLocaleLowerCase(d))}h!==-1&&(l=u.length-h-s,i.push({baseIndex:c,index:h,charsLeft:l,value:u}))}for(i.sort((d,f)=>{if(f.index===-1)return-1;if(d.index===-1)return 1;if(d.index<f.index)return-1;if(f.index<d.index)return 1;if(d.index===f.index){if(d.charsLeft<f.charsLeft)return-1;if(d.charsLeft>f.charsLeft)return 1}return 0}),c=0,a=i.length;c<a;c++)o.push(i[c].baseIndex);return o})}static get EDITOR_TYPE(){return rJ}getValue(){const e=this.rawChoices.find(r=>this.stripValueIfNeeded(r)===this.TEXTAREA.value);return we(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),oe(this.htContainer,"autocompleteEditor"),oe(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&Pe(this.TEXTAREA,[YK(),WK(),bH("listbox"),XK()])}prepare(e,r,n,i,o,s){super.prepare(e,r,n,i,o,s),this.hot.getSettings().ariaTags&&Pe(this.TEXTAREA,[ei("false"),ZK(`${L0(F0,this)}-listbox-${e}-${r}`)])}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,r=this.hot.getSettings().ariaTags,n=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=n==null?void 0:n.length,{row:o,col:s}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",a=>this.onBeforeKeyDown(a)),this.htEditor.addHook("afterScroll",L0(xL,this)),this.htEditor.updateSettings({colWidths:e?[ir(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(a,l,u,c,h,d,f)=>{cs(a,l,u,c,h,d,f);const{filteringCaseSensitive:g,allowHtml:w,locale:v}=this.cellProperties,b=this.query;let p=Lt(d),_,O;p&&!w&&(_=g===!0?p.indexOf(b):p.toLocaleLowerCase(v).indexOf(b.toLocaleLowerCase(v)),_!==-1&&(O=p.substr(_,b.length),p=p.replace(O,`<strong>${O}</strong>`))),r&&Pe(l,[BK(),...n?[t3(i)]:[],...n?[r3(n.indexOf(d)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${c}`]]),l.innerHTML=p},afterSelectionEnd:(a,l)=>{if(r){const u=h=>{Pe(h,[mS()]),Pe(this.TEXTAREA,...JK(h.id))},c=this.htEditor.getCell(a,l,!0);c!==null?u(c):this.htEditor.addHookOnce("afterScrollVertically",()=>{const h=this.htEditor.getCell(a,l,!0);u(h)})}}}),r&&(Pe(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...Xo()),Pe(this.htEditor.rootElement,[CH(),QK("polite"),e3("text"),["id",`${L0(F0,this)}-listbox-${o}-${s}`]]),Pe(this.TEXTAREA,...ei("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&Pe(this.TEXTAREA,[ei("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const r=this.cellProperties.source;this.query=e,typeof r=="function"?r.call(this.cellProperties,e,n=>{this.rawChoices=n,this.updateChoicesList(this.stripValuesIfNeeded(n))}):Array.isArray(r)?(this.rawChoices=r,this.updateChoicesList(this.stripValuesIfNeeded(r))):this.updateChoicesList([])}updateChoicesList(e){const r=HH(this.TEXTAREA),n=h3(this.TEXTAREA),i=this.cellProperties.sortByRelevance,o=this.cellProperties.filter;let s=null,a=null,l=e;i&&(s=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(s)?s.length:0;if(o===!1)u&&(a=s[0]);else{const c=[];for(let h=0,d=l.length;h<d&&!(i&&u<=h);h++)u?c.push(l[s[h]]):c.push(l[h]);a=0,l=c}this.strippedChoices=l,l.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData(Og([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),Lg(this.TEXTAREA,r,r===n?void 0:n)}flipDropdownIfNeeded(){const e=this.getEditedCellRect(),r=e.height;let n=e.top;if(this.hot.view.isVerticallyScrollableByWindow()){const a=this.hot.view.getTableOffset().top-this.hot.rootWindow.scrollY;n=Math.max(n+a,0)}const i=this.getHeight(),o=this.hot.view.getWorkspaceHeight()-n-r,s=i>o&&n>o+r;return s?this.flipDropdown(i):this.unflipDropdown(),this.limitDropdownIfNeeded(s?n:o,i),s}limitDropdownIfNeeded(e,r){if(r>e){let n=0,i=0,o=0,s=null;do o=this.htEditor.getRowHeight(i)||this.htEditor.view.getDefaultRowHeight(),n+=o,i+=1;while(n<e);s=n-o,this.htEditor.flipped&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+r-s}px`),this.setDropdownHeight(n-o)}}flipDropdown(e){const r=this.htEditor.rootElement.style;r.position="absolute",r.top=`${-e}px`,this.htEditor.flipped=!0}unflipDropdown(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.htEditor.flipped=void 0}updateDropdownDimensions(){this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),$0(V0,this,AL).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),$0(V0,this,AL).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}highlightBestMatchingChoice(e){typeof e=="number"?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getHeight(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),r=parseInt(e.borderTopWidth,10)+parseInt(e.borderBottomWidth,10),n=Math.min(this.cellProperties.visibleRows,this.strippedChoices.length);return Array.from({length:n},(o,s)=>s).reduce((o,s)=>{const a=this.htEditor.getRowHeight(s)||this.htEditor.view.getDefaultRowHeight();return o+a},0)+r+1}getWidth(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),r=parseInt(e.borderInlineStartWidth,10)+parseInt(e.borderInlineEndWidth,10);return this.htEditor.getColWidth(0)+r}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:r}=this.cellProperties,n=qe(e,o=>Lt(o));return qe(n,o=>r?o:vH(o))}allowKeyEventPropagation(e){const r=this.htEditor.getSelectedRangeLast(),n={row:r?r.from.row:-1};let i=!1;return e===Re.ARROW_DOWN&&n.row>0&&n.row<this.htEditor.countRows()-1&&(i=!0),e===Re.ARROW_UP&&n.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(P3(e.keyCode)||e.keyCode===Re.BACKSPACE||e.keyCode===Re.DELETE||e.keyCode===Re.INSERT){let r=10;if(e.keyCode===Re.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(r+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},r)}}}function AL(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getWidth()+_r(this.hot.rootDocument)})}const nJ="checkbox";class HL extends Xu{static get EDITOR_TYPE(){return nJ}beginEditing(e,r){if(r&&r.type==="mouseup"&&r.target.nodeName==="TD"){const n=this.TD.querySelector('input[type="checkbox"]');_e(n,"htBadValue")||n.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}/*!
546
+ * Pikaday
547
+ *
548
+ * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
549
+ */const ea=()=>window,li=()=>window.document,B0=(t,e)=>window.setTimeout(t,e),go=function(t,e,r,n){t.addEventListener(e,r,!!n)},hs=function(t,e,r,n){t.removeEventListener(e,r,!!n)},iJ=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},Dn=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},j0=function(t,e){Dn(t,e)||(t.className=t.className===""?e:t.className+" "+e)},U0=function(t,e){t.className=iJ((" "+t.className+" ").replace(" "+e+" "," "))},z0=function(t){return/Array/.test(Object.prototype.toString.call(t))},kn=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},oJ=function(t){let e=t.getDay();return e===0||e===6},sJ=function(t){return t%4===0&&t%100!==0||t%400===0},NL=function(t,e){return[31,sJ(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},Bm=function(t){kn(t)&&t.setHours(0,0,0,0)},jm=function(t,e){return t.getTime()===e.getTime()},Um=function(t,e,r){let n,i;for(n in e)i=t[n]!==void 0,i&&typeof e[n]=="object"&&e[n]!==null&&e[n].nodeName===void 0?kn(e[n])?r&&(t[n]=new Date(e[n].getTime())):z0(e[n])?r&&(t[n]=e[n].slice(0)):t[n]=Um({},e[n],r):(r||!i)&&(t[n]=e[n]);return t},DL=function(t,e,r){let n=li().createEvent("HTMLEvents");n.initEvent(e,!0,!1),n=Um(n,r),t.dispatchEvent(n)},kL=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},mo={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},LL=function(t,e,r){for(e+=t.firstDay;e>=7;)e-=7;return r?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},aJ=function(t){let e=[],r="false";if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)e.push("is-outside-current-month"),t.enableSelectionDaysInNextAndPreviousMonths||e.push("is-selection-disabled");else return'<td class="is-empty"></td>';return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),r="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'" aria-selected="'+r+'"><button class="pika-button pika-day" type="button" data-pika-year="'+t.year+'" data-pika-month="'+t.month+'" data-pika-day="'+t.day+'">'+t.day+"</button></td>"},lJ=function(t,e){t.setHours(0,0,0,0);let r=t.getDate(),n=t.getDay(),i=e,o=i-1,s=7,a=function(d){return(d+s-1)%s};t.setDate(r+o-a(n));let l=new Date(t.getFullYear(),0,i),u=24*60*60*1e3,c=(t.getTime()-l.getTime())/u;return 1+Math.round((c-o+a(l.getDay()))/s)},uJ=function(t,e,r,n,i){let o=new Date(n,r,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(o).isoWeek():lJ(o,i))+"</td>"},cJ=function(t,e,r,n){return'<tr class="pika-row'+(r?" pick-whole-week":"")+(n?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},hJ=function(t){return"<tbody>"+t.join("")+"</tbody>"},dJ=function(t){let e,r=[];for(t.showWeekNumber&&r.push("<th></th>"),e=0;e<7;e++)r.push('<th scope="col"><abbr title="'+LL(t,e)+'">'+LL(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?r.reverse():r).join("")+"</tr></thead>"},fJ=function(t,e,r,n,i,o){let s,a,l,u=t._o,c=r===u.minYear,h=r===u.maxYear,d='<div id="'+o+'" class="pika-title" role="heading" aria-live="polite">',f,g,w=!0,v=!0;for(l=[],s=0;s<12;s++)l.push('<option value="'+(r===i?s-e:12+s-e)+'"'+(s===n?' selected="selected"':"")+(c&&s<u.minMonth||h&&s>u.maxMonth?' disabled="disabled"':"")+">"+u.i18n.months[s]+"</option>");for(f='<div class="pika-label">'+u.i18n.months[n]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",z0(u.yearRange)?(s=u.yearRange[0],a=u.yearRange[1]+1):(s=r-u.yearRange,a=1+r+u.yearRange),l=[];s<a&&s<=u.maxYear;s++)s>=u.minYear&&l.push('<option value="'+s+'"'+(s===r?' selected="selected"':"")+">"+s+"</option>");return g='<div class="pika-label">'+r+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",u.showMonthAfterYear?d+=g+f:d+=f+g,c&&(n===0||u.minMonth>=n)&&(w=!1),h&&(n===11||u.maxMonth<=n)&&(v=!1),e===0&&(d+='<button class="pika-prev'+(w?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(v?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},gJ=function(t,e,r){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+r+'">'+dJ(t)+hJ(e)+"</table>"};function Y0(t){let e=this,r=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||ea().event;let o=i.target||i.srcElement;if(o)if(Dn(o,"is-disabled")||(Dn(o,"pika-button")&&!Dn(o,"is-empty")&&!Dn(o.parentNode,"is-disabled")?(e.setDate(new Date(o.getAttribute("data-pika-year"),o.getAttribute("data-pika-month"),o.getAttribute("data-pika-day"))),r.bound&&B0(function(){e.hide(),r.blurFieldOnSelect&&r.field&&r.field.blur()},100)):Dn(o,"pika-prev")?e.prevMonth():Dn(o,"pika-next")&&e.nextMonth()),Dn(o,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||ea().event;let o=i.target||i.srcElement;o&&(Dn(o,"pika-select-month")?e.gotoMonth(o.value):Dn(o,"pika-select-year")&&e.gotoYear(o.value))},e._onKeyChange=function(i){if(i=i||ea().event,e.isVisible())switch(i.keyCode){case 13:case 27:r.field&&r.field.blur();break;case 37:e.adjustDate("subtract",1);break;case 38:e.adjustDate("subtract",7);break;case 39:e.adjustDate("add",1);break;case 40:e.adjustDate("add",7);break;case 8:case 46:e.setDate(null);break}},e._parseFieldValue=function(){if(r.parse)return r.parse(r.field.value,r.format);if(this.hasMoment){let i=this.moment(r.field.value,r.format,r.formatStrict);return i&&i.isValid()?i.toDate():null}else return new Date(Date.parse(r.field.value))},e._onInputChange=function(i){let o;i.firedBy!==e&&(o=e._parseFieldValue(),kn(o)&&e.setDate(o),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=li().activeElement;do if(Dn(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=B0(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||ea().event;let o=i.target||i.srcElement,s=o;if(o){!hasEventListeners&&Dn(o,"pika-select")&&(o.onchange||(o.setAttribute("onchange","return;"),go(o,"change",e._onChange)));do if(Dn(s,"pika-single")||s===r.trigger)return;while(s=s.parentNode);e._v&&o!==r.trigger&&s!==r.trigger&&e.hide()}},e.el=li().createElement("div"),e.el.className="pika-single"+(r.isRTL?" is-rtl":"")+(r.theme?" "+r.theme:""),go(e.el,"mousedown",e._onMouseDown,!0),go(e.el,"touchend",e._onMouseDown,!0),go(e.el,"change",e._onChange),r.keyboardInput&&go(li(),"keydown",e._onKeyChange),r.field&&(r.container?r.container.appendChild(e.el):r.bound?li().body.appendChild(e.el):r.field.parentNode.insertBefore(e.el,r.field.nextSibling),go(r.field,"change",e._onInputChange),r.defaultDate||(r.defaultDate=e._parseFieldValue(),r.setDefaultDate=!0));let n=r.defaultDate;kn(n)?r.setDefaultDate?e.setDate(n,!0):e.gotoDate(n):e.gotoDate(new Date),r.bound?(this.hide(),e.el.className+=" is-bound",go(r.trigger,"click",e._onInputClick),go(r.trigger,"focus",e._onInputFocus),go(r.trigger,"blur",e._onInputBlur)):this.show()}Y0.prototype={config:function(t){this._o||(this._o=Um({},mo,!0));let e=Um(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme=typeof e.theme=="string"&&e.theme?e.theme:null,e.bound=!!(e.bound!==void 0?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn=typeof e.disableDayFn=="function"?e.disableDayFn:null;let r=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=r>4?4:r,kn(e.minDate)||(e.minDate=!1),kn(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate<e.minDate&&(e.maxDate=e.minDate=!1),e.minDate&&this.setMinDate(e.minDate),e.maxDate&&this.setMaxDate(e.maxDate),z0(e.yearRange)){let n=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||n,e.yearRange[1]=parseInt(e.yearRange[1],10)||n}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||mo.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,kn(this._d)?this._o.toString?this._o.toString(this._d,t):this.hasMoment?this.moment(this._d).format(t):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(t,e){this.hasMoment&&this.moment.isMoment(t)&&this.setDate(t.toDate(),e)},useMoment:function(t){this.hasMoment=!0,this.moment=t},getDate:function(){return kn(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value="",DL(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!kn(t))return;let r=this._o.minDate,n=this._o.maxDate;kn(r)&&t<r?t=r:kn(n)&&t>n&&(t=n),this._d=new Date(t.getTime()),Bm(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),DL(this._o.field,"change",{firedBy:this})),!e&&typeof this._o.onSelect=="function"&&this._o.onSelect.call(this,this.getDate())},clear:function(){this.setDate(null)},gotoDate:function(t){let e=!0;if(kn(t)){if(this.calendars){let r=new Date(this.calendars[0].year,this.calendars[0].month,1),n=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=t.getTime();n.setMonth(n.getMonth()+1),n.setDate(n.getDate()-1),e=i<r.getTime()||n.getTime()<i}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],this._o.mainCalendar==="right"&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){let r=this.getDate()||new Date,n=parseInt(e)*24*60*60*1e3,i;t==="add"?i=new Date(r.valueOf()+n):t==="subtract"&&(i=new Date(r.valueOf()-n)),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=kL(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=kL({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){t instanceof Date?(Bm(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=mo.minDate,this._o.minYear=mo.minYear,this._o.minMonth=mo.minMonth,this._o.startRange=mo.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(Bm(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=mo.maxDate,this._o.maxYear=mo.maxYear,this._o.maxMonth=mo.maxMonth,this._o.endRange=mo.endRange),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(!this._v&&!t)return;let e=this._o,r=e.minYear,n=e.maxYear,i=e.minMonth,o=e.maxMonth,s="",a;this._y<=r&&(this._y=r,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=n&&(this._y=n,!isNaN(o)&&this._m>o&&(this._m=o));for(let l=0;l<e.numberOfMonths;l++)a="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),s+='<div class="pika-lendar">'+fJ(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,a)+this.render(this.calendars[l].year,this.calendars[l].month,a)+"</div>";this.el.innerHTML=s,e.bound&&e.field.type!=="hidden"&&B0(function(){e.trigger.focus()},1),typeof this._o.onDraw=="function"&&this._o.onDraw(this),e.bound&&e.field.setAttribute("aria-label",e.ariaLabel)},adjustPosition:function(){let t,e,r,n,i,o,s,a,l,u,c;this._o.container||(this.el.style.position="absolute",t=this._o.trigger,e=this.el.offsetWidth,r=this.el.offsetHeight,n=ea().innerWidth||li().documentElement.clientWidth,i=ea().innerHeight||li().documentElement.clientHeight,o=li().body.scrollTop||li().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),s=l.left+ea().pageXOffset,a=l.bottom+ea().pageYOffset,(this._o.reposition&&s+e>n||this._o.position.indexOf("right")>-1&&s-e+t.offsetWidth>0)&&(s=s-e+t.offsetWidth,u=!1),(this._o.reposition&&a+r>i+o||this._o.position.indexOf("top")>-1&&a-r-t.offsetHeight>0)&&(a=a-r-t.offsetHeight,c=!1),s<0&&(s=0),a<0&&(a=0),this.el.style.left=s+"px",this.el.style.top=a+"px",j0(this.el,u?"left-aligned":"right-aligned"),j0(this.el,c?"bottom-aligned":"top-aligned"),U0(this.el,u?"right-aligned":"left-aligned"),U0(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,r){let n=this._o,i=new Date,o=NL(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];Bm(i),n.firstDay>0&&(s-=n.firstDay,s<0&&(s+=7));let u=e===0?11:e-1,c=e===11?0:e+1,h=e===0?t-1:t,d=e===11?t+1:t,f=NL(h,u),g=o+s,w=g;for(;w>7;)w-=7;g+=7-w;let v=!1;for(let b=0,p=0;b<g;b++){let _=new Date(t,e,1+(b-s)),O=kn(this._d)?jm(_,this._d):!1,T=jm(_,i),M=n.events.indexOf(_.toDateString())!==-1,P=b<s||b>=o+s,G=1+(b-s),j=e,A=t,q=n.startRange&&jm(n.startRange,_),Q=n.endRange&&jm(n.endRange,_),ue=n.startRange&&n.endRange&&n.startRange<_&&_<n.endRange,J=n.minDate&&_<n.minDate||n.maxDate&&_>n.maxDate||n.disableWeekends&&oJ(_)||n.disableDayFn&&n.disableDayFn(_);P&&(b<s?(G=f+G,j=u,A=h):(G=G-o,j=c,A=d));let Z={day:G,month:j,year:A,hasEvent:M,isSelected:O,isToday:T,isDisabled:J,isEmpty:P,isStartRange:q,isEndRange:Q,isInRange:ue,showDaysInNextAndPreviousMonths:n.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:n.enableSelectionDaysInNextAndPreviousMonths};n.pickWholeWeek&&O&&(v=!0),l.push(aJ(Z)),++p===7&&(n.showWeekNumber&&l.unshift(uJ(this,b-s,e,t,n.firstWeekOfYearMinDays)),a.push(cJ(l,n.isRTL,n.pickWholeWeek,v)),l=[],p=0,v=!1)}return gJ(n,a,r)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),U0(this.el,"is-hidden"),this._o.bound&&(go(li(),"click",this._onClick),this.adjustPosition()),typeof this._o.onOpen=="function"&&this._o.onOpen.call(this))},hide:function(){let t=this._v;t!==!1&&(this._o.bound&&hs(li(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),j0(this.el,"is-hidden"),this._v=!1,t!==void 0&&typeof this._o.onClose=="function"&&this._o.onClose.call(this))},destroy:function(){let t=this._o;this.hide(),hs(this.el,"mousedown",this._onMouseDown,!0),hs(this.el,"touchend",this._onMouseDown,!0),hs(this.el,"change",this._onChange),t.keyboardInput&&hs(li(),"keydown",this._onKeyChange),t.field&&(hs(t.field,"change",this._onInputChange),t.bound&&(hs(t.trigger,"click",this._onInputClick),hs(t.trigger,"focus",this._onInputFocus),hs(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function mJ(t,e){pJ(t,e),e.add(t)}function pJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $L(t,e,r){return(e=wJ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wJ(t){var e=vJ(t,"string");return typeof e=="symbol"?e:e+""}function vJ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function G0(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const FL="date",VL="dateEditor",yJ="DD/MM/YYYY";var zm=new WeakSet;class WL extends ml{constructor(){super(...arguments),mJ(this,zm),$L(this,"parentDestroyed",!1),$L(this,"$datePicker",null)}static get EDITOR_TYPE(){return FL}init(){if(typeof se!="function")throw new Error("You need to include moment.js to your project.");if(typeof Y0!="function")throw new Error("You need to include Pikaday to your project.");super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()}),this.hot.addHook("afterSetTheme",(e,r)=>{r||(Ee(this.datePicker,/ht-theme-.*/g),oe(this.datePicker,e))})}createElements(){super.createElements(),this.datePicker=this.hot.rootDocument.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,this.datePicker.setAttribute("dir",this.hot.isRtl()?"rtl":"ltr"),oe(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();Ee(this.datePicker,/ht-theme-.*/g),oe(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",r=>{_e(r.target,"pika-day")&&this.hideDatepicker(),r.stopPropagation()})}destroyElements(){const e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,r,n,i,o,s){super.prepare(e,r,n,i,o,s)}open(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const n=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),n.addShortcuts([{keys:[["ArrowLeft"]],callback:()=>{this.$datePicker.adjustDate("subtract",1)}},{keys:[["ArrowRight"]],callback:()=>{this.$datePicker.adjustDate("add",1)}},{keys:[["ArrowUp"]],callback:()=>{this.$datePicker.adjustDate("subtract",7)}},{keys:[["ArrowDown"]],callback:()=>{this.$datePicker.adjustDate("add",7)}}],{group:VL})}close(){var e;this._opened=!1,(e=this.$datePicker)!==null&&e!==void 0&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{const i=this.hot._getEditorManager();i.closeEditor(),this.hot.view.render(),i.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(VL),super.close()}finishEditing(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.finishEditing(e,r)}showDatepicker(e){const r=G0(zm,this,q0).call(this),n=this.hot.view.isMouseDown(),i=e?ZH(e.keyCode):!1;let o;this.datePicker.style.display="block",this.$datePicker=new Y0(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(se),this.$datePicker._onInputFocus=function(){},this.originalValue?(o=this.originalValue,se(o,r,!0).isValid()&&this.$datePicker.setMoment(se(o,r),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!n&&this.setValue("")):this.cellProperties.defaultDate?(o=this.cellProperties.defaultDate,se(o,r,!0).isValid()&&this.$datePicker.setMoment(se(o,r),!0),!i&&!n&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){var e;const r=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&Wg(n,this.cellProperties.datePickerConfig);const i=n.onSelect,o=n.onClose;return n.field=r,n.trigger=r,n.container=this.datePicker,n.bound=!1,n.keyboardInput=!1,n.format=(e=n.format)!==null&&e!==void 0?e:G0(zm,this,q0).call(this),n.reposition=n.reposition||!1,n.isRTL=!1,n.onSelect=s=>{let a=s;isNaN(a.getTime())||(a=se(a).format(G0(zm,this,q0).call(this))),this.setValue(a),i&&i(),es()&&this.hideDatepicker()},n.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),o&&o()},n}refreshDimensions(e){var r;if(super.refreshDimensions(e),this.state!==Kt.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}const{rowIndexMapper:n,columnIndexMapper:i}=this.hot,{wtOverlays:o}=this.hot.view._wt,{wtTable:s}=(r=o.getParentOverlay(this.TD))!==null&&r!==void 0?r:this.hot.view._wt,a=n.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleRow()),l=n.getVisualFromRenderableIndex(s.getLastPartiallyVisibleRow()),u=i.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleColumn()),c=i.getVisualFromRenderableIndex(s.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=u&&this.col<=c){const h=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+h.top+dr(this.TD)}px`;let d=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?d+=h.right-ir(this.datePicker):d+=h.left,this.datePickerStyle.left=`${d}px`}else this.hideDatepicker()}}function q0(){var t;return(t=this.cellProperties.dateFormat)!==null&&t!==void 0?t:yJ}const CJ="dropdown";class BL extends W0{static get EDITOR_TYPE(){return CJ}prepare(e,r,n,i,o,s){s.filter=!1,s.strict=!0,super.prepare(e,r,n,i,o,s)}}const bJ="numeric";class jL extends ml{static get EDITOR_TYPE(){return bJ}}function SJ(t,e,r){return(e=RJ(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function RJ(t){var e=EJ(t,"string");return typeof e=="symbol"?e:e+""}function EJ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const TJ="password";class UL extends ml{constructor(){super(...arguments),SJ(this,"autoResize",Zk(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return TJ}createElements(){super.createElements(),this.TEXTAREA=this.hot.rootDocument.createElement("input"),this.TEXTAREA.setAttribute("type","password"),this.TEXTAREA.setAttribute("data-hot-input",""),this.TEXTAREA.className="handsontableInput",this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,Zo(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const K0="ht_editor_visible",zL="selectEditor",_J="select";class YL extends Xu{static get EDITOR_TYPE(){return _J}init(){this.selectWrapper=this.hot.rootDocument.createElement("div"),this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.selectWrapper.style.display="none";const e=this.hot.rootDocument.createElement("DIV"),r=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",r&&e.setAttribute(...Ga()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),oe(this.selectWrapper,"htSelectEditor"),this.selectWrapper.appendChild(this.select),this.selectWrapper.insertBefore(e,this.selectWrapper.firstChild),this.hot.rootElement.appendChild(this.selectWrapper),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.selectWrapper.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.selectWrapper.style.display="none",_e(this.selectWrapper,K0)&&Ee(this.selectWrapper,K0),this.unregisterShortcuts(),this.clearHooks()}focus(){this.select.focus()}registerHooks(){this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>this.refreshDimensions()),this.addHook("afterRowResize",()=>this.refreshDimensions())}prepare(e,r,n,i,o,s){super.prepare(e,r,n,i,o,s);const a=this.cellProperties.selectOptions;let l;typeof a=="function"?l=this.prepareOptions(a(this.row,this.col,this.prop)):l=this.prepareOptions(a),Zo(this.select),Fe(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,Iu(h,u),this.select.appendChild(h)})}prepareOptions(e){let r={};if(Array.isArray(e))for(let n=0,i=e.length;n<i;n++)r[e[n]]=e[n];else typeof e=="object"&&(r=e);return r}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==Kt.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:r,width:n,height:i}=this.getEditedCellRect(),o=this.selectWrapper.style;o.height=`${i}px`,o.width=`${n}px`,o.top=`${e}px`,o[this.hot.isRtl()?"right":"left"]=`${r}px`,o.margin="0px",oe(this.selectWrapper,K0)}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("editor"),n={group:zL};this.isInFullEditMode()&&r.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{const i=this.select.selectedIndex-1;i>=0&&(this.select[i].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const i=this.select.selectedIndex+1;i<=this.select.length-1&&(this.select[i].selected=!0)}}],n)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(zL)}}const MJ="time";class GL extends ml{static get EDITOR_TYPE(){return MJ}prepare(e,r,n,i,o,s){super.prepare(e,r,n,i,o,s),this.TEXTAREA.dir="ltr"}}function PJ(){Hn(Xu),Hn(W0),Hn(HL),Hn(WL),Hn(BL),Hn(k0),Hn(jL),Hn(UL),Hn(YL),Hn(ml),Hn(GL)}const IJ="html";function X0(t,e,r,n,i,o,s){hd.apply(this,[t,e,r,n,i,o,s]),Iu(e,o??"",!1)}X0.RENDERER_TYPE=IJ;const OJ="autocomplete";function Ju(t,e,r,n,i,o,s){const{rootDocument:a}=t,l=s.allowHtml?X0:cs,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...Ga()),u.appendChild(a.createTextNode("▼")),l.apply(this,[t,e,r,n,i,o,s]),e.firstChild||e.appendChild(a.createTextNode(" ")),e.insertBefore(u,e.firstChild),oe(e,"htAutocomplete"),!t.acArrowListener){const h=new Pi(t);t.acArrowListener=function(d){_e(d.target,"htAutocompleteArrow")&&t.view._wt.getSetting("onCellDblClick",null,t._createCellCoords(r,n),e)},h.addEventListener(t.rootElement,"mousedown",t.acArrowListener),t.addHookOnce("afterDestroy",()=>{h.destroy()})}}Ju.RENDERER_TYPE=OJ;const xJ="dropdown";function Z0(t,e,r,n,i,o,s){Ju.apply(this,[t,e,r,n,i,o,s])}Z0.RENDERER_TYPE=xJ;const qL=new WeakMap,KL=new WeakMap,AJ="htBadValue",Qu="data-row",ec="data-col",HJ="checkboxRenderer",XL="checkbox";de.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,r){const{label:n,type:i,row:o,column:s,prop:a}=e;if(i===XL){if(n){const{value:l,property:u}=n;let c=r;if(l)c=typeof l=="function"?l(o,s,a,r):l;else if(u){const h=this.getDataAtRowProp(o,u);c=h!==null?h:r}t=c}return t}});function J0(t,e,r,n,i,o,s){const{rootDocument:a}=t,l=t.getSettings().ariaTags;hd.apply(this,[t,e,r,n,i,o,s]),NJ(t);let u=DJ(a);const c=s.label;let h=!1;if(typeof s.checkedTemplate>"u"&&(s.checkedTemplate=!0),typeof s.uncheckedTemplate>"u"&&(s.uncheckedTemplate=!1),Zo(e),o===s.checkedTemplate||Lt(o).toLocaleLowerCase(s.locale)===Lt(s.checkedTemplate).toLocaleLowerCase(s.locale)?u.checked=!0:o===s.uncheckedTemplate||Lt(o).toLocaleLowerCase(s.locale)===Lt(s.uncheckedTemplate).toLocaleLowerCase(s.locale)?u.checked=!1:qt(o)?oe(u,"noValue"):(u.style.display="none",oe(u,AJ),h=!0),Pe(u,[[Qu,r],[ec,n]]),l&&Pe(u,[Ph(u.checked?t.getTranslatedPhrase(i0):t.getTranslatedPhrase(o0)),_H(u.checked),jK()]),!h&&c){let w="";if(c.value)w=typeof c.value=="function"?c.value.call(this,r,n,i,o):c.value;else if(c.property){const b=t.getDataAtRowProp(r,c.property);w=b!==null?b:""}const v=kJ(a,w,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(v),e.appendChild(u)):(v.appendChild(u),u=v):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(v)):(v.insertBefore(u,v.firstChild),u=v))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),qL.has(t)||(qL.set(t,!0),d());function d(){const v=t.getShortcutManager().getContext("grid"),b={group:HJ,relativeToGroup:Qs,position:"before"};v.addShortcuts([{keys:[["space"]],callback:()=>(f(),!g()),runOnlyIf:()=>{var p;return(p=t.getSelectedRangeLast())===null||p===void 0?void 0:p.highlight.isCell()}},{keys:[["enter"]],callback:()=>(f(),!g()),runOnlyIf:()=>{const p=t.getSelectedRangeLast();return t.getSettings().enterBeginsEditing&&(p==null?void 0:p.highlight.isCell())&&!t.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!g()),runOnlyIf:()=>{var p;return(p=t.getSelectedRangeLast())===null||p===void 0?void 0:p.highlight.isCell()}}],b)}function f(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const v=t.getSelectedRange(),b=[],p=new Map;let _=[],O=0;if(v){for(let T=0;T<v.length;T++){const{row:M,col:P}=v[T].getTopStartCorner(),{row:G,col:j}=v[T].getBottomEndCorner();for(let A=M;A<=G;A+=1)for(let q=P;q<=j;q+=1){const Q=t.getCellMeta(A,q);if(Q.hidden)continue;const ue={checkedTemplate:Q.checkedTemplate,uncheckedTemplate:Q.uncheckedTemplate};if(Q.type!=="checkbox"){w===!0&&!Q.readOnly&&(p.has(b.length)?p.set(b.length,[...p.get(b.length),[A,q,null]]):p.set(b.length,[[A,q,null]]));continue}if(Q.readOnly===!0)continue;typeof Q.checkedTemplate>"u"&&(Q.checkedTemplate=!0),typeof Q.uncheckedTemplate>"u"&&(Q.uncheckedTemplate=!1);const J=t.getDataAtCell(A,q);w===!1?[Q.checkedTemplate,Q.checkedTemplate.toString()].includes(J)?_.push([A,q,Q.uncheckedTemplate,ue]):[Q.uncheckedTemplate,Q.uncheckedTemplate.toString(),null,void 0].includes(J)&&_.push([A,q,Q.checkedTemplate,ue]):_.push([A,q,Q.uncheckedTemplate,ue]),O+=1}b.push(O),O=0}_.every(T=>{let[,,M]=T;return M===_[0][2]})?_=_.map(T=>{let[M,P,G]=T;return[M,P,G]}):_=_.map(T=>{let[M,P,,G]=T;return[M,P,G.checkedTemplate]}),_.length>0&&b.forEach((T,M)=>{let P=_.splice(0,T);p.size&&p.has(M)&&(P=[...P,...p.get(M)]),t.setDataAtCell(P)})}}function g(){const w=t.getSelectedRange();if(w){for(let v=0;v<w.length;v++){const b=w[v].getTopStartCorner(),p=w[v].getBottomEndCorner();for(let _=b.row;_<=p.row;_++)for(let O=b.col;O<=p.col;O++){if(t.getCellMeta(_,O).readOnly)continue;const M=t.getCell(_,O);if(Jo(M)&&M.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}J0.RENDERER_TYPE=XL;function NJ(t){let e=KL.get(t);if(!e){const{rootElement:r}=t;e=new Pi(t),e.addEventListener(r,"click",n=>$J(n,t)),e.addEventListener(r,"mouseup",n=>LJ(n,t)),e.addEventListener(r,"change",n=>FJ(n,t)),KL.set(t,e)}return e}function DJ(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function kJ(t,e,r){const n=t.createElement("label");n.className=`htCheckboxRendererLabel ${r?"fullWidth":""}`;const i=t.createTextNode(e);if(r){const o=t.createElement("span");o.appendChild(i),n.appendChild(o)}else n.appendChild(i);return n.cloneNode(!0)}function LJ(t,e){const{target:r}=t;Q0(r)&&(!r.hasAttribute(Qu)||!r.hasAttribute(ec)||setTimeout(e.listen,10))}function $J(t,e){const{target:r}=t;if(!Q0(r)||!r.hasAttribute(Qu)||!r.hasAttribute(ec))return;const n=parseInt(r.getAttribute(Qu),10),i=parseInt(r.getAttribute(ec),10);e.getCellMeta(n,i).readOnly&&t.preventDefault()}function FJ(t,e){const{target:r}=t;if(!Q0(r)||!r.hasAttribute(Qu)||!r.hasAttribute(ec))return;const n=parseInt(r.getAttribute(Qu),10),i=parseInt(r.getAttribute(ec),10),o=e.getCellMeta(n,i);if(!o.readOnly){let s=null;t.target.checked?s=o.uncheckedTemplate===void 0?!0:o.checkedTemplate:s=o.uncheckedTemplate===void 0?!1:o.uncheckedTemplate,e.setDataAtCell(n,i,s)}}function Q0(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const VJ="handsontable";function eT(t,e,r,n,i,o,s){Ju.apply(this,[t,e,r,n,i,o,s])}eT.RENDERER_TYPE=VJ;var WJ=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function BJ(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}/*!
550
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
551
+ *
552
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
553
+ * of this software and associated documentation files (the "Software"), to deal
554
+ * in the Software without restriction, including without limitation the rights
555
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
556
+ * copies of the Software, and to permit persons to whom the Software is
557
+ * furnished to do so, subject to the following conditions:
558
+ *
559
+ * The above copyright notice and this permission notice shall be included in
560
+ * all copies or substantial portions of the Software.
561
+ *
562
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
563
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
564
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
565
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
566
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
567
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
568
+ * SOFTWARE.
569
+ */var tT,ZL;function jJ(){return ZL||(ZL=1,tT={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(t){let e=t%10;return~~(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),tT}/*!
570
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
571
+ *
572
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
573
+ * of this software and associated documentation files (the "Software"), to deal
574
+ * in the Software without restriction, including without limitation the rights
575
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
576
+ * copies of the Software, and to permit persons to whom the Software is
577
+ * furnished to do so, subject to the following conditions:
578
+ *
579
+ * The above copyright notice and this permission notice shall be included in
580
+ * all copies or substantial portions of the Software.
581
+ *
582
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
583
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
584
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
585
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
586
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
587
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
588
+ * SOFTWARE.
589
+ */var rT,JL;function QL(){if(JL)return rT;JL=1;const t=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function e(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function r(l,u,c,h,d,f,g){if(!isNaN(+l))return+l;let w="",v=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(v!==l)return-1*r(v,u,c,h,d,f);for(let M=0;M<t.length;M++){let P=t[M];if(w=l.replace(RegExp(`([0-9 ])(${P.key})$`),"$1"),w!==l)return r(w,u,c,h,d,f)*P.factor}if(w=l.replace("%",""),w!==l)return r(w,u,c,h,d,f)/100;let b=parseFloat(l);if(isNaN(b))return;let p=h(b);if(p&&p!=="."&&(w=l.replace(new RegExp(`${e(p)}$`),""),w!==l))return r(w,u,c,h,d,f);let _={};Object.keys(f).forEach(M=>{_[f[M]]=M});let O=Object.keys(_).sort().reverse(),T=O.length;for(let M=0;M<T;M++){let P=O[M],G=_[P];if(w=l.replace(P,""),w!==l){let j;switch(G){case"thousand":j=Math.pow(10,3);break;case"million":j=Math.pow(10,6);break;case"billion":j=Math.pow(10,9);break;case"trillion":j=Math.pow(10,12);break}return r(w,u,c,h,d,f)*j}}}function n(l,u,c){let h=l.replace(c,"");return h=h.replace(new RegExp(`([0-9])${e(u.thousands)}([0-9])`,"g"),"$1$2"),h=h.replace(u.decimal,"."),h}function i(l,u,c="",h,d,f,g){if(l==="")return;if(l===d)return 0;let w=n(l,u,c);return r(w,u,c,h,d,f)}function o(l,u){if(!(l.indexOf(":")&&u.thousands!==":"))return!1;let h=l.split(":");if(h.length!==3)return!1;let d=+h[0],f=+h[1],g=+h[2];return!isNaN(d)&&!isNaN(f)&&!isNaN(g)}function s(l){let u=l.split(":"),c=+u[0],h=+u[1];return+u[2]+60*h+3600*c}function a(l,u){const c=aT();let h=c.currentDelimiters(),d=c.currentCurrency().symbol,f=c.currentOrdinal(),g=c.getZeroFormat(),w=c.currentAbbreviations(),v;if(typeof l=="string")o(l,h)?v=s(l):v=i(l,h,d,f,g,w);else if(typeof l=="number")v=l;else return;if(v!==void 0)return v}return rT={unformat:a},rT}/*!
590
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
591
+ *
592
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
593
+ * of this software and associated documentation files (the "Software"), to deal
594
+ * in the Software without restriction, including without limitation the rights
595
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
596
+ * copies of the Software, and to permit persons to whom the Software is
597
+ * furnished to do so, subject to the following conditions:
598
+ *
599
+ * The above copyright notice and this permission notice shall be included in
600
+ * all copies or substantial portions of the Software.
601
+ *
602
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
603
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
604
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
605
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
606
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
607
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
608
+ * SOFTWARE.
609
+ */var nT,e$;function iT(){if(e$)return nT;e$=1;let t=QL();const e=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,r=["currency","percent","byte","time","ordinal","number"],n=["trillion","billion","million","thousand"],i=["prefix","infix","postfix"],o=["sign","parenthesis"],s={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},u={output:{type:"string",validValues:r},base:{type:"string",validValues:["decimal","binary","general"],restriction:(v,b)=>b.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:v=>v.output==="byte"},characteristic:{type:"number",restriction:v=>v>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:n},average:"boolean",lowPrecision:{type:"boolean",restriction:(v,b)=>b.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:i},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:v=>v>=0,message:"value must be positive"},{restriction:(v,b)=>!b.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:v=>v>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:o},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(v,b)=>b.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:v=>v.match(e),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:s,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function h(v,b){let p=d(v),_=g(b);return p&&_}function d(v){return t.unformat(v)!==void 0}function f(v,b,p,_=!1){let O=Object.keys(v).map(T=>{if(!b[T])return console.error(`${p} Invalid key: ${T}`),!1;let M=v[T],P=b[T];if(typeof P=="string"&&(P={type:P}),P.type==="format"){if(!f(M,u,`[Validate ${T}]`,!0))return!1}else if(typeof M!==P.type)return console.error(`${p} ${T} type mismatched: "${P.type}" expected, "${typeof M}" provided`),!1;if(P.restrictions&&P.restrictions.length){let G=P.restrictions.length;for(let j=0;j<G;j++){let{restriction:A,message:q}=P.restrictions[j];if(!A(M,v))return console.error(`${p} ${T} invalid value: ${q}`),!1}}return P.restriction&&!P.restriction(M,v)?(console.error(`${p} ${T} invalid value: ${P.message}`),!1):P.validValues&&P.validValues.indexOf(M)===-1?(console.error(`${p} ${T} invalid value: must be among ${JSON.stringify(P.validValues)}, "${M}" provided`),!1):!(P.children&&!f(M,P.children,`[Validate ${T}]`))});return _||O.push(...Object.keys(b).map(T=>{let M=b[T];if(typeof M=="string"&&(M={type:M}),M.mandatory){let P=M.mandatory;if(typeof P=="function"&&(P=P(v)),P&&v[T]===void 0)return console.error(`${p} Missing mandatory key "${T}"`),!1}return!0})),O.reduce((T,M)=>T&&M,!0)}function g(v){return f(v,u,"[Validate format]")}function w(v){return f(v,c,"[Validate language]")}return nT={validate:h,validateFormat:g,validateInput:d,validateLanguage:w},nT}/*!
610
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
611
+ *
612
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
613
+ * of this software and associated documentation files (the "Software"), to deal
614
+ * in the Software without restriction, including without limitation the rights
615
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
616
+ * copies of the Software, and to permit persons to whom the Software is
617
+ * furnished to do so, subject to the following conditions:
618
+ *
619
+ * The above copyright notice and this permission notice shall be included in
620
+ * all copies or substantial portions of the Software.
621
+ *
622
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
623
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
624
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
625
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
626
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
627
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
628
+ * SOFTWARE.
629
+ */function UJ(t,e){let r=t.match(/^{([^}]*)}/);return r?(e.prefix=r[1],t.slice(r[0].length)):t}function zJ(t,e){let r=t.match(/{([^}]*)}$/);return r?(e.postfix=r[1],t.slice(0,-r[0].length)):t}function YJ(t,e){if(t.indexOf("$")!==-1){e.output="currency";return}if(t.indexOf("%")!==-1){e.output="percent";return}if(t.indexOf("bd")!==-1){e.output="byte",e.base="general";return}if(t.indexOf("b")!==-1){e.output="byte",e.base="binary";return}if(t.indexOf("d")!==-1){e.output="byte",e.base="decimal";return}if(t.indexOf(":")!==-1){e.output="time";return}t.indexOf("o")!==-1&&(e.output="ordinal")}function GJ(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function qJ(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function KJ(t,e){let r=t.match(/[1-9]+[0-9]*/);r&&(e.totalLength=+r[0])}function XJ(t,e){let n=t.split(".")[0].match(/0+/);n&&(e.characteristic=n[0].length)}function ZJ(t,e){let r=t.split(".")[1];if(r){let n=r.match(/0+/);n&&(e.mantissa=n[0].length)}}function JJ(t,e){const r=t.split(".")[1];r&&(e.trimMantissa=r.indexOf("[")!==-1)}function QJ(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function eQ(t,e){t.indexOf("K")!==-1?e.forceAverage="thousand":t.indexOf("M")!==-1?e.forceAverage="million":t.indexOf("B")!==-1?e.forceAverage="billion":t.indexOf("T")!==-1&&(e.forceAverage="trillion")}function tQ(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function rQ(t,e){if(t.indexOf(".")!==-1){let r=t.split(".")[0];e.optionalCharacteristic=r.indexOf("0")===-1}}function nQ(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function iQ(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function oQ(t,e={}){return typeof t!="string"?t:(t=UJ(t,e),t=zJ(t,e),YJ(t,e),KJ(t,e),XJ(t,e),rQ(t,e),QJ(t,e),eQ(t,e),ZJ(t,e),tQ(t,e),JJ(t,e),GJ(t,e),qJ(t,e),nQ(t,e),iQ(t,e),e)}var oT={parseFormat:oQ};/*!
630
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
631
+ *
632
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
633
+ * of this software and associated documentation files (the "Software"), to deal
634
+ * in the Software without restriction, including without limitation the rights
635
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
636
+ * copies of the Software, and to permit persons to whom the Software is
637
+ * furnished to do so, subject to the following conditions:
638
+ *
639
+ * The above copyright notice and this permission notice shall be included in
640
+ * all copies or substantial portions of the Software.
641
+ *
642
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
643
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
644
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
645
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
646
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
647
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
648
+ * SOFTWARE.
649
+ */var sT,t$;function aT(){if(t$)return sT;t$=1;const t=jJ(),e=iT(),r=oT;let n={},i,o={},s=null,a={};function l(c){i=c}function u(){return o[i]}return n.languages=()=>Object.assign({},o),n.currentLanguage=()=>i,n.currentBytes=()=>u().bytes||{},n.currentCurrency=()=>u().currency,n.currentAbbreviations=()=>u().abbreviations,n.currentDelimiters=()=>u().delimiters,n.currentOrdinal=()=>u().ordinal,n.currentDefaults=()=>Object.assign({},u().defaults,a),n.currentOrdinalDefaultFormat=()=>Object.assign({},n.currentDefaults(),u().ordinalFormat),n.currentByteDefaultFormat=()=>Object.assign({},n.currentDefaults(),u().byteFormat),n.currentPercentageDefaultFormat=()=>Object.assign({},n.currentDefaults(),u().percentageFormat),n.currentCurrencyDefaultFormat=()=>Object.assign({},n.currentDefaults(),u().currencyFormat),n.currentTimeDefaultFormat=()=>Object.assign({},n.currentDefaults(),u().timeFormat),n.setDefaults=c=>{c=r.parseFormat(c),e.validateFormat(c)&&(a=c)},n.getZeroFormat=()=>s,n.setZeroFormat=c=>s=typeof c=="string"?c:null,n.hasZeroFormat=()=>s!==null,n.languageData=c=>{if(c){if(o[c])return o[c];throw new Error(`Unknown tag "${c}"`)}return u()},n.registerLanguage=(c,h=!1)=>{if(!e.validateLanguage(c))throw new Error("Invalid language data");o[c.languageTag]=c,h&&l(c.languageTag)},n.setLanguage=(c,h=t.languageTag)=>{if(!o[c]){let d=c.split("-")[0],f=Object.keys(o).find(g=>g.split("-")[0]===d);if(!o[f]){l(h);return}l(f);return}l(c)},n.registerLanguage(t),i=t.languageTag,sT=n,sT}function sQ(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}/*!
650
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
651
+ *
652
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
653
+ * of this software and associated documentation files (the "Software"), to deal
654
+ * in the Software without restriction, including without limitation the rights
655
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
656
+ * copies of the Software, and to permit persons to whom the Software is
657
+ * furnished to do so, subject to the following conditions:
658
+ *
659
+ * The above copyright notice and this permission notice shall be included in
660
+ * all copies or substantial portions of the Software.
661
+ *
662
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
663
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
664
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
665
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
666
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
667
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
668
+ * SOFTWARE.
669
+ */function aQ(t,e){t.forEach(r=>{let n;try{n=sQ(`../languages/${r}`)}catch{console.error(`Unable to load "${r}". No matching language file found.`)}n&&e.registerLanguage(n)})}var lQ=t=>({loadLanguagesInNode:e=>aQ(e,t)}),r$={exports:{}};(function(t){(function(e){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,f=1e9;function g(M){var P,G,j,A=y.prototype={constructor:y,toString:null,valueOf:null},q=new y(1),Q=20,ue=4,J=-7,Z=21,ie=-1e7,ee=1e7,te=!1,ae=1,z=0,$={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},m="0123456789abcdefghijklmnopqrstuvwxyz",C=!0;function y(R,E){var S,D,H,F,X,L,W,K,U=this;if(!(U instanceof y))return new y(R,E);if(E==null){if(R&&R._isBigNumber===!0){U.s=R.s,!R.c||R.e>ee?U.c=U.e=null:R.e<ie?U.c=[U.e=0]:(U.e=R.e,U.c=R.c.slice());return}if((L=typeof R=="number")&&R*0==0){if(U.s=1/R<0?(R=-R,-1):1,R===~~R){for(F=0,X=R;X>=10;X/=10,F++);F>ee?U.c=U.e=null:(U.e=F,U.c=[R]);return}K=String(R)}else{if(!n.test(K=String(R)))return j(U,K,L);U.s=K.charCodeAt(0)==45?(K=K.slice(1),-1):1}(F=K.indexOf("."))>-1&&(K=K.replace(".","")),(X=K.search(/e/i))>0?(F<0&&(F=X),F+=+K.slice(X+1),K=K.substring(0,X)):F<0&&(F=K.length)}else{if(p(E,2,m.length,"Base"),E==10&&C)return U=new y(R),B(U,Q+U.e+1,ue);if(K=String(R),L=typeof R=="number"){if(R*0!=0)return j(U,K,L,E);if(U.s=1/R<0?(K=K.slice(1),-1):1,y.DEBUG&&K.replace(/^0\.0*|\./,"").length>15)throw Error(a+R)}else U.s=K.charCodeAt(0)===45?(K=K.slice(1),-1):1;for(S=m.slice(0,E),F=X=0,W=K.length;X<W;X++)if(S.indexOf(D=K.charAt(X))<0){if(D=="."){if(X>F){F=W;continue}}else if(!H&&(K==K.toUpperCase()&&(K=K.toLowerCase())||K==K.toLowerCase()&&(K=K.toUpperCase()))){H=!0,X=-1,F=0;continue}return j(U,String(R),L,E)}L=!1,K=G(K,E,10,U.s),(F=K.indexOf("."))>-1?K=K.replace(".",""):F=K.length}for(X=0;K.charCodeAt(X)===48;X++);for(W=K.length;K.charCodeAt(--W)===48;);if(K=K.slice(X,++W)){if(W-=X,L&&y.DEBUG&&W>15&&(R>c||R!==o(R)))throw Error(a+U.s*R);if((F=F-X-1)>ee)U.c=U.e=null;else if(F<ie)U.c=[U.e=0];else{if(U.e=F,U.c=[],X=(F+1)%u,F<0&&(X+=u),X<W){for(X&&U.c.push(+K.slice(0,X)),W-=u;X<W;)U.c.push(+K.slice(X,X+=u));X=u-(K=K.slice(X)).length}else X-=W;for(;X--;K+="0");U.c.push(+K)}}else U.c=[U.e=0]}y.clone=g,y.ROUND_UP=0,y.ROUND_DOWN=1,y.ROUND_CEIL=2,y.ROUND_FLOOR=3,y.ROUND_HALF_UP=4,y.ROUND_HALF_DOWN=5,y.ROUND_HALF_EVEN=6,y.ROUND_HALF_CEIL=7,y.ROUND_HALF_FLOOR=8,y.EUCLID=9,y.config=y.set=function(R){var E,S;if(R!=null)if(typeof R=="object"){if(R.hasOwnProperty(E="DECIMAL_PLACES")&&(S=R[E],p(S,0,f,E),Q=S),R.hasOwnProperty(E="ROUNDING_MODE")&&(S=R[E],p(S,0,8,E),ue=S),R.hasOwnProperty(E="EXPONENTIAL_AT")&&(S=R[E],S&&S.pop?(p(S[0],-f,0,E),p(S[1],0,f,E),J=S[0],Z=S[1]):(p(S,-f,f,E),J=-(Z=S<0?-S:S))),R.hasOwnProperty(E="RANGE"))if(S=R[E],S&&S.pop)p(S[0],-f,-1,E),p(S[1],1,f,E),ie=S[0],ee=S[1];else if(p(S,-f,f,E),S)ie=-(ee=S<0?-S:S);else throw Error(s+E+" cannot be zero: "+S);if(R.hasOwnProperty(E="CRYPTO"))if(S=R[E],S===!!S)if(S)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))te=S;else throw te=!S,Error(s+"crypto unavailable");else te=S;else throw Error(s+E+" not true or false: "+S);if(R.hasOwnProperty(E="MODULO_MODE")&&(S=R[E],p(S,0,9,E),ae=S),R.hasOwnProperty(E="POW_PRECISION")&&(S=R[E],p(S,0,f,E),z=S),R.hasOwnProperty(E="FORMAT"))if(S=R[E],typeof S=="object")$=S;else throw Error(s+E+" not an object: "+S);if(R.hasOwnProperty(E="ALPHABET"))if(S=R[E],typeof S=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(S))C=S.slice(0,10)=="0123456789",m=S;else throw Error(s+E+" invalid: "+S)}else throw Error(s+"Object expected: "+R);return{DECIMAL_PLACES:Q,ROUNDING_MODE:ue,EXPONENTIAL_AT:[J,Z],RANGE:[ie,ee],CRYPTO:te,MODULO_MODE:ae,POW_PRECISION:z,FORMAT:$,ALPHABET:m}},y.isBigNumber=function(R){if(!R||R._isBigNumber!==!0)return!1;if(!y.DEBUG)return!0;var E,S,D=R.c,H=R.e,F=R.s;e:if({}.toString.call(D)=="[object Array]"){if((F===1||F===-1)&&H>=-f&&H<=f&&H===o(H)){if(D[0]===0){if(H===0&&D.length===1)return!0;break e}if(E=(H+1)%u,E<1&&(E+=u),String(D[0]).length==E){for(E=0;E<D.length;E++)if(S=D[E],S<0||S>=l||S!==o(S))break e;if(S!==0)return!0}}}else if(D===null&&H===null&&(F===null||F===1||F===-1))return!0;throw Error(s+"Invalid BigNumber: "+R)},y.maximum=y.max=function(){return x(arguments,-1)},y.minimum=y.min=function(){return x(arguments,1)},y.random=function(){var R=9007199254740992,E=Math.random()*R&2097151?function(){return o(Math.random()*R)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(S){var D,H,F,X,L,W=0,K=[],U=new y(q);if(S==null?S=Q:p(S,0,f),X=i(S/u),te)if(crypto.getRandomValues){for(D=crypto.getRandomValues(new Uint32Array(X*=2));W<X;)L=D[W]*131072+(D[W+1]>>>11),L>=9e15?(H=crypto.getRandomValues(new Uint32Array(2)),D[W]=H[0],D[W+1]=H[1]):(K.push(L%1e14),W+=2);W=X/2}else if(crypto.randomBytes){for(D=crypto.randomBytes(X*=7);W<X;)L=(D[W]&31)*281474976710656+D[W+1]*1099511627776+D[W+2]*4294967296+D[W+3]*16777216+(D[W+4]<<16)+(D[W+5]<<8)+D[W+6],L>=9e15?crypto.randomBytes(7).copy(D,W):(K.push(L%1e14),W+=7);W=X/7}else throw te=!1,Error(s+"crypto unavailable");if(!te)for(;W<X;)L=E(),L<9e15&&(K[W++]=L%1e14);for(X=K[--W],S%=u,X&&S&&(L=h[u-S],K[W]=o(X/L)*L);K[W]===0;K.pop(),W--);if(W<0)K=[F=0];else{for(F=-1;K[0]===0;K.splice(0,1),F-=u);for(W=1,L=K[0];L>=10;L/=10,W++);W<u&&(F-=u-W)}return U.e=F,U.c=K,U}}(),y.sum=function(){for(var R=1,E=arguments,S=new y(E[0]);R<E.length;)S=S.plus(E[R++]);return S},G=function(){var R="0123456789";function E(S,D,H,F){for(var X,L=[0],W,K=0,U=S.length;K<U;){for(W=L.length;W--;L[W]*=D);for(L[0]+=F.indexOf(S.charAt(K++)),X=0;X<L.length;X++)L[X]>H-1&&(L[X+1]==null&&(L[X+1]=0),L[X+1]+=L[X]/H|0,L[X]%=H)}return L.reverse()}return function(S,D,H,F,X){var L,W,K,U,re,me,ye,xe,Be=S.indexOf("."),Ke=Q,Ie=ue;for(Be>=0&&(U=z,z=0,S=S.replace(".",""),xe=new y(D),me=xe.pow(S.length-Be),z=U,xe.c=E(T(v(me.c),me.e,"0"),10,H,R),xe.e=xe.c.length),ye=E(S,D,H,X?(L=m,R):(L=R,m)),K=U=ye.length;ye[--U]==0;ye.pop());if(!ye[0])return L.charAt(0);if(Be<0?--K:(me.c=ye,me.e=K,me.s=F,me=P(me,xe,Ke,Ie,H),ye=me.c,re=me.r,K=me.e),W=K+Ke+1,Be=ye[W],U=H/2,re=re||W<0||ye[W+1]!=null,re=Ie<4?(Be!=null||re)&&(Ie==0||Ie==(me.s<0?3:2)):Be>U||Be==U&&(Ie==4||re||Ie==6&&ye[W-1]&1||Ie==(me.s<0?8:7)),W<1||!ye[0])S=re?T(L.charAt(1),-Ke,L.charAt(0)):L.charAt(0);else{if(ye.length=W,re)for(--H;++ye[--W]>H;)ye[W]=0,W||(++K,ye=[1].concat(ye));for(U=ye.length;!ye[--U];);for(Be=0,S="";Be<=U;S+=L.charAt(ye[Be++]));S=T(S,K,L.charAt(0))}return S}}(),P=function(){function R(D,H,F){var X,L,W,K,U=0,re=D.length,me=H%d,ye=H/d|0;for(D=D.slice();re--;)W=D[re]%d,K=D[re]/d|0,X=ye*W+K*me,L=me*W+X%d*d+U,U=(L/F|0)+(X/d|0)+ye*K,D[re]=L%F;return U&&(D=[U].concat(D)),D}function E(D,H,F,X){var L,W;if(F!=X)W=F>X?1:-1;else for(L=W=0;L<F;L++)if(D[L]!=H[L]){W=D[L]>H[L]?1:-1;break}return W}function S(D,H,F,X){for(var L=0;F--;)D[F]-=L,L=D[F]<H[F]?1:0,D[F]=L*X+D[F]-H[F];for(;!D[0]&&D.length>1;D.splice(0,1));}return function(D,H,F,X,L){var W,K,U,re,me,ye,xe,Be,Ke,Ie,ze,Ht,qi,As,pi,Nt,vr,_t=D.s==H.s?1:-1,Dt=D.c,Ye=H.c;if(!Dt||!Dt[0]||!Ye||!Ye[0])return new y(!D.s||!H.s||(Dt?Ye&&Dt[0]==Ye[0]:!Ye)?NaN:Dt&&Dt[0]==0||!Ye?_t*0:_t/0);for(Be=new y(_t),Ke=Be.c=[],K=D.e-H.e,_t=F+K+1,L||(L=l,K=w(D.e/u)-w(H.e/u),_t=_t/u|0),U=0;Ye[U]==(Dt[U]||0);U++);if(Ye[U]>(Dt[U]||0)&&K--,_t<0)Ke.push(1),re=!0;else{for(As=Dt.length,Nt=Ye.length,U=0,_t+=2,me=o(L/(Ye[0]+1)),me>1&&(Ye=R(Ye,me,L),Dt=R(Dt,me,L),Nt=Ye.length,As=Dt.length),qi=Nt,Ie=Dt.slice(0,Nt),ze=Ie.length;ze<Nt;Ie[ze++]=0);vr=Ye.slice(),vr=[0].concat(vr),pi=Ye[0],Ye[1]>=L/2&&pi++;do{if(me=0,W=E(Ye,Ie,Nt,ze),W<0){if(Ht=Ie[0],Nt!=ze&&(Ht=Ht*L+(Ie[1]||0)),me=o(Ht/pi),me>1)for(me>=L&&(me=L-1),ye=R(Ye,me,L),xe=ye.length,ze=Ie.length;E(ye,Ie,xe,ze)==1;)me--,S(ye,Nt<xe?vr:Ye,xe,L),xe=ye.length,W=1;else me==0&&(W=me=1),ye=Ye.slice(),xe=ye.length;if(xe<ze&&(ye=[0].concat(ye)),S(Ie,ye,ze,L),ze=Ie.length,W==-1)for(;E(Ye,Ie,Nt,ze)<1;)me++,S(Ie,Nt<ze?vr:Ye,ze,L),ze=Ie.length}else W===0&&(me++,Ie=[0]);Ke[U++]=me,Ie[0]?Ie[ze++]=Dt[qi]||0:(Ie=[Dt[qi]],ze=1)}while((qi++<As||Ie[0]!=null)&&_t--);re=Ie[0]!=null,Ke[0]||Ke.splice(0,1)}if(L==l){for(U=1,_t=Ke[0];_t>=10;_t/=10,U++);B(Be,F+(Be.e=U+K*u-1)+1,X,re)}else Be.e=K,Be.r=+re;return Be}}();function I(R,E,S,D){var H,F,X,L,W;if(S==null?S=ue:p(S,0,8),!R.c)return R.toString();if(H=R.c[0],X=R.e,E==null)W=v(R.c),W=D==1||D==2&&(X<=J||X>=Z)?O(W,X):T(W,X,"0");else if(R=B(new y(R),E,S),F=R.e,W=v(R.c),L=W.length,D==1||D==2&&(E<=F||F<=J)){for(;L<E;W+="0",L++);W=O(W,F)}else if(E-=X,W=T(W,F,"0"),F+1>L){if(--E>0)for(W+=".";E--;W+="0");}else if(E+=F-L,E>0)for(F+1==L&&(W+=".");E--;W+="0");return R.s<0&&H?"-"+W:W}function x(R,E){for(var S,D,H=1,F=new y(R[0]);H<R.length;H++)D=new y(R[H]),(!D.s||(S=b(F,D))===E||S===0&&F.s===E)&&(F=D);return F}function N(R,E,S){for(var D=1,H=E.length;!E[--H];E.pop());for(H=E[0];H>=10;H/=10,D++);return(S=D+S*u-1)>ee?R.c=R.e=null:S<ie?R.c=[R.e=0]:(R.e=S,R.c=E),R}j=function(){var R=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,S=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,H=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,X,L,W){var K,U=L?X:X.replace(H,"");if(D.test(U))F.s=isNaN(U)?null:U<0?-1:1;else{if(!L&&(U=U.replace(R,function(re,me,ye){return K=(ye=ye.toLowerCase())=="x"?16:ye=="b"?2:8,!W||W==K?me:re}),W&&(K=W,U=U.replace(E,"$1").replace(S,"0.$1")),X!=U))return new y(U,K);if(y.DEBUG)throw Error(s+"Not a"+(W?" base "+W:"")+" number: "+X);F.s=null}F.c=F.e=null}}();function B(R,E,S,D){var H,F,X,L,W,K,U,re=R.c,me=h;if(re){e:{for(H=1,L=re[0];L>=10;L/=10,H++);if(F=E-H,F<0)F+=u,X=E,W=re[K=0],U=o(W/me[H-X-1]%10);else if(K=i((F+1)/u),K>=re.length)if(D){for(;re.length<=K;re.push(0));W=U=0,H=1,F%=u,X=F-u+1}else break e;else{for(W=L=re[K],H=1;L>=10;L/=10,H++);F%=u,X=F-u+H,U=X<0?0:o(W/me[H-X-1]%10)}if(D=D||E<0||re[K+1]!=null||(X<0?W:W%me[H-X-1]),D=S<4?(U||D)&&(S==0||S==(R.s<0?3:2)):U>5||U==5&&(S==4||D||S==6&&(F>0?X>0?W/me[H-X]:0:re[K-1])%10&1||S==(R.s<0?8:7)),E<1||!re[0])return re.length=0,D?(E-=R.e+1,re[0]=me[(u-E%u)%u],R.e=-E||0):re[0]=R.e=0,R;if(F==0?(re.length=K,L=1,K--):(re.length=K+1,L=me[u-F],re[K]=X>0?o(W/me[H-X]%me[X])*L:0),D)for(;;)if(K==0){for(F=1,X=re[0];X>=10;X/=10,F++);for(X=re[0]+=L,L=1;X>=10;X/=10,L++);F!=L&&(R.e++,re[0]==l&&(re[0]=1));break}else{if(re[K]+=L,re[K]!=l)break;re[K--]=0,L=1}for(F=re.length;re[--F]===0;re.pop());}R.e>ee?R.c=R.e=null:R.e<ie&&(R.c=[R.e=0])}return R}function Y(R){var E,S=R.e;return S===null?R.toString():(E=v(R.c),E=S<=J||S>=Z?O(E,S):T(E,S,"0"),R.s<0?"-"+E:E)}return A.absoluteValue=A.abs=function(){var R=new y(this);return R.s<0&&(R.s=1),R},A.comparedTo=function(R,E){return b(this,new y(R,E))},A.decimalPlaces=A.dp=function(R,E){var S,D,H,F=this;if(R!=null)return p(R,0,f),E==null?E=ue:p(E,0,8),B(new y(F),R+F.e+1,E);if(!(S=F.c))return null;if(D=((H=S.length-1)-w(this.e/u))*u,H=S[H])for(;H%10==0;H/=10,D--);return D<0&&(D=0),D},A.dividedBy=A.div=function(R,E){return P(this,new y(R,E),Q,ue)},A.dividedToIntegerBy=A.idiv=function(R,E){return P(this,new y(R,E),0,1)},A.exponentiatedBy=A.pow=function(R,E){var S,D,H,F,X,L,W,K,U,re=this;if(R=new y(R),R.c&&!R.isInteger())throw Error(s+"Exponent not an integer: "+Y(R));if(E!=null&&(E=new y(E)),L=R.e>14,!re.c||!re.c[0]||re.c[0]==1&&!re.e&&re.c.length==1||!R.c||!R.c[0])return U=new y(Math.pow(+Y(re),L?R.s*(2-_(R)):+Y(R))),E?U.mod(E):U;if(W=R.s<0,E){if(E.c?!E.c[0]:!E.s)return new y(NaN);D=!W&&re.isInteger()&&E.isInteger(),D&&(re=re.mod(E))}else{if(R.e>9&&(re.e>0||re.e<-1||(re.e==0?re.c[0]>1||L&&re.c[1]>=24e7:re.c[0]<8e13||L&&re.c[0]<=9999975e7)))return F=re.s<0&&_(R)?-0:0,re.e>-1&&(F=1/F),new y(W?1/F:F);z&&(F=i(z/u+2))}for(L?(S=new y(.5),W&&(R.s=1),K=_(R)):(H=Math.abs(+Y(R)),K=H%2),U=new y(q);;){if(K){if(U=U.times(re),!U.c)break;F?U.c.length>F&&(U.c.length=F):D&&(U=U.mod(E))}if(H){if(H=o(H/2),H===0)break;K=H%2}else if(R=R.times(S),B(R,R.e+1,1),R.e>14)K=_(R);else{if(H=+Y(R),H===0)break;K=H%2}re=re.times(re),F?re.c&&re.c.length>F&&(re.c.length=F):D&&(re=re.mod(E))}return D?U:(W&&(U=q.div(U)),E?U.mod(E):F?B(U,z,ue,X):U)},A.integerValue=function(R){var E=new y(this);return R==null?R=ue:p(R,0,8),B(E,E.e+1,R)},A.isEqualTo=A.eq=function(R,E){return b(this,new y(R,E))===0},A.isFinite=function(){return!!this.c},A.isGreaterThan=A.gt=function(R,E){return b(this,new y(R,E))>0},A.isGreaterThanOrEqualTo=A.gte=function(R,E){return(E=b(this,new y(R,E)))===1||E===0},A.isInteger=function(){return!!this.c&&w(this.e/u)>this.c.length-2},A.isLessThan=A.lt=function(R,E){return b(this,new y(R,E))<0},A.isLessThanOrEqualTo=A.lte=function(R,E){return(E=b(this,new y(R,E)))===-1||E===0},A.isNaN=function(){return!this.s},A.isNegative=function(){return this.s<0},A.isPositive=function(){return this.s>0},A.isZero=function(){return!!this.c&&this.c[0]==0},A.minus=function(R,E){var S,D,H,F,X=this,L=X.s;if(R=new y(R,E),E=R.s,!L||!E)return new y(NaN);if(L!=E)return R.s=-E,X.plus(R);var W=X.e/u,K=R.e/u,U=X.c,re=R.c;if(!W||!K){if(!U||!re)return U?(R.s=-E,R):new y(re?X:NaN);if(!U[0]||!re[0])return re[0]?(R.s=-E,R):new y(U[0]?X:ue==3?-0:0)}if(W=w(W),K=w(K),U=U.slice(),L=W-K){for((F=L<0)?(L=-L,H=U):(K=W,H=re),H.reverse(),E=L;E--;H.push(0));H.reverse()}else for(D=(F=(L=U.length)<(E=re.length))?L:E,L=E=0;E<D;E++)if(U[E]!=re[E]){F=U[E]<re[E];break}if(F&&(H=U,U=re,re=H,R.s=-R.s),E=(D=re.length)-(S=U.length),E>0)for(;E--;U[S++]=0);for(E=l-1;D>L;){if(U[--D]<re[D]){for(S=D;S&&!U[--S];U[S]=E);--U[S],U[D]+=l}U[D]-=re[D]}for(;U[0]==0;U.splice(0,1),--K);return U[0]?N(R,U,K):(R.s=ue==3?-1:1,R.c=[R.e=0],R)},A.modulo=A.mod=function(R,E){var S,D,H=this;return R=new y(R,E),!H.c||!R.s||R.c&&!R.c[0]?new y(NaN):!R.c||H.c&&!H.c[0]?new y(H):(ae==9?(D=R.s,R.s=1,S=P(H,R,0,3),R.s=D,S.s*=D):S=P(H,R,0,ae),R=H.minus(S.times(R)),!R.c[0]&&ae==1&&(R.s=H.s),R)},A.multipliedBy=A.times=function(R,E){var S,D,H,F,X,L,W,K,U,re,me,ye,xe,Be,Ke,Ie=this,ze=Ie.c,Ht=(R=new y(R,E)).c;if(!ze||!Ht||!ze[0]||!Ht[0])return!Ie.s||!R.s||ze&&!ze[0]&&!Ht||Ht&&!Ht[0]&&!ze?R.c=R.e=R.s=null:(R.s*=Ie.s,!ze||!Ht?R.c=R.e=null:(R.c=[0],R.e=0)),R;for(D=w(Ie.e/u)+w(R.e/u),R.s*=Ie.s,W=ze.length,re=Ht.length,W<re&&(xe=ze,ze=Ht,Ht=xe,H=W,W=re,re=H),H=W+re,xe=[];H--;xe.push(0));for(Be=l,Ke=d,H=re;--H>=0;){for(S=0,me=Ht[H]%Ke,ye=Ht[H]/Ke|0,X=W,F=H+X;F>H;)K=ze[--X]%Ke,U=ze[X]/Ke|0,L=ye*K+U*me,K=me*K+L%Ke*Ke+xe[F]+S,S=(K/Be|0)+(L/Ke|0)+ye*U,xe[F--]=K%Be;xe[F]=S}return S?++D:xe.splice(0,1),N(R,xe,D)},A.negated=function(){var R=new y(this);return R.s=-R.s||null,R},A.plus=function(R,E){var S,D=this,H=D.s;if(R=new y(R,E),E=R.s,!H||!E)return new y(NaN);if(H!=E)return R.s=-E,D.minus(R);var F=D.e/u,X=R.e/u,L=D.c,W=R.c;if(!F||!X){if(!L||!W)return new y(H/0);if(!L[0]||!W[0])return W[0]?R:new y(L[0]?D:H*0)}if(F=w(F),X=w(X),L=L.slice(),H=F-X){for(H>0?(X=F,S=W):(H=-H,S=L),S.reverse();H--;S.push(0));S.reverse()}for(H=L.length,E=W.length,H-E<0&&(S=W,W=L,L=S,E=H),H=0;E;)H=(L[--E]=L[E]+W[E]+H)/l|0,L[E]=l===L[E]?0:L[E]%l;return H&&(L=[H].concat(L),++X),N(R,L,X)},A.precision=A.sd=function(R,E){var S,D,H,F=this;if(R!=null&&R!==!!R)return p(R,1,f),E==null?E=ue:p(E,0,8),B(new y(F),R,E);if(!(S=F.c))return null;if(H=S.length-1,D=H*u+1,H=S[H]){for(;H%10==0;H/=10,D--);for(H=S[0];H>=10;H/=10,D++);}return R&&F.e+1>D&&(D=F.e+1),D},A.shiftedBy=function(R){return p(R,-c,c),this.times("1e"+R)},A.squareRoot=A.sqrt=function(){var R,E,S,D,H,F=this,X=F.c,L=F.s,W=F.e,K=Q+4,U=new y("0.5");if(L!==1||!X||!X[0])return new y(!L||L<0&&(!X||X[0])?NaN:X?F:1/0);if(L=Math.sqrt(+Y(F)),L==0||L==1/0?(E=v(X),(E.length+W)%2==0&&(E+="0"),L=Math.sqrt(+E),W=w((W+1)/2)-(W<0||W%2),L==1/0?E="5e"+W:(E=L.toExponential(),E=E.slice(0,E.indexOf("e")+1)+W),S=new y(E)):S=new y(L+""),S.c[0]){for(W=S.e,L=W+K,L<3&&(L=0);;)if(H=S,S=U.times(H.plus(P(F,H,K,1))),v(H.c).slice(0,L)===(E=v(S.c)).slice(0,L))if(S.e<W&&--L,E=E.slice(L-3,L+1),E=="9999"||!D&&E=="4999"){if(!D&&(B(H,H.e+Q+2,0),H.times(H).eq(F))){S=H;break}K+=4,L+=4,D=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(B(S,S.e+Q+2,1),R=!S.times(S).eq(F));break}}return B(S,S.e+Q+1,ue,R)},A.toExponential=function(R,E){return R!=null&&(p(R,0,f),R++),I(this,R,E,1)},A.toFixed=function(R,E){return R!=null&&(p(R,0,f),R=R+this.e+1),I(this,R,E)},A.toFormat=function(R,E,S){var D,H=this;if(S==null)R!=null&&E&&typeof E=="object"?(S=E,E=null):R&&typeof R=="object"?(S=R,R=E=null):S=$;else if(typeof S!="object")throw Error(s+"Argument not an object: "+S);if(D=H.toFixed(R,E),H.c){var F,X=D.split("."),L=+S.groupSize,W=+S.secondaryGroupSize,K=S.groupSeparator||"",U=X[0],re=X[1],me=H.s<0,ye=me?U.slice(1):U,xe=ye.length;if(W&&(F=L,L=W,W=F,xe-=F),L>0&&xe>0){for(F=xe%L||L,U=ye.substr(0,F);F<xe;F+=L)U+=K+ye.substr(F,L);W>0&&(U+=K+ye.slice(F)),me&&(U="-"+U)}D=re?U+(S.decimalSeparator||"")+((W=+S.fractionGroupSize)?re.replace(new RegExp("\\d{"+W+"}\\B","g"),"$&"+(S.fractionGroupSeparator||"")):re):U}return(S.prefix||"")+D+(S.suffix||"")},A.toFraction=function(R){var E,S,D,H,F,X,L,W,K,U,re,me,ye=this,xe=ye.c;if(R!=null&&(L=new y(R),!L.isInteger()&&(L.c||L.s!==1)||L.lt(q)))throw Error(s+"Argument "+(L.isInteger()?"out of range: ":"not an integer: ")+Y(L));if(!xe)return new y(ye);for(E=new y(q),K=S=new y(q),D=W=new y(q),me=v(xe),F=E.e=me.length-ye.e-1,E.c[0]=h[(X=F%u)<0?u+X:X],R=!R||L.comparedTo(E)>0?F>0?E:K:L,X=ee,ee=1/0,L=new y(me),W.c[0]=0;U=P(L,E,0,1),H=S.plus(U.times(D)),H.comparedTo(R)!=1;)S=D,D=H,K=W.plus(U.times(H=K)),W=H,E=L.minus(U.times(H=E)),L=H;return H=P(R.minus(S),D,0,1),W=W.plus(H.times(K)),S=S.plus(H.times(D)),W.s=K.s=ye.s,F=F*2,re=P(K,D,F,ue).minus(ye).abs().comparedTo(P(W,S,F,ue).minus(ye).abs())<1?[K,D]:[W,S],ee=X,re},A.toNumber=function(){return+Y(this)},A.toPrecision=function(R,E){return R!=null&&p(R,1,f),I(this,R,E,2)},A.toString=function(R){var E,S=this,D=S.s,H=S.e;return H===null?D?(E="Infinity",D<0&&(E="-"+E)):E="NaN":(R==null?E=H<=J||H>=Z?O(v(S.c),H):T(v(S.c),H,"0"):R===10&&C?(S=B(new y(S),Q+H+1,ue),E=T(v(S.c),S.e,"0")):(p(R,2,m.length,"Base"),E=G(T(v(S.c),H,"0"),10,R,D,!0)),D<0&&S.c[0]&&(E="-"+E)),E},A.valueOf=A.toJSON=function(){return Y(this)},A._isBigNumber=!0,M!=null&&y.set(M),y}function w(M){var P=M|0;return M>0||M===P?P:P-1}function v(M){for(var P,G,j=1,A=M.length,q=M[0]+"";j<A;){for(P=M[j++]+"",G=u-P.length;G--;P="0"+P);q+=P}for(A=q.length;q.charCodeAt(--A)===48;);return q.slice(0,A+1||1)}function b(M,P){var G,j,A=M.c,q=P.c,Q=M.s,ue=P.s,J=M.e,Z=P.e;if(!Q||!ue)return null;if(G=A&&!A[0],j=q&&!q[0],G||j)return G?j?0:-ue:Q;if(Q!=ue)return Q;if(G=Q<0,j=J==Z,!A||!q)return j?0:!A^G?1:-1;if(!j)return J>Z^G?1:-1;for(ue=(J=A.length)<(Z=q.length)?J:Z,Q=0;Q<ue;Q++)if(A[Q]!=q[Q])return A[Q]>q[Q]^G?1:-1;return J==Z?0:J>Z^G?1:-1}function p(M,P,G,j){if(M<P||M>G||M!==o(M))throw Error(s+(j||"Argument")+(typeof M=="number"?M<P||M>G?" out of range: ":" not an integer: ":" not a primitive number: ")+String(M))}function _(M){var P=M.c.length-1;return w(M.e/u)==P&&M.c[P]%2!=0}function O(M,P){return(M.length>1?M.charAt(0)+"."+M.slice(1):M)+(P<0?"e":"e+")+P}function T(M,P,G){var j,A;if(P<0){for(A=G+".";++P;A+=G);M=A+M}else if(j=M.length,++P>j){for(A=G,P-=j;--P;A+=G);M+=A}else P<j&&(M=M.slice(0,P)+"."+M.slice(P));return M}r=g(),r.default=r.BigNumber=r,t.exports?t.exports=r:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=r)})(WJ)})(r$);var n$=r$.exports;/*!
670
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
671
+ *
672
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
673
+ * of this software and associated documentation files (the "Software"), to deal
674
+ * in the Software without restriction, including without limitation the rights
675
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
676
+ * copies of the Software, and to permit persons to whom the Software is
677
+ * furnished to do so, subject to the following conditions:
678
+ *
679
+ * The above copyright notice and this permission notice shall be included in
680
+ * all copies or substantial portions of the Software.
681
+ *
682
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
683
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
684
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
685
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
686
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
687
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
688
+ * SOFTWARE.
689
+ */const $i=aT(),uQ=iT(),cQ=oT,hQ=n$,Hr={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},fd={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:i$,decimalSuffixes:Ym}=$i.currentBytes(),lT={general:{scale:1024,suffixes:Ym},binary:{scale:1024,suffixes:i$},decimal:{scale:1e3,suffixes:Ym}};function dQ(t,e={},r){if(typeof e=="string"&&(e=cQ.parseFormat(e)),!uQ.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",o=e.postfix||"",s=fQ(t,e,r);return s=AQ(s,i),s=HQ(s,o),s}function fQ(t,e,r){switch(e.output){case"currency":return e=tc(e,$i.currentCurrencyDefaultFormat()),bQ(t,e,$i);case"percent":return e=tc(e,$i.currentPercentageDefaultFormat()),CQ(t,e,$i,r);case"byte":return e=tc(e,$i.currentByteDefaultFormat()),wQ(t,e,$i,r);case"time":return e=tc(e,$i.currentTimeDefaultFormat()),yQ(t);case"ordinal":return e=tc(e,$i.currentOrdinalDefaultFormat()),vQ(t,e,$i);case"number":default:return gd({instance:t,providedFormat:e})}}function gQ(t){let e=lT.decimal;return Gm(t._value,e.suffixes,e.scale).suffix}function mQ(t){let e=lT.binary;return Gm(t._value,e.suffixes,e.scale).suffix}function pQ(t){let e=lT.general;return Gm(t._value,e.suffixes,e.scale).suffix}function Gm(t,e,r){let n=e[0],i=Math.abs(t);if(i>=r){for(let o=1;o<e.length;++o){let s=Math.pow(r,o),a=Math.pow(r,o+1);if(i>=s&&i<a){n=e[o],t=t/s;break}}n===e[0]&&(t=t/Math.pow(r,e.length-1),n=e[e.length-1])}return{value:t,suffix:n}}function wQ(t,e,r,n){let i=e.base||"binary",o=Object.assign({},fd,e);const{binarySuffixes:s,decimalSuffixes:a}=r.currentBytes();let u={general:{scale:1024,suffixes:a||Ym,marker:"bd"},binary:{scale:1024,suffixes:s||i$,marker:"b"},decimal:{scale:1e3,suffixes:a||Ym,marker:"d"}}[i],{value:c,suffix:h}=Gm(t._value,u.suffixes,u.scale);return`${gd({instance:n(c),providedFormat:e,state:r,defaults:r.currentByteDefaultFormat()})}${o.spaceSeparated?" ":""}${h}`}function vQ(t,e,r){let n=r.currentOrdinal(),i=Object.assign({},fd,e),o=gd({instance:t,providedFormat:e,state:r}),s=n(t._value);return`${o}${i.spaceSeparated?" ":""}${s}`}function yQ(t){let e=Math.floor(t._value/60/60),r=Math.floor((t._value-e*60*60)/60),n=Math.round(t._value-e*60*60-r*60);return`${e}:${r<10?"0":""}${r}:${n<10?"0":""}${n}`}function CQ(t,e,r,n){let i=e.prefixSymbol,o=gd({instance:n(t._value*100),providedFormat:e,state:r}),s=Object.assign({},fd,e);return i?`%${s.spaceSeparated?" ":""}${o}`:`${o}${s.spaceSeparated?" ":""}%`}function bQ(t,e,r){const n=r.currentCurrency();let i=Object.assign({},e),o=Object.assign({},fd,i),s,a="",l=!!o.totalLength||!!o.forceAverage||o.average,u=i.currencyPosition||n.position,c=i.currencySymbol||n.symbol;const h=o.spaceSeparatedCurrency!==void 0?o.spaceSeparatedCurrency:o.spaceSeparated;i.lowPrecision===void 0&&(i.lowPrecision=!1),h&&(a=" "),u==="infix"&&(s=a+c+a);let d=gd({instance:t,providedFormat:i,state:r,decimalSeparator:s});return u==="prefix"&&(t._value<0&&o.negative==="sign"?d=`-${a}${c}${d.slice(1)}`:t._value>0&&o.forceSign?d=`+${a}${c}${d.slice(1)}`:d=c+a+d),(!u||u==="postfix")&&(a=!o.spaceSeparatedAbbreviation&&l?"":a,d=d+a+c),d}function SQ({value:t,forceAverage:e,lowPrecision:r=!0,abbreviations:n,spaceSeparated:i=!1,totalLength:o=0,roundingFunction:s=Math.round}){let a="",l=Math.abs(t),u=-1;if(e&&n[e]&&Hr[e]?(a=n[e],t=t/Hr[e]):l>=Hr.trillion||r&&s(l/Hr.trillion)===1?(a=n.trillion,t=t/Hr.trillion):l<Hr.trillion&&l>=Hr.billion||r&&s(l/Hr.billion)===1?(a=n.billion,t=t/Hr.billion):l<Hr.billion&&l>=Hr.million||r&&s(l/Hr.million)===1?(a=n.million,t=t/Hr.million):(l<Hr.million&&l>=Hr.thousand||r&&s(l/Hr.thousand)===1)&&(a=n.thousand,t=t/Hr.thousand),a&&(a=(i?" ":"")+a),o){let h=t<0,d=t.toString().split(".")[0],f=h?d.length-1:d.length;u=Math.max(o-f,0)}return{value:t,abbreviation:a,mantissaPrecision:u}}function RQ({value:t,characteristicPrecision:e}){let[r,n]=t.toExponential().split("e"),i=+r;if(!e)return{value:i,abbreviation:`e${n}`};let o=1;return o<e&&(i=i*Math.pow(10,e-o),n=+n-(e-o),n=n>=0?`+${n}`:n),{value:i,abbreviation:`e${n}`}}function qm(t){let e="";for(let r=0;r<t;r++)e+="0";return e}function EQ(t,e){let r=t.toString(),[n,i]=r.split("e"),[o,s=""]=n.split(".");if(+i>0)r=o+s+qm(i-s.length);else{let a=".";+o<0?a=`-0${a}`:a=`0${a}`;let l=(qm(-i-1)+Math.abs(o)+s).substr(0,e);l.length<e&&(l+=qm(e-l.length)),r=a+l}return+i>0&&e>0&&(r+=`.${qm(e)}`),r}function TQ(t,e,r=Math.round){return t.toString().indexOf("e")!==-1?EQ(t,e):new hQ(r(+`${t}e+${e}`)/Math.pow(10,e)).toFixed(e)}function _Q(t,e,r,n,i,o){if(n===-1)return t;let s=TQ(e,n,o),[a,l=""]=s.toString().split(".");if(l.match(/^0+$/)&&(r||i))return a;let u=l.match(/0+$/);return i&&u?`${a}.${l.toString().slice(0,u.index)}`:s.toString()}function MQ(t,e,r,n){let i=t,[o,s]=i.toString().split(".");if(o.match(/^-?0$/)&&r)return s?`${o.replace("0","")}.${s}`:o.replace("0","");const a=e<0&&o.indexOf("-")===0;if(a&&(o=o.slice(1),i=i.slice(1)),o.length<n){let l=n-o.length;for(let u=0;u<l;u++)i=`0${i}`}return a&&(i=`-${i}`),i.toString()}function PQ(t,e){let r=[],n=0;for(let i=t;i>0;i--)n===e&&(r.unshift(i),n=0),n++;return r}function IQ(t,e,r,n,i){let o=n.currentDelimiters(),s=o.thousands;i=i||o.decimal;let a=o.thousandsSize||3,l=t.toString(),u=l.split(".")[0],c=l.split(".")[1];const h=e<0&&u.indexOf("-")===0;return r&&(h&&(u=u.slice(1)),PQ(u.length,a).forEach((f,g)=>{u=u.slice(0,f+g)+s+u.slice(f+g)}),h&&(u=`-${u}`)),c?l=u+i+c:l=u,l}function OQ(t,e){return t+e}function xQ(t,e,r){return e===0?t:+t==0?t.replace("-",""):e>0?`+${t}`:r==="sign"?t:`(${t.replace("-","")})`}function AQ(t,e){return e+t}function HQ(t,e){return t+e}function gd({instance:t,providedFormat:e,state:r=$i,decimalSeparator:n,defaults:i=r.currentDefaults()}){let o=t._value;if(o===0&&r.hasZeroFormat())return r.getZeroFormat();if(!isFinite(o))return o.toString();let s=Object.assign({},fd,i,e),a=s.totalLength,l=a?0:s.characteristic,u=s.optionalCharacteristic,c=s.forceAverage,h=s.lowPrecision,d=!!a||!!c||s.average,f=a?-1:d&&e.mantissa===void 0?0:s.mantissa,g=a?!1:e.optionalMantissa===void 0?f===-1:s.optionalMantissa,w=s.trimMantissa,v=s.thousandSeparated,b=s.spaceSeparated,p=s.negative,_=s.forceSign,O=s.exponential,T=s.roundingFunction,M="";if(d){let G=SQ({value:o,forceAverage:c,lowPrecision:h,abbreviations:r.currentAbbreviations(),spaceSeparated:b,roundingFunction:T,totalLength:a});o=G.value,M+=G.abbreviation,a&&(f=G.mantissaPrecision)}if(O){let G=RQ({value:o,characteristicPrecision:l});o=G.value,M=G.abbreviation+M}let P=_Q(o.toString(),o,g,f,w,T);return P=MQ(P,o,u,l),P=IQ(P,o,v,r,n),(d||O)&&(P=OQ(P,M)),(_||o<0)&&(P=xQ(P,o,p)),P}function tc(t,e){if(!t)return e;let r=Object.keys(t);return r.length===1&&r[0]==="output"?e:t}var NQ=t=>({format:(...e)=>dQ(...e,t),getByteUnit:(...e)=>pQ(...e,t),getBinaryByteUnit:(...e)=>mQ(...e,t),getDecimalByteUnit:(...e)=>gQ(...e,t),formatOrDefault:tc});/*!
690
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
691
+ *
692
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
693
+ * of this software and associated documentation files (the "Software"), to deal
694
+ * in the Software without restriction, including without limitation the rights
695
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
696
+ * copies of the Software, and to permit persons to whom the Software is
697
+ * furnished to do so, subject to the following conditions:
698
+ *
699
+ * The above copyright notice and this permission notice shall be included in
700
+ * all copies or substantial portions of the Software.
701
+ *
702
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
703
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
704
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
705
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
706
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
707
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
708
+ * SOFTWARE.
709
+ */const ds=n$;function DQ(t,e,r){let n=new ds(t._value),i=e;return r.isNumbro(e)&&(i=e._value),i=new ds(i),t._value=n.plus(i).toNumber(),t}function o$(t,e,r){let n=new ds(t._value),i=e;return r.isNumbro(e)&&(i=e._value),i=new ds(i),t._value=n.minus(i).toNumber(),t}function kQ(t,e,r){let n=new ds(t._value),i=e;return r.isNumbro(e)&&(i=e._value),i=new ds(i),t._value=n.times(i).toNumber(),t}function LQ(t,e,r){let n=new ds(t._value),i=e;return r.isNumbro(e)&&(i=e._value),i=new ds(i),t._value=n.dividedBy(i).toNumber(),t}function $Q(t,e,r){let n=e;return r.isNumbro(e)&&(n=e._value),t._value=n,t}function FQ(t,e,r){let n=r(t._value);return o$(n,e,r),Math.abs(n._value)}var VQ=t=>({add:(e,r)=>DQ(e,r,t),subtract:(e,r)=>o$(e,r,t),multiply:(e,r)=>kQ(e,r,t),divide:(e,r)=>LQ(e,r,t),set:(e,r)=>$Q(e,r,t),difference:(e,r)=>FQ(e,r,t),BigNumber:ds});/*!
710
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
711
+ *
712
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
713
+ * of this software and associated documentation files (the "Software"), to deal
714
+ * in the Software without restriction, including without limitation the rights
715
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
716
+ * copies of the Software, and to permit persons to whom the Software is
717
+ * furnished to do so, subject to the following conditions:
718
+ *
719
+ * The above copyright notice and this permission notice shall be included in
720
+ * all copies or substantial portions of the Software.
721
+ *
722
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
723
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
724
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
725
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
726
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
727
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
728
+ * SOFTWARE.
729
+ */const WQ="2.5.0",po=aT(),BQ=iT(),jQ=lQ(Xt),UQ=QL();let pl=NQ(Xt),wl=VQ(Xt);const zQ=oT;class s${constructor(e){this._value=e}clone(){return Xt(this._value)}format(e={}){return pl.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=zQ.parseFormat(e)),e=pl.formatOrDefault(e,po.currentCurrencyDefaultFormat()),e.output="currency",pl.format(this,e)}formatTime(e={}){return e.output="time",pl.format(this,e)}binaryByteUnits(){return pl.getBinaryByteUnit(this)}decimalByteUnits(){return pl.getDecimalByteUnit(this)}byteUnits(){return pl.getByteUnit(this)}difference(e){return wl.difference(this,e)}add(e){return wl.add(this,e)}subtract(e){return wl.subtract(this,e)}multiply(e){return wl.multiply(this,e)}divide(e){return wl.divide(this,e)}set(e){return wl.set(this,a$(e))}value(){return this._value}valueOf(){return this._value}}function a$(t){let e=t;return Xt.isNumbro(t)?e=t._value:typeof t=="string"?e=Xt.unformat(t):isNaN(t)&&(e=NaN),e}function Xt(t){return new s$(a$(t))}Xt.version=WQ,Xt.isNumbro=function(t){return t instanceof s$},Xt.language=po.currentLanguage,Xt.registerLanguage=po.registerLanguage,Xt.setLanguage=po.setLanguage,Xt.languages=po.languages,Xt.languageData=po.languageData,Xt.zeroFormat=po.setZeroFormat,Xt.defaultFormat=po.currentDefaults,Xt.setDefaults=po.setDefaults,Xt.defaultCurrencyFormat=po.currentCurrencyDefaultFormat,Xt.validate=BQ.validate,Xt.loadLanguagesInNode=jQ.loadLanguagesInNode,Xt.unformat=UQ.unformat,Xt.BigNumber=wl.BigNumber;var YQ=Xt,vl=BJ(YQ);const GQ="numeric";function l$(t,e){if(Xr(t)){const r=e.numericFormat,n=r&&r.culture||"-",i=r&&r.pattern;if(typeof n<"u"&&!vl.languages()[n]){const o=n.replace("-",""),s=vl.allLanguages?vl.allLanguages[n]:vl[o];s&&vl.registerLanguage(s)}vl.setLanguage(n),t=vl(t).format(i||"0")}return t}function uT(t,e,r,n,i,o,s){let a=o;if(Xr(a)){let u=[];if(Array.isArray(s.className))u=s.className;else{var l;const c=(l=s.className)!==null&&l!==void 0?l:"";c.length&&(u=c.split(" "))}a=l$(a,s),u.indexOf("htLeft")<0&&u.indexOf("htCenter")<0&&u.indexOf("htRight")<0&&u.indexOf("htJustify")<0&&u.push("htRight"),u.indexOf("htNumeric")<0&&u.push("htNumeric"),s.className=u.join(" "),e.dir="ltr"}cs(t,e,r,n,i,a,s)}uT.RENDERER_TYPE=GQ;const qQ="password";function cT(t,e,r,n,i,o,s){cs.apply(this,[t,e,r,n,i,o,s]);const a=s.hashLength||e.innerHTML.length,l=s.hashSymbol||"*";let u="";Ce(a-1,()=>{u+=l}),Iu(e,u)}cT.RENDERER_TYPE=qQ;const KQ="select";function hT(t,e,r,n,i,o,s){cs.apply(this,[t,e,r,n,i,o,s])}hT.RENDERER_TYPE=KQ;const XQ="time";function dT(t,e,r,n,i,o,s){cs.apply(this,[t,e,r,n,i,o,s]),e.dir="ltr"}dT.RENDERER_TYPE=XQ;function ZQ(){ri(Ju),ri(hd),ri(J0),ri(Z0),ri(eT),ri(X0),ri(uT),ri(cT),ri(hT),ri(cs),ri(dT)}const JQ="autocomplete";function Km(t,e){let r=t;if(r==null&&(r=""),this.allowEmpty&&r===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(r,u$(r,e)):u$(r,e)(this.source):e(!0)}Km.VALIDATOR_TYPE=JQ;function u$(t,e){const r=t;return function(n){let i=!1;for(let o=0,s=n.length;o<s;o++)if(r===n[o]){i=!0;break}e(i)}}function QQ(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const eee="date";function fT(t,e){const r=fN(FL,this.instance);let n=t,i=!0;n==null&&(n="");let o=se(n,this.dateFormat||r.defaultDateFormat,!0).isValid(),s=se(new Date(n)).isValid()||o;if(this.allowEmpty&&n===""&&(s=!0,o=!0),s||(i=!1),!s&&o&&(i=!0),s&&!o)if(this.correctFormat===!0){const a=tee(n,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}fT.VALIDATOR_TYPE=eee;function tee(t,e){const r=se(QQ(t)),n=se(t,e),i=t.search(/[A-Za-z]/g)>-1;let o;return r.isValid()&&r.format("x")===n.format("x")||!n.isValid()||i?o=r:o=n,o.format(e)}const ree="dropdown";function gT(t,e){Km.apply(this,[t,e])}gT.VALIDATOR_TYPE=ree;const nee="numeric";function mT(t,e){let r=t;r==null&&(r=""),this.allowEmpty&&r===""?e(!0):e(r===""?!1:Xr(t))}mT.VALIDATOR_TYPE=nee;const iee=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],oee="time";function pT(t,e){const r=this.timeFormat||"h:mm:ss a";let n=!0,i=t;i===null&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const o=/^\d{1,2}$/.test(i);o&&(i+=":00");const s=se(i,iee,!0).isValid()?se(i):se(i,r);let a=s.isValid(),l=se(i,r,!0).isValid()&&!o;if(this.allowEmpty&&i===""&&(a=!0,l=!0),a||(n=!1),!a&&l&&(n=!0),a&&!l)if(this.correctFormat===!0){const u=s.format(r);this.instance.setDataAtCell(this.visualRow,this.visualCol,u,"timeValidator"),n=!0}else n=!1;e(n)}pT.VALIDATOR_TYPE=oee;function see(){Nu(Km),Nu(gT),Nu(fT),Nu(mT),Nu(pT)}const aee={CELL_TYPE:"autocomplete",editor:W0,renderer:Ju,validator:Km},lee={CELL_TYPE:"checkbox",editor:HL,renderer:J0},uee="date";function c$(t,e,r,n,i,o,s){Ju.apply(this,[t,e,r,n,i,o,s])}c$.RENDERER_TYPE=uee;const cee={CELL_TYPE:"date",editor:WL,renderer:c$,validator:fT},hee={CELL_TYPE:"dropdown",editor:BL,renderer:Z0,validator:gT,filter:!1,strict:!0},dee={CELL_TYPE:"handsontable",editor:k0,renderer:eT},fee={CELL_TYPE:"numeric",editor:jL,renderer:uT,validator:mT,dataType:"number"},gee={CELL_TYPE:"password",editor:UL,renderer:cT,copyable:!1},mee={CELL_TYPE:"select",editor:YL,renderer:hT},pee={CELL_TYPE:"time",editor:GL,renderer:dT,validator:pT};function wee(){ki(aee),ki(lee),ki(cee),ki(hee),ki(dee),ki(fee),ki(gee),ki(mee),ki(eL),ki(pee)}function vee(t,e){h$(t,e),e.add(t)}function yee(t,e,r){h$(t,e),e.set(t,r)}function h$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rc(t,e,r){return(e=Cee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cee(t){var e=bee(t,"string");return typeof e=="symbol"?e:e+""}function bee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nc(t,e){return t.get(d$(t,e))}function d$(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const f$=new Map([["plugin",T4],["cell-type",Ok],["editor",dN],["renderer",$N],["validator",FN]]),g$=Symbol("mainSetting"),See="base",Xm=[];let yl=null;var Cl=new WeakMap,m$=new WeakSet;class rt{static get PLUGIN_KEY(){return See}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}constructor(e){vee(this,m$),rc(this,"eventManager",new Pi(this)),rc(this,"pluginName",null),rc(this,"pluginsInitializedCallbacks",[]),rc(this,"isPluginsReady",!1),rc(this,"enabled",!1),rc(this,"initialized",!1),yee(this,Cl,{}),Qo(this,"hot",e,{writable:!1}),yl=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",r=>this.onUpdateSettings(r)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,r=Array.isArray(e)?e:[];if(r.length>0){const i=[];if(r.forEach(o=>{const[s,a]=o.split(":");if(!f$.has(s))throw new Error(`Unknown plugin dependency type "${s}" was found.`);f$.get(s)(a)||i.push(` - ${a} (${s})`)}),i.length>0){const o=[`The ${this.pluginName} plugin requires the following modules:
730
+ `,`${i.join(`
731
+ `)}
732
+ `].join("");Xm.push(o)}}if(yl||(yl=LN()),yl.indexOf(this.pluginName)>=0&&yl.splice(yl.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),yl.length===0){if(Xm.length>0){const i=[`${Xm.join(`
733
+ `)}
734
+ `,"You have to import and register them manually."].join("");throw Xm.length=0,new Error(i)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;(e=this.eventManager)===null||e===void 0||e.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){const r=this.hot.getSettings()[this.constructor.PLUGIN_KEY];if(e===void 0)return r;const n=this.constructor.DEFAULT_SETTINGS;if((Array.isArray(r)||$e(r))&&n[g$]===e){var i;return Array.isArray(r)?r:(i=r[e])!==null&&i!==void 0?i:n[e]}if($e(r)){var o;return(o=r[e])!==null&&o!==void 0?o:n[e]}return n[e]}addHook(e,r,n){nc(Cl,this)[e]=nc(Cl,this)[e]||[];const i=nc(Cl,this)[e];this.hot.addHook(e,r,n),i.push(r),nc(Cl,this)[e]=i}removeHooks(e){k(nc(Cl,this)[e]||[],r=>{this.hot.removeHook(e,r)})}clearHooks(){const e=nc(Cl,this);Fe(e,(r,n)=>this.removeHooks(n)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){k(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const r=d$(m$,this,Ree).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&r&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;(e=this.eventManager)===null||e===void 0||e.destroy(),this.clearHooks(),Fe(this,(r,n)=>{n!=="hot"&&(this[n]=null)}),delete this.t,delete this.hot}}function Ree(t){if(!t)return!1;const e=this.constructor.SETTING_KEYS;if(typeof e=="boolean")return e;for(let r=0;r<e.length;r++)if(t[e[r]]!==void 0)return!0;return!1}function bl(t,e,r){return(e=Eee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Eee(t){var e=Tee(t,"string");return typeof e=="symbol"?e:e+""}function Tee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let p$=class{constructor(e){bl(this,"hot",null),bl(this,"container",null),bl(this,"injected",!1),bl(this,"rows",[]),bl(this,"columns",[]),bl(this,"samples",null),bl(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,r){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const n={row:e};this.rows.push(n),this.samples=r,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),e===0&&oe(this.table.table,"htGhostTableFirstRow"),this.container.container.appendChild(this.table.fragment),n.table=this.table.table}addColumnHeadersRow(e){const r=this.hot.getColHeader(0);if(r!=null){const n={row:-1};this.rows.push(n),this.container=this.createContainer(this.hot.rootElement.className),this.samples=e,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.appendColumnHeadersRow(),this.container.container.appendChild(this.table.fragment),n.table=this.table.table}}addColumn(e,r){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const n={col:e};this.columns.push(n),this.samples=r,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&this.hot.getColHeader(e)!==null&&this.hot.view.appendColHeader(e,this.table.th,void 0,-1),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table}getHeights(e){this.injected||this.injectTable(),k(this.rows,r=>{const{height:n}=r.table.getBoundingClientRect();e(r.row,Math.ceil(n))})}getWidths(e){this.injected||this.injectTable(),k(this.columns,r=>{const{width:n}=r.table.getBoundingClientRect();e(r.col,Math.ceil(n))})}setSettings(e){this.settings=e}setSetting(e,r){this.settings||(this.settings={}),this.settings[e]=r}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const r=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&r.appendChild(this.createColElement(-1,-1)),this.samples.forEach(n=>{k(n.strings,i=>{r.appendChild(this.createColElement(i.col,e))})}),r}createRow(e){const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),n.appendChild(i)),this.samples.forEach(o=>{k(o.strings,s=>{const a=s.col,l=this.hot.getCellMeta(e,a),u=this.hot.getCellRenderer(l),c=r.createElement("td");c.setAttribute("ghost-table",1),u(this.hot,c,e,a,this.hot.colToProp(a),s.value,l),n.appendChild(c)})}),n}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,r=e.createDocumentFragment(),n=[];if(this.hot.hasRowHeaders()){const i=e.createElement("th");n.push([-1,i]),r.appendChild(i)}this.samples.forEach(i=>{k(i.strings,o=>{const s=o.col,a=e.createElement("th");n.push([s,a]),r.appendChild(a)})}),this.table.tHead.appendChild(r),k(n,i=>{const[o,s]=i;this.hot.view.appendColHeader(o,s)})}createCol(e){const{rootDocument:r}=this.hot,n=r.createDocumentFragment();return this.samples.forEach(i=>{k(i.strings,o=>{const s=o.row,a=this.hot.getCellMeta(s,e),l=this.hot.getCellRenderer(a),u=r.createElement("td"),c=r.createElement("tr");u.setAttribute("ghost-table",1),l(this.hot,u,s,e,this.hot.colToProp(e),o.value,a),c.appendChild(u),n.appendChild(c)})}),n}clean(){this.rows.length=0,this.rows[-1]=void 0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()}injectTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)}removeTable(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)}createColElement(e,r){const n=this.hot.rootDocument.createElement("col");let i=0;r>=0&&e>=0&&(i=this.hot.getCellMeta(r,e).colspan);let o=this.hot.getColWidth(e);if(i>1)for(let s=e+1;s<e+i;s++)o+=this.hot.getColWidth(s);return n.style.width=`${o}px`,n}createTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("table"),o=r.createElement("thead"),s=r.createElement("tbody"),a=r.createElement("colgroup"),l=r.createElement("tr"),u=r.createElement("th");return this.isVertical()&&i.appendChild(a),this.isHorizontal()&&(l.appendChild(u),o.appendChild(l),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(o),this.isVertical()&&s.appendChild(l),i.appendChild(s),oe(i,e),n.appendChild(i),{fragment:n,table:i,tHead:o,tBody:s,colGroup:a,tr:l,th:u}}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("div"),o=`htGhostTable htAutoSize ${e.trim()}`;return oe(i,o),n.appendChild(i),{fragment:n,container:i}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}};function Zm(t,e,r){return(e=_ee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _ee(t){var e=Mee(t,"string");return typeof e=="symbol"?e:e+""}function Mee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jm{static get SAMPLE_COUNT(){return 3}constructor(e){Zm(this,"samples",null),Zm(this,"dataFactory",null),Zm(this,"customSampleCount",null),Zm(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:Jm.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,r){return this.generateSamples("row",r,e)}generateColumnSamples(e,r){return this.generateSamples("col",r,e)}generateSamples(e,r,n){const i=new Map,{from:o,to:s}=typeof n=="number"?{from:n,to:n}:n;return Ce(o,s,a=>{const l=this.generateSample(e,r,a);i.set(a,l)}),i}generateSample(e,r,n){if(e!=="row"&&e!=="col")throw new Error("Unsupported sample type");const i=new Map,o=e==="row"?"col":"row",s=[];return Ce(r.from,r.to,a=>{const l=e==="row"?this.dataFactory(n,a):this.dataFactory(a,n);if(l===!1)return;const{value:u,bundleSeed:c}=l,h=typeof c=="string"&&c.length>0;let d;h?d=c:$e(u)?d=`${Object.keys(u).length}`:Array.isArray(u)?d=`${u.length}`:d=`${Lt(u).length}`,i.has(d)||i.set(d,{needed:this.getSampleCount(),strings:[]});const f=i.get(d);f.needed&&(!(s.indexOf(u)>-1)||this.allowDuplicates||h)&&(f.strings.push({value:u,[o]:a}),s.push(u),f.needed-=1)}),i}}function Pee(t,e){w$(t,e),e.add(t)}function wT(t,e,r){w$(t,e),e.set(t,r)}function w$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function md(t,e,r){return(e=Iee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Iee(t){var e=Oee(t,"string");return typeof e=="symbol"?e:e+""}function Oee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ta(t,e){return t.get(wn(t,e))}function Qm(t,e,r){return t.set(wn(t,e),r),r}function wn(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}de.getSingleton().register("modifyAutoColumnSizeSeed");const vT="autoColumnSize",xee=10,Aee="autoColumnSize";var yT=new WeakMap,ic=new WeakMap,oc=new WeakMap,Ln=new WeakSet;class pd extends rt{static get PLUGIN_KEY(){return vT}static get PLUGIN_PRIORITY(){return xee}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),Pee(this,Ln),md(this,"ghostTable",new p$(this.hot)),md(this,"samplesGenerator",new Jm((r,n)=>{const i=this.hot.toPhysicalRow(r),o=this.hot.toPhysicalColumn(n);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o))return!1;const s=this.hot.getCellMeta(r,n);let a="";s.spanned||(a=this.hot.getDataAtCell(r,n));let l="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(l=this.hot.runHooks("modifyAutoColumnSizeSeed",l,s,a)),{value:a,bundleSeed:l}})),md(this,"inProgress",!1),md(this,"measuredColumns",0),md(this,"columnWidthsMap",new Js),wT(this,yT,!1),wT(this,ic,[]),wT(this,oc,[]),this.hot.columnIndexMapper.registerMap(Aee,this.columnWidthsMap),this.addHook("beforeColumnResize",(r,n,i)=>wn(Ln,this,C$).call(this,r,n,i))}isEnabled(){return this.hot.getSettings()[vT]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;this.ghostTable.setSetting("useHeaders",this.getSetting("useHeaders")),this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const r=this.getSetting("samplingRatio");r&&!isNaN(r)&&this.samplesGenerator.setSampleCount(parseInt(r,10)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return wn(Ln,e,Dee).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return wn(Ln,e,kee).call(e,...i)}),this.addHook("afterFormulasValuesUpdate",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return wn(Ln,e,$ee).call(e,...i)}),this.addHook("beforeRender",()=>wn(Ln,this,Nee).call(this)),this.addHook("modifyColWidth",(n,i)=>this.getColumnWidth(i,n)),this.addHook("init",()=>wn(Ln,this,Lee).call(this)),super.enablePlugin()}updatePlugin(){Qm(oc,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,r,n)=>wn(Ln,this,C$).call(this,e,r,n))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),r=this.getLastVisibleColumn();if(e===-1||r===-1)return;const n=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:r},void 0,n)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof r=="number"?{from:r,to:r}:r;Ce(i.from,i.to,s=>{let a=this.hot.toPhysicalColumn(s);a===null&&(a=s),(n||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a))&&wn(Ln,this,v$).call(this,s,o)}),this.ghostTable.columns.length&&(wn(Ln,this,y$).call(this),this.measuredColumns=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=0;const i=this.hot.countCols()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){jg(o),this.inProgress=!1;return}this.calculateColumnsWidth({from:n,to:Math.min(n+pd.CALCULATION_STEP,i)},e,r),n=n+pd.CALCULATION_STEP+1,n<i?o=Bg(s):(jg(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateColumnsWidth({from:0,to:a},e,r),n=a+1),n<i?s():this.inProgress=!1}recalculateAllColumnsWidth(){this.hot.view.isVisible()&&this.calculateAllColumnsWidth({from:0,to:this.hot.countRows()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[vT];let r=pd.SYNC_CALCULATION_LIMIT;const n=this.hot.countCols()-1;return $e(e)&&(r=e.syncLimit,pH(r)?r=HN(n,r):r>>=0),Math.min(r,n)}getColumnWidth(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=r;return i===void 0&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),n&&typeof i=="number"&&(i=Math.max(i,Du))),i}getFirstVisibleColumn(){var e;return(e=this.hot.getFirstRenderedVisibleColumn())!==null&&e!==void 0?e:-1}getLastVisibleColumn(){var e;return(e=this.hot.getLastRenderedVisibleColumn())!==null&&e!==void 0?e:-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce((n,i,o)=>{const s=ta(ic,this).length;return(s-1<o||ta(ic,this)[o]!==i)&&n.push(this.hot.toVisualColumn(o)),s-1<o?ta(ic,this).push(i):ta(ic,this)[o]=i,n},[])}clearCache(e){Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(r=>{this.columnWidthsMap.setValueAtIndex(r,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!this.columnWidthsMap.getValues().slice(0,this.measuredColumns).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function Hee(t){const e={from:0,to:this.hot.countRows()-1};t.forEach(r=>{const n=this.hot.toPhysicalColumn(r);n!==null&&(this.hot._getColWidthFromSettings(n)||wn(Ln,this,v$).call(this,r,e))}),this.ghostTable.columns.length&&(wn(Ln,this,y$).call(this),this.ghostTable.clean())}function v$(t,e){this.samplesGenerator.generateColumnSamples(t,e).forEach((n,i)=>this.ghostTable.addColumn(i,n))}function y$(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((t,e)=>{const r=this.hot.toPhysicalColumn(t);this.columnWidthsMap.setValueAtIndex(r,e)})},!0)}function Nee(){this.calculateVisibleColumnsWidth(),this.inProgress||(wn(Ln,this,Hee).call(this,ta(oc,this)),Qm(oc,this,[]))}function Dee(t,e){e||this.recalculateAllColumnsWidth()}function kee(t){const e=t.reduce((r,n)=>{let[,i]=n;const o=this.hot.propToCol(i);return Number.isInteger(o)&&r.indexOf(o)===-1&&r.push(o),r},[]);ta(oc,this).push(...e)}function C$(t,e,r){let n=t;return r&&(this.calculateColumnsWidth(e,void 0,!0),n=this.getColumnWidth(e,void 0,!1)),n}function Lee(){Qm(ic,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),Qm(yT,this,!0)}function $ee(t){if(!ta(yT,this))return;const e=t.reduce((r,n)=>{var i;const o=(i=n.address)===null||i===void 0?void 0:i.col;if(Number.isInteger(o)){const s=this.hot.toVisualColumn(o);r.indexOf(s)===-1&&r.push(s)}return r},[]);ta(oc,this).push(...e)}const Sl={horizontal:"horizontal",vertical:"vertical"};function Fee(t,e,r){let n,i,o;return e[0]===t[0]&&e[1]<t[1]?(o="left",n=r(e[0],e[1]),i=r(e[2],t[1]-1)):e[2]===t[2]&&e[0]===t[0]&&e[3]>t[3]?(o="right",n=r(e[0],t[3]+1),i=r(e[2],e[3])):e[0]<t[0]&&e[1]===t[1]?(o="up",n=r(e[0],e[1]),i=r(t[0]-1,e[3])):e[2]>t[2]&&e[1]===t[1]&&(o="down",n=r(t[2]+1,e[1]),i=r(e[2],e[3])),n&&n.normalize(),i&&i.normalize(),{directionOfDrag:o,startOfDragCoords:n,endOfDragCoords:i}}function Vee(t){const e={};return t===!0?(e.directions=Object.keys(Sl),e.autoInsertRow=!0):$e(t)?(we(t.autoInsertRow)?t.direction===Sl.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,we(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(Sl)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function Wee(t,e){Bee(t,e),e.add(t)}function Bee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sc(t,e,r){return(e=jee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jee(t){var e=Uee(t,"string");return typeof e=="symbol"?e:e+""}function Uee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wd(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}de.getSingleton().register("modifyAutofillRange"),de.getSingleton().register("beforeAutofill"),de.getSingleton().register("afterAutofill");const b$="autofill",zee=20,Yee=["fillHandle"],Gee="insert_row_below",qee=200;var ac=new WeakSet;class Kee extends rt{constructor(){super(...arguments),Wee(this,ac),sc(this,"addingStarted",!1),sc(this,"mouseDownOnCellCorner",!1),sc(this,"mouseDragOutside",!1),sc(this,"handleDraggedCells",0),sc(this,"directions",[]),sc(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return b$}static get PLUGIN_PRIORITY(){return zee}static get SETTING_KEYS(){return[b$,...Yee]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>wd(ac,this,Zee).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>wd(ac,this,Xee).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,r)=>wd(ac,this,Jee).call(this,r)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:r,col:n}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.hot.runHooks("modifyCopyableRange",[{startRow:r,startCol:n,endRow:i,endCol:o}]),a=[],l=[],u=[];return k(s,c=>{for(let h=c.startRow;h<=c.endRow;h+=1)a.indexOf(h)===-1&&a.push(h);for(let h=c.startCol;h<=c.endCol;h+=1)l.indexOf(h)===-1&&l.push(h)}),k(a,c=>{const h=[];k(l,d=>{h.push(this.hot.getCopyableData(c,d))}),u.push(h)}),u}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,r,n,i]=this.hot.selection.highlight.getFill().getVisualCorners(),o=this.hot.getSelectedRangeLast(),s=o.getTopStartCorner(),a=o.getBottomEndCorner();this.resetSelectionOfDraggedArea();const l=[s.row,s.col,a.row,a.col],u=this.hot.runHooks("modifyAutofillRange",[Math.min(s.row,e),Math.min(s.col,r),Math.max(a.row,n),Math.max(a.col,i)],l),{directionOfDrag:c,startOfDragCoords:h,endOfDragCoords:d}=Fee(l,u,(f,g)=>this.hot._createCellCoords(f,g));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),g=o.clone(),w=this.hot._createCellRange(h,h,d),v=this.hot.runHooks("beforeAutofill",f,g,w,c);if(v===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let b=v;const p=v;if(["up","left"].indexOf(c)>-1&&!(p.length===1&&p[0].length===0))if(b=[],c==="up"){const _=d.row-h.row+1,O=_%p.length;for(let T=0;T<_;T++)b.push(p[(T+(p.length-O))%p.length])}else{const _=d.col-h.col+1,O=_%p[0].length;for(let T=0;T<p.length;T++){b.push([]);for(let M=0;M<_;M++)b[T].push(p[T][(M+(p[T].length-O))%p[T].length])}}this.hot.populateFromArray(h.row,h.col,b,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",b,g,w,c),this.hot.render()}else this.hot.view.render();return!0}reduceSelectionAreaIfNeeded(e){return e.row<0&&(e.row=0),e.col<0&&(e.col=0),e}getCoordsOfDragAndDropBorders(e){const r=this.hot.getSelectedRangeLast(),n=r.getBottomEndCorner();let i=e;if(this.directions.includes(Sl.vertical)&&this.directions.includes(Sl.horizontal)){const o=r.getTopStartCorner();(n.col<=e.col||o.col>=e.col)&&(i=this.hot._createCellCoords(n.row,e.col)),(n.row<e.row||o.row>e.row)&&(i=this.hot._createCellCoords(e.row,n.col))}else if(this.directions.includes(Sl.vertical))i=this.hot._createCellCoords(e.row,n.col);else if(this.directions.includes(Sl.horizontal))i=this.hot._createCellCoords(n.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){const r=this.getCoordsOfDragAndDropBorders(e);r&&this.redrawBorders(r)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(Gee,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},qee)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&this.addingStarted===!1&&this.autoInsertRow){const e=this.hot.getSelectedLast(),r=this.hot.selection.highlight.getFill().getVisualCorners(),n=this.hot.countRows();e[2]<n-1&&r[2]===n-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const r=this.hot.getData(),n=this.hot.countRows();let i;for(let o=e[2]+1;o<n;o++){for(let l=e[1];l<=e[3];l++){const u=r[o][l];if(!qt(u))return-1}const s=r[o][e[1]-1],a=r[o][e[3]+1];(!qt(s)||!qt(a))&&(i=o)}return i}addSelectionFromStartAreaToSpecificRowIndex(e,r){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(r,e[3])).commit()}setSelection(e){this.hot.selectCell(...qe(e,r=>Math.max(r,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),r=this.getIndexOfLastAdjacentFilledInRow(e);return r===-1||r===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,r),!0)}resetSelectionOfDraggedArea(){this.handleDraggedCells=0,this.hot.selection.highlight.getFill().clear()}redrawBorders(e){this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(e).commit(),this.hot.view.render()}getIfMouseWasDraggedOutside(e){const{documentElement:r}=this.hot.rootDocument,n=kr(this.hot.table).top-(this.hot.rootWindow.pageYOffset||r.scrollTop)+dr(this.hot.table),i=kr(this.hot.table).left-(this.hot.rootWindow.pageXOffset||r.scrollLeft)+ir(this.hot.table);return e.clientY>n&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>wd(ac,this,Qee).call(this)),this.eventManager.addEventListener(e,"mousemove",r=>wd(ac,this,ete).call(this,r))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=Vee(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function Xee(){this.selectAdjacent()&&this.fillIn()}function Zee(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function Jee(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function Qee(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function ete(t){const e=this.getIfMouseWasDraggedOutside(t);this.addingStarted===!1&&this.handleDraggedCells>0&&e?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function tte(t,e){R$(t,e),e.add(t)}function S$(t,e,r){R$(t,e),e.set(t,r)}function R$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lc(t,e,r){return(e=rte(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rte(t){var e=nte(t,"string");return typeof e=="symbol"?e:e+""}function nte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function E$(t,e,r){return t.set(wo(t,e),r),r}function ep(t,e){return t.get(wo(t,e))}function wo(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const CT="autoRowSize",ite=40,ote="autoRowSize";var vd=new WeakMap,bT=new WeakMap,fs=new WeakSet;class yd extends rt{static get PLUGIN_KEY(){return CT}static get PLUGIN_PRIORITY(){return ite}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),tte(this,fs),lc(this,"headerHeight",null),lc(this,"ghostTable",new p$(this.hot)),lc(this,"samplesGenerator",new Jm((r,n)=>{const i=this.hot.toPhysicalRow(r),o=this.hot.toPhysicalColumn(n);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o)||r>=0&&n>=0&&this.hot.getCellMeta(r,n).hidden)return!1;let s;return r>=0?s=this.hot.getDataAtCell(r,n):r===-1&&(s=this.hot.getColHeader(n)),{value:s}})),lc(this,"inProgress",!1),lc(this,"measuredRows",0),lc(this,"rowHeightsMap",new Js),S$(this,vd,[]),S$(this,bT,!1),this.hot.rowIndexMapper.registerMap(ote,this.rowHeightsMap),this.addHook("beforeRowResize",(r,n,i)=>wo(fs,this,T$).call(this,r,n,i))}isEnabled(){const e=this.hot.getSettings()[CT];return e===!0||$e(e)}enablePlugin(){var e=this;if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const r=this.getSetting("samplingRatio");r&&!isNaN(r)&&this.samplesGenerator.setSampleCount(parseInt(r,10)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return wo(fs,e,lte).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return wo(fs,e,ute).call(e,...i)}),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("afterFormulasValuesUpdate",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return wo(fs,e,hte).call(e,...i)}),this.addHook("beforeRender",()=>wo(fs,this,ate).call(this)),this.addHook("modifyRowHeight",(n,i)=>this.getRowHeight(i,n)),this.addHook("init",()=>wo(fs,this,cte).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,r,n)=>wo(fs,this,T$).call(this,e,r,n))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),r=this.getLastVisibleRow();if(e===-1||r===-1)return;const n=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:r},void 0,n)}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof r=="number"?{from:r,to:r}:r;if(this.hot.getColHeader(0)!==null){const s=this.samplesGenerator.generateRowSamples(-1,o);this.ghostTable.addColumnHeadersRow(s.get(-1))}Ce(i.from,i.to,s=>{let a=this.hot.toPhysicalRow(s);a===null&&(a=s),(n||this.rowHeightsMap.getValueAtIndex(a)===null)&&this.samplesGenerator.generateRowSamples(s,o).forEach((u,c)=>this.ghostTable.addRow(c,u))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((s,a)=>{s<0?this.headerHeight=a:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(s),a)})},!0),this.measuredRows=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=0;const i=this.hot.countRows()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){jg(o),this.inProgress=!1;return}this.calculateRowsHeight({from:n,to:Math.min(n+yd.CALCULATION_STEP,i)},e,r),n=n+yd.CALCULATION_STEP+1,n<i?o=Bg(s):(jg(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateRowsHeight({from:0,to:a},e,r),n=a+1),n<i?s():(this.inProgress=!1,this.hot.view.adjustElementsSize())}recalculateAllRowsHeight(){this.hot.view.isVisible()&&this.calculateAllRowsHeight({from:0,to:this.hot.countCols()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[CT];let r=yd.SYNC_CALCULATION_LIMIT;const n=this.hot.countRows()-1;return $e(e)&&(r=e.syncLimit,pH(r)?r=HN(n,r):r>>=0),Math.min(r,n)}getRowHeight(e,r){const n=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let i=r;return n!==null&&n>(r||0)&&(i=n),i}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return(e=this.hot.getFirstRenderedVisibleRow())!==null&&e!==void 0?e:-1}getLastVisibleRow(){var e;return(e=this.hot.getLastRenderedVisibleRow())!==null&&e!==void 0?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(r=>{this.rowHeightsMap.setValueAtIndex(r,null)})},!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:r,to:n}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{Ce(Math.min(r,n),Math.max(r,n),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function ste(t){const e={from:0,to:this.hot.countCols()-1};t.forEach(r=>{this.samplesGenerator.generateRowSamples(r,e).forEach((i,o)=>this.ghostTable.addRow(o,i))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((r,n)=>{const i=this.hot.toPhysicalRow(r);this.rowHeightsMap.setValueAtIndex(i,n)})},!0),this.ghostTable.clean())}function ate(){this.calculateVisibleRowsHeight(),this.inProgress||(wo(fs,this,ste).call(this,ep(vd,this)),E$(vd,this,[]))}function T$(t,e,r){let n=t;return r&&(this.calculateRowsHeight(e,void 0,!0),n=this.getRowHeight(e)),n}function lte(t,e){e||this.recalculateAllRowsHeight()}function ute(t){const e=t.reduce((r,n)=>{let[i]=n;return r.indexOf(i)===-1&&r.push(i),r},[]);ep(vd,this).push(...e)}function cte(){this.recalculateAllRowsHeight(),E$(bT,this,!0)}function hte(t){if(!ep(bT,this))return;const e=t.reduce((r,n)=>{var i;const o=(i=n.address)===null||i===void 0?void 0:i.row;if(Number.isInteger(o)){const s=this.hot.toVisualRow(o);r.indexOf(s)===-1&&r.push(s)}return r},[]);ep(vd,this).push(...e)}const{getListWithInsertedItems:dte,getListWithRemovedItems:fte}=rk("physicallyIndexed");class gte extends cl{constructor(){super(e=>e)}insert(e,r){const n=NR(this.indexedValues,r);this.indexedValues=dte(n,e,r,this.initValueOrFn),super.insert(e,r)}remove(e){const r=fte(this.indexedValues,e);this.indexedValues=HR(r,e),super.remove(e)}}const{getListWithInsertedItems:mte,getListWithRemovedItems:pte}=rk("physicallyIndexed");class wte extends cl{constructor(){super(e=>e)}insert(e,r){this.indexedValues=mte(this.indexedValues,e,r,(n,i)=>this.getNextValue(i)),super.insert(e,r)}remove(e){this.indexedValues=pte(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function vte(t,e){yte(t,e),e.add(t)}function yte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cte(t,e,r){return(e=bte(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bte(t){var e=Ste(t,"string");return typeof e=="symbol"?e:e+""}function Ste(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rte(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const _$="bindRowsWithHeaders",Ete=210,Tte="loose",M$=new Map([["loose",gte],["strict",wte]]);var P$=new WeakSet;class _te extends rt{constructor(){super(...arguments),vte(this,P$),Cte(this,"headerIndexes",null)}static get PLUGIN_KEY(){return _$}static get PLUGIN_PRIORITY(){return Ete}isEnabled(){return!!this.hot.getSettings()[_$]}enablePlugin(){var e;if(this.enabled)return;const r=(e=M$.get(this.getSetting()))!==null&&e!==void 0?e:M$.get(Tte);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new r),this.addHook("modifyRowHeader",n=>Rte(P$,this,Mte).call(this,n)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function Mte(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function Pte(t,e){I$(t,e),e.add(t)}function Ite(t,e,r){I$(t,e),e.set(t,r)}function I$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function O$(t,e,r){return(e=Ote(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ote(t){var e=xte(t,"string");return typeof e=="symbol"?e:e+""}function xte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function x$(t,e){return t.get(uc(t,e))}function ST(t,e,r){return t.set(uc(t,e),r),r}function uc(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const tp="collapsibleColumns",Ate=290,Hte=["nestedHeaders"],cc="collapsibleIndicator",A$=tp,H$=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var hc=new WeakMap,Cd=new WeakSet;class Nte extends rt{constructor(){super(...arguments),Pte(this,Cd),O$(this,"nestedHeadersPlugin",null),O$(this,"headerStateManager",null),Ite(this,hc,null)}static get PLUGIN_KEY(){return tp}static get PLUGIN_PRIORITY(){return Ate}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[tp,...Hte]}isEnabled(){return!!this.hot.getSettings()[tp]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:r}=this.hot.getSettings();r||st("You need to configure the Nested Headers plugin in order to use collapsible headers."),ST(hc,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>uc(Cd,this,Lte).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return uc(Cd,e,$te).call(e,...i)}),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return uc(Cd,e,Dte).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(n,i,o)=>uc(Cd,this,kte).call(this,n,i,o)),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();typeof e=="boolean"?this.headerStateManager.mapState(r=>({collapsible:r.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),ST(hc,this,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;const{row:r,col:n}=this.hot.getSelectedRangeLast().highlight,{collapsible:i,isCollapsed:o,columnIndex:s}=(e=this.headerStateManager.getHeaderTreeNodeData(r,n))!==null&&e!==void 0?e:{};if(i)return o?this.expandSection({row:r,col:s}):this.collapseSection({row:r,col:s}),!1},runOnlyIf:()=>{var e,r;return((e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.isSingle())&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight.isHeader())},group:A$,relativeToGroup:Qs,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(A$)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,r=this.hot.view._wt.wtTable.THEAD,n=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,i=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,o=function(s){s&&s.parentNode.removeChild(s)};Ce(0,e-1,s=>{const a=r.childNodes[s],l=n.childNodes[s],u=i?i.childNodes[s]:null;Ce(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${cc}`);o(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${cc}`),o(h)),i&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${cc}`),o(h))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const r=this.headerStateManager.mapNodes(n=>{const{collapsible:i,origColspan:o,headerLevel:s,columnIndex:a,isCollapsed:l}=n;if(i===!0&&o>1&&(l&&e==="expand"||!l&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(s),col:a}});this.toggleCollapsibleSection(r,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,r){if(!H$.has(r))throw new Error(`Unsupported action is passed (${r}).`);if(!Array.isArray(e))return;const n=za(e,f=>{let{row:g}=f;return g<0});let i=n.length>0;k(n,f=>{var g;let{row:w,col:v}=f;const{collapsible:b,isCollapsed:p}=(g=this.headerStateManager.getHeaderSettings(w,v))!==null&&g!==void 0?g:{};if(!b||p&&r==="collapse"||!p&&r==="expand")return i=!1,!1});const o=[],s=[];i&&k(n,f=>{let{row:g,col:w}=f;const{colspanCompensation:v,affectedColumns:b,rollbackModification:p}=this.headerStateManager.triggerNodeModification(r,g,w);v>0&&(s.push(...b),o.push(p))});const a=this.getCollapsedColumns();let l=[];r==="collapse"?l=PK([...a,...s]):r==="expand"&&(l=za(a,f=>!s.includes(f)));const u=H$.get(r);if(this.hot.runHooks(u.beforeHook,a,l,i)===!1){k(o,f=>{f()});return}this.hot.batchExecution(()=>{k(s,f=>{x$(hc,this).setValueAtIndex(this.hot.toPhysicalColumn(f),u.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==a.length,d=this.hot.getSelectedRangeLast();if(r==="collapse"&&h&&d){const{row:f,col:g}=d.highlight;if((this.hot.rowIndexMapper.isHidden(f)||this.hot.columnIndexMapper.isHidden(g))&&s.includes(g)){const v=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,b=g>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(g,1,!0):g;v!==null&&b!==null&&this.hot.selectCell(v,b)}}this.hot.runHooks(u.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return x$(hc,this).getHiddenIndexes()}destroy(){ST(hc,this,null),super.destroy()}}function Dte(t,e,r){var n;const{collapsible:i,origColspan:o,isCollapsed:s}=(n=this.headerStateManager.getHeaderSettings(r,t))!==null&&n!==void 0?n:{},a=i&&o>1&&t>=this.hot.getSettings().fixedColumnsStart,l=this.hot.getSettings().ariaTags;let u=e.querySelector(`.${cc}`);if(Pu(e,[ei("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),oe(u,cc),e.querySelector("div:first-child").appendChild(u)),Ee(u,["collapsed","expanded"]),s?(oe(u,"collapsed"),Za(u,"+"),l&&Pe(e,...ei(!1))):(oe(u,"expanded"),Za(u,"-"),l&&Pe(e,...ei(!0))),l&&Pe(u,...Ga());else{var c;(c=u)===null||c===void 0||c.remove()}}function kte(t,e){_e(t.target,cc)&&(_e(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):_e(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),_i(t))}function Lte(){this.updatePlugin()}function $te(t,e){e||this.updatePlugin()}function Rl(t,e,r){return(e=Fte(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fte(t){var e=Vte(t,"string");return typeof e=="symbol"?e:e+""}function Vte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Wte=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],Bte=!1,jte=!0,Ute=!0;class zte{constructor(e,r){Rl(this,"hot",void 0),Rl(this,"sortingStates",new dm),Rl(this,"sortEmptyCells",Bte),Rl(this,"indicator",jte),Rl(this,"headerAction",Ute),Rl(this,"compareFunctionFactory",void 0),Rl(this,"mapName",void 0),this.hot=e,this.mapName=r,this.hot.columnIndexMapper.registerMap(r,this.sortingStates)}updateAllColumnsProperties(e){$e(e)&&Fe(e,(r,n)=>{Wte.includes(n)&&(this[n]=r)})}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return typeof this.compareFunctionFactory=="function"&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var r;return(r=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))===null||r===void 0?void 0:r.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(r=>{let[n]=r;return n===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return $e(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(r=>{let[n,i]=r;return{column:this.hot.toVisualColumn(n),...i}})}getColumnSortState(e){const r=this.getSortOrderOfColumn(e);if(we(r))return{column:e,sortOrder:r}}setSortStates(e){this.sortingStates.clear();for(let r=0;r<e.length;r+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[r].column),{sortOrder:e[r].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}function N$(t,e,r){const n=e.locale;return function(i,o){const{sortEmptyCells:s}=r;return typeof i=="string"&&(i=i.toLocaleLowerCase(n)),typeof o=="string"&&(o=o.toLocaleLowerCase(n)),i===o?vo:qt(i)?qt(o)?vo:s&&t==="asc"?Bt:jt:qt(o)?s&&t==="asc"?jt:Bt:isNaN(i)&&!isNaN(o)?t==="asc"?jt:Bt:!isNaN(i)&&isNaN(o)||(isNaN(i)||isNaN(o)||(i=parseFloat(i),o=parseFloat(o)),i<o)?t==="asc"?Bt:jt:i>o?t==="asc"?jt:Bt:vo}}const D$="default";function Yte(t,e,r){return function(n,i){const o=parseFloat(n),s=parseFloat(i),{sortEmptyCells:a}=r;if(o===s||isNaN(o)&&isNaN(s))return vo;if(a){if(qt(n))return t==="asc"?Bt:jt;if(qt(i))return t==="asc"?jt:Bt}return isNaN(o)?jt:isNaN(s)?Bt:o<s?t==="asc"?Bt:jt:o>s?t==="asc"?jt:Bt:vo}}const Gte="numeric";function qte(t,e,r){const n=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:o}=r;return function(s,a){const l=qt(s),u=qt(a),c=l?i:s,h=u?i:a,d=c===i||c===n,f=h===i||h===n;if(o===!1){if(l&&u===!1)return jt;if(l===!1&&u)return Bt}return d===!1&&f?t==="asc"?Bt:jt:d&&f===!1?t==="asc"?jt:Bt:d===!1&&f===!1?N$(t,e,r)(s,a):c===i&&h===n?t==="asc"?Bt:jt:c===n&&h===i?t==="asc"?jt:Bt:vo}}const Kte="checkbox";function Xte(t,e,r){return j$(t,e.dateFormat,r)}const Zte="date";function Jte(t,e,r){return j$(t,e.timeFormat,r)}const Qte="time",{register:bd,getItem:k$,hasItem:ere}=Mi("sorting.compareFunctionFactory"),{register:L$,getItem:tre}=Mi("sorting.mainSortComparator");function $$(t){return ere(t)?k$(t):k$(D$)}bd(Kte,qte),bd(Zte,Xte),bd(D$,N$),bd(Gte,Yte),bd(Qte,Jte);const vo=0,Bt=-1,jt=1;function rre(t,e){const r=tre(e);for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];t.sort(r(...i))}const rp="asc",np="desc",F$="colHeader";function nre(t){if($e(t)===!1)return!1;const{column:e,sortOrder:r}=t;return Number.isInteger(e)&&[rp,np].includes(r)}function ire(t){if(t.some(r=>nre(r)===!1))return!1;const e=t.map(r=>{let{column:n}=r;return n});return new Set(e).size===e.length}function V$(t){if(t!==np)return t===rp?np:rp}function W$(t){return t.querySelector(`.${F$}`)}function B$(t,e){if(t<0||!e.parentNode)return!1;const r=e.parentNode.parentNode.childNodes;return Array.from(r).indexOf(e.parentNode)-r.length===-1}function RT(t,e,r){return t===-1&&e>=0&&Qa(r)===!1}function j$(t,e,r){return function(n,i){const{sortEmptyCells:o}=r;if(n===i)return vo;if(qt(n))return qt(i)?vo:o&&t==="asc"?Bt:jt;if(qt(i))return o&&t==="asc"?jt:Bt;const s=se(n,e),a=se(i,e);return s.isValid()?a.isValid()?a.isAfter(s)?t==="asc"?Bt:jt:a.isBefore(s)?t==="asc"?jt:Bt:vo:Bt:jt}}function ore(t,e){st(at`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
735
+ Only \`${t}\` will work. The \`${e}\` plugin will remain disabled.`)}const sre="ascending",are="descending",U$="indicatorDisabled",z$="columnSorting",Y$="sortAction",G$=new Map([[rp,sre],[np,are]]);function lre(t,e,r,n){const i=[z$];if(n&&i.push(Y$),r===!1)return i.push(U$),i;const o=t.getSortOrderOfColumn(e);return we(o)&&i.push(G$.get(o)),i}function ure(){return Array.from(G$.values()).concat(Y$,U$,z$)}function cre(t,e){return function(r,n){const[,...i]=r,[,...o]=n;return function(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.columnSorting;return(d.compareFunctionFactory?d.compareFunctionFactory:$$(u.type))(l,u,d)(c,h)}(0)}}function hre(t,e){dre(t,e),e.add(t)}function dre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ip(t,e,r){return(e=fre(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fre(t){var e=gre(t,"string");return typeof e=="symbol"?e:e+""}function gre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dc(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const op="columnSorting",mre=50,sp="append",pre="replace",q$=op;L$(op,cre),de.getSingleton().register("beforeColumnSort"),de.getSingleton().register("afterColumnSort");const Sd=new WeakMap;var El=new WeakSet;class K$ extends rt{constructor(){super(...arguments),hre(this,El),ip(this,"columnStatesManager",null),ip(this,"columnMetaCache",null),ip(this,"pluginKey",op),ip(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return op}static get PLUGIN_PRIORITY(){return mre}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;if(Sd.has(this.hot)&&Sd.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),ore(Sd.get(this.hot),this.pluginKey);return}this.enabled||(Sd.set(this.hot,this.pluginKey),this.columnStatesManager=new zte(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new Js(r=>{let n=this.hot.toVisualColumn(r);return n===null&&(n=r),this.getMergedPluginSettings(n)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(r,n)=>dc(El,this,wre).call(this,r,n)),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return dc(El,e,yre).call(e,...n)}),this.addHook("afterOnCellMouseDown",(r,n)=>this.onAfterOnCellMouseDown(r,n)),this.addHook("afterInit",()=>dc(El,this,ET).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return dc(El,e,vre).call(e,...n)}),this.hot.view&&dc(El,this,ET).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(r,n)=>{const i=W$(n);B$(r,n)===!1||i===null||this.updateHeaderClasses(i)};Sd.delete(this.hot),this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("afterGetColHeader",e)}),this.hot.batchExecution(()=>{this.indexesSequenceCache!==null&&(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginKey),this.indexesSequenceCache=null)},!0),this.hot.columnIndexMapper.unregisterMap(`${this.pluginKey}.columnMeta`),this.columnStatesManager.destroy(),this.columnMetaCache=null,this.columnStatesManager=null,this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,r;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingle())&&this.hot.selection.isCellVisible(n)&&n.row===-1&&n.col>=0},relativeToGroup:Qs,position:"before",group:q$})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(q$)}sort(e){const r=this.getSortConfig(),n=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(n);this.hot.runHooks("beforeColumnSort",r,n,i)!==!1&&(r.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new nk),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(n),this.sortByPresetSortStates(n),this.saveAllSortSettings(n)),this.hot.runHooks("afterColumnSort",r,i?n:r,i),i&&this.hot.render())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return we(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const r=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(r)&&this.columnStatesManager.setSortStates(r)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const r=this.hot.countCols();return ire(e)&&e.every(n=>{let{column:i}=n;return i<=r&&i>=0})}saveAllSortSettings(e){const r=this.columnStatesManager.getAllColumnsProperties(),n=i=>{let{column:o,...s}=i;return{column:this.hot.toPhysicalColumn(o),...s}};r.initialConfig=qe(e,n),this.hot.runHooks("persistentStateSave","columnSorting",r)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const r=e.value,n=i=>{let{column:o,...s}=i;return{column:this.hot.toVisualColumn(o),...s}};return we(r)&&Array.isArray(r.initialConfig)&&(r.initialConfig=qe(r.initialConfig,n)),r}getColumnNextConfig(e){const r=this.columnStatesManager.getSortOrderOfColumn(e);if(we(r)){const i=V$(r);return we(i)?{column:e,sortOrder:i}:void 0}const n=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<n)return{column:e,sortOrder:V$()}}getNextSortConfig(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sp;const n=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=n!==-1,o=this.getSortConfig(),s=this.getColumnNextConfig(e);if(i){if($t(s))return[...o.slice(0,n),...o.slice(n+1)];if(r===sp)return[...o.slice(0,n),...o.slice(n+1),s];if(r===pre)return[...o.slice(0,n),s,...o.slice(n+1)]}return we(s)?o.concat(s):o}getPluginColumnConfig(e){if($e(e)){const r=e[this.pluginKey];if($e(r))return r}return{}}getMergedPluginSettings(e){const r=this.hot.getSettings()[this.pluginKey],n=this.columnStatesManager.getAllColumnsProperties(),i=this.hot.getCellMeta(0,e),o=Object.getPrototypeOf(i);return Array.isArray(o.columns)?Object.assign(n,r,this.getPluginColumnConfig(o.columns[e])):ht(o.columns)?Object.assign(n,r,this.getPluginColumnConfig(o.columns(e))):Object.assign(n,r)}getFirstCellSettings(e){const r=this.hot.getCellMeta(0,e),n=Object.create(r);return n[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),n}getNumberOfRowsToSort(e){const r=this.hot.getSettings();return r.maxRows<=e?r.maxRows:e-r.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),e.length===0)return;const r=[],n=this.hot.countRows(),i=u=>qe(e,c=>this.hot.getDataAtCell(u,c.column));for(let u=0;u<this.getNumberOfRowsToSort(n);u+=1)r.push([this.hot.toPhysicalRow(u)].concat(i(u)));const o=qe(r,u=>u[0]);rre(r,this.pluginKey,qe(e,u=>u.sortOrder),qe(e,u=>this.getFirstCellSettings(u.column)));for(let u=r.length;u<n;u+=1)r.push([u].concat(i(u)));const s=qe(r,u=>u[0]),a=new Map(qe(o,(u,c)=>[u,s[c]])),l=qe(this.hot.rowIndexMapper.getIndexesSequence(),u=>a.has(u)?a.get(u):u);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if($e(e)){this.columnStatesManager.updateAllColumnsProperties(e);const r=e.initialConfig;(Array.isArray(r)||$e(r))&&this.sort(r)}else this.hot.render()}updateHeaderClasses(e){if(Ee(e,ure()),this.enabled!==!1){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];oe(e,lre(...n))}}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),we(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,r){return this.getFirstCellSettings(r)[this.pluginKey].headerAction&&_e(e.target,F$)}onAfterOnCellMouseDown(e,r){if(RT(r.row,r.col,e)!==!1&&this.wasClickableHeaderClicked(e,r.col)){this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(r.col));const n=this.hot.getActiveEditor(),i=this.getColumnNextConfig(r.col);n!=null&&n.isOpened()&&this.hot.getCellValidator(n.row,n.col)?this.hot.addHookOnce("postAfterValidate",()=>{this.sort(i)}):this.sort(i)}}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function ET(){const t=this.getAllSavedSortSettings();if($e(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function wre(t,e){const r=W$(e);if(B$(t,e)===!1||r===null)return;const n=this.getFirstCellSettings(t)[this.pluginKey],i=n.indicator,o=n.headerAction;if(this.updateHeaderClasses(r,this.columnStatesManager,t,i,o),this.hot.getSettings().ariaTags){const s=this.columnStatesManager.getSortOrderOfColumn(t);Pe(e,...KK(s?`${s}ending`:"none"))}}function vre(t){t===!0&&this.hot.view&&dc(El,this,ET).call(this)}function yre(t,e,r,n){RT(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(n.column=!0)}function Tl(t,e,r){return(e=Cre(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cre(t){var e=bre(t,"string");return typeof e=="symbol"?e:e+""}function bre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Sre{constructor(e,r){Tl(this,"plugin",void 0),Tl(this,"hot",void 0),Tl(this,"endpoints",[]),Tl(this,"settings",void 0),Tl(this,"settingsType","array"),Tl(this,"currentEndpoint",null),Tl(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=r}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){const r=[];let n=e;if(!n&&typeof this.settings=="function"){this.settingsType="function";return}return n||(n=this.settings),k(n,i=>{const o={};this.assignSetting(i,o,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(i,o,"reversedRowCoords",!1),this.assignSetting(i,o,"destinationRow",new Error(`
736
+ You must provide a destination row for the Column Summary plugin in order to work properly!
737
+ `)),this.assignSetting(i,o,"destinationColumn",new Error(`
738
+ You must provide a destination column for the Column Summary plugin in order to work properly!
739
+ `)),this.assignSetting(i,o,"sourceColumn",i.destinationColumn),this.assignSetting(i,o,"type","sum"),this.assignSetting(i,o,"forceNumeric",!1),this.assignSetting(i,o,"suppressDataTypeErrors",!0),this.assignSetting(i,o,"customFunction",null),this.assignSetting(i,o,"readOnly",!0),this.assignSetting(i,o,"roundFloat",!1),r.push(o)}),r}assignSetting(e,r,n,i){if(n==="ranges"&&e[n]===void 0){r[n]=i;return}else if(n==="ranges"&&e[n].length===0)return;if(e[n]===void 0){if(i instanceof Error)throw i;r[n]=i}else n==="destinationRow"&&r.reversedRowCoords?r[n]=this.hot.countRows()-e[n]-1:r[n]=e[n]}resetSetupBeforeStructureAlteration(e,r,n){if(this.settingsType!=="function")return;const i=e.indexOf("row")>-1?"row":"col",o=this.getAllEndpoints();k(o,s=>{i==="row"&&s.destinationRow>=r&&(e==="insert_row"?s.alterRowOffset=n:e==="remove_row"&&(s.alterRowOffset=-1*n)),i==="col"&&s.destinationColumn>=r&&(e==="insert_col"?s.alterColumnOffset=n:e==="remove_col"&&(s.alterColumnOffset=-1*n))}),this.resetAllEndpoints(o,!1)}resetSetupAfterStructureAlteration(e,r,n,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(this.settingsType==="function"){const d=()=>(this.hot.removeHook("beforeViewRender",d),this.refreshAllEndpoints());this.hot.addHookOnce("beforeViewRender",d);return}const a=e.indexOf("row")>-1?"row":"col",l=e.indexOf("remove")>-1?-1:1,u=this.getAllEndpoints(),c=e.indexOf("move_row")===0,h=r;k(u,d=>{a==="row"&&d.destinationRow>=h&&(d.alterRowOffset=l*n),a==="col"&&d.destinationColumn>=h&&(d.alterColumnOffset=l*n)}),this.resetAllEndpoints(u,!c),c?k(u,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):k(u,d=>{this.shiftEndpointCoordinates(d,h)}),s&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,r,n,i){k(e.ranges,o=>{o[1]&&(r>=o[0]&&r<=o[1]?n>o[1]?o[1]+=i:n<o[0]&&(o[0]-=i):n>=o[0]&&n<=o[1]&&(o[1]-=i,r<=o[0]&&(o[0]+=1,o[1]+=1)))})}recreatePhysicalRanges(e){const r=e.ranges,n=[],i=[];k(r,o=>{const s=[];if(o[1])for(let a=o[0];a<=o[1];a++)s.push(this.hot.toPhysicalRow(a));else s.push(this.hot.toPhysicalRow(o[0]));i.push(s)}),k(i,o=>{let s=[];k(o,(a,l)=>{l===0?s.push(a):o[l]!==o[l-1]+1&&(s.push(o[l-1]),n.push(s),s=[],s.push(a)),l===o.length-1&&(s.push(a),n.push(s))})}),e.ranges=n}shiftEndpointCoordinates(e,r){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,k(e.ranges,n=>{k(n,(i,o)=>{i>=r&&(n[o]+=e.alterRowOffset||0)})})):e.alterColumnOffset&&e.alterColumnOffset!==0&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getAllEndpoints(),r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.some(i=>{const o=i.alterRowOffset||0,s=i.alterColumnOffset||0;return i.destinationRow+o>=this.hot.countRows()||i.destinationColumn+s>=this.hot.countCols()})||(this.cellsToSetCache=[],k(e,i=>{this.resetEndpointValue(i,r)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],k(this.getAllEndpoints(),e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")}),this.currentEndpoint=null,this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const r=[];this.cellsToSetCache=[],k(e,(n,i,o)=>{`${n[2]||""}`!=`${n[3]}`&&k(this.getAllEndpoints(),(s,a)=>{this.hot.propToCol(o[i][1])===s.sourceColumn&&r.indexOf(a)===-1&&r.push(a)})}),k(r,n=>{this.refreshEndpoint(this.getEndpoint(n))}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach(e=>{const r=this.hot.toVisualRow(e.destinationRow);if(r!==null){const n=this.hot.getCellMeta(r,e.destinationColumn);n.readOnly=e.readOnly,n.className="columnSummaryResult"}})}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(r?n:0)),this.hot.toVisualColumn(e.destinationColumn+(r?i:0)),""])}setEndpointValue(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols()){this.throwOutOfBoundsWarning();return}const o=this.hot.toVisualRow(e.destinationRow);if(o!==null){const s=this.hot.getCellMeta(o,e.destinationColumn);(r==="init"||s.readOnly!==e.readOnly)&&(s.readOnly=e.readOnly,s.className="columnSummaryResult")}if((e.roundFloat===!0||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const s=e.roundFloat;let a=0;Number.isInteger(s)&&(a=Math.min(Math.max(0,s),100)),e.result=e.result.toFixed(a)}n?this.hot.setDataAtCell(i,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([i,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){st("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function TT(t){return t==null||isNaN(t)}function Rre(t,e){Ere(t,e),e.add(t)}function Ere(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tre(t,e,r){return(e=_re(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _re(t){var e=Mre(t,"string");return typeof e=="symbol"?e:e+""}function Mre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ap(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const _T="columnSummary",Pre=220;var Rd=new WeakSet;class Ire extends rt{constructor(){super(...arguments),Rre(this,Rd),Tre(this,"endpoints",null)}static get PLUGIN_KEY(){return _T}static get PLUGIN_PRIORITY(){return Pre}isEnabled(){return!!this.hot.getSettings()[_T]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[_T],this.endpoints=new Sre(this,this.settings),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ap(Rd,e,Ore).call(e,...n)}),this.addHook("afterChange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ap(Rd,e,Are).call(e,...n)}),this.addHook("afterUpdateSettings",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ap(Rd,e,xre).call(e,...n)}),this.addHook("beforeCreateRow",(r,n,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",r,n,null,i)),this.addHook("beforeCreateCol",(r,n,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",r,n,null,i)),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...n)}),this.addHook("beforeRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...n)}),this.addHook("afterCreateRow",(r,n,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",r,n,null,i)),this.addHook("afterCreateCol",(r,n,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",r,n,null,i)),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...n)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...n)}),this.addHook("afterRowMove",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ap(Rd,e,Hre).call(e,...n)}),super.enablePlugin())}disablePlugin(){this.endpoints=null,this.settings=null,this.currentEndpoint=null,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.endpoints.initEndpoints(),super.updatePlugin()}calculate(e){switch(e.type.toLowerCase()){case"sum":e.result=this.calculateSum(e);break;case"min":e.result=this.calculateMinMax(e,e.type);break;case"max":e.result=this.calculateMinMax(e,e.type);break;case"count":e.result=this.countEntries(e);break;case"average":e.result=this.calculateAverage(e);break;case"custom":e.result=e.customFunction.call(this,e);break}}calculateSum(e){let r=0;return Fe(e.ranges,n=>{r+=this.getPartialSum(n,e.sourceColumn)}),r}getPartialSum(e,r){let n=0,i=e[1]||e[0],o=null,s=0;do{if(o=this.getCellValue(i,r),o=TT(o)?null:o,o!==null){const a=(`${o}`.split(".")[1]||[]).length||1;a>s&&(s=a)}n+=o||0,i-=1}while(i>=e[0]);return Math.round(n*10**s)/10**s}calculateMinMax(e,r){let n=null;return Fe(e.ranges,i=>{const o=this.getPartialMinMax(i,e.sourceColumn,r);if(n===null&&o!==null&&(n=o),o!==null)switch(r){case"min":n=Math.min(n,o);break;case"max":n=Math.max(n,o);break}}),n===null?"Not enough data":n}getPartialMinMax(e,r,n){let i=null,o=e[1]||e[0],s;do{if(s=this.getCellValue(o,r),s=TT(s)?null:s,i===null)i=s;else if(s!==null)switch(n){case"min":i=Math.min(i,s);break;case"max":i=Math.max(i,s);break}o-=1}while(o>=e[0]);return i}countEmpty(e,r){let n,i=0,o=e[1]||e[0];do n=this.getCellValue(o,r),n=TT(n)?null:n,n===null&&(i+=1),o-=1;while(o>=e[0]);return i}countEntries(e){let r=0;const n=e.ranges;return Fe(n,i=>{const o=i[1]===void 0?1:i[1]-i[0]+1,s=this.countEmpty(i,e.sourceColumn);r+=o,r-=s}),r}calculateAverage(e){const r=this.calculateSum(e),n=this.countEntries(e);return r/n}getCellValue(e,r){const n=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(r);let o=this.hot.getSourceDataAtCell(e,r),s="";if(n!==null&&i!==null&&(s=this.hot.getCellMeta(n,i).className||""),s.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&(typeof o=="string"&&(o=o.replace(/,/,".")),o=parseFloat(o)),isNaN(o)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(at`ColumnSummary plugin: cell at (${e}, ${r}) is not in a\x20
740
+ numeric format. Cannot do the calculation.`);return o}}function Ore(){this.endpoints.initEndpoints()}function xre(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function Are(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function Hre(t,e){this.endpoints.resetSetupBeforeStructureAlteration("move_row",t[0],t.length,t,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",e,t.length,t,this.pluginName)}function Nre(t,e){X$(t,e),e.add(t)}function MT(t,e,r){X$(t,e),e.set(t,r)}function X$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fc(t,e){return t.get(IT(t,e))}function PT(t,e,r){return t.set(IT(t,e),r),r}function IT(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var lp=new WeakMap,up=new WeakMap,cp=new WeakMap,Z$=new WeakSet;class J${constructor(){Nre(this,Z$),MT(this,lp,!0),MT(this,up,null),MT(this,cp,new ResizeObserver(e=>IT(Z$,this,Dre).call(this,e)))}setObservedElement(e){PT(up,this,e)}unobserve(){fc(cp,this).unobserve(fc(up,this))}observe(){PT(lp,this,!0),fc(cp,this).observe(fc(up,this))}destroy(){fc(cp,this).disconnect()}}function Dre(t){if(fc(lp,this)||!Array.isArray(t)||!t.length){PT(lp,this,!1);return}t.forEach(e=>{let{borderBoxSize:r}=e;const{inlineSize:n,blockSize:i}=r[0];this.runLocalHooks("resize",n,i)})}wt(J$,Ar);function _l(t,e,r){kre(t,e),e.set(t,r)}function kre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vt(t,e){return t.get(Q$(t,e))}function gs(t,e,r){return t.set(Q$(t,e),r),r}function Q$(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Ml=new WeakMap,OT=new WeakMap,ms=new WeakMap,ra=new WeakMap,na=new WeakMap,hp=new WeakMap,gc=new WeakMap;class Pl{static get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"}static get CLASS_EDITOR(){return"htComments"}static get CLASS_INPUT(){return"htCommentTextArea"}static get CLASS_CELL(){return"htCommentCell"}constructor(e,r){var n=this;_l(this,Ml,void 0),_l(this,OT,!1),_l(this,ms,null),_l(this,ra,void 0),_l(this,na,void 0),_l(this,hp,!0),_l(this,gc,new J$),gs(Ml,this,e),gs(OT,this,r),gs(ra,this,this.createEditor()),gs(na,this,vt(ra,this).style),vt(gc,this).setObservedElement(this.getInputElement()),vt(gc,this).addLocalHook("resize",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.runLocalHooks("resize",...o)}),this.hide()}setPosition(e,r){vt(na,this).left=`${e}px`,vt(na,this).top=`${r}px`}setSize(e,r){if(e&&r){const n=this.getInputElement();n.style.width=`${e}px`,n.style.height=`${r}px`}}getSize(){return{width:ir(this.getInputElement()),height:dr(this.getInputElement())}}observeSize(){vt(gc,this).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const r=this.getInputElement();r.readOnly=e}show(){vt(na,this).display="block",gs(hp,this,!1)}hide(){vt(gc,this).unobserve(),vt(hp,this)||(vt(na,this).display="none"),gs(hp,this,!0)}isVisible(){return vt(na,this).display==="block"}setValue(){const r=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")||"";this.getInputElement().value=r}getValue(){return this.getInputElement().value}isFocused(){return vt(Ml,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=vt(Ml,this).createElement("div"),r=vt(Ml,this).createElement("textarea");return e.style.display="none",gs(ms,this,vt(Ml,this).createElement("div")),vt(ms,this).setAttribute("dir",vt(OT,this)?"rtl":"ltr"),oe(vt(ms,this),Pl.CLASS_EDITOR_CONTAINER),vt(Ml,this).body.appendChild(vt(ms,this)),oe(e,Pl.CLASS_EDITOR),oe(r,Pl.CLASS_INPUT),r.setAttribute("data-hot-input",!0),e.appendChild(r),vt(ms,this).appendChild(e),e}getInputElement(){return vt(ra,this).querySelector(`.${Pl.CLASS_INPUT}`)}getEditorElement(){return vt(ra,this)}destroy(){const e=vt(ms,this)?vt(ms,this).parentNode:null;vt(ra,this).parentNode.removeChild(vt(ra,this)),gs(ra,this,null),gs(na,this,null),vt(gc,this).destroy(),e&&e.removeChild(vt(ms,this))}}wt(Pl,Ar);function xT(t,e,r){return(e=Lre(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lre(t){var e=$re(t,"string");return typeof e=="symbol"?e:e+""}function $re(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Fre=250,Vre=250;class eF{constructor(e){xT(this,"wasLastActionShow",!0),xT(this,"showDebounced",null),xT(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},Vre)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fre;this.showDebounced=Vg(r=>{this.wasLastActionShow&&this.runLocalHooks("show",r.from.row,r.from.col)},e)}destroy(){this.clearLocalHooks()}}wt(eF,Ar);function Wre(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function Bre(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function Il(t,e){const r={};return k(t,n=>{n.forAll((i,o)=>{i>=0&&o>=0&&(r[i]||(r[i]=[]),r[i][o]=e(i,o))})}),r}function ia(t,e,r,n,i){k(t,o=>{o.forAll((s,a)=>{s>=0&&a>=0&&jre(s,a,e,r,n,i)})})}function jre(t,e,r,n,i,o){const s=i(t,e);let a=n;s.className&&(r==="vertical"?a=Wre(s.className,n):a=Bre(s.className,n)),o(t,e,"className",a)}function tF(t){return`<span class="selected">✓</span>${t}`}function dp(t,e){let r=!1;return Array.isArray(t)&&k(t,n=>(n.forAll((i,o)=>{if(i>=0&&o>=0&&e(i,o))return r=!0,!1}),r)),r}function fp(t,e){const r={top:0,left:0};if(e!==t.ownerDocument){const{frameElement:n}=e.defaultView,{top:i,left:o}=n.getBoundingClientRect();r.top=i,r.left=o}return r}const We="---------";function Ure(){return{name:We}}const ui="alignment";function zre(){return{key:ui,name(){return this.getTranslatedPhrase(lE)},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()?!0:!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${ui}:left`,name(){return this.getTranslatedPhrase(uE)},callback(){const t=this.getSelectedRange(),e=Il(t,(i,o)=>this.getCellMeta(i,o).className),r="horizontal",n="htLeft";this.runHooks("beforeCellAlignment",e,t,r,n),ia(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ui}:center`,name(){return this.getTranslatedPhrase(cE)},callback(){const t=this.getSelectedRange(),e=Il(t,(i,o)=>this.getCellMeta(i,o).className),r="horizontal",n="htCenter";this.runHooks("beforeCellAlignment",e,t,r,n),ia(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ui}:right`,name(){return this.getTranslatedPhrase(hE)},callback(){const t=this.getSelectedRange(),e=Il(t,(i,o)=>this.getCellMeta(i,o).className),r="horizontal",n="htRight";this.runHooks("beforeCellAlignment",e,t,r,n),ia(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ui}:justify`,name(){return this.getTranslatedPhrase(dE)},callback(){const t=this.getSelectedRange(),e=Il(t,(i,o)=>this.getCellMeta(i,o).className),r="horizontal",n="htJustify";this.runHooks("beforeCellAlignment",e,t,r,n),ia(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{name:We},{key:`${ui}:top`,name(){return this.getTranslatedPhrase(fE)},callback(){const t=this.getSelectedRange(),e=Il(t,(i,o)=>this.getCellMeta(i,o).className),r="vertical",n="htTop";this.runHooks("beforeCellAlignment",e,t,r,n),ia(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ui}:middle`,name(){return this.getTranslatedPhrase(gE)},callback(){const t=this.getSelectedRange(),e=Il(t,(i,o)=>this.getCellMeta(i,o).className),r="vertical",n="htMiddle";this.runHooks("beforeCellAlignment",e,t,r,n),ia(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ui}:bottom`,name(){return this.getTranslatedPhrase(mE)},callback(){const t=this.getSelectedRange(),e=Il(t,(i,o)=>this.getCellMeta(i,o).className),r="vertical",n="htBottom";this.runHooks("beforeCellAlignment",e,t,r,n),ia(t,r,n,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1}]}}}const gp="clear_column";function Yre(){return{key:gp,name(){return this.getTranslatedPhrase(qR)},callback(t,e){const r=e[0].start.col,n=e[0].end.col;this.countRows()&&this.populateFromArray(0,r,[[null]],Math.max(e[0].start.row,e[0].end.row),n,"ContextMenu.clearColumn")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let e=!1;return t.forAll((r,n)=>{if(r<0||n<0)return!0;const{readOnly:i}=this.getCellMeta(r,n);return i?!0:(e=!0,!1)}),!e}}}const Ed="col_left";function Gre(){return{key:Ed,name(){return this.getTranslatedPhrase(BR)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner(),e=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(e,t.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols?!0:this.selection.isSelectedByCorner()?this.countCols()===0:!1},hidden(){return!this.getSettings().allowInsertColumn}}}const Td="col_right";function qre(){return{key:Td,name(){return this.getTranslatedPhrase(jR)},callback(){const t=this.getSelectedRangeLast().getTopRightCorner(),e=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(e,t.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)},hidden(){return!this.getSettings().allowInsertColumn}}}const _d="make_read_only";function Kre(){return{key:_d,checkable:!0,ariaChecked(){return dp(this.getSelectedRange(),(e,r)=>this.getCellMeta(e,r).readOnly)},ariaLabel(){return this.getTranslatedPhrase(vm)},name(){let t=this.getTranslatedPhrase(vm);return dp(this.getSelectedRange(),(r,n)=>this.getCellMeta(r,n).readOnly)&&(t=tF(t)),t},callback(){const t=this.getSelectedRange(),e=dp(t,(r,n)=>this.getCellMeta(r,n).readOnly);k(t,r=>{r.forAll((n,i)=>{n>=0&&i>=0&&this.setCellMeta(n,i,"readOnly",!e)})}),this.render()},disabled(){const t=this.getSelectedRangeLast();return!!(!t||t.isSingleHeader()||this.selection.isSelectedByCorner()||this.countRows()===0||this.countCols()===0||!this.getSelectedRange()||this.getSelectedRange().length===0)}}}const mp="redo";function Xre(){return{key:mp,name(){return this.getTranslatedPhrase(GR)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const Md="remove_col";function Zre(){return{key:Md,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[,r,,n]=t[0];r-n!==0&&(e=1)}return this.getTranslatedPhrase(zR,e)},callback(){this.alter("remove_col",K9(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0)return!0;const e=this.countCols();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByRowHeader()||e===0},hidden(){return!this.getSettings().allowRemoveColumn}}}const pp="remove_row";function Jre(){return{key:pp,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[r,,n]=t[0];r-n!==0&&(e=1)}return this.getTranslatedPhrase(UR,e)},callback(){this.alter("remove_row",X9(this),1,"ContextMenu.removeRow")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.row<0)return!0;const e=this.countRows();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByColumnHeader()||e===0},hidden(){return!this.getSettings().allowRemoveRow}}}const wp="row_above";function Qre(){return{key:wp,name(){return this.getTranslatedPhrase(VR)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",t.row,1,"ContextMenu.rowAbove")},disabled(){const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows?!0:this.selection.isSelectedByCorner()?this.countRows()===0:!1},hidden(){return!this.getSettings().allowInsertRow}}}const vp="row_below";function ene(){return{key:vp,name(){return this.getTranslatedPhrase(WR)},callback(){const t=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",t.row,1,"ContextMenu.rowBelow")},disabled(){const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)},hidden(){return!this.getSettings().allowInsertRow}}}const Pd="no_items";function tne(){return{key:Pd,name(){return this.getTranslatedPhrase(FR)},disabled:!0,isCommand:!1}}const yp="undo";function rne(){return{key:yp,name(){return this.getTranslatedPhrase(YR)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const nne=[wp,vp,Ed,Td,gp,pp,Md,yp,mp,_d,ui,We,Pd],ine={[We]:Ure,[Pd]:tne,[wp]:Qre,[vp]:ene,[Ed]:Gre,[Td]:qre,[gp]:Yre,[pp]:Jre,[Md]:Zre,[yp]:rne,[mp]:Xre,[_d]:Kre,[ui]:zre};function rF(){const t={};return Fe(ine,(e,r)=>{t[r]=e()}),t}function one(t){return{key:"commentsAddEdit",name(){var e;const r=(e=this.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r!=null&&r.isCell()&&t.getCommentAtCell(r.row,r.col)?this.getTranslatedPhrase(oE):this.getTranslatedPhrase(iE)},callback(){const e=this.getSelectedRangeLast();t.setRange(e),t.show(),t.focusEditor()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function sne(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(sE)},callback(){this.getSelectedRangeLast().forAll((r,n)=>{r>=0&&n>=0&&t.removeCommentAtCell(r,n,!1)}),this.render()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function ane(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(aE);return dp(this.getSelectedRange(),(n,i)=>t.getCommentMeta(n,i,bp))?tF(e):e},callback(){this.getSelectedRangeLast().forAll((r,n)=>{if(r>=0&&n>=0){const i=!!t.getCommentMeta(r,n,bp);t.updateCommentMeta(r,n,{[bp]:!i})}})},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||!t.getCommentAtCell(e.highlight.row,e.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function lne(t,e){nF(t,e),e.add(t)}function mc(t,e,r){nF(t,e),e.set(t,r)}function nF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function une(t,e,r){return(e=cne(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cne(t){var e=hne(t,"string");return typeof e=="symbol"?e:e+""}function hne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oa(t,e,r){return t.set(vn(t,e),r),r}function ke(t,e){return t.get(vn(t,e))}function vn(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Cp="comments",dne=60,ps="comment",Id="value",iF="style",bp="readOnly",Od=Cp,AT=`plugin:${Cp}`;var gt=new WeakMap,yo=new WeakMap,Sp=new WeakMap,Rp=new WeakMap,HT=new WeakMap,Ep=new WeakMap,$n=new WeakSet;class fne extends rt{constructor(){super(...arguments),lne(this,$n),une(this,"range",{}),mc(this,gt,null),mc(this,yo,null),mc(this,Sp,!1),mc(this,Rp,!1),mc(this,HT,null),mc(this,Ep,"")}static get PLUGIN_KEY(){return Cp}static get PLUGIN_PRIORITY(){return dne}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[Cp]}enablePlugin(){var e=this;this.enabled||(ke(gt,this)||(oa(gt,this,new Pl(this.hot.rootDocument,this.hot.isRtl())),ke(gt,this).addLocalHook("resize",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return vn($n,e,bne).call(e,...n)})),ke(yo,this)||oa(yo,this,new eF(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",r=>this.addToContextMenu(r)),this.addHook("afterRenderer",(r,n,i,o,s,a)=>vn($n,this,vne).call(this,r,a)),this.addHook("afterScroll",()=>vn($n,this,Sne).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",r=>vn($n,this,oF).call(this,r)),this.addHook("beforeCompositionStart",r=>vn($n,this,oF).call(this,r)),this.addHook("afterSetTheme",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return vn($n,e,Rne).call(e,...n)}),ke(yo,this).addLocalHook("hide",()=>this.hide()),ke(yo,this).addLocalHook("show",(r,n)=>this.showAtCell(r,n)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){ke(yo,this).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),r=e.getContext("grid"),n=e.addContext(AT);r.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();oa(Rp,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(AT),this.hot._registerTimeout(()=>{oa(Rp,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell()},group:Od}),n.addShortcut({keys:[["Escape"]],callback:()=>{ke(gt,this).setValue(ke(Ep,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>ke(gt,this).isVisible()&&ke(gt,this).isFocused(),group:Od}),n.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>ke(gt,this).isVisible()&&ke(gt,this).isFocused(),group:Od}),n.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{ke(gt,this).setValue(ke(gt,this).getValue()),this.hide(),e.setActiveContextName("grid")},group:Od})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Od)}registerListeners(){const{rootDocument:e}=this.hot,r=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",n=>vn($n,this,pne).call(this,n)),this.eventManager.addEventListener(e,"mousedown",n=>vn($n,this,gne).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>vn($n,this,wne).call(this)),this.eventManager.addEventListener(r,"focus",()=>vn($n,this,Cne).call(this)),this.eventManager.addEventListener(r,"blur",()=>vn($n,this,yne).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",n=>vn($n,this,mne).call(this,n))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const r=qa(e.target,"TD","TBODY");return!!(r&&_e(r,"htCommentCell")&&qa(r,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const r=ke(gt,this).getValue();let n="";e!=null?n=e:r!=null&&(n=r);const i=this.range.from.row,o=this.range.from.col;this.updateCommentMeta(i,o,{[Id]:n}),this.hot.render()}setCommentAtCell(e,r,n){this.setRange({from:this.hot._createCellCoords(e,r)}),this.setComment(n)}removeComment(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.setCellMeta(this.range.from.row,this.range.from.col,ps),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setRange({from:this.hot._createCellCoords(e,r)}),this.removeComment(n)}getComment(){const e=this.range.from.row,r=this.range.from.col;return this.getCommentMeta(e,r,Id)}getCommentAtCell(e,r){return this.getCommentMeta(e,r,Id)}show(){var e;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{from:{row:r,col:n}}=this.range;if(r<0||r>this.hot.countSourceRows()-1||n<0||n>this.hot.countSourceCols()-1)return!1;const i=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return ke(yo,this).cancelHiding(),ke(gt,this).setValue((e=i[ps]?i[ps][Id]:null)!==null&&e!==void 0?e:""),ke(gt,this).show(),this.refreshEditor(!0),!0}showAtCell(e,r){return this.setRange({from:this.hot._createCellCoords(e,r)}),this.show()}hide(){ke(gt,this).hide()}refreshEditor(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!ke(gt,this).isVisible()))return;const{rowIndexMapper:r,columnIndexMapper:n}=this.hot,{row:i,col:o}=this.range.from;let s=r.getRenderableFromVisualIndex(i),a=n.getRenderableFromVisualIndex(o);const l=s===null;ke(gt,this).setPosition(0,0),s===null&&(s=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(i,-1))),a===null&&(a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(o,-1)));const u=s===null,c=a===null;s=s??0,a=a??0;const{rootWindow:h,view:{_wt:d}}=this.hot,{wtTable:f}=d,g=d.getCell({row:s,col:a},!0),w=this.getCommentMeta(i,o,iF);w?ke(gt,this).setSize(w.width,w.height):ke(gt,this).resetSize();const v=c?0:f.getColumnWidth(a),b=l&&!u?dr(g):0,{left:p,top:_,width:O,height:T}=g.getBoundingClientRect(),{width:M,height:P}=ke(gt,this).getSize(),{innerWidth:G,innerHeight:j}=this.hot.rootWindow,A=this.hot.rootDocument.documentElement,q=_r(this.hot.rootDocument),Q=DH(this.hot.rootWindow)?q:0,ue=kH(this.hot.rootWindow)?q:0;let J=p+h.scrollX+v,Z=_+h.scrollY+b;this.hot.isRtl()&&(J-=M+v),this.hot.isLtr()&&p+O+M>G-Q?J=p+h.scrollX-M-1:this.hot.isRtl()&&J<-(A.scrollWidth-A.clientWidth)&&(J=p+h.scrollX+v+1),_+P>j-ue&&(Z-=P-T+1),ke(gt,this).setPosition(J,Z),ke(gt,this).setReadOnlyState(this.getCommentMeta(i,o,bp)),ke(gt,this).observeSize()}focusEditor(){ke(gt,this).focus()}updateCommentMeta(e,r,n){const i=this.hot.getCellMeta(e,r)[ps];let o;i?(o=Kr(i),Wg(o,n)):o=n,this.hot.setCellMeta(e,r,ps,o)}getCommentMeta(e,r,n){const i=this.hot.getCellMeta(e,r);if(i[ps])return i[ps][n]}addToContextMenu(e){e.items.push({name:We},one(this),sne(this),ane(this))}getEditorInputElement(){return ke(gt,this).getInputElement()}destroy(){var e,r;(e=ke(gt,this))===null||e===void 0||e.destroy(),(r=ke(yo,this))===null||r===void 0||r.destroy(),super.destroy()}}function gne(t){if(!(!this.hot.view||!this.hot.view._wt)&&!ke(Sp,this)&&!this.targetIsCommentTextArea(t)){const e=qa(t.target,"TD","TBODY");let r=null;e&&(r=this.hot.getCoords(e)),(!e||this.range.from&&r&&(this.range.from.row!==r.row||this.range.from.col!==r.col))&&this.hide()}}function mne(t){t.stopPropagation()}function pne(t){const{rootDocument:e}=this.hot;if(!(ke(Sp,this)||ke(gt,this).isFocused()||_e(t.target,"wtBorder")||ke(HT,this)===t.target||!ke(gt,this)))if(oa(HT,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const r=this.hot._createCellRange(this.hot.getCoords(t.target));ke(yo,this).show(r)}else Ka(t.target,e)&&!this.targetIsCommentTextArea(t)&&ke(yo,this).hide()}function wne(){oa(Sp,this,!1)}function vne(t,e){e[ps]&&e[ps][Id]&&oe(t,e.commentedCellClassName)}function yne(){oa(Ep,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function Cne(){oa(Ep,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(AT)}function bne(t,e){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[iF]:{width:t,height:e}})}function oF(t){ke(gt,this).isFocused()&&_i(t)}function Sne(){ke(Rp,this)||this.hide()}function Rne(){const t=ke(gt,this).getEditorElement();Ee(t,/ht-theme-.*/g),oe(t,this.hot.getCurrentThemeName())}function NT(t,e,r){return(e=Ene(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ene(t){var e=Tne(t,"string");return typeof e=="symbol"?e:e+""}function Tne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sF{constructor(e){NT(this,"hot",void 0),NT(this,"commands",{}),NT(this,"commonCallback",null),this.hot=e}registerCommand(e,r){this.commands[e]=r}setCommonCallback(e){this.commonCallback=e}execute(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];const o=e.split(":"),s=o[0],a=o.length===2?o[1]:null;let l=this.commands[s];if(!l)throw new Error(`Menu command '${s}' not exists.`);if(a&&l.submenu&&(l=_ne(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||gr(l,"submenu"))return;const u=[];typeof l.callback=="function"&&u.push(l.callback),typeof this.commonCallback=="function"&&u.push(this.commonCallback),n.unshift(o.join(":")),k(u,c=>c.apply(this.hot,n))}}function _ne(t,e){let r;return k(e,n=>{const i=n.key?n.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return r=n,!1}),r}function DT(t,e,r){return(e=Mne(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mne(t){var e=Pne(t,"string");return typeof e=="symbol"?e:e+""}function Pne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class aF{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;DT(this,"hot",void 0),DT(this,"predefinedItems",rF()),DT(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=r}setPredefinedItems(e){const r={};this.defaultOrderPattern.length=0,Fe(e,(n,i)=>{let o="";n.name===We?(r[We]=n,o=We):isNaN(parseInt(i,10))?(n.key=n.key===void 0?i:n.key,r[i]=n,o=n.key):(r[n.key]=n,o=n.key),this.defaultOrderPattern.push(o)}),this.predefinedItems=r}getItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return Ine(e,this.defaultOrderPattern,this.predefinedItems)}}function Ine(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=[];let i=t;return i&&i.items?i=i.items:Array.isArray(i)||(i=e),$e(i)?Fe(i,(o,s)=>{let a=r[typeof o=="string"?o:s];a||(a=o),$e(o)?fr(a,o):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=s),n.push(a)}):k(i,(o,s)=>{let a=r[o];!a&&nne.indexOf(o)>=0||(a||(a={name:o,key:`${s}`}),$e(o)&&fr(a,o),a.key===void 0&&(a.key=s),n.push(a))}),n}function sa(t,e,r){return(e=One(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function One(t){var e=xne(t,"string");return typeof e=="symbol"?e:e+""}function xne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ane{constructor(e,r){sa(this,"top",void 0),sa(this,"topRelative",void 0),sa(this,"left",void 0),sa(this,"leftRelative",void 0),sa(this,"scrollTop",void 0),sa(this,"scrollLeft",void 0),sa(this,"cellHeight",void 0),sa(this,"cellWidth",void 0);const n=r.scrollY,i=r.scrollX;let o,s,a,l,u,c;this.rootWindow=r,this.type=this.getSourceType(e),this.type==="literal"?(o=parseInt(e.top,10),a=parseInt(e.left,10),u=e.height||0,c=e.width||0,s=o,l=a,o+=n,a+=i):this.type==="event"&&(o=parseInt(e.pageY,10),a=parseInt(e.pageX,10),u=e.target.clientHeight,c=e.target.clientWidth,s=o-n,l=a-i),this.top=o,this.topRelative=s,this.left=a,this.leftRelative=l,this.scrollTop=n,this.scrollLeft=i,this.cellHeight=u,this.cellWidth=c}getSourceType(e){let r="literal";return e instanceof Event&&(r="event"),r}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=r}fitsOnRight(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=r}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function xd(t,e,r){Hne(t,e),e.set(t,r)}function Hne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ne(t,e){return t.get(lF(t,e))}function Tp(t,e,r){return t.set(lF(t,e),r),r}function lF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Qr=new WeakMap,yn=new WeakMap,Cn=new WeakMap,kT=new WeakMap,pc=new WeakMap;class Nne{constructor(e){xd(this,Qr,void 0),xd(this,yn,void 0),xd(this,Cn,void 0),xd(this,kT,!1),xd(this,pc,{above:0,below:0,left:0,right:0}),Tp(kT,this,e)}setOffset(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Ne(pc,this)[e]=r,this}setElement(e){return Tp(Qr,this,e),this}setParentElement(e){return Tp(yn,this,e),this}updatePosition(e){Tp(Cn,this,new Ane(e,Ne(Qr,this).ownerDocument.defaultView)),Ne(kT,this)?(Ne(Cn,this).fitsBelow(Ne(Qr,this))?this.setPositionBelowCursor():Ne(Cn,this).fitsAbove(Ne(Qr,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Ne(Qr,this).dir==="rtl"?Ne(Cn,this).fitsOnLeft(Ne(Qr,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Ne(Cn,this).fitsOnRight(Ne(Qr,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Ne(pc,this).above+Ne(Cn,this).top-Ne(Qr,this).offsetHeight;if(Ne(yn,this)){const n=Ne(yn,this).ownerDocument.defaultView.getComputedStyle(Ne(yn,this).querySelector(".ht_master")),i=Number.parseInt(n.paddingTop,10),o=Number.parseInt(n.borderTop,10);e=Ne(Cn,this).top+Ne(Cn,this).cellHeight-Ne(Qr,this).scrollHeight+i+o}Ne(Qr,this).style.top=`${e}px`}setPositionBelowCursor(){let e=Ne(pc,this).below+Ne(Cn,this).top+1;if(Ne(yn,this)){const n=Ne(yn,this).ownerDocument.defaultView.getComputedStyle(Ne(yn,this).querySelector(".ht_master")),i=Number.parseInt(n.paddingTop,10),o=Number.parseInt(n.borderTop,10);e=Ne(Cn,this).top-i-o-1}Ne(Qr,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Ne(Cn,this).left;if(Ne(yn,this)){const r=Ne(yn,this).ownerDocument.defaultView,n=Number.parseInt(r.getComputedStyle(Ne(yn,this).querySelector(".htCore")).borderRightWidth,10);e+=Ne(Cn,this).cellWidth+n}else e+=Ne(pc,this).right;Ne(Qr,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Ne(pc,this).left+Ne(Cn,this).left-Ne(Qr,this).offsetWidth;if(Ne(yn,this)){const r=Ne(yn,this).ownerDocument.defaultView,n=Number.parseInt(r.getComputedStyle(Ne(yn,this).querySelector(".htCore")).borderLeftWidth,10);e-=n}Ne(Qr,this).style.left=`${e}px`}}function uF(t){let{initialPage:e=-1,size:r=()=>0,onItemSelect:n=()=>{},onClear:i=()=>{}}=t;const o=new Set;let s=Ze(e,-1,g()-1);function a(v,b){const p=g()-1;return v<0&&(v=p),v>p&&(v=0),o.has(v)?-1:(o.add(v),n(v,!1)===!1&&(v=a(b===1?++v:--v,b)),v)}function l(v){v>-1&&v<g()&&n(v,!0)!==!1&&(s=v)}function u(){return s}function c(){g()>0&&(o.clear(),s=a(0,1))}function h(){g()>0&&(o.clear(),s=a(g()-1,-1))}function d(){g()>0&&(o.clear(),s=a(++s,1))}function f(){g()>0&&(o.clear(),s=a(--s,-1))}function g(){return Math.max(r(),0)}function w(){o.clear(),s=e,i()}return{setCurrentPage:l,getCurrentPage:u,toFirstItem:c,toLastItem:h,toNextItem:d,toPreviousItem:f,getSize:g,clear:w}}function Dne(t){return qe(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function LT(t){return gr(t,"submenu")}function $T(t){return new RegExp(We,"i").test(t.name)}function _p(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function cF(t){return gr(t,"disableSelection")}function kne(t){return _e(t,"htSeparator")}function Lne(t){return _e(t,"htSubmenu")}function $ne(t){return _e(t,"htDisabled")}function Fne(t){return _e(t,"htSelectionDisabled")}function Vne(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function hF(t,e){const r=t.slice(0);for(let n=0;n<r.length&&r[n].name===e;)r.shift();return r}function Wne(t,e){let r=t.slice(0);return r.reverse(),r=hF(r,e),r.reverse(),r}function Bne(t){const e=[];return k(t,(r,n)=>{n>0?e[e.length-1].name!==r.name&&e.push(r):e.push(r)}),e}function jne(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:We,r=t.slice(0);return r=hF(r,e),r=Wne(r,e),r=Bne(r),r}function Une(t){return t.checkable===!0}function zne(t){return uF({size:()=>t.countRows(),onItemSelect(e,r){const n=t.getCell(e,0);if(!n||kne(n)||$ne(n)||Fne(n))return!1;t.selectCell(e,0,...r?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function Yne(t){const{hot:e,hotMenu:r}=t;return[{keys:[["Control/Meta","A"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:()=>t.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(n,i)=>{const o=e.getSettings(),s=typeof o.tabMoves=="function"?o.tabMoves(n):o.tabMoves;i.includes("shift")?e.selection.transformStart(-s.row,-s.col):e.selection.transformStart(s.row,s.col),t.close(!0)}},{keys:[["Escape"]],callback:()=>t.close()},{keys:[["ArrowDown"]],callback:()=>t.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>t.getNavigator().toPreviousItem()},{keys:[[e.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{const n=r.getSelectedLast();if(n){const i=t.openSubMenu(n[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[[e.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{r.getSelectedLast()&&t.isSubMenu()&&(t.close(),t.isSubMenu()&&t.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>t.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>t.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:n=>{const i=r.getSelectedLast();i&&(r.getSourceDataAtRow(i[0]).submenu?t.openSubMenu(i[0]).getNavigator().toFirstItem():(t.executeCommand(n),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{r.getSelectedLast()?r.selection.transformStart(-r.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{r.getSelectedLast()?r.selection.transformStart(r.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const dF="menu",fF=dF;function Gne(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=[];n(Yne(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;i(c,h)});function n(u,c){a(c).addShortcuts(u,{group:dF})}function i(u,c){const h=a(c);u.forEach(d=>{let{keys:f}=d;f.forEach(g=>h.removeShortcutsByKeys(g))}),r.push({shortcuts:u,contextName:c}),n(u,c)}function o(){return[...r]}function s(u){return u?`${fF}:${u}`:fF}function a(u){var c;const h=t.hotMenu.getShortcutManager(),d=s(u);return(c=h.getContext(d))!==null&&c!==void 0?c:h.addContext(d)}function l(u){t.hotMenu.getShortcutManager().setActiveContextName(s(u))}return{addCustomShortcuts:i,getCustomShortcuts:o,getContext:a,listen:l}}function qne(t){return(e,r,n,i,o,s)=>{const a=e.getSourceDataAtRow(n),l=t.rootDocument.createElement("div"),u=typeof s=="function"?s.call(t):s,c=typeof a.ariaLabel=="function"?a.ariaLabel.call(t):a.ariaLabel,h=typeof a.ariaChecked=="function"?a.ariaChecked.call(t):a.ariaChecked;if(Zo(r),oe(l,"htItemWrapper"),t.getSettings().ariaTags){const d=!_p(a,t)&&!cF(a)&&!$T(a);Pe(r,[...Une(a)?[VK(),Ph(c),_H(h)]:[FK(),Ph(u)],...d?[Ya(-1)]:[],..._p(a,t)?[GK()]:[],...LT(a)?[ei(!1)]:[]])}r.className="",r.appendChild(l),$T(a)?oe(r,"htSeparator"):typeof a.renderer=="function"?(oe(r,"htCustomMenuRenderer"),r.appendChild(a.renderer(e,l,n,i,o,u))):Iu(l,u),_p(a,t)?oe(r,"htDisabled"):cF(a)?oe(r,"htSelectionDisabled"):LT(a)&&oe(r,"htSubmenu")}}function FT(t,e,r){Kne(t,e),e.set(t,r)}function Kne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Co(t,e,r){return(e=Xne(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xne(t){var e=Zne(t,"string");return typeof e=="symbol"?e:e+""}function Zne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function VT(t,e,r){return t.set(gF(t,e),r),r}function Ol(t,e){return t.get(gF(t,e))}function gF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const mF=215;var Ad=new WeakMap,Mp=new WeakMap,Pp=new WeakMap;class wc{get tableBorderWidth(){return Ol(Pp,this)===void 0&&this.hotMenu&&VT(Pp,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),Ol(Pp,this)}constructor(e,r){var n=this;Co(this,"hot",void 0),Co(this,"options",void 0),Co(this,"eventManager",new Pi(this)),Co(this,"container",void 0),Co(this,"positioner",void 0),Co(this,"hotMenu",null),Co(this,"hotSubMenus",{}),Co(this,"parentMenu",void 0),Co(this,"menuItems",null),Co(this,"origOutsideClickDeselects",null),FT(this,Ad,void 0),FT(this,Mp,void 0),FT(this,Pp,void 0),this.hot=e,this.options=r||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:mF,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new Nne(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n.parentMenu.runLocalHooks("afterSelectionChange",...o)}),this.hot.addHook("afterSetTheme",(i,o)=>{if(!o){var s;(s=this.hotMenu)===null||s===void 0||s.useTheme(i)}})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",r=>this.onDocumentMouseDown(r)),this.eventManager.addEventListener(e.document,"touchstart",r=>this.onDocumentMouseDown(r)),this.eventManager.addEventListener(e.document,"contextmenu",r=>this.onDocumentContextMenu(r)),e=Mu(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Ol(Ad,this)}getKeyboardShortcutsCtrl(){return Ol(Mp,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedLast())}isSubMenu(){return this.parentMenu!==null}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=Vg(a=>this.openSubMenu(a),300),r=this.options.minWidth||mF;let n=!1,i=za(this.menuItems,a=>(a.key===Pd&&(n=!0),Vne(a,this.hot)));if(i.length<1&&!n)i.push(rF()[Pd]);else if(i.length===0)return;i=jne(i,We);let o=!1;const s={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return we(a)&&a<r?r:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:qne(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(a,l)=>{Ol(Ad,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},afterOnCellContextMenu:a=>{a.preventDefault(),KH()&&o&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(a,l,u,c,h)=>{this.hotMenu.view.isMouseDown()&&(h.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:a=>{this.hasSelectedItem()&&(o=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(a))},afterOnCellMouseUp:a=>{(!KH()||!Qa(a))&&o&&this.hasSelectedItem()&&(es()||qH()?this.hot._registerTimeout(()=>this.close(!0),325):this.close(!0))},afterUnlisten:()=>{!this.hasSelectedItem()&&this.isOpened()&&this.hotMenu.listen()}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new this.hot.constructor(this.container,s),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),VT(Ad,this,zne(this.hotMenu)),VT(Mp,this,Gne(this)),Ol(Mp,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this)),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isOpened()){if(e&&this.isSubMenu())this.parentMenu.close();else if(Ol(Ad,this).clear(),this.closeAllSubMenus(),this.container.style.display="none",this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose"),this.isSubMenu()){if(this.hot.getSettings().ariaTags){const r=this.parentMenu.hotMenu.getSelectedLast();if(r){const n=this.parentMenu.hotMenu.getCell(r[0],0);Pe(n,[ei(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const r=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!r||!Lne(r))return!1;const n=this.hotMenu.getSourceDataAtRow(e),i=new wc(this.hot,{parent:this,name:n.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(n.submenu.items),i.open(),i.setPosition(r.getBoundingClientRect()),this.hotSubMenus[n.key]=i,this.hot.getSettings().ariaTags&&Pe(r,[ei(!0)]),i}closeSubMenu(e){const r=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[r.key];if(n){n.destroy(),delete this.hotSubMenus[r.key];const i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&Pe(i,[ei(!1)])}}closeAllSubMenus(){k(this.hotMenu.getData(),(e,r)=>this.closeSubMenu(r))}isAllSubMenusClosed(){return Object.keys(this.hotSubMenus).length===0}focus(){this.isOpened()&&(this.hotMenu.rootElement.focus({preventScroll:!0}),this.getKeyboardShortcutsCtrl().listen(),this.hotMenu.listen())}destroy(){const e=this.container.parentNode;this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy(),e&&e.removeChild(this.container)}isOpened(){return this.hotMenu!==null}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;const r=this.getSelectedItem();if(this.runLocalHooks("select",r,e),this.isCommandPassive(r))return;const n=this.hot.getSelectedRange(),i=n?Dne(n):[];this.runLocalHooks("executeCommand",r.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",r.key,i,e)}isCommandPassive(e){return e.isCommand===!1||$T(e)||_p(e,this.hot)||LT(e)}setOffset(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.positioner.setOffset(e,r)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){const e=this.hotMenu.view.getStylesHandler(),{wtTable:r}=this.hotMenu.view._wt,n=this.hotMenu.getSettings().data,i=r.hider.style,o=r.holder.style,s=parseInt(i.width,10),a=hn(n,(l,u,c)=>{const d=this.hotMenu.getCell(c,0)?dr(this.hotMenu.getCell(c,0)):0;return l+(u.name===We?1:d)},0);e.isClassicTheme()?(o.width=`${s+3}px`,o.height=`${a+3}px`):(o.width=`${s}px`,o.height=`${a}px`),i.height=o.height}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const r=this.options.container.ownerDocument;let n=e,i;return n&&(ht(n)&&(n=n.call(this.hot),n===null||$t(n)?n="":n=n.toString()),n=n.replace(/[^A-Za-z0-9]/g,"_"),n=`${this.options.className}Sub_${n}`,i=r.querySelector(`.${this.options.className}.${n}`)),i||(i=r.createElement("div"),oe(i,`htMenu handsontable ${this.options.className}`),n&&oe(i,n),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&Pe(this.hotMenu.rootElement,[$K(),Ya(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!Ka(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!Ka(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&_e(e.target,"htCore")&&Ka(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}wt(wc,Ar);function Jne(t,e){Qne(t,e),e.add(t)}function Qne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function WT(t,e,r){return(e=eie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eie(t){var e=tie(t,"string");return typeof e=="symbol"?e:e+""}function tie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ip(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Hd="contextMenu",rie=70,pF=Hd;de.getSingleton().register("afterContextMenuDefaultOptions"),de.getSingleton().register("beforeContextMenuShow"),de.getSingleton().register("afterContextMenuShow"),de.getSingleton().register("afterContextMenuHide"),de.getSingleton().register("afterContextMenuExecute");var Nd=new WeakSet;class Op extends rt{constructor(){super(...arguments),Jne(this,Nd),WT(this,"commandExecutor",new sF(this.hot)),WT(this,"itemsFactory",null),WT(this,"menu",null)}static get PLUGIN_KEY(){return Hd}static get PLUGIN_PRIORITY(){return rie}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[wp,vp,We,Ed,Td,We,pp,Md,We,yp,mp,We,_d,We,ui]}isEnabled(){return!!this.hot.getSettings()[Hd]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[Hd];typeof r.callback=="function"&&this.commandExecutor.setCommonCallback(r.callback),this.menu=new wc(this.hot,{className:"htContextMenu",keepInViewport:!0,container:r.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>Ip(Nd,this,iie).call(this)),this.menu.addLocalHook("afterOpen",()=>Ip(Nd,this,oie).call(this)),this.menu.addLocalHook("afterClose",()=>Ip(Nd,this,sie).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return e.executeCommand.call(e,...i)}),this.addHook("afterOnCellContextMenu",n=>Ip(Nd,this,nie).call(this,n)),this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&(this.menu.destroy(),this.menu=null),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control/Meta","Shift","Backslash"],["Shift","F10"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();this.hot.scrollToFocusedCell();const r=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),n=fp(this.menu.container,this.hot.rootDocument);this.open({left:r.left+n.left,top:r.top+n.top-1+r.height},{left:r.width,above:-r.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&this.hot.selection.isCellVisible(r)&&!this.menu.isOpened()},group:pF})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(pF)}open(e){var r;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};if((r=this.menu)!==null&&r!==void 0&&r.isOpened())return;this.prepareMenuItems(),this.menu.open();const i=this.menu.tableBorderWidth>0;Fe(n,(o,s)=>{const a=["below","right"].includes(s)?o+1:o-1;this.menu.setOffset(s,i?o:a)}),this.menu.setPosition(e)}close(){var e;(e=this.menu)===null||e===void 0||e.close(),this.itemsFactory=null}executeCommand(e){this.itemsFactory===null&&this.prepareMenuItems();for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.commandExecutor.execute(e,...n)}prepareMenuItems(){this.itemsFactory=new aF(this.hot,Op.DEFAULT_ITEMS);const e=this.hot.getSettings()[Hd],r={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);const n=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",n),this.menu.setMenuItems(n),k(n,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function nie(t){const e=this.hot.getSettings(),r=e.rowHeaders,n=e.colHeaders;function i(a){return a.nodeName==="TD"||a.parentNode.nodeName==="TD"}const o=t.target;if(this.close(),_e(o,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(r||n)&&!i(o)&&!(_e(o,"current")&&_e(o,"wtBorder"))))return;const s=fp(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+s.top,left:t.clientX+s.left})}function iie(){this.hot.runHooks("beforeContextMenuShow",this)}function oie(){this.hot.runHooks("afterContextMenuShow",this)}function sie(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Op.SEPARATOR={name:We};function aie(t){return{key:"copy",name(){return this.getTranslatedPhrase(KR)},callback(){t.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function lie(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),r=e?Ze(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(JR,r)},callback(){t.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function uie(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),r=e?Ze(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(ZR,r)},callback(){t.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function cie(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),r=e?Ze(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(XR,r)},callback(){t.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function hie(t){return{key:"cut",name(){return this.getTranslatedPhrase(QR)},callback(){t.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}class die{constructor(){this.data={}}setData(e,r){this.data[e]=r}getData(e){return this.data[e]||void 0}}class fie{constructor(){this.clipboardData=new die}preventDefault(){}composedPath(){return[]}}function gie(t,e){wF(t,e),e.add(t)}function vc(t,e,r){wF(t,e),e.set(t,r)}function wF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function en(t,e){return t.get(Cc(t,e))}function yc(t,e,r){return t.set(Cc(t,e),r),r}function Cc(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var aa=new WeakMap,BT=new WeakMap,Dd=new WeakMap,jT=new WeakMap,UT=new WeakMap,kd=new WeakMap,Ld=new WeakSet;class mie{constructor(e){let{countRows:r,countColumns:n,rowsLimit:i,columnsLimit:o,countColumnHeaders:s}=e;gie(this,Ld),vc(this,aa,void 0),vc(this,BT,void 0),vc(this,Dd,void 0),vc(this,jT,void 0),vc(this,UT,void 0),vc(this,kd,void 0),yc(BT,this,r),yc(Dd,this,n),yc(jT,this,i),yc(UT,this,o),yc(kd,this,s)}setSelectedRange(e){yc(aa,this,e)}getCellsRange(){if(en(BT,this).call(this)===0||en(Dd,this).call(this)===0)return null;const{row:e,col:r}=en(aa,this).getTopStartCorner(),{row:n,col:i}=en(aa,this).getBottomEndCorner(),o=Cc(Ld,this,pie).call(this,e,n),s=Cc(Ld,this,zT).call(this,r,i);return{isRangeTrimmed:n!==o||i!==s,startRow:e,startCol:r,endRow:o,endCol:s}}getMostBottomColumnHeadersRange(){if(en(Dd,this).call(this)===0||en(kd,this).call(this)===0)return null;const{col:e}=en(aa,this).getTopStartCorner(),{col:r}=en(aa,this).getBottomEndCorner(),n=Cc(Ld,this,zT).call(this,e,r);return{isRangeTrimmed:r!==n,startRow:-1,startCol:e,endRow:-1,endCol:n}}getAllColumnHeadersRange(){if(en(Dd,this).call(this)===0||en(kd,this).call(this)===0)return null;const{col:e}=en(aa,this).getTopStartCorner(),{col:r}=en(aa,this).getBottomEndCorner(),n=Cc(Ld,this,zT).call(this,e,r);return{isRangeTrimmed:r!==n,startRow:-en(kd,this).call(this),startCol:e,endRow:-1,endCol:n}}}function zT(t,e){return Math.min(e,Math.max(t+en(UT,this).call(this)-1,t))}function pie(t,e){return Math.min(e,Math.max(t+en(jT,this).call(this)-1,t))}function vF(t){const e=[],r=[];return k(t,n=>{const i=Math.min(n.startRow,n.endRow),o=Math.max(n.startRow,n.endRow);Ce(i,o,l=>{e.indexOf(l)===-1&&e.push(l)});const s=Math.min(n.startCol,n.endCol),a=Math.max(n.startCol,n.endCol);Ce(s,a,l=>{r.indexOf(l)===-1&&r.push(l)})}),{rows:e,columns:r}}function wie(t,e){yF(t,e),e.add(t)}function la(t,e,r){yF(t,e),e.set(t,r)}function yF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $d(t,e,r){return(e=vie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vie(t){var e=yie(t,"string");return typeof e=="symbol"?e:e+""}function yie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bn(t,e){return t.get(Sn(t,e))}function Fi(t,e,r){return t.set(Sn(t,e),r),r}function Sn(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}de.getSingleton().register("afterCopyLimit"),de.getSingleton().register("modifyCopyableRange"),de.getSingleton().register("beforeCut"),de.getSingleton().register("afterCut"),de.getSingleton().register("beforePaste"),de.getSingleton().register("afterPaste"),de.getSingleton().register("beforeCopy"),de.getSingleton().register("afterCopy");const YT="copyPaste",Cie=80,bie=["fragmentSelection"],CF=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var GT=new WeakMap,qT=new WeakMap,KT=new WeakMap,bc=new WeakMap,xp=new WeakMap,Ap=new WeakMap,Sc=new WeakMap,Hp=new WeakMap,Fn=new WeakSet;class Sie extends rt{constructor(){super(...arguments),wie(this,Fn),$d(this,"columnsLimit",1/0),$d(this,"rowsLimit",1/0),$d(this,"pasteMode","overwrite"),$d(this,"uiContainer",this.hot.rootDocument.body),la(this,GT,!1),la(this,qT,!1),la(this,KT,!1),la(this,bc,"cells-only"),la(this,xp,!1),la(this,Ap,!1),la(this,Sc,new mie({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),la(this,Hp,!1),$d(this,"copyableRanges",[])}static get PLUGIN_KEY(){return YT}static get SETTING_KEYS(){return[YT,...bie]}static get PLUGIN_PRIORITY(){return Cie}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[YT]}enablePlugin(){var e,r,n=this;this.enabled||(this.pasteMode=(e=this.getSetting("pasteMode"))!==null&&e!==void 0?e:this.pasteMode,this.rowsLimit=isNaN(this.getSetting("rowsLimit"))?this.rowsLimit:this.getSetting("rowsLimit"),this.columnsLimit=isNaN(this.getSetting("columnsLimit"))?this.columnsLimit:this.getSetting("columnsLimit"),Fi(GT,this,this.getSetting("copyColumnHeaders")),Fi(qT,this,this.getSetting("copyColumnGroupHeaders")),Fi(KT,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=(r=this.getSetting("uiContainer"))!==null&&r!==void 0?r:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",i=>Sn(Fn,this,Tie).call(this,i)),this.addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Sn(Fn,n,_ie).call(n,...o)}),this.addHook("afterSelectionEnd",()=>Sn(Fn,this,Mie).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return n.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return n.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return n.onPaste(...arguments)}),Ug()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Sn(Fn,n,Pie).call(n,...o)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Sn(Fn,n,Iie).call(n,...o)}),this.addHook("afterSelection",()=>Sn(Fn,this,Oie).call(this))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cells-only";Fi(bc,this,e),Fi(xp,this,!0),Sn(Fn,this,bF).call(this,"copy")}copyCellsOnly(){this.copy("cells-only")}copyColumnHeadersOnly(){this.copy("column-headers-only")}copyWithAllColumnHeaders(){this.copy("with-column-group-headers")}copyWithColumnHeaders(){this.copy("with-column-headers")}cut(){Fi(Ap,this,!0),Sn(Fn,this,bF).call(this,"cut")}getRangedCopyableData(e){return ld(this.getRangedData(e))}getRangedData(e){const r=[],{rows:n,columns:i}=vF(e);return k(n,o=>{const s=[];k(i,a=>{o<0?s.push(this.hot.getColHeader(a,o)):s.push(this.hot.getCopyableData(o,a))}),r.push(s)}),r}paste(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;if(!e&&!r)return;const n=new fie;e&&n.clipboardData.setData("text/plain",e),r&&n.clipboardData.setData("text/html",r),this.onPaste(n)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}bn(Sc,this).setSelectedRange(e);const r=new Map([["headers",null],["cells",null]]);bn(bc,this)==="column-headers-only"?r.set("headers",bn(Sc,this).getMostBottomColumnHeadersRange()):(bn(bc,this)==="with-column-headers"?r.set("headers",bn(Sc,this).getMostBottomColumnHeadersRange()):bn(bc,this)==="with-column-group-headers"&&r.set("headers",bn(Sc,this).getAllColumnHeadersRange()),r.set("cells",bn(Sc,this).getCellsRange())),this.copyableRanges=Array.from(r.values()).filter(i=>i!==null).map(i=>{let{startRow:o,startCol:s,endRow:a,endCol:l}=i;return{startRow:o,startCol:s,endRow:a,endCol:l}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const n=r.get("cells");if(n!==null&&n.isRangeTrimmed){const{startRow:i,startCol:o,endRow:s,endCol:a}=n;this.hot.runHooks("afterCopyLimit",s-i+1,a-o+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return(e=this.hot.getActiveEditor())===null||e===void 0?void 0:e.isOpened()}populateValues(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const n=e.length,i=e[0].length,o=[],{row:s,col:a}=r.getTopStartCorner(),{row:l,col:u}=r.getBottomEndCorner();let c=s,h=a,d=s,f=a;for(;o.length<n||c<=l;){const{skipRowOnPaste:g,visualRow:w}=this.hot.getCellMeta(c,a);if(c=w+1,g===!0)continue;d=w,h=a;const v=[],b=o.length%n;for(;v.length<i||h<=u;){const{skipColumnOnPaste:p,visualCol:_}=this.hot.getCellMeta(s,h);if(h=_+1,p===!0)continue;f=_;const O=v.length%i;v.push(e[b][O])}o.push(v)}return Fi(Hp,this,!0),this.hot.populateFromArray(s,a,o,void 0,void 0,"CopyPaste.paste",this.pasteMode),[s,a,d,f]}onCopy(e){const r=e.composedPath()[0],n=this.hot.getFocusManager().getRefocusElement(),i=r==null?void 0:r.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!bn(xp,this)||this.isEditorOpened()||Jo(r)&&(i&&r!==n||!i&&r!==this.hot.rootDocument.body&&!Hg(r,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Fi(xp,this,!1);const o=this.getRangedData(this.copyableRanges),s=Sn(Fn,this,Rie).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",o,this.copyableRanges,s)){const l=ld(o);if(e&&e.clipboardData){const u=xN(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",l),e.clipboardData.setData("text/html",[CF,u].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",l);this.hot.runHooks("afterCopy",o,this.copyableRanges,s)}Fi(bc,this,"cells-only")}onCut(e){const r=e.composedPath()[0],n=this.hot.getFocusManager().getRefocusElement(),i=r==null?void 0:r.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!bn(Ap,this)||this.isEditorOpened()||Jo(r)&&(i&&r!==n||!i&&r!==this.hot.rootDocument.body&&!Hg(r,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Fi(Ap,this,!1);const o=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",o,this.copyableRanges)){const a=ld(o);if(e&&e.clipboardData){const l=xN(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",a),e.clipboardData.setData("text/html",[CF,l].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",a);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",o,this.copyableRanges)}}onPaste(e){const r=e.composedPath()[0],n=this.hot.getFocusManager().getRefocusElement(),i=r==null?void 0:r.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||Jo(r)&&(i&&r!==n||!i&&r!==this.hot.rootDocument.body&&!Hg(r,this.hot.rootElement)))return;e.preventDefault();let o;if(e&&typeof e.clipboardData<"u"){const c=dS(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});c&&/(<table)|(<TABLE)/g.test(c)?o=p4(c,this.hot.rootDocument).data:o=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(o=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof o=="string"&&(o=t8(o)),o===void 0||o&&o.length===0||this.hot.runHooks("beforePaste",o,this.copyableRanges)===!1)return;const[s,a,l,u]=this.populateValues(o);this.hot.selectCell(s,a,Math.min(this.hot.countRows()-1,l),Math.min(this.hot.countCols()-1,u)),this.hot.runHooks("afterPaste",o,this.copyableRanges)}destroy(){super.destroy()}}function bF(t){if(Ug()){const e=this.hot.getSelectedRangeLast();if(e){const{row:r,col:n}=e.highlight,i=this.hot.getCell(r,n,!0);i&&g3(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function Rie(t){const{rows:e}=vF(t);let r=0;for(let n=0;n<e.length&&!(e[n]>=0);n++)r+=1;return{columnHeadersCount:r}}function Eie(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:r}=t.highlight,n=this.hot.getCell(e,r,!0);n&&FH(n)}}}function SF(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:r}=t.highlight,n=this.hot.getCell(e,r,!0);n!=null&&n.hasAttribute("contenteditable")&&VH(n)}}}function Tie(t){t.items.push({name:"---------"},aie(this)),bn(GT,this)&&t.items.push(cie(this)),bn(qT,this)&&t.items.push(uie(this)),bn(KT,this)&&t.items.push(lie(this)),t.items.push(hie(this))}function _ie(t,e,r,n,i){bn(Hp,this)&&(i.value=!0),Fi(Hp,this,!1)}function Mie(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function Pie(){Sn(Fn,this,SF).call(this)}function Iie(){Sn(Fn,this,Eie).call(this)}function Oie(){Sn(Fn,this,SF).call(this)}function RF(t,e){return`border_row${t}col${e}`}function Fd(){return{width:1,color:"#000"}}function ws(){return{hide:!0}}function xie(){return{width:1,color:"#000",cornerVisible:!1}}function XT(t){if(we(t.start)||we(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(we(t.end)||we(t.right)){var r;t.end=(r=t.end)!==null&&r!==void 0?r:t.right}return delete t.left,delete t.right,t}function Vd(t){return we(t.start)&&(t.left=t.start),we(t.end)&&(t.right=t.end),t}function ZT(t,e){return{id:RF(t,e),border:xie(),row:t,col:e,top:ws(),bottom:ws(),start:ws(),end:ws()}}function Aie(t,e){return gr(e,"border")&&e.border&&(t.border=e.border),gr(e,"top")&&we(e.top)&&(e.top?($e(e.top)||(e.top=Fd()),t.top=e.top):(e.top=ws(),t.top=e.top)),gr(e,"bottom")&&we(e.bottom)&&(e.bottom?($e(e.bottom)||(e.bottom=Fd()),t.bottom=e.bottom):(e.bottom=ws(),t.bottom=e.bottom)),gr(e,"start")&&we(e.start)&&(e.start?($e(e.start)||(e.start=Fd()),t.start=e.start):(e.start=ws(),t.start=e.start)),gr(e,"end")&&we(e.end)&&(e.end?($e(e.end)||(e.end=Fd()),t.end=e.end):(e.end=ws(),t.end=e.end)),t}function vs(t,e){let r=!1;return k(t.getSelectedRange(),n=>{n.forAll((i,o)=>{if(i<0||o<0)return;const s=t.getCellMeta(i,o).borders;if(s)if(e){if(!gr(s[e],"hide")||s[e].hide===!1)return r=!0,!1}else return r=!0,!1})}),r}function Np(t){return`<span class="selected">✓</span>${t}`}function Hie(t){return t.some(e=>we(e.left)||we(e.right))}function Nie(t){return t.some(e=>we(e.start)||we(e.end))}const Die=new Map([["left","start"],["right","end"]]);function kie(t){var e;return(e=Die.get(t))!==null&&e!==void 0?e:t}function Lie(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(yE);return vs(this,"bottom")&&(e=Np(e)),e},callback(e,r){const n=vs(this,"bottom");t.prepareBorder(r,"bottom",n)}}}function $ie(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let r=this.getTranslatedPhrase(CE);return vs(this,e)&&(r=Np(r)),r},callback(r,n){const i=vs(this,e);t.prepareBorder(n,e,i)}}}function Fie(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(bE)},callback(e,r){t.prepareBorder(r,"noBorders")},disabled(){return!vs(this)}}}function Vie(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let r=this.getTranslatedPhrase(vE);return vs(this,e)&&(r=Np(r)),r},callback(r,n){const i=vs(this,e);t.prepareBorder(n,e,i)}}}function Wie(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(wE);return vs(this,"top")&&(e=Np(e)),e},callback(e,r){const n=vs(this,"top");t.prepareBorder(r,"top",n)}}}function Bie(t,e){jie(t,e),e.add(t)}function jie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Uie(t,e,r){return(e=zie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zie(t){var e=Yie(t,"string");return typeof e=="symbol"?e:e+""}function Yie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function EF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Dp="customBorders",Gie=90;var JT=new WeakSet;class qie extends rt{constructor(){super(...arguments),Bie(this,JT),Uie(this,"savedBorders",[])}static get PLUGIN_KEY(){return Dp}static get PLUGIN_PRIORITY(){return Gie}isEnabled(){return!!this.hot.getSettings()[Dp]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>EF(JT,this,Kie).call(this,e)),this.addHook("init",()=>EF(JT,this,Xie).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,r){let n=["top","bottom","start","end"],i=null;r&&(this.checkSettingsCohesion([r]),n=Object.keys(r),i=XT(r));const o=Gu(e),s=od(o,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});k(e,a=>{s(a).forAll((l,u)=>{k(n,c=>{this.prepareBorderFromCustomAdded(l,u,i,kie(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const r=Gu(e),n=od(r,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return k(e,o=>{n(o).forAll((s,a)=>{k(this.savedBorders,l=>{l.row===s&&l.col===a&&i.push(Vd(l))})})}),i}clearBorders(e){e?this.setBorders(e):(k(this.savedBorders,r=>{this.clearBordersFromSelectionSettings(r.id),this.clearNullCellRange(),this.hot.removeCellMeta(r.row,r.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,r){this.checkSavedBorders(e)||this.savedBorders.push(e);const i=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,i,r)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:i})}prepareBorderFromCustomAdded(e,r,n,i){const o=this.hot.countRows(),s=this.hot.countCols();if(e>=o||r>=s)return;let a=ZT(e,r);n&&(a=Aie(a,n),k(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,n),a.id=l.settings.id,a.top=l.settings.top,a.bottom=l.settings.bottom,a.start=l.settings.start,a.end=l.settings.end,!1})),this.hot.setCellMeta(e,r,"borders",Vd(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,r){const n=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);Ce(e.from.row,n,o=>{Ce(e.from.col,i,s=>{const a=ZT(o,s);let l=0;o===e.from.row&&gr(r,"top")&&(l+=1,a.top=r.top),o===e.to.row&&gr(r,"bottom")&&(l+=1,a.bottom=r.bottom),s===e.from.col&&gr(r,"start")&&(l+=1,a.start=r.start),s===e.to.col&&gr(r,"end")&&(l+=1,a.end=r.end),l>0&&(this.hot.setCellMeta(o,s,"borders",Vd(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,r){const n=RF(e,r);this.spliceBorder(n),this.clearBordersFromSelectionSettings(n),this.clearNullCellRange(),this.hot.removeCellMeta(e,r,"borders")}setBorder(e,r,n,i){let o=this.hot.getCellMeta(e,r).borders;!o||o.border===void 0?o=ZT(e,r):o=XT(o),i?(o[n]=ws(),this.countHide(o)===4?this.removeAllBorders(e,r):(this.checkCustomSelectionsFromContextMenu(o,n,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,r,"borders",Vd(o)))):(o[n]=Fd(),this.checkCustomSelectionsFromContextMenu(o,n,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,r,"borders",Vd(o)))}prepareBorder(e,r,n){k(e,i=>{let{start:o,end:s}=i;if(o.row===s.row&&o.col===s.col)r==="noBorders"?this.removeAllBorders(o.row,o.col):this.setBorder(o.row,o.col,r,n);else switch(r){case"noBorders":Ce(o.col,s.col,a=>{Ce(o.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":Ce(o.col,s.col,a=>{this.setBorder(o.row,a,r,n)});break;case"bottom":Ce(o.col,s.col,a=>{this.setBorder(s.row,a,r,n)});break;case"start":Ce(o.row,s.row,a=>{this.setBorder(a,o.col,r,n)});break;case"end":Ce(o.row,s.row,a=>{this.setBorder(a,s.col,r,n)});break}})}createCustomBorders(e){k(e,r=>{const n=XT(r);r.range?this.prepareBorderFromCustomAddedRange(r.range,n):this.prepareBorderFromCustomAdded(r.row,r.col,n)})}countHide(e){const{top:r,bottom:n,start:i,end:o}=e;return hn([r,n,i,o],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const r=qe(this.hot.selection.highlight.customSelections,n=>n.settings.id).indexOf(e);r>-1&&this.hot.selection.highlight.customSelections[r].clear()}clearNullCellRange(){k(this.hot.selection.highlight.customSelections,(e,r)=>{if(e.cellRange===null)return this.hot.selection.highlight.customSelections[r].destroy(),this.hot.selection.highlight.customSelections.splice(r,1),!1})}hideBorders(){k(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const r=qe(this.savedBorders,n=>n.id).indexOf(e);r>-1&&this.savedBorders.splice(r,1)}checkSavedBorders(e){let r=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),r=!0):k(this.savedBorders,(i,o)=>{if(e.id===i.id)return this.savedBorders[o]=e,r=!0,!1}),r}checkCustomSelectionsFromContextMenu(e,r,n){let i=!1;return k(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){const s=this.hot.view._wt.selectionManager.getBorderInstances(o);return k(s,a=>{a.toggleHiddenClass(r,n)}),i=!0,!1}}),i}checkCustomSelections(e,r,n){const i=this.countHide(e);let o=!1;return i===4?(this.removeAllBorders(e.row,e.col),o=!0):k(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){if(s.visualCellRange=r,s.commit(),n){const a=this.hot.view._wt.selectionManager.getBorderInstances(s);k(a,l=>{l.changeBorderStyle(n,e)})}return o=!0,!1}}),o}changeBorderSettings(){const e=this.hot.getSettings()[Dp];if(Array.isArray(e)){const r=Kr(e);this.checkSettingsCohesion(r),r.length||(this.savedBorders=r),this.createCustomBorders(r)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const r=Hie(e),n=Nie(e);if(r&&n)throw new Error('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".');if(this.hot.isRtl()&&r)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function Kie(t){this.hot.getSettings()[Dp]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(pE)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[Wie(this),Vie(this),Lie(this),$ie(this),Fie(this)]}})}function Xie(){this.changeBorderSettings()}function Zie(t,e){Jie(t,e),e.add(t)}function Jie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function QT(t,e,r){return(e=Qie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qie(t){var e=eoe(t,"string");return typeof e=="symbol"?e:e+""}function eoe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function TF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const _F="dragToScroll",toe=100;var e_=new WeakSet;class roe extends rt{constructor(){super(...arguments),Zie(this,e_),QT(this,"boundaries",null),QT(this,"callback",null),QT(this,"listening",!1)}static get PLUGIN_KEY(){return _F}static get PLUGIN_PRIORITY(){return toe}isEnabled(){return!!this.hot.getSettings()[_F]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>TF(e_,this,MF).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>TF(e_,this,MF).call(this,e)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.unregisterEvents(),super.disablePlugin()}setBoundaries(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{left:0,right:this.hot.rootWindow.innerWidth,top:0,bottom:this.hot.rootWindow.innerHeight};this.boundaries=e}setCallback(e){this.callback=e}check(e,r){let n=0,i=0;r<this.boundaries.top?i=r-this.boundaries.top:r>this.boundaries.bottom&&(i=r-this.boundaries.bottom),e<this.boundaries.left?n=e-this.boundaries.left:e>this.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,i)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let r=e;for(;r;)this.eventManager.addEventListener(r.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(r.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(r.document,"mousemove",n=>this.onMouseMove(n)),r=Mu(r)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function MF(t){if(Qa(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((r,n)=>{var i,o;const s=(i=e.scrollLeft)!==null&&i!==void 0?i:e.scrollX,a=(o=e.scrollTop)!==null&&o!==void 0?o:e.scrollY;e.scroll(s+Math.sign(r)*50,a+Math.sign(n)*20)}),this.listen()}function noe(t,e){PF(t,e),e.add(t)}function ioe(t,e,r){PF(t,e),e.set(t,r)}function PF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function t_(t,e,r){return(e=ooe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ooe(t){var e=soe(t,"string");return typeof e=="symbol"?e:e+""}function soe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function aoe(t,e){return t.get(ci(t,e))}function IF(t,e,r){return t.set(ci(t,e),r),r}function ci(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}de.getSingleton().register("afterDropdownMenuDefaultOptions"),de.getSingleton().register("beforeDropdownMenuShow"),de.getSingleton().register("afterDropdownMenuShow"),de.getSingleton().register("afterDropdownMenuHide"),de.getSingleton().register("afterDropdownMenuExecute");const kp="dropdownMenu",loe=230,Wd="changeType",r_=kp;var Lp=new WeakMap,Vi=new WeakSet;class $p extends rt{static get PLUGIN_KEY(){return kp}static get PLUGIN_PRIORITY(){return loe}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Ed,Td,We,Md,We,gp,We,_d,We,ui]}constructor(e){super(e),noe(this,Vi),t_(this,"commandExecutor",new sF(this.hot)),t_(this,"itemsFactory",null),t_(this,"menu",null),ioe(this,Lp,!1),this.hot.addHook("afterGetColHeader",(r,n)=>ci(Vi,this,coe).call(this,r,n))}isEnabled(){return this.hot.getSettings()[kp]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new aF(this.hot,$p.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ci(Vi,e,poe).call(e,...o)}),this.addHook("beforeViewportScrollHorizontally",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ci(Vi,e,moe).call(e,...o)});const r=this.hot.getSettings()[kp],n={items:this.itemsFactory.getItems(r)};this.registerEvents(),typeof r.callback=="function"&&this.commandExecutor.setCommonCallback(r.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const i=this.itemsFactory.getItems(r);this.menu&&this.menu.destroy(),this.menu=new wc(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:r.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",i),this.menu.setMenuItems(i),this.menu.addLocalHook("beforeOpen",()=>ci(Vi,this,hoe).call(this)),this.menu.addLocalHook("afterOpen",()=>ci(Vi,this,doe).call(this)),this.menu.addLocalHook("afterSubmenuOpen",o=>ci(Vi,this,foe).call(this,o)),this.menu.addLocalHook("afterClose",()=>ci(Vi,this,goe).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e.executeCommand.call(e,...s)}),k(i,o=>this.commandExecutor.registerCommand(o.key,o))})}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("grid"),r=()=>{const{highlight:n}=this.hot.getSelectedRangeLast();if((n.isHeader()&&n.row===-1||n.isCell())&&n.col>=0){this.hot.selectColumns(n.col,n.col,-1);const{from:i}=this.hot.getSelectedRangeLast(),o=fp(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,i.col,!0).querySelector(`.${Wd}`),a=s.getBoundingClientRect();this.open({left:a.left+o.left,top:a.top+s.offsetHeight+o.top},{left:a.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:r,runOnlyIf:()=>{var n;const i=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:r_},{keys:[["Shift","Alt","ArrowDown"]],callback:r,runOnlyIf:()=>{var n;const i=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isCell()&&!this.menu.isOpened()},group:r_}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(r_)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>ci(Vi,this,uoe).call(this,e))}open(e){var r;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(r=this.menu)!==null&&r!==void 0&&r.isOpened()||(this.menu.open(),Fe(n,(i,o)=>{this.menu.setOffset(o,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.commandExecutor.execute(e,...n)}setListening(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function OF(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function uoe(t){if(_e(t.target,Wd)){const e=fp(this.menu.container,this.hot.rootDocument),r=t.target.getBoundingClientRect();t.stopPropagation(),IF(Lp,this,!1),this.open({left:r.left+e.left,top:r.top+t.target.offsetHeight+e.top},{left:r.width,right:0,above:0,below:3})}}function coe(t,e){const r=e.parentNode;if(!r)return;const n=r.parentNode.childNodes,i=Array.prototype.indexOf.call(n,r);if(t<0||i!==n.length-1)return;const o=e.querySelector(`.${Wd}`);if(this.enabled&&o)return;if(!this.enabled){o&&o.parentNode.removeChild(o);return}const s=this.hot.rootDocument.createElement("button");s.className=Wd,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&(Pe(s,[Ga(),Ph(" ")]),Pe(e,[bH("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function hoe(){this.hot.runHooks("beforeDropdownMenuShow",this)}function doe(){this.hot.runHooks("afterDropdownMenuShow",this),ci(Vi,this,OF).call(this,this.menu)}function foe(t){ci(Vi,this,OF).call(this,t)}function goe(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function moe(t){return aoe(Lp,this)?null:t}function poe(t){_e(t.target,Wd)&&IF(Lp,this,!0)}$p.SEPARATOR={name:We};function xF(t,e,r){return(e=woe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function woe(t){var e=voe(t,"string");return typeof e=="symbol"?e:e+""}function voe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yoe{constructor(e){xF(this,"hot",void 0),xF(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:r,endRow:n,endCol:i}=this._getDataRange(),o=this.options,s=[];return Ce(e,n,a=>{const l=[];!o.exportHiddenRows&&this._isHiddenRow(a)||(Ce(r,i,u=>{!o.exportHiddenColumns&&this._isHiddenColumn(u)||l.push(this.hot.getDataAtCell(a,u))}),s.push(l))}),s}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:r,endRow:n}=this._getDataRange(),i=this.hot.getRowHeader();Ce(r,n,o=>{!this.options.exportHiddenRows&&this._isHiddenRow(o)||e.push(i[o])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:r,endCol:n}=this._getDataRange(),i=this.hot.getColHeader();Ce(r,n,o=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(o)||e.push(i[o])})}return e}_getDataRange(){const e=this.hot.countCols()-1,r=this.hot.countRows()-1;let[n=0,i=0,o=r,s=e]=this.options.range;return n=Math.max(n,0),i=Math.max(i,0),o=Math.min(o,r),s=Math.min(s,e),{startRow:n,startCol:i,endRow:o,endCol:s}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}function AF(t,e,r){return(e=Coe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Coe(t){var e=boe(t,"string");return typeof e=="symbol"?e:e+""}function boe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class n_{static get DEFAULT_OPTIONS(){return{mimeType:"text/plain",fileExtension:"txt",filename:"Handsontable [YYYY]-[MM]-[DD]",encoding:"utf-8",bom:!1,columnHeaders:!1,rowHeaders:!1,exportHiddenColumns:!1,exportHiddenRows:!1,range:[]}}constructor(e,r){AF(this,"dataProvider",void 0),AF(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(r),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let r=io(this.constructor.DEFAULT_OPTIONS);const n=new Date;return r=fr(io(n_.DEFAULT_OPTIONS),r),r=fr(r,e),r.filename=wH(r.filename,{YYYY:n.getFullYear(),MM:`${n.getMonth()+1}`.padStart(2,"0"),DD:`${n.getDate()}`.padStart(2,"0")}),r}}function Soe(t,e){Roe(t,e),e.add(t)}function Roe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function HF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const NF="\r",Eoe='"',Toe=`
741
+ `,_oe="=",Moe="+",Poe="-",Ioe="@",Ooe=" ";var i_=new WeakSet;class xoe extends n_{constructor(){super(...arguments),Soe(this,i_)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
742
+ `,sanitizeValues:!1}}export(){const e=this.options,r=this.dataProvider.getData();let n=this.dataProvider.getColumnHeaders();const i=n.length>0,o=this.dataProvider.getRowHeaders(),s=o.length>0;let a=e.bom?"\uFEFF":"";return i&&(n=qe(n,l=>this._escapeCell(l,{force:!0,sanitizeValue:e.sanitizeValues})),s&&(a+=e.columnDelimiter),a+=n.join(e.columnDelimiter),a+=e.rowDelimiter),k(r,(l,u)=>{u>0&&(a+=e.rowDelimiter),s&&(a+=this._escapeCell(o[u],{sanitizeValue:e.sanitizeValues}),a+=e.columnDelimiter);const c=l.map(h=>this._escapeCell(h,{sanitizeValue:e.sanitizeValues})).join(e.columnDelimiter);a+=c}),a}_escapeCell(e){let{force:r=!1,sanitizeValue:n=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=Lt(e);return i===""||(n&&(r=!0),n instanceof RegExp?i=HF(i_,this,Hoe).call(this,i,n):typeof n=="function"?i=n(i):n&&(i=HF(i_,this,Aoe).call(this,i)),(r||i.indexOf(NF)>=0||i.indexOf(Eoe)>=0||i.indexOf(Toe)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`)),i}}function Aoe(t){return t.startsWith(_oe)||t.startsWith(Moe)||t.startsWith(Poe)||t.startsWith(Ioe)||t.startsWith(Ooe)||t.startsWith(NF)?`'${t}`:t}function Hoe(t,e){return e.test(t)?`'${t}`:t}const o_={["csv"]:xoe};function Noe(t,e,r){return typeof o_[t]=="function"?new o_[t](e,r):null}const Doe="exportFile",koe=240;class Loe extends rt{static get PLUGIN_KEY(){return Doe}static get PLUGIN_PRIORITY(){return koe}isEnabled(){return!0}exportAsString(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createTypeFormatter(e,r).export()}exportAsBlob(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,r))}downloadFile(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{rootDocument:n,rootWindow:i}=this.hot,o=this._createTypeFormatter(e,r),s=this._createBlob(o),a=i.URL||i.webkitURL,l=n.createElement("a"),u=`${o.options.filename}.${o.options.fileExtension}`;if(l.download!==void 0){const c=a.createObjectURL(s);l.style.display="none",l.setAttribute("href",c),l.setAttribute("download",u),n.body.appendChild(l),l.dispatchEvent(new MouseEvent("click")),n.body.removeChild(l),setTimeout(()=>{a.revokeObjectURL(c)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(s,u)}_createTypeFormatter(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!o_[e])throw new Error(`Export format type "${e}" is not supported.`);return Noe(e,new yoe(this.hot),r)}_createBlob(e){let r=null;return typeof Blob<"u"&&(r=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),r}}function Rc(t,e,r){return(e=$oe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $oe(t){var e=Foe(t,"string");return typeof e=="symbol"?e:e+""}function Foe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Bd{constructor(e,r){let{id:n,stateless:i=!0}=r;Rc(this,"hot",void 0),Rc(this,"id",void 0),Rc(this,"elements",[]),Rc(this,"hidden",!1),Rc(this,"stateId",""),Rc(this,"state",void 0),this.hot=e,this.id=n,this.stateId=`Filters.component.${this.id}`,this.state=i?null:this.hot.columnIndexMapper.registerMap(this.stateId,new dm)}getElements(){return this.elements}reset(){k(this.elements,e=>e.reset())}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return this.hot===null||this.hidden}restoreState(e){this.state&&this.setState(this.state.getValueAtIndex(e))}setState(){throw new Error("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){throw new Error("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),k(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}wt(Bd,Ar);const jd={};function ua(t,e){if(!jd[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:r,descriptor:n}=jd[t];let i=e;return n.inputValuesDecorator&&(i=n.inputValuesDecorator(i)),function(o){return r.apply(o.meta.instance,[].concat([o],[i]))}}function xl(t){if(!jd[t])throw Error(`Filter condition "${t}" does not exist.`);return jd[t].descriptor}function sr(t,e,r){r.key=t,jd[t]={condition:e,descriptor:r}}const Pr="none";function Voe(){return!0}sr(Pr,Voe,{name:ym,inputsCount:0,showOperators:!1});const Ud="empty";function Woe(t){return qt(t.value)}sr(Ud,Woe,{name:PE,inputsCount:0,showOperators:!0});const Fp="not_empty";function Boe(t,e){return!ua(Ud,e)(t)}sr(Fp,Boe,{name:IE,inputsCount:0,showOperators:!0});const zd="eq";function joe(t,e){let[r]=e;return Lt(t.value).toLocaleLowerCase(t.meta.locale)===Lt(r)}sr(zd,joe,{name:OE,inputsCount:1,showOperators:!0});const Vp="neq";function Uoe(t,e){return!ua(zd,e)(t)}sr(Vp,Uoe,{name:xE,inputsCount:1,showOperators:!0});const DF="gt";function zoe(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value>n}sr(DF,zoe,{name:kE,inputsCount:1,showOperators:!0});const kF="gte";function Yoe(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value>=n}sr(kF,Yoe,{name:LE,inputsCount:1,showOperators:!0});const LF="lt";function Goe(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value<n}sr(LF,Goe,{name:$E,inputsCount:1,showOperators:!0});const $F="lte";function qoe(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value<=n}sr($F,qoe,{name:FE,inputsCount:1,showOperators:!0});const s_="date_after";function Koe(t,e){let[r]=e;const n=se(t.value,t.meta.dateFormat),i=se(r,t.meta.dateFormat);return!n.isValid()||!i.isValid()?!1:n.diff(i)>=0}sr(s_,Koe,{name:BE,inputsCount:1,showOperators:!0});const a_="date_before";function Xoe(t,e){let[r]=e;const n=se(t.value,t.meta.dateFormat),i=se(r,t.meta.dateFormat);return!n.isValid()||!i.isValid()?!1:n.diff(i)<=0}sr(a_,Xoe,{name:jE,inputsCount:1,showOperators:!0});const Wp="between";function Zoe(t,e){let[r,n]=e,i=r,o=n;if(t.meta.type==="numeric"){const s=parseFloat(i,10),a=parseFloat(o,10);i=Math.min(s,a),o=Math.max(s,a)}else if(t.meta.type==="date"){const s=ua(a_,[o]),a=ua(s_,[i]);return s(t)&&a(t)}return t.value>=i&&t.value<=o}sr(Wp,Zoe,{name:VE,inputsCount:2,showOperators:!0});const FF="not_between";function Joe(t,e){return!ua(Wp,e)(t)}sr(FF,Joe,{name:WE,inputsCount:2,showOperators:!0});const VF="begins_with";function Qoe(t,e){let[r]=e;return Lt(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Lt(r))}sr(VF,Qoe,{name:AE,inputsCount:1,showOperators:!0});const WF="ends_with";function ese(t,e){let[r]=e;return Lt(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Lt(r))}sr(WF,ese,{name:HE,inputsCount:1,showOperators:!0});const l_="contains";function tse(t,e){let[r]=e;return Lt(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Lt(r))>=0}sr(l_,tse,{name:NE,inputsCount:1,showOperators:!0});const BF="not_contains";function rse(t,e){return!ua(l_,e)(t)}sr(BF,rse,{name:DE,inputsCount:1,showOperators:!0});const jF="date_tomorrow";function nse(t){const e=se(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(se().subtract(-1,"days").startOf("day"),"d"):!1}sr(jF,nse,{name:zE,inputsCount:0});const UF="date_today";function ise(t){const e=se(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(se().startOf("day"),"d"):!1}sr(UF,ise,{name:UE,inputsCount:0});const zF="date_yesterday";function ose(t){const e=se(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(se().subtract(1,"days").startOf("day"),"d"):!1}sr(zF,ose,{name:YE,inputsCount:0}),b3();function sse(t,e){let r=t;return r===""&&(r=`(${e})`),r}function Yd(t){const e=new Set(t);return function(r){return e.has(r)}}function u_(t){return t??""}function c_(t){return Array.from(new Set(t)).map(e=>u_(e)).sort((e,r)=>typeof e=="number"&&typeof r=="number"?e-r:e===r?0:e>r?1:-1)}function YF(t,e,r,n){const i=[],o=t===e;let s;return o||(s=Yd(e)),t.forEach(a=>{let l=!1;(o||s(a))&&(l=!0);const u={checked:l,value:a,visualValue:sse(a,r)};n&&n(u),i.push(u)}),i}const Al="by_value";function ase(t,e){let[r]=e;return r(t.value)}sr(Al,ase,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[Yd(e)]},showOperators:!1});const Gd={};function lse(t){if(!Gd[t])throw Error(`Operation with id "${t}" does not exist.`);const e=Gd[t].func;return function(r,n){return e(r,n)}}function use(t){return Gd[t].name}function h_(t,e,r){Gd[t]={name:e,func:r}}const ca="conjunction",cse=KE;function hse(t,e){return t.every(r=>r.func(e))}h_(ca,cse,hse);const Bp="disjunction",dse=Cm;function fse(t,e){return t.some(r=>r.func(e))}h_(Bp,dse,fse);const d_="disjunctionWithExtraCondition",gse=Cm;function mse(t,e){if(t.length<3)throw Error("Operation doesn't work on less then three conditions.");return t.slice(0,t.length-1).some(r=>r.func(e))&&t[t.length-1].func(e)}h_(d_,gse,mse);const pse="numeric",GF="text",wse="date",qF={[pse]:[Pr,We,Ud,Fp,We,zd,Vp,We,DF,kF,LF,$F,Wp,FF],[GF]:[Pr,We,Ud,Fp,We,zd,Vp,We,VF,WF,We,l_,BF],[wse]:[Pr,We,Ud,Fp,We,zd,Vp,We,a_,s_,Wp,We,jF,UF,zF]};function vse(t){const e=[];let r=t;return qF[r]||(r=GF),k(qF[r],n=>{let i;n===We?i={name:We}:i=io(xl(n)),e.push(i)}),e}function qd(t,e,r){return(e=yse(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yse(t){var e=Cse(t,"string");return typeof e=="symbol"?e:e+""}function Cse(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const f_="built",g_="building",KF=["click","input","keydown","keypress","keyup","focus","blur","change"];let Wi=class TB{static get DEFAULTS(){return io({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,r){qd(this,"hot",void 0),qd(this,"eventManager",new Pi(this)),qd(this,"options",void 0),qd(this,"_element",void 0),qd(this,"buildState",void 0),this.hot=e,this.options=fr(TB.DEFAULTS,r),this._element=this.hot.rootDocument.createElement(this.options.wrapIt?"div":this.options.tagName)}setValue(e){this.options.value=e,this.update()}getValue(){return this.options.value}get element(){return this.buildState===g_?this._element:this.buildState===f_?(this.update(),this._element):(this.buildState=g_,this.build(),this.buildState=f_,this._element)}isBuilt(){return this.buildState===f_}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Jr)?this.hot.getTranslatedPhrase(e):e}build(){const e=(r,n)=>{this.eventManager.addEventListener(r,n,i=>this.runLocalHooks(n,i,this))};if(this.buildState||(this.buildState=g_),this._element.setAttribute("data-hot-input",!0),this.options.tabIndex!==void 0&&this._element.setAttribute("tabindex",this.options.tabIndex),this.options.role!==void 0&&this._element.setAttribute("role",this.options.role),this.options.className&&oe(this._element,this.options.className),this.options.children.length)k(this.options.children,r=>this._element.appendChild(r.element));else if(this.options.wrapIt){const r=this.hot.rootDocument.createElement(this.options.tagName);r.setAttribute("data-hot-input",!0),Fe(this.options,(n,i)=>{r[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(r[i]=this.translateIfPossible(n))}),this._element.appendChild(r),k(KF,n=>e(r,n))}else k(KF,r=>e(this._element,r))}update(){}reset(){this.options.value="",this.update()}show(){this.element.style.display=""}hide(){this.element.style.display="none"}focus(){}destroy(){this.eventManager.destroy(),this.eventManager=null,this.hot=null,this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null}};wt(Wi,Ar);function bse(t,e){XF(t,e),e.add(t)}function Sse(t,e,r){XF(t,e),e.set(t,r)}function XF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jp(t,e){return t.get(m_(t,e))}function Rse(t,e,r){return t.set(m_(t,e),r),r}function m_(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Ec=new WeakMap,ZF=new WeakSet;class ha extends Wi{static get DEFAULTS(){return io({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,r){super(e,fr(ha.DEFAULTS,r)),bse(this,ZF),Sse(this,Ec,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>m_(ZF,this,Ese).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");Rse(Ec,this,this._element.firstChild),oe(this._element,"htUIInput"),oe(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(jp(Ec,this).type=this.options.type,jp(Ec,this).placeholder=this.translateIfPossible(this.options.placeholder),jp(Ec,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&jp(Ec,this).focus()}}function Ese(t){this.options.value=t.target.value}function Tse(t,e){JF(t,e),e.add(t)}function Kd(t,e,r){JF(t,e),e.set(t,r)}function JF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tc(t,e,r){return t.set(Xd(t,e),r),r}function Ut(t,e){return t.get(Xd(t,e))}function Xd(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var br=new WeakMap,Up=new WeakMap,zp=new WeakMap,p_=new WeakMap,Yp=new WeakMap,Gp=new WeakSet;class Zd extends Wi{static get DEFAULTS(){return io({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,r){super(e,fr(Zd.DEFAULTS,r)),Tse(this,Gp),Kd(this,br,null),Kd(this,Up,[]),Kd(this,zp,void 0),Kd(this,p_,void 0),Kd(this,Yp,void 0),this.registerHooks()}getMenu(){return Ut(br,this)}registerHooks(){this.addLocalHook("click",()=>Xd(Gp,this,Pse).call(this))}setItems(e){Tc(Up,this,this.translateNames(e)),Ut(br,this)&&Ut(br,this).setMenuItems(Ut(Up,this))}translateNames(e){return k(e,r=>{r.name=this.translateIfPossible(r.name)}),e}build(){super.build(),Tc(br,this,new wc(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),Ut(br,this).setMenuItems(Ut(Up,this));const e=new Wi(this.hot,{className:"htUISelectCaption"}),r=new Wi(this.hot,{className:"htUISelectDropdown"});Tc(zp,this,e),Tc(p_,this,e.element),Tc(Yp,this,r),this.hot.getSettings().ariaTags&&(Pe(r.element,[Ga()]),Pe(this._element,[CH()])),k([e,r],n=>this._element.appendChild(n.element)),Ut(br,this).addLocalHook("select",n=>Xd(Gp,this,_se).call(this,n)),Ut(br,this).addLocalHook("afterClose",()=>Xd(Gp,this,Mse).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=Ut(br,this).hot.getTranslatedPhrase(ym),Ut(p_,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();Ut(br,this)&&(Ut(br,this).open(),Ut(br,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),Ut(br,this).getNavigator().toFirstItem(),Ut(br,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:r=>{this.closeOptions(),this.runLocalHooks("tabKeydown",r)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){Ut(br,this)&&Ut(br,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){Ut(br,this)&&(Ut(br,this).destroy(),Tc(br,this,null)),Ut(zp,this)&&Ut(zp,this).destroy(),Ut(Yp,this)&&Ut(Yp,this).destroy(),super.destroy()}}function _se(t){t.name!==We&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function Mse(){this.runLocalHooks("afterClose")}function Pse(){this.openOptions()}function Ise(t,e){Ose(t,e),e.add(t)}function Ose(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function QF(t,e,r){return(e=xse(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xse(t){var e=Ase(t,"string");return typeof e=="symbol"?e:e+""}function Ase(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eV(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var w_=new WeakSet;class v_ extends Bd{constructor(e,r){super(e,{id:r.id,stateless:!1}),Ise(this,w_),QF(this,"name",""),QF(this,"addSeparator",!1),this.name=r.name,this.addSeparator=r.addSeparator,this.elements.push(new Zd(this.hot,{menuContainer:r.menuContainer})),this.elements.push(new ha(this.hot,{placeholder:t0})),this.elements.push(new ha(this.hot,{placeholder:r0})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>eV(w_,this,Hse).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),k(this.getInputElements(),e=>{e.addLocalHook("keydown",r=>eV(w_,this,Nse).call(this,r))})}setState(e){if(this.reset(),!e)return;const r=io(e.command);r.name.startsWith(Wt)&&(r.name=this.hot.getTranslatedPhrase(r.name)),this.getSelectElement().setValue(r),k(e.args,(n,i)=>{if(i>r.inputsCount-1)return!1;const o=this.getInputElement(i);o.setValue(n),o[r.inputsCount>i?"show":"hide"](),i||this.hot._registerTimeout(()=>o.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||xl(Pr),r=[];return k(this.getInputElements(),(n,i)=>{e.inputsCount>i&&r.push(n.getValue())}),{command:e,args:r}}updateState(e,r){const n=xl(e?e.name:Pr);this.state.setValueAtIndex(r,{command:n,args:e?e.args:[]}),e||k(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof Zd)[0]}getInputElement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter(e=>e instanceof ha)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r,n,i,o,s)=>{oe(r.parentNode,"htFiltersMenuCondition"),this.addSeparator&&oe(r.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return oe(a,"htFiltersMenuLabel"),a.textContent=s,r.appendChild(a),r.parentElement.hasAttribute("ghost-table")||k(this.elements,l=>r.appendChild(l.element)),r}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let r=[xl(Pr)];if(e!==null){const{visualIndex:n}=e;r=vse(this.hot.getDataType(0,n,this.hot.countRows(),n))}k(this.getInputElements(),n=>n.hide()),this.getSelectElement().setItems(r),super.reset(),this.getSelectElement().setValue(r[0])}}function Hse(t){k(this.getInputElements(),(e,r)=>{e[t.inputsCount>r?"show":"hide"](),r===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function Nse(t){Hh(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),_i(t))}function tV(t,e,r){Dse(t,e),e.set(t,r)}function Dse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jd(t,e){return t.get(nV(t,e))}function rV(t,e,r){return t.set(nV(t,e),r),r}function nV(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var _c=new WeakMap,y_=new WeakMap;class qp extends Wi{static get DEFAULTS(){return io({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,r){super(e,fr(qp.DEFAULTS,r)),tV(this,_c,void 0),tV(this,y_,void 0)}build(){super.build();const e=this.hot.rootDocument.createElement("label");e.textContent=this.translateIfPossible(this.options.label.textContent),e.htmlFor=this.translateIfPossible(this.options.label.htmlFor),rV(y_,this,e),rV(_c,this,this._element.firstChild),Jd(_c,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Jd(y_,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?Jd(_c,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(Jd(_c,this).checked=e)}focus(){this.isBuilt()&&Jd(_c,this).focus()}}function kse(t,e){Lse(t,e),e.add(t)}function Lse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $se(t,e,r){return(e=Fse(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fse(t){var e=Vse(t,"string");return typeof e=="symbol"?e:e+""}function Vse(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wse(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const iV=0;var oV=new WeakSet;class Bse extends Bd{constructor(e,r){super(e,{id:r.id,stateless:!1}),kse(this,oV),$se(this,"name",""),this.name=r.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r)=>(oe(r.parentNode,"htFiltersMenuOperators"),k(this.elements,n=>r.appendChild(n.element)),r)}}buildOperatorsElement(){const e=[ca,Bp];k(e,r=>{const n=new qp(this.hot,{name:"operator",label:{htmlFor:r,textContent:use(r)},value:r,checked:r===e[iV],id:r});n.addLocalHook("change",i=>Wse(oV,this,jse).call(this,i)),this.elements.push(n)})}setChecked(e){if(this.elements.length<e)throw Error(at`Radio button with index ${e} doesn't exist.`);k(this.elements,(r,n)=>{r.setChecked(n===e)})}getActiveOperationId(){const e=this.elements.find(r=>r instanceof qp&&r.isChecked());return e?e.getValue():ca}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&k(this.elements,r=>{r.setChecked(r.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ca,r=arguments.length>1?arguments[1]:void 0,n=e;n===d_&&(n=Bp),this.state.setValueAtIndex(r,n)}reset(){this.setChecked(iV)}}function jse(t){this.setState(t.target.value)}function Use(t,e,r){zse(t,e),e.set(t,r)}function zse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function C_(t,e){return t.get(sV(t,e))}function Yse(t,e,r){return t.set(sV(t,e),r),r}function sV(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Qd=new WeakMap;class ef extends Wi{static get DEFAULTS(){return io({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,r){super(e,fr(ef.DEFAULTS,r)),Use(this,Qd,void 0)}build(){super.build(),Yse(Qd,this,this._element.firstChild)}update(){this.isBuilt()&&(C_(Qd,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&C_(Qd,this).focus()}activate(){C_(Qd,this).click()}}function Gse(t,e){aV(t,e),e.add(t)}function Mc(t,e,r){aV(t,e),e.set(t,r)}function aV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function He(t,e){return t.get(Pc(t,e))}function Bi(t,e,r){return t.set(Pc(t,e),r),r}function Pc(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const lV="multipleSelect.itemBox";var ji=new WeakMap,Zt=new WeakMap,b_=new WeakMap,ys=new WeakMap,da=new WeakMap,fa=new WeakMap,tf=new WeakSet;class rf extends Wi{static get DEFAULTS(){return io({className:"htUIMultipleSelect",value:[]})}constructor(e,r){super(e,fr(rf.DEFAULTS,r)),Gse(this,tf),Mc(this,ji,[]),Mc(this,Zt,void 0),Mc(this,b_,void 0),Mc(this,ys,void 0),Mc(this,da,void 0),Mc(this,fa,void 0),Bi(ys,this,new ha(this.hot,{placeholder:e0,className:"htUIMultipleSelectSearch"})),Bi(da,this,new ef(this.hot,{textContent:XE,className:"htUISelectAll"})),Bi(fa,this,new ef(this.hot,{textContent:ZE,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return He(Zt,this)}registerHooks(){He(ys,this).addLocalHook("keydown",e=>Pc(tf,this,Kse).call(this,e)),He(ys,this).addLocalHook("input",e=>Pc(tf,this,qse).call(this,e)),He(da,this).addLocalHook("click",e=>Pc(tf,this,Xse).call(this,e)),He(fa,this).addLocalHook("click",e=>Pc(tf,this,Zse).call(this,e))}setItems(e){var r;Bi(ji,this,e),(r=He(Zt,this))===null||r===void 0||r.loadData(He(ji,this))}setLocale(e){Bi(b_,this,e)}getLocale(){return He(b_,this)}getItems(){return[...He(ji,this)]}getValue(){return Qse(He(ji,this))}getSearchInputElement(){return He(ys,this)}getSelectAllElement(){return He(da,this)}getClearAllElement(){return He(fa,this)}isSelectedAllValues(){return He(ji,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,r=e.createElement("div"),n=new Wi(this.hot,{className:"htUISelectionControls",children:[He(da,this),He(fa,this)]});this._element.appendChild(He(ys,this).element),this._element.appendChild(n.element),this._element.appendChild(r);const i=o=>{var s;if(!this._element)return;(s=He(Zt,this))===null||s===void 0||s.destroy(),oe(o,"htUIMultipleSelectHot"),Bi(Zt,this,new this.hot.constructor(o,{data:He(ji,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(u,c,h,d,f,g)=>{u.title=g.instance.getDataAtRowProp(c,g.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{He(Zt,this).listen()},modifyColWidth:u=>{const c=He(Zt,this).container.scrollWidth-_r(e);return u!==void 0&&u<c?c:u},maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},themeName:this.hot.getCurrentThemeName(),layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),He(Zt,this).init(),this.hot.addHook("afterSetTheme",(u,c)=>{c||He(Zt,this).useTheme(u)});const l=He(Zt,this).getShortcutManager().getContext("grid");l.removeShortcutsByKeys(["Tab"]),l.removeShortcutsByKeys(["Shift","Tab"]),l.addShortcut({keys:[["Escape"]],callback:u=>{this.runLocalHooks("keydown",u,this)},group:lV}),l.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:u=>{He(Zt,this).deselectCell(),this.runLocalHooks("keydown",u,this),this.runLocalHooks("listTabKeydown",u,this)},group:lV})};i(r),this.hot._registerTimeout(()=>i(r),100)}focus(){this.isBuilt()&&He(Zt,this).listen()}reset(){He(ys,this).reset(),He(da,this).reset(),He(fa,this).reset()}update(){this.isBuilt()&&(He(Zt,this).loadData(Jse(He(ji,this),this.options.value)),super.update())}destroy(){var e;(e=He(Zt,this))===null||e===void 0||e.destroy(),He(ys,this).destroy(),He(fa,this).destroy(),He(da,this).destroy(),Bi(ys,this,null),Bi(fa,this,null),Bi(da,this,null),Bi(Zt,this,null),Bi(ji,this,null),super.destroy()}}function qse(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let r;e===""?r=[...He(ji,this)]:r=He(ji,this).filter(n=>`${n.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),He(Zt,this).loadData(r)}function Kse(t){this.runLocalHooks("keydown",t,this),WH(Hh,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),_i(t),He(Zt,this).listen(),He(Zt,this).selectCell(0,0))}function Xse(t){const e=[];t.preventDefault(),He(Zt,this).getSourceData().forEach((r,n)=>{r.checked=!0,e.push(qD(r,n)[0])}),He(Zt,this).setSourceDataAtCell(e)}function Zse(t){const e=[];t.preventDefault(),He(Zt,this).getSourceData().forEach((r,n)=>{r.checked=!1,e.push(qD(r,n)[0])}),He(Zt,this).setSourceDataAtCell(e)}function Jse(t,e){const r=Yd(e);return t.map(n=>(n.checked=r(n.value),n))}function Qse(t){const e=[];return t.forEach(r=>{r.checked&&e.push(r.value)}),e}function eae(t,e){tae(t,e),e.add(t)}function tae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rae(t,e,r){return(e=nae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nae(t){var e=iae(t,"string");return typeof e=="symbol"?e:e+""}function iae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Kp(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var nf=new WeakSet;class oae extends Bd{constructor(e,r){super(e,{id:r.id,stateless:!1}),eae(this,nf),rae(this,"name",""),this.name=r.name,this.elements.push(new rf(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>Kp(nf,this,sae).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,r)=>Kp(nf,this,aae).call(this,e,r))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===Al){const r=this.getMultipleSelectElement();r.setItems(e.itemsSnapshot),r.setValue(e.args[0]),r.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),r=e.getItems();return{command:{key:e.isSelectedAllValues()||!r.length?Pr:Al},args:[e.getValue()],itemsSnapshot:r}}updateState(e){const r=(n,i,o,s,a)=>{const[l]=za(i,h=>h.name===Al),u={},c=this.hot.getTranslatedPhrase(bm);if(l){const h=s(n,a),d=qe(h,p=>p.value),f=new Map(h.map(p=>[p.value,this.hot.getCellMeta(p.meta.visualRow,p.meta.visualCol)])),g=c_(d);o&&(l.args[0]=o);const w=[],v=YF(g,l.args[0],c,p=>{p.checked&&w.push(p.value),Kp(nf,this,uV).call(this,p,f)}),b=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,b).locale,u.args=[w],u.command=xl(Al),u.itemsSnapshot=v}else u.args=[],u.command=xl(Pr);this.state.setValueAtIndex(n,u)};r(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&r(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof rf)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r,n,i,o,s)=>{oe(r.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return oe(a,"htFiltersMenuLabel"),a.textContent=s,r.appendChild(a),r.parentElement.hasAttribute("ghost-table")||k(this.elements,l=>r.appendChild(l.element)),r}}}reset(){const e=this.hot.getTranslatedPhrase(bm),r=this._getColumnVisibleValues(),n=r.map(l=>l.value),i=new Map(r.map(l=>[l.value,l.meta])),o=c_(n),s=YF(o,o,e,l=>{Kp(nf,this,uV).call(this,l,i)});this.getMultipleSelectElement().setItems(s),super.reset(),this.getMultipleSelectElement().setValue(o);const a=this.hot.getPlugin("filters").getSelectedColumn();a!==null&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,a.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return e===null?[]:qe(this.hot.getDataAtCol(e.visualIndex),(r,n)=>({value:u_(r),meta:this.hot.getCellMeta(n,e.visualIndex)}))}}function sae(t){Hh(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),_i(t))}function uV(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function aae(t,e){switch(e.type){case"numeric":return l$(t,e);default:return t}}var cV;function lae(t,e){uae(t,e),e.add(t)}function uae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cae(t,e,r){return(e=hae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hae(t){var e=dae(t,"string");return typeof e=="symbol"?e:e+""}function dae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fae(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var hV=new WeakSet;class of extends Bd{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,r){super(e,{id:r.id,stateless:!0}),lae(this,hV),cae(this,"name",""),this.name=r.name,this.elements.push(new ha(this.hot,{type:"button",value:JE,className:"htUIButton htUIButtonOK",identifier:of.BUTTON_OK})),this.elements.push(new ha(this.hot,{type:"button",value:QE,className:"htUIButton htUIButtonCancel",identifier:of.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){k(this.elements,e=>{e.addLocalHook("click",(r,n)=>fae(hV,this,gae).call(this,r,n))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r)=>(oe(r.parentNode,"htFiltersMenuActionBar"),k(this.elements,n=>r.appendChild(n.element)),r)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}cV=of;function gae(t,e){e.options.identifier===cV.BUTTON_OK?this.accept():this.cancel()}function S_(t,e,r){return(e=mae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mae(t){var e=pae(t,"string");return typeof e=="symbol"?e:e+""}function pae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const dV="ConditionCollection.filteringStates";class R_{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;S_(this,"hot",void 0),S_(this,"isMapRegistrable",void 0),S_(this,"filteringStates",new dm),this.hot=e,this.isMapRegistrable=r,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(dV,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,r){var n;const i=this.filteringStates.getValueAtIndex(r),o=(n=i==null?void 0:i.conditions)!==null&&n!==void 0?n:[],s=i==null?void 0:i.operation;return this.isMatchInConditions(o,e,s)}isMatchInConditions(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ca;return e.length?lse(n)(e,r):!0}addCondition(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ca,i=arguments.length>3?arguments[3]:void 0;const o=this.hot.getCellMeta(0,e).locale,s=r.args.map(c=>typeof c=="string"?c.toLocaleLowerCase(o):c),a=r.name||r.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==n)throw Error(at`The column of index ${e} has been already applied with a \`${l}\`\x20
743
+ filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
744
+ Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
745
+ use it consequently for a particular column).`)}else if($t(Gd[n]))throw new Error(at`Unexpected operation named \`${n}\`. Possible ones are\x20
746
+ \`disjunction\` and \`conjunction\`.`);const u=this.getConditions(e);u.length===0?this.filteringStates.setValueAtIndex(e,{operation:n,conditions:[{name:a,args:s,func:ua(a,s)}]},i):u.push({name:a,args:s,func:ua(a,s)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var r,n;return(r=(n=this.filteringStates.getValueAtIndex(e))===null||n===void 0?void 0:n.conditions)!==null&&r!==void 0?r:[]}getOperation(e){var r;return(r=this.filteringStates.getValueAtIndex(e))===null||r===void 0?void 0:r.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[r]=e;return r})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return this.filteringStates.getEntries().reduce((e,r)=>{let[n,{operation:i,conditions:o}]=r;return e.push({column:n,operation:i,conditions:o.map(s=>{let{name:a,args:l}=s;return{name:a,args:[...l]}})}),e},[])}importAllConditions(e){this.clean(),e.forEach(r=>{r.conditions.forEach(n=>this.addCondition(r.column,n))})}removeConditions(e){this.runLocalHooks("beforeRemove",e),this.filteringStates.clearValue(e),this.runLocalHooks("afterRemove",e)}clean(){this.runLocalHooks("beforeClean"),this.filteringStates.clear(),this.runLocalHooks("afterClean")}hasConditions(e,r){const n=this.getConditions(e);return r?n.some(i=>i.name===r):n.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(dV),this.filteringStates=null,this.clearLocalHooks()}}wt(R_,Ar);function fV(t,e,r){return(e=wae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wae(t){var e=vae(t,"string");return typeof e=="symbol"?e:e+""}function vae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gV{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];fV(this,"conditionCollection",void 0),fV(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=r}filter(){let e=[];return k(this.conditionCollection.getFilteredColumns(),(r,n)=>{let i=this.columnDataFactory(r);n&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(r,i)}),e}filterByColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];return k(r,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&n.push(i)}),n}_getIntersectData(e,r){const n=[];return k(r,i=>{const o=i.meta.visualRow;e[o]!==void 0&&(n[o]=e[o])}),n}}function yae(t,e){Cae(t,e),e.add(t)}function Cae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hl(t,e,r){return(e=bae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bae(t){var e=Sae(t,"string");return typeof e=="symbol"?e:e+""}function Sae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function E_(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Xp=new WeakSet;class mV{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];yae(this,Xp),Hl(this,"hot",void 0),Hl(this,"conditionCollection",void 0),Hl(this,"columnDataFactory",void 0),Hl(this,"changes",[]),Hl(this,"grouping",!1),Hl(this,"latestEditedColumnPosition",-1),Hl(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=r,this.columnDataFactory=n,this.conditionCollection.addLocalHook("beforeRemove",i=>E_(Xp,this,Rae).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>E_(Xp,this,Eae).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>E_(Xp,this,Tae).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,k(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,r){var n=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const i=this.conditionCollection.exportAllConditions();let o=this.conditionCollection.getColumnStackPosition(e);o===-1&&(o=this.latestEditedColumnPosition);const s=i.slice(0,o),a=i.slice(o);a.length&&a[0].column===e&&a.shift();const l=m3(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new R_(n.hot,!1),g=[].concat(c,d);f.importAllConditions(g);const w=n.columnDataFactory(h);let v;f.isEmpty()?v=w:v=new gV(f,p=>n.columnDataFactory(p)).filter(),v=qe(v,p=>p.meta.visualRow);const b=Yd(v);return f.destroy(),za(w,p=>b(p.meta.visualRow))})(s),u=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:u},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:r})}destroy(){this.clearLocalHooks(),Fe(this,(e,r)=>{this[r]=null})}}function Rae(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function Eae(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function Tae(){k(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}wt(mV,Ar);function _ae(t){return uF({initialPage:0,size:()=>t.length,onItemSelect:(r,n)=>{const i=t[r];if(i instanceof rf)return n;if(i.element&&!Ou(i.element))return!1;i.focus()}})}const sf="filters";function Mae(t,e){let r=-1,n;const i=_ae(e),o=h=>()=>{n.isOpened()&&n.getKeyboardShortcutsCtrl().listen(sf),i.setCurrentPage(e.indexOf(h))};e.forEach(h=>{h instanceof Wi&&(h.addLocalHook("click",o(h)),h.addLocalHook("focus",o(h)),h.addLocalHook("afterClose",o(h)))}),l(t);function s(h){const d=n.getKeyboardShortcutsCtrl(),f=h.getKeyboardShortcutsCtrl();i.clear(),f.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:d.getContext(sf),callback:()=>{h.isSubMenu()&&h.close(),d.listen(sf)}}]),!h.isSubMenu()&&d.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:g=>{const w=n.getNavigator();w.getCurrentPage()>-1&&(r=w.getCurrentPage()),w.clear(),g.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{n.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:g=>{const w=e[i.getCurrentPage()];w instanceof Zd&&(w.openOptions(),g.preventDefault()),w instanceof ef&&(w.activate(),g.preventDefault()),w instanceof Wi||g.preventDefault()}}],sf)}function a(){n.focus(),n.getKeyboardShortcutsCtrl().listen(sf)}function l(h){h.addLocalHook("afterSelectionChange",d=>{d.key.startsWith("filter_")||i.clear()}),h.addLocalHook("afterSubmenuOpen",s),h.addLocalHook("afterOpen",s),n=h}function u(){return n}function c(){return r}return{...i,listen:a,setMenu:l,getMenu:u,getLastMenuPage:c}}function Pae(t,e){pV(t,e),e.add(t)}function T_(t,e,r){pV(t,e),e.set(t,r)}function pV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function af(t,e,r){return(e=Iae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Iae(t){var e=Oae(t,"string");return typeof e=="symbol"?e:e+""}function Oae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zp(t,e,r){return t.set(Rn(t,e),r),r}function hi(t,e){return t.get(Rn(t,e))}function Rn(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const __="filters",xae=250,wV=__;var Cs=new WeakMap,M_=new WeakMap,Nl=new WeakMap,Vn=new WeakSet;class Aae extends rt{static get PLUGIN_KEY(){return __}static get PLUGIN_PRIORITY(){return xae}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var r;super(e),r=this,Pae(this,Vn),af(this,"dropdownMenuPlugin",null),af(this,"conditionCollection",null),af(this,"conditionUpdateObserver",null),af(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),af(this,"filtersRowsMap",null),T_(this,Cs,void 0),T_(this,M_,new WeakSet),T_(this,Nl,[]),this.hot.addHook("afterGetColHeader",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Rn(Vn,r,Fae).call(r,...i)})}isEnabled(){return!!this.hot.getSettings()[__]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new rd),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const r=this.hot.getSettings().dropdownMenu,n=r&&r.uiContainer||this.hot.rootDocument.body,i=a=>(a.addLocalHook("accept",()=>Rn(Vn,this,vV).call(this,"accept")),a.addLocalHook("cancel",()=>Rn(Vn,this,vV).call(this,"cancel")),a.addLocalHook("change",l=>Rn(Vn,this,$ae).call(this,a,l)),a),o=()=>`${this.hot.getTranslatedPhrase(GE)}:`,s=()=>`${this.hot.getTranslatedPhrase(qE)}:`;if(!this.components.get("filter_by_condition")){const a=new v_(this.hot,{id:"filter_by_condition",name:o,addSeparator:!1,menuContainer:n});a.addLocalHook("afterClose",()=>Rn(Vn,this,yV).call(this)),this.components.set("filter_by_condition",i(a))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new Bse(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const a=new v_(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:n});a.addLocalHook("afterClose",()=>Rn(Vn,this,yV).call(this)),this.components.set("filter_by_condition2",i(a))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",i(new oae(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new of(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new R_(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new mV(this.hot,this.conditionCollection,a=>this.getDataMapAtColumn(a)),this.conditionUpdateObserver.addLocalHook("update",a=>Rn(Vn,this,Vae).call(this,a))),this.components.forEach(a=>a.show()),this.addHook("afterDropdownMenuDefaultOptions",function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return Rn(Vn,e,Lae).call(e,...l)}),this.addHook("beforeDropdownMenuShow",()=>Rn(Vn,this,kae).call(this)),this.addHook("afterDropdownMenuShow",()=>Rn(Vn,this,Nae).call(this)),this.addHook("afterDropdownMenuHide",()=>Rn(Vn,this,Dae).call(this)),this.addHook("afterChange",a=>Rn(Vn,this,Hae).call(this,a)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!hi(Cs,this)&&this.dropdownMenuPlugin.enabled){const a=[{focus:()=>{const u=hi(Cs,this).getMenu(),c=u.getNavigator(),h=hi(Cs,this).getLastMenuPage();u.focus(),h>0?c.setCurrentPage(h):c.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];Zp(Cs,this,Mae(this.dropdownMenuPlugin.menu,a));const l=u=>{hi(Cs,this).listen(),u.preventDefault(),Hh(u.keyCode,"TAB")&&(u.shiftKey?hi(Cs,this).toPreviousItem():hi(Cs,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",l),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",l)}this.registerShortcuts(),super.enablePlugin()}disablePlugin(){if(this.enabled){var e;(e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((r,n)=>{r.destroy(),this.components.set(n,null)}),this.conditionCollection.destroy(),this.conditionCollection=null,this.hot.rowIndexMapper.unregisterMap(this.pluginName)}this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Alt","A"]],stopPropagation:!0,callback:()=>{const e=this.hot.getSelected();this.clearConditions(),this.filter(),e&&this.hot.selectCells(e)},group:wV})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(wV)}addCondition(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ca;const o=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(o,{command:{key:r},args:n},i)}removeConditions(e){const r=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(r)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const r=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(r)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){const{navigableHeaders:e}=this.hot.getSettings(),r=this._createDataFilter(),n=!this.conditionCollection.isEmpty();let i=[];const o=this.exportConditions(),s=this.hot.runHooks("beforeFilter",o,hi(Nl,this));if(s!==!1&&n){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=qe(r.filter(),u=>u.meta.visualRow);const l=Yd(i);Ce(this.hot.countSourceRows()-1,u=>{l(u)||a.push(u)}),k(a,u=>{this.filtersRowsMap.setValueAtIndex(u,!0)})},!0),!e&&!i.length&&this.hot.deselectCell(),Zp(Nl,this,this.exportConditions())}else s!==!1&&!n?(Zp(Nl,this,this.exportConditions()),this.filtersRowsMap.clear()):this.importConditions(hi(Nl,this));this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col),s!==!1&&(this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(),this.hot.render())}getSelectedColumn(){var e;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r?{visualIndex:r.col,physicalIndex:this.hot.toPhysicalColumn(r.col)}:null}getDataMapAtColumn(e){const r=this.hot.toVisualColumn(e),n=[];return k(this.hot.getSourceDataAtCol(r),(i,o)=>{var s;const{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:g}=this.hot.getCellMeta(o,r),w=(s=this.hot.getDataAtCell(this.hot.toVisualRow(o),r))!==null&&s!==void 0?s:i;n.push({meta:{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:g},value:u_(w)})}),n}updateValueComponentCondition(e){const r=this.hot.getDataAtCol(e),n=c_(r);this.conditionUpdateObserver.updateStatesAtColumn(e,n)}restoreComponents(e){var r;const n=(r=this.getSelectedColumn())===null||r===void 0?void 0:r.physicalIndex;e.forEach(i=>{i.isHidden()||i.restoreState(n)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,r,n,i){let o=e;return o===Bp&&r.command.key!==Pr&&n.command.key!==Pr&&i.command.key!==Pr?o=d_:i.command.key!==Pr&&(r.command.key===Pr||n.command.key===Pr)&&(o=ca),o}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:r}=e.getState(),n=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];r.showOperators?this.showComponents(...n):this.hideComponents(...n)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new gV(e,r=>this.getDataMapAtColumn(r))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const r=this.dropdownMenuPlugin.menu;for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return k(i,s=>{k(r.menuItems,(a,l)=>{a.key===s.getMenuItemDescriptor().key&&e.push(l)})}),e}changeComponentsVisibility(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.dropdownMenuPlugin)return;const n=this.dropdownMenuPlugin.menu.hotMenu,i=n.getPlugin("hiddenRows");for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];const l=this.getIndexesOfComponents(...s);e?i.showRows(l):i.hideRows(l),n.render()}hideComponents(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.changeComponentsVisibility(!1,...r)}showComponents(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.changeComponentsVisibility(!0,...r)}destroy(){this.enabled&&(this.components.forEach((e,r)=>{e!==null&&(e.destroy(),this.components.set(r,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function Hae(t){t&&k(t,e=>{const[,r]=e,n=this.hot.propToCol(r);this.conditionCollection.hasConditions(n)&&this.updateValueComponentCondition(n)})}function Nae(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function Dae(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function kae(){const t=this.dropdownMenuPlugin.menu;hi(M_,this).has(t)||hi(Cs,this).setMenu(t),hi(M_,this).add(t)}function Lae(t){t.items.push({name:We}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function vV(t){var e;if(t==="accept"){const n=this.getSelectedColumn();if(n===null){var r;(r=this.dropdownMenuPlugin)===null||r===void 0||r.close();return}const{physicalIndex:i}=n,o=this.components.get("filter_by_condition").getState(),s=this.components.get("filter_by_condition2").getState(),a=this.components.get("filter_by_value").getState(),l=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),o,s,a);this.conditionUpdateObserver.groupChanges();let u=this.conditionCollection.getColumnStackPosition(i);u===-1&&(u=void 0),this.conditionCollection.removeConditions(i),o.command.key!==Pr&&(this.conditionCollection.addCondition(i,o,l,u),s.command.key!==Pr&&this.conditionCollection.addCondition(i,s,l,u)),a.command.key!==Pr&&this.conditionCollection.addCondition(i,a,l,u),this.conditionUpdateObserver.flush(),this.components.forEach(c=>c.saveState(i)),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function $ae(t,e){const r=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),t.constructor===v_&&!e.inputsCount&&this.setListeningDropdownMenu(),r.updateMenuDimensions()}function yV(){this.setListeningDropdownMenu()}function Fae(t,e,r){const n=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(n)&&r===this.hot.view.getColumnHeadersCount()-1?oe(e,"htFiltersActive"):Ee(e,"htFiltersActive")}function Vae(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:r,column:n},conditionArgsChange:i}=t;Array.isArray(i)&&Zp(Nl,this,hi(Nl,this).map(a=>(a.column===n&&r.length>0&&a.conditions.forEach(l=>{l.name==="by_value"&&(l.args=[[...i]])}),a)));const o=r.filter(a=>a.name===Al),s=r.filter(a=>a.name!==Al);if(o.length>=2||s.length>=3)st(at`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
747
+ The overall amount of conditions exceed the capability of the dropdown menu.\x20
748
+ For more details see the documentation.`);else{const a=this.conditionCollection.getOperation(n);this.components.get("filter_by_condition").updateState(s[0],n),this.components.get("filter_by_condition2").updateState(s[1],n),this.components.get("filter_operators").updateState(a,n),this.components.get("filter_by_value").updateState(t)}}const CV="internal-use-in-handsontable",P_={licenseKey:CV,useArrayArithmetic:!0,useColumnIndex:!1,useStats:!1,evaluateNullToZero:!0,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,leapYear1900:!1,nullDate:{year:1899,month:12,day:30},nullYear:30,dateFormats:["DD/MM/YYYY","DD/MM/YY"],timeFormats:["hh:mm","hh:mm:ss.sss"],matchWholeCell:!0,useRegularExpressions:!1,useWildcards:!0,functionArgSeparator:",",thousandSeparator:"",decimalSeparator:".",language:"enGB"};function bV(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[Vr])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function SV(t){return Object.keys(t).reduce((e,r)=>(r!=="hyperformula"&&(e[r]=t[r]),e),{})}function Wae(t){var e;const r=t[Vr],n=SV(r!=null&&(e=r.engine)!==null&&e!==void 0&&e.hyperformula?r.engine:{}),i=bV(t);return{...P_,...n,...i}}function Bae(t){var e;const r=t[Vr],n=SV(r!=null&&(e=r.engine)!==null&&e!==void 0&&e.hyperformula?r.engine:{}),i=bV(t);return{...n,...i}}function jae(t,e){return Object.keys(e).some(r=>e[r]!==void 0&&e[r]!==t[r])}function Jp(){const t="engine_relationship",e=Mi(Vr);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function I_(){const t="shared_engine_usage",e=Mi(Vr);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function Uae(t){const e=t.getSettings(),r=e[Vr],n=r==null?void 0:r.engine;if(r===!0||$t(n))return null;if(typeof n.hyperformula=="function"||typeof n=="function"){var i;return zae((i=n.hyperformula)!==null&&i!==void 0?i:n,e,t)}else if(typeof n=="object"&&$t(n.hyperformula)){const o=Jp(),s=I_().get(n);return o.has(n)||o.set(n,[]),o.get(n).push(t),s&&s.push(t.guid),n.getConfig().licenseKey||n.updateConfig({licenseKey:CV}),(n.getConfig().leapYear1900!==P_.leapYear1900||SS(n.getConfig().nullDate,P_.nullDate)===!1)&&st(at`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
749
+ settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),n}return null}function zae(t,e,r){const n=e[Vr],i=Wae(e),o=Jp(),s=I_();Yae(t,n.functions),Gae(t,n.language);const a=t.buildEmpty(i);return o.set(a,[r]),s.set(a,[r.guid]),qae(a,n.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function RV(t){var e;const r=Jp(),n=r.size===0?[]:Array.from((e=r.get(t))!==null&&e!==void 0?e:[]);return new Map(n.map(i=>[i.getPlugin("formulas").sheetId,i]))}function EV(t,e){if(t){const r=Jp(),n=r.get(t),i=I_(),o=i.get(t);n&&n.includes(e)&&(n.splice(n.indexOf(e),1),n.length===0&&r.delete(t)),o&&o.includes(e.guid)&&(o.splice(o.indexOf(e.guid),1),o.length===0&&(i.delete(t),t.destroy()))}}function Yae(t,e){e&&e.forEach(r=>{const{name:n,plugin:i,translations:o}=r;try{t.registerFunction(n,i,o)}catch(s){st(s.message)}})}function Gae(t,e){if(e){const{langCode:r}=e;try{t.registerLanguage(r,e)}catch(n){st(n.message)}}}function qae(t,e){e&&(t.suspendEvaluation(),e.forEach(r=>{const{name:n,expression:i,scope:o,options:s}=r;try{t.addNamedExpression(n,i,o,s)}catch(a){st(a.message)}}),t.resumeEvaluation())}function Kae(t,e){return($t(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const TV="DD/MM/YYYY";function Xae(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function Zae(t){return Xae(t)?t.substr(1):t}function Jae(t){return typeof t=="string"&&t.startsWith("=")}function O_(t,e){return typeof t=="string"&&e==="date"}function _V(t,e){return se(t,e,!0).isValid()}function MV(t,e){return se(t,e,!0).format(TV)}function Qae(t,e){return se(t,TV,!0).format(e)}function PV(t,e){const n=new Date(Date.UTC(0,0,t+-1));return se(n).format(e)}function ele(t,e,r){const n=Array.from(Array(r).keys()).filter(o=>t.includes(o)===!1);if(e===0){var i;return(i=n[e])!==null&&i!==void 0?i:0}return n[e-1]+1}function tle(t,e){const r=[];return t.forEach(n=>{const i={from:n,to:e};r.forEach(o=>{const s=o.from>o.to,a=o.to<=i.from;o.from>i.from&&a&&s&&(i.from+=1)}),i.from>=e&&(e+=1),r.push(i)}),r}function rle(t){return t.forEach((e,r)=>{t.slice(r+1).forEach(i=>{const o=i.from<i.to;i.from>e.from&&o&&(i.from-=1)})}),t}function x_(t,e,r){const n=tle(t,ele(t,e,r));return rle(n)}function Dl(t,e,r){nle(t,e),e.set(t,r)}function nle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function At(t,e){return t.get(IV(t,e))}function ga(t,e,r){return t.set(IV(t,e),r),r}function IV(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var lf=new WeakMap,ma=new WeakMap,Wn=new WeakMap,Qp=new WeakMap,A_=new WeakMap,H_=new WeakMap,ew=new WeakMap;class OV{constructor(e,r,n){Dl(this,lf,void 0),Dl(this,ma,void 0),Dl(this,Wn,void 0),Dl(this,Qp,[]),Dl(this,A_,[]),Dl(this,H_,void 0),Dl(this,ew,[]),ga(lf,this,e),ga(ma,this,r),ga(Wn,this,n)}setRemovedHfIndexes(e){return ga(ew,this,e.map(r=>{const n=At(ma,this).getVisualFromPhysicalIndex(r);return this.getHfIndexFromVisualIndex(n)})),At(ew,this)}getRemovedHfIndexes(){return At(ew,this)}getHfIndexFromVisualIndex(e){const r=At(ma,this).getIndexesSequence(),n=At(ma,this).getNotTrimmedIndexes();return r.indexOf(n[e],e)}syncMoves(e){const n=`move${Ti(At(lf,this))}s`;At(Wn,this).getEngine().batch(()=>{e.forEach(i=>{const o=i.from!==i.to,s=i.from+1!==i.to;o&&s&&At(Wn,this).getEngine()[n](At(Wn,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,r,n){n!==!1&&(ga(A_,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),ga(H_,this,this.getHfIndexFromVisualIndex(r)))}calculateAndSyncMoves(e,r){if(At(Wn,this).isPerformingUndoRedo()||e===!1||r===!1)return;const n=x_(At(A_,this),At(H_,this),At(ma,this).getNumberOfIndexes());At(Wn,this).getSheetId()===null?At(Wn,this).getPostponeAction(()=>this.syncMoves(n)):this.syncMoves(n)}getIndexesChangeSyncMethod(){const e=`set${Ti(At(lf,this))}Order`;return r=>{if(At(Wn,this).isPerformingUndoRedo())return;const n=At(ma,this).getIndexesSequence();if(r==="update"&&n.length>0){const i=At(Qp,this).map(l=>n.indexOf(l)),o=At(Wn,this).getEngine().getSheetDimensions(At(Wn,this).getSheetId());let s;At(lf,this)==="row"?s=o.height:s=o.width;const a=i.length;for(let l=a;l<s;l+=1)i.push(l);At(Wn,this).getEngine()[e](At(Wn,this).getSheetId(),i)}ga(Qp,this,n)}}init(){ga(Qp,this,At(ma,this).getIndexesSequence())}}function kl(t,e,r){ile(t,e),e.set(t,r)}function ile(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bs(t,e){return t.get(xV(t,e))}function Ll(t,e,r){return t.set(xV(t,e),r),r}function xV(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var tw=new WeakMap,rw=new WeakMap,N_=new WeakMap,D_=new WeakMap,k_=new WeakMap,L_=new WeakMap,$_=new WeakMap;class ole{constructor(e,r,n){kl(this,tw,void 0),kl(this,rw,void 0),kl(this,N_,void 0),kl(this,D_,!1),kl(this,k_,!1),kl(this,L_,null),kl(this,$_,null),Ll(tw,this,new OV("row",e,this)),Ll(rw,this,new OV("column",r,this)),Ll(N_,this,n)}getForAxis(e){return e==="row"?bs(tw,this):bs(rw,this)}setPerformUndo(e){Ll(D_,this,e)}setPerformRedo(e){Ll(k_,this,e)}isPerformingUndoRedo(){return bs(D_,this)||bs(k_,this)}getSheetId(){return bs($_,this)}getEngine(){return bs(L_,this)}getPostponeAction(){return bs(N_,this)}setupSyncEndpoint(e,r){Ll(L_,this,e),Ll($_,this,r),bs(tw,this).init(),bs(rw,this).init()}}function sle(t,e){AV(t,e),e.add(t)}function $l(t,e,r){return(e=ale(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ale(t){var e=lle(t,"string");return typeof e=="symbol"?e:e+""}function lle(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function F_(t,e,r){AV(t,e),e.set(t,r)}function AV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pa(t,e,r){return t.set(tt(t,e),r),r}function Fl(t,e){return t.get(tt(t,e))}function tt(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Vr="formulas",ule=["maxRows","maxColumns","language"],cle=260;de.getSingleton().register("afterNamedExpressionAdded"),de.getSingleton().register("afterNamedExpressionRemoved"),de.getSingleton().register("afterSheetAdded"),de.getSingleton().register("afterSheetRemoved"),de.getSingleton().register("afterSheetRenamed"),de.getSingleton().register("afterFormulasValuesUpdate");const Ic=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var Ss=new WeakMap,nw=new WeakMap,uf=new WeakMap,nt=new WeakSet;class hle extends rt{constructor(){var e;super(...arguments),e=this,sle(this,nt),F_(this,Ss,!1),F_(this,nw,!1),F_(this,uf,[["valuesUpdated",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return tt(nt,e,Mle).call(e,...n)}],["namedExpressionAdded",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return tt(nt,e,Ple).call(e,...n)}],["namedExpressionRemoved",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return tt(nt,e,Ile).call(e,...n)}],["sheetAdded",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return tt(nt,e,Ole).call(e,...n)}],["sheetRenamed",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return tt(nt,e,xle).call(e,...n)}],["sheetRemoved",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return tt(nt,e,Ale).call(e,...n)}]]),$l(this,"staticRegister",Mi("formulas")),$l(this,"engine",null),$l(this,"sheetId",null),$l(this,"sheetName",null),$l(this,"indexSyncer",null),$l(this,"rowAxisSyncer",null),$l(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return Vr}static get PLUGIN_PRIORITY(){return cle}static get SETTING_KEYS(){return[Vr,...ule]}isEnabled(){return!!this.hot.getSettings()[Vr]}enablePlugin(){var e,r=this;if(!this.enabled){if(this.engine=(e=Uae(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){st("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.");return}if(this.sheetName!==null&&!this.engine.doesSheetExist(this.sheetName)){const n=this.addSheet(this.sheetName,this.hot.getSourceDataArray());n!==!1&&tt(nt,this,cf).call(this,n)}this.addHook("beforeLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,HV).call(r,...i)}),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,NV).call(r,...i)}),this.addHook("beforeUpdateData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,HV).call(r,...i)}),this.addHook("afterUpdateData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,NV).call(r,...i)}),this.addHook("modifyData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,mle).call(r,...i)}),this.addHook("modifySourceData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,ple).call(r,...i)}),this.addHook("beforeValidate",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,dle).call(r,...i)}),this.addHook("afterSetSourceDataAtCell",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,wle).call(r,...i)}),this.addHook("afterSetDataAtCell",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,DV).call(r,...i)}),this.addHook("afterSetDataAtRowProp",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,DV).call(r,...i)}),this.addHook("beforeCreateRow",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,vle).call(r,...i)}),this.addHook("beforeCreateCol",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,yle).call(r,...i)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,Sle).call(r,...i)}),this.addHook("afterCreateCol",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,Rle).call(r,...i)}),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,Cle).call(r,...i)}),this.addHook("beforeRemoveCol",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,ble).call(r,...i)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,Ele).call(r,...i)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,Tle).call(r,...i)}),this.indexSyncer=new ole(this.hot.rowIndexMapper,this.hot.columnIndexMapper,n=>{this.hot.addHookOnce("init",()=>{n()})}),this.rowAxisSyncer=this.indexSyncer.getForAxis("row"),this.columnAxisSyncer=this.indexSyncer.getForAxis("column"),this.hot.addHook("afterRowSequenceChange",this.rowAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("afterColumnSequenceChange",this.columnAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("beforeRowMove",(n,i,o,s)=>{this.rowAxisSyncer.storeMovesInformation(n,i,s)}),this.hot.addHook("beforeColumnMove",(n,i,o,s)=>{this.columnAxisSyncer.storeMovesInformation(n,i,s)}),this.hot.addHook("afterRowMove",(n,i,o,s,a)=>{this.rowAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("afterColumnMove",(n,i,o,s,a)=>{this.columnAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("beforeColumnFreeze",(n,i)=>{this.columnAxisSyncer.storeMovesInformation([n],this.hot.getSettings().fixedColumnsStart,i)}),this.hot.addHook("afterColumnFreeze",(n,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.hot.addHook("beforeColumnUnfreeze",(n,i)=>{this.columnAxisSyncer.storeMovesInformation([n],this.hot.getSettings().fixedColumnsStart-1,i)}),this.hot.addHook("afterColumnUnfreeze",(n,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.addHook("afterCellMetaReset",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,gle).call(r,...i)}),this.addHook("beforeUndo",()=>{this.indexSyncer.setPerformUndo(!0),this.engine.undo()}),this.addHook("beforeRedo",()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformUndo(!1)}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformRedo(!1)}),this.addHook("afterDetachChild",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,_le).call(r,...i)}),this.addHook("beforeAutofill",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return tt(nt,r,fle).call(r,...i)}),Fl(uf,this).forEach(n=>{let[i,o]=n;return this.engine.on(i,o)}),super.enablePlugin()}}disablePlugin(){Fl(uf,this).forEach(e=>{let[r,n]=e;return this.engine.off(r,n)}),EV(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const r=Bae(this.hot.getSettings());jae(this.engine.getConfig(),r)&&this.engine.updateConfig(r);const n=this.hot.getSettings()[Vr];if(we(n)&&we(n.sheetName)&&n.sheetName!==this.sheetName&&this.switchSheet(n.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[Vr].sheetName;if(i&&this.engine.doesSheetExist(i))this.switchSheet(this.sheetName);else{const o=this.addSheet(i??void 0,this.hot.getSourceDataArray());tt(nt,this,cf).call(this,o)}}super.updatePlugin(e)}destroy(){Fl(uf,this).forEach(e=>{var r;let[n,i]=e;return(r=this.engine)===null||r===void 0?void 0:r.off(n,i)}),pa(uf,this,null),EV(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,r){if(we(r)&&!V5(r))return st("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return st("Sheet with the provided name already exists."),!1;try{const n=this.engine.addSheet(e??void 0);return r&&this.engine.setSheetContent(this.engine.getSheetId(n),r),n}catch(n){return st(n.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){MS(`The sheet named \`${e}\` does not exist, switch aborted.`);return}tt(nt,this,cf).call(this,e);const r=this.engine.getSheetSerialized(this.sheetId);r.length>0&&this.hot.loadData(r,`${Ti(Vr)}.switchSheet`)}getCellType(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;const i=this.hot.toPhysicalRow(e),o=this.hot.toPhysicalColumn(r);return i!==null&&o!==null?this.engine.getCellType({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r)}):"EMPTY"}isFormulaCellType(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r)})}renderDependentSheets(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=new Set;e.forEach(i=>{var o;const s=i==null||(o=i.address)===null||o===void 0?void 0:o.sheet;s!==void 0&&(n.has(s)||n.add(s))}),RV(this.engine).forEach((i,o)=>{if((r||o!==this.sheetId)&&n.has(o)){var s;i.render(),(s=i.view)===null||s===void 0||s.adjustElementsSize()}})}validateDependentCells(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=o=>{var s;const{row:a,col:l,sheet:u}=(s=o==null?void 0:o.address)!==null&&s!==void 0?s:{};return we(u)?`${u}:${a}x${l}`:""},i=new Set(r.map(o=>n(o)));e.forEach(o=>{var s,a;const{row:l,col:u}=(s=o.address)!==null&&s!==void 0?s:{};if(we(l)===!1||we(u)===!1||l>=this.hot.countRows()||u>=this.hot.countCols())return;const c=o==null||(a=o.address)===null||a===void 0?void 0:a.sheet,h=n(o);if(c!==void 0&&!i.has(h)){const d=RV(this.engine).get(c);if(!d)return;d.validateCell(d.getDataAtCell(l,u),d.getCellMeta(l,u),()=>{})}})}syncChangeWithEngine(e,r,n){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){st(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const o=this.hot.getCellMeta(e,r);return O_(n,o.type)&&(_V(n,o.dateFormat)?n=MV(n,o.dateFormat):Jae(n)===!1&&(n=`'${n}`)),this.engine.setCellContents(i,n)}}function cf(t){this.sheetName=t,this.sheetId=this.engine.getSheetId(this.sheetName)}function dle(t,e,r){const n=this.hot.propToCol(r);if(this.isFormulaCellType(e,n)){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId},o=this.hot.getCellMeta(e,n);let s=this.engine.getCellValue(i);return o.type==="date"&&Xr(s)&&(s=PV(s,o.dateFormat)),typeof s=="object"&&s!==null?s.value:s}return t}function fle(t,e,r){const{row:n,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),{row:a,col:l}=r.getTopStartCorner(),{row:u,col:c}=r.getBottomEndCorner(),h={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(n),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId}},d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(u),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(c),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(d)===!1)return!1;const f=this.engine.getFillRangeData(h,d),{row:g,col:w}=h.start,{row:v,col:b}=h.end,p=v-g+1,_=b-w+1;for(let O=0;O<f.length;O+=1)for(let T=0;T<f[O].length;T+=1){const M=f[O][T],P=g+O%p,G=w+T%_,j=this.hot.getCellMeta(P,G);O_(M,j.type)&&(M.startsWith("'")?f[O][T]=M.slice(1):this.isFormulaCellType(P,G,this.sheetId)===!1&&(f[O][T]=Qae(M,j.dateFormat)))}return f}function HV(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(Ti(Vr))||pa(nw,this,$t(this.hot.getSettings().data))}function gle(){if(Fl(nw,this)){this.switchSheet(this.sheetName);return}const t=this.hot.getSourceDataArray();t.forEach((r,n)=>{r.forEach((i,o)=>{const s=this.hot.getCellMeta(n,o,{skipMetaExtension:!0}),a=s.dateFormat;O_(i,s.type)&&(_V(i,a)?t[n][o]=MV(i,a):i.startsWith("=")||(t[n][o]=`'${i}`))})}),pa(Ss,this,!0);const e=this.engine.setSheetContent(this.sheetId,t);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(e),pa(Ss,this,!1)}function NV(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(r.includes(Ti(Vr)))return;const n=Kae(this.engine,this.hot.getSettings()[Vr].sheetName);if(tt(nt,this,cf).call(this,n),r!=="updateSettings")if(Fl(nw,this))this.switchSheet(this.sheetName);else{const i=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){pa(Ss,this,!0);const o=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(o),pa(Ss,this,!1)}}}function mle(t,e,r,n){if(n!=="get"||Fl(Ss,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t);if(i===null||e===null)return;const o=this.getCellType(i,e);if(o==="VALUE"||o==="EMPTY"){r.value=Zae(r.value);return}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(s);const l=this.hot.getCellMeta(i,e,{skipMetaExtension:!0});l.type==="date"&&Xr(a)&&(a=PV(a,l.dateFormat)),r.value=typeof a=="object"&&a!==null?a.value:a}function ple(t,e,r,n){if(n!=="get"||Fl(Ss,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t),o=this.hot.propToCol(e);if(i===null||o===null)return;const s=this.getCellType(i,o);if(s==="VALUE"||s==="EMPTY")return;const a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(a.width===0&&a.height===0)return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};r.value=this.engine.getCellSerialized(l)}function DV(t,e){if(Ic(e))return;const r=[],n=[],i=this.engine.batch(()=>{t.forEach(o=>{let[s,a,,l]=o;const u=this.hot.propToCol(a),c=this.hot.toPhysicalRow(s),h=this.hot.toPhysicalColumn(u),d={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId};c!==null&&h!==null?this.syncChangeWithEngine(s,u,l):r.push([s,u,l]),n.push({address:d})})});r.length&&this.hot.addHookOnce("afterChange",()=>{const o=this.engine.batch(()=>{r.forEach(s=>{let[a,l,u]=s;this.syncChangeWithEngine(a,l,u)})});this.renderDependentSheets(o,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,n)}function wle(t,e){if(Ic(e))return;const r=[],n=[];t.forEach(i=>{let[o,s,,a]=i;const l=this.hot.propToCol(s);if(!Xr(l))return;const u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(u)){st(`Not possible to set source cell data at ${JSON.stringify(u)}`);return}n.push({address:u}),r.push(...this.engine.setCellContents(u,a))}),this.renderDependentSheets(r),this.validateDependentCells(r,n)}function vle(t,e){let r=this.rowAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countRows()&&(r=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[r,e]))return!1}function yle(t,e){let r=this.columnAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countCols()&&(r=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[r,e]))return!1}function Cle(t,e,r){return this.rowAxisSyncer.setRemovedHfIndexes(r).every(o=>this.engine.isItPossibleToRemoveRows(this.sheetId,[o,1]))===!1?!1:void 0}function ble(t,e,r){return this.columnAxisSyncer.setRemovedHfIndexes(r).every(o=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[o,1]))===!1?!1:void 0}function Sle(t,e,r){if(Ic(r))return;const n=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(n)}function Rle(t,e,r){if(Ic(r))return;const n=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(n)}function Ele(t,e,r,n){if(Ic(n))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeRows(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function Tle(t,e,r,n){if(Ic(n))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeColumns(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function _le(t,e,r){var n;pa(Ss,this,!0);const i=this.hot.getSourceDataArray(r,0,r+(((n=e.__children)===null||n===void 0?void 0:n.length)||0),this.hot.countSourceCols());pa(Ss,this,!1),i.forEach((o,s)=>{o.forEach((a,l)=>{this.engine.setCellContents({col:l,row:r+s,sheet:this.sheetId},[[a]])})})}function Mle(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function Ple(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function Ile(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function Ole(t){this.hot.runHooks("afterSheetAdded",t)}function xle(t,e){tt(nt,this,cf).call(this,e),this.hot.runHooks("afterSheetRenamed",t,e)}function Ale(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function Hle(t){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let r=0;if(Array.isArray(e)){const[,n,,i]=e;n-i!==0&&(r=1)}return this.getTranslatedPhrase(EE,r)},callback(){const{from:e,to:r}=this.getSelectedRangeLast(),n=Math.max(Math.min(e.col,r.col),0),i=Math.max(e.col,r.col),o=[];for(let l=n;l<=i;l+=1)o.push(l);t.hideColumns(o);const s=o[o.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function Nle(t){const e=[];return{key:"hidden_columns_show",name(){const r=e.length>1?1:0;return this.getTranslatedPhrase(TE,r)},callback(){var r,n;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(r=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&r!==void 0?r:0,o=(n=this.columnIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&n!==void 0?n:this.countCols()-1,t.showColumns(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countCols()||this.selectColumns(i,o)},disabled:!1,hidden(){const r=qe(t.getHiddenColumns(),h=>this.toPhysicalColumn(h));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||r.length<1)return!0;e.length=0;const n=this.getSelectedRangeLast(),i=n.getTopStartCorner().col,o=n.getBottomEndCorner().col,s=this.columnIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(g=>r.includes(g)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countCols()));else{const h=this.countCols()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return k(c,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function Dle(t,e){kV(t,e),e.add(t)}function kle(t,e,r){kV(t,e),e.set(t,r)}function kV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vl(t,e){return t.get(wa(t,e))}function LV(t,e,r){return t.set(wa(t,e),r),r}function wa(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}de.getSingleton().register("beforeHideColumns"),de.getSingleton().register("afterHideColumns"),de.getSingleton().register("beforeUnhideColumns"),de.getSingleton().register("afterUnhideColumns");const $V="hiddenColumns",Lle=310;var bo=new WeakMap,Wl=new WeakSet;class $le extends rt{constructor(){super(...arguments),Dle(this,Wl),kle(this,bo,null)}static get PLUGIN_KEY(){return $V}static get PLUGIN_PRIORITY(){return Lle}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[$V]}enablePlugin(){var e=this;this.enabled||(LV(bo,this,new hm),Vl(bo,this).addLocalHook("init",()=>wa(Wl,this,Ule).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,Vl(bo,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return wa(Wl,e,jle).call(e,...n)}),this.addHook("afterGetCellMeta",(r,n,i)=>wa(Wl,this,Vle).call(this,r,n,i)),this.addHook("modifyColWidth",(r,n)=>wa(Wl,this,Fle).call(this,r,n),2),this.addHook("afterGetColHeader",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return wa(Wl,e,Ble).call(e,...n)}),this.addHook("modifyCopyableRange",r=>wa(Wl,this,Wle).call(this,r)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){const r=this.getHiddenColumns(),n=this.isValidConfig(e);let i=r;const o=Vl(bo,this).getValues().slice(),s=e.length>0;if(n&&s){const l=e.map(u=>this.hot.toPhysicalColumn(u));k(l,u=>{o[u]=!1}),i=hn(o,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",r,i,n&&s)!==!1&&(n&&s&&Vl(bo,this).setValues(o),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",r,i,n&&s,n&&i.length<r.length))}showColumn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.showColumns(r)}hideColumns(e){const r=this.getHiddenColumns(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeHideColumns",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{k(e,s=>{Vl(bo,this).setValueAtIndex(this.hot.toPhysicalColumn(s),!0)})},!0),this.hot.runHooks("afterHideColumns",r,i,n,n&&i.length>r.length))}hideColumn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.hideColumns(r)}getHiddenColumns(){return qe(Vl(bo,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return Vl(bo,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const r=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(n=>Number.isInteger(n)&&n>=0&&n<r):!1}resetCellsMeta(){k(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){LV(bo,this,null),super.destroy()}}function Fle(t,e){if(this.isHidden(e))return 0;if(this.getSetting("indicators")&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function Vle(t,e,r){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(e)&&(r.skipColumnOnPaste=!0),this.isHidden(e-1))r.className=r.className||"",r.className.indexOf("afterHiddenColumn")===-1&&(r.className+=" afterHiddenColumn");else if(r.className){const n=r.className.split(" ");if(n.length>0){const i=n.indexOf("afterHiddenColumn");i>-1&&n.splice(i,1),r.className=n.join(" ")}}}function Wle(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],r=(n,i,o,s)=>{e.push({startRow:n,endRow:i,startCol:o,endCol:s})};return k(t,n=>{let i=!0,o=0;Ce(n.startCol,n.endCol,s=>{this.isHidden(s)?(i||r(n.startRow,n.endRow,o,s-1),i=!0):(i&&(o=s),s===n.endCol&&r(n.startRow,n.endRow,o,s),i=!1)})}),e}function Ble(t,e){if(!this.getSetting("indicators")||t<0)return;const r=[];t>=1&&this.isHidden(t-1)&&r.push("afterHiddenColumn"),t<this.hot.countCols()-1&&this.isHidden(t+1)&&r.push("beforeHiddenColumn"),oe(e,r)}function jle(t){t.items.push({name:We},Hle(this),Nle(this))}function Ule(){const t=this.getSetting("columns");Array.isArray(t)&&this.hideColumns(t)}function zle(t){return{key:"hidden_rows_hide",name(){const e=this.getSelectedLast();let r=0;if(Array.isArray(e)){const[n,,i]=e;n-i!==0&&(r=1)}return this.getTranslatedPhrase(_E,r)},callback(){const{from:e,to:r}=this.getSelectedRangeLast(),n=Math.max(Math.min(e.row,r.row),0),i=Math.max(e.row,r.row),o=[];for(let l=n;l<=i;l+=1)o.push(l);t.hideRows(o);const s=o[o.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectRows(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function Yle(t){const e=[];return{key:"hidden_rows_show",name(){const r=e.length>1?1:0;return this.getTranslatedPhrase(ME,r)},callback(){var r,n;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(r=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&r!==void 0?r:0,o=(n=this.rowIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&n!==void 0?n:this.countRows()-1,t.showRows(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countRows()||this.selectRows(i,o)},disabled:!1,hidden(){const r=qe(t.getHiddenRows(),h=>this.toPhysicalRow(h));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||r.length<1)return!0;e.length=0;const n=this.getSelectedRangeLast(),i=n.getTopStartCorner().row,o=n.getBottomEndCorner().row,s=this.rowIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(g=>r.includes(g)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countRows()));else{const h=this.countRows()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return k(c,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function Gle(t,e){FV(t,e),e.add(t)}function qle(t,e,r){FV(t,e),e.set(t,r)}function FV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bl(t,e){return t.get(va(t,e))}function VV(t,e,r){return t.set(va(t,e),r),r}function va(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}de.getSingleton().register("beforeHideRows"),de.getSingleton().register("afterHideRows"),de.getSingleton().register("beforeUnhideRows"),de.getSingleton().register("afterUnhideRows");const WV="hiddenRows",Kle=320;var So=new WeakMap,jl=new WeakSet;class Xle extends rt{constructor(){super(...arguments),Gle(this,jl),qle(this,So,null)}static get PLUGIN_KEY(){return WV}static get PLUGIN_PRIORITY(){return Kle}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[WV]}enablePlugin(){var e=this;this.enabled||(VV(So,this,new hm),Bl(So,this).addLocalHook("init",()=>va(jl,this,rue).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Bl(So,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return va(jl,e,tue).call(e,...n)}),this.addHook("afterGetCellMeta",(r,n,i)=>va(jl,this,Jle).call(this,r,n,i)),this.addHook("modifyRowHeight",(r,n)=>va(jl,this,Zle).call(this,r,n)),this.addHook("afterGetRowHeader",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return va(jl,e,eue).call(e,...n)}),this.addHook("modifyCopyableRange",r=>va(jl,this,Qle).call(this,r)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){const r=this.getHiddenRows(),n=this.isValidConfig(e);let i=r;const o=Bl(So,this).getValues().slice(),s=e.length>0;if(n&&s){const l=e.map(u=>this.hot.toPhysicalRow(u));k(l,u=>{o[u]=!1}),i=hn(o,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",r,i,n&&s)!==!1&&(n&&s&&Bl(So,this).setValues(o),this.hot.runHooks("afterUnhideRows",r,i,n&&s,n&&i.length<r.length))}showRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.showRows(r)}hideRows(e){const r=this.getHiddenRows(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeHideRows",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{k(e,s=>{Bl(So,this).setValueAtIndex(this.hot.toPhysicalRow(s),!0)})},!0),this.hot.runHooks("afterHideRows",r,i,n,n&&i.length>r.length))}hideRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.hideRows(r)}getHiddenRows(){return qe(Bl(So,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return Bl(So,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const r=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(n=>Number.isInteger(n)&&n>=0&&n<r):!1}resetCellsMeta(){k(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){VV(So,this,null),super.destroy()}}function Zle(t,e){return this.isHidden(e)?0:t}function Jle(t,e,r){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(t)&&(r.skipRowOnPaste=!0),this.isHidden(t-1))r.className=r.className||"",r.className.indexOf("afterHiddenRow")===-1&&(r.className+=" afterHiddenRow");else if(r.className){const n=r.className.split(" ");if(n.length>0){const i=n.indexOf("afterHiddenRow");i>-1&&n.splice(i,1),r.className=n.join(" ")}}}function Qle(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],r=(n,i,o,s)=>{e.push({startRow:n,endRow:i,startCol:o,endCol:s})};return k(t,n=>{let i=!0,o=0;Ce(n.startRow,n.endRow,s=>{this.isHidden(s)?(i||r(o,s-1,n.startCol,n.endCol),i=!0):(i&&(o=s),s===n.endRow&&r(o,s,n.startCol,n.endCol),i=!1)})}),e}function eue(t,e){if(!this.getSetting("indicators")||t<0)return;const r=[];t>=1&&this.isHidden(t-1)&&r.push("afterHiddenRow"),t<this.hot.countRows()-1&&this.isHidden(t+1)&&r.push("beforeHiddenRow"),oe(e,r)}function tue(t){t.items.push({name:We},zle(this),Yle(this))}function rue(){const t=this.getSetting("rows");Array.isArray(t)&&this.hideRows(t)}function nue(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(eE)},callback(e,r){const[{start:{col:n}}]=r;t.freezeColumn(n),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let r=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(r=!0),r}}}function iue(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(tE)},callback(e,r){const[{start:{col:n}}]=r;t.unfreezeColumn(n),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let r=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(r=!0),r}}}function oue(t,e){BV(t,e),e.add(t)}function sue(t,e,r){BV(t,e),e.set(t,r)}function BV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function V_(t,e){return t.get(iw(t,e))}function W_(t,e,r){return t.set(iw(t,e),r),r}function iw(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}de.getSingleton().register("beforeColumnFreeze"),de.getSingleton().register("afterColumnFreeze"),de.getSingleton().register("beforeColumnUnfreeze"),de.getSingleton().register("afterColumnUnfreeze");const jV="manualColumnFreeze",aue=110;var Ul=new WeakMap,B_=new WeakSet;class lue extends rt{constructor(){super(...arguments),oue(this,B_),sue(this,Ul,!1)}static get PLUGIN_KEY(){return jV}static get PLUGIN_PRIORITY(){return aue}isEnabled(){return!!this.hot.getSettings()[jV]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>iw(B_,this,uue).call(this,e)),this.addHook("beforeColumnMove",(e,r)=>iw(B_,this,cue).call(this,e,r)),super.enablePlugin())}disablePlugin(){W_(Ul,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const r=this.hot.getSettings(),n=r.fixedColumnsStart<this.hot.countCols()&&e>r.fixedColumnsStart-1;V_(Ul,this)||W_(Ul,this,!0),this.hot.runHooks("beforeColumnFreeze",e,n)!==!1&&(n&&(this.hot.columnIndexMapper.moveIndexes(e,r.fixedColumnsStart),r._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,n))}unfreezeColumn(e){const r=this.hot.getSettings(),n=r.fixedColumnsStart>0&&e<=r.fixedColumnsStart-1;V_(Ul,this)||W_(Ul,this,!0),this.hot.runHooks("beforeColumnUnfreeze",e,n)!==!1&&(n&&(r._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,r.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,n))}}function uue(t){t.items.push({name:"---------"},nue(this),iue(this))}function cue(t,e){if(V_(Ul,this)){const r=this.hot.getSettings().fixedColumnsStart;if(e<r||t.some(n=>n<r))return!1}}function ow(t,e,r){return(e=hue(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hue(t){var e=due(t,"string");return typeof e=="symbol"?e:e+""}function due(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const j_=0,UV=1,zV=2,Oc="px";let YV=class{constructor(e){ow(this,"hot",void 0),ow(this,"_element",null),ow(this,"state",j_),ow(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=zV}build(){this.state===j_&&(this._element=this.hot.rootDocument.createElement("div"),this.state=UV)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=j_}isAppended(){return this.state===zV}isBuilt(){return this.state>=UV}setPosition(e,r){Xr(e)&&(this._element.style.top=e+Oc),Xr(r)&&(this._element.style[this.inlineProperty]=r+Oc)}getPosition(){const e=this._element.style;return{top:e.top?parseInt(e.top,10):0,start:e[this.inlineProperty]?parseInt(e[this.inlineProperty],10):0}}setSize(e,r){Xr(e)&&(this._element.style.width=e+Oc),Xr(r)&&(this._element.style.height=r+Oc)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,r){Xr(e)&&(this._element.style.marginTop=e+Oc),Xr(r)&&(this._element.style[`margin${Ti(this.inlineProperty)}`]=r+Oc)}getOffset(){const e=this._element.style,r=`margin${Ti(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[r]?parseInt(e[r],10):0}}};const fue="ht__manualColumnMove--backlight";let gue=class extends YV{build(){super.build(),oe(this._element,fue)}};const mue="ht__manualColumnMove--guideline";let pue=class extends YV{build(){super.build(),oe(this._element,mue)}};function wue(t,e){GV(t,e),e.add(t)}function Ui(t,e,r){GV(t,e),e.set(t,r)}function GV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function En(t,e,r){return t.set(ya(t,e),r),r}function ve(t,e){return t.get(ya(t,e))}function ya(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}de.getSingleton().register("beforeColumnMove"),de.getSingleton().register("afterColumnMove");const U_="manualColumnMove",vue=120,qV="ht__manualColumnMove",sw="show-ui",z_="on-moving--columns",Y_="after-selection--columns";var tn=new WeakMap,Ca=new WeakMap,Rs=new WeakMap,aw=new WeakMap,ba=new WeakMap,rn=new WeakMap,lw=new WeakMap,di=new WeakMap,xc=new WeakMap,uw=new WeakMap,hf=new WeakMap,zl=new WeakSet;class yue extends rt{constructor(){super(...arguments),wue(this,zl),Ui(this,tn,new gue(this.hot)),Ui(this,Ca,new pue(this.hot)),Ui(this,Rs,[]),Ui(this,aw,0),Ui(this,ba,!1),Ui(this,rn,{}),Ui(this,lw,void 0),Ui(this,di,void 0),Ui(this,xc,void 0),Ui(this,uw,void 0),Ui(this,hf,void 0)}static get PLUGIN_KEY(){return U_}static get PLUGIN_PRIORITY(){return vue}isEnabled(){return!!this.hot.getSettings()[U_]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ya(zl,e,Cue).call(e,...n)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ya(zl,e,Sue).call(e,...n)}),this.addHook("afterScrollVertically",()=>ya(zl,this,Eue).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ya(zl,e,Tue).call(e,...n)}),this.buildPluginUI(),this.registerEvents(),oe(this.hot.rootElement,qV),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){Ee(this.hot.rootElement,qV),this.unregisterEvents(),ve(tn,this).destroy(),ve(Ca,this).destroy(),super.disablePlugin()}moveColumn(e,r){return this.moveColumns([e],r)}moveColumns(e,r){const n=ve(lw,this),i=this.isMovePossible(e,r),o=this.hot.runHooks("beforeColumnMove",e,r,n,i);if(En(lw,this,void 0),o===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,r);const s=i&&this.isColumnOrderChanged(e,r);return this.hot.runHooks("afterColumnMove",e,r,n,i,s),s}dragColumn(e,r){return this.dragColumns([e],r)}dragColumns(e,r){const n=this.countFinalIndex(e,r);return En(lw,this,r),this.moveColumns(e,n)}isMovePossible(e,r){const n=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+r>n,o=r<0,s=e.some(l=>l<0),a=e.some(l=>l>=n);return!(i||o||s||a)}isColumnOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}countFinalIndex(e,r){const n=hn(e,(i,o)=>(o<r&&(i+=1),i),0);return r-n}getColumnsWidth(e,r){const n=this.hot.columnIndexMapper;let i=0;for(let o=e;o<=r;o+=1){const s=n.getRenderableFromVisualIndex(o);o<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:s!==null&&(i+=this.hot.view._wt.wtTable.getColumnWidth(s)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[U_];if(Array.isArray(e))this.moveColumns(e,0);else if(e!==void 0){const r=this.persistentStateLoad();r.length&&this.moveColumns(r,0)}}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualColumnMove",this.hot.columnIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualColumnMove",e),e.value?e.value:[]}prepareColumnsToMoving(e,r){const n=[];return Ce(e,r,i=>{n.push(i)}),n}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(ve(di,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const r=this.hot.view._wt.wtTable,n=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof n.scrollX=="number"?n.scrollX:n.scrollLeft;let o=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,ve(di,this)-1);const s=r.hider.offsetWidth,a=r.TBODY.offsetLeft,l=ve(tn,this).getOffset().start,u=ve(tn,this).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const g=this.hot.rootWindow,w=ir(this.hot.rootElement),v=g.innerWidth-ve(xc,this)-w;h=g.innerWidth-ve(rn,this).eventPageX-v-(n.scrollX===void 0?i:0)}else h=ve(rn,this).eventPageX-(ve(xc,this)-(n.scrollX===void 0?i:0));if(ve(uw,this)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(ve(di,this))&&(o+=i),o+=c,ve(di,this)<0)ve(hf,this)>0?ve(rn,this).col=0:ve(rn,this).col=e>0?e-1:e;else if(ve(rn,this).TD.offsetWidth/2+o<=h){const g=ve(di,this)>=ve(aw,this)?ve(aw,this)-1:ve(di,this);ve(rn,this).col=g+1,o+=ve(rn,this).TD.offsetWidth}else ve(rn,this).col=ve(di,this);let d=h,f=o;h+u+l>=s?d=s-u-l:h+l<a+c&&(d=a+c+Math.abs(l)),o>=s-1?f=s-1:f===0?f=1:n.scrollX!==void 0&&ve(di,this)<ve(hf,this)&&(f-=ve(xc,this)<=n.scrollX?ve(xc,this):0),ve(tn,this).setPosition(null,d),ve(Ca,this).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",r=>ya(zl,this,bue).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>ya(zl,this,Rue).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){ve(tn,this).build(),ve(Ca,this).build()}destroy(){ve(tn,this).destroy(),ve(Ca,this).destroy(),super.destroy()}}function Cue(t,e,r,n){const i=this.hot.view._wt.wtTable,o=this.hot.selection.isSelectedByColumnHeader(),s=this.hot.getSelectedRangeLast(),a=_e(t.target,"sortAction");if(!s||!o||ve(ba,this)||t.button!==0||a){En(ba,this,!1),ve(Rs,this).length=0,Ee(this.hot.rootElement,[z_,sw]);return}const l=ve(Ca,this).isBuilt()&&!ve(Ca,this).isAppended(),u=ve(tn,this).isBuilt()&&!ve(tn,this).isAppended();l&&u&&(ve(Ca,this).appendTo(i.hider),ve(tn,this).appendTo(i.hider));const{from:c,to:h}=s,d=Math.min(c.col,h.col),f=Math.max(c.col,h.col);if(e.row<0&&e.col>=d&&e.col<=f){n.column=!0,En(ba,this,!0);const g=r.firstChild?x3(t,r.firstChild).x:t.offsetX;ve(rn,this).eventPageX=t.pageX,En(di,this,e.col),ve(rn,this).TD=r,ve(rn,this).col=e.col,En(Rs,this,this.prepareColumnsToMoving(d,f)),En(uw,this,!!this.hot.getSettings().rowHeaders),En(aw,this,this.hot.countCols()),En(hf,this,this.hot.getSettings().fixedColumnsStart),En(xc,this,kr(this.hot.rootElement).left);const w=ve(uw,this)?-1:0,v=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,b=e.col<ve(hf,this),p=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),_=Math.abs(g-(this.hot.isRtl()?r.offsetWidth:0)),O=this.getColumnsWidth(d,e.col-1)+_,T=this.getColumnsWidth(w,d-1)+(b?p:0)+O;ve(tn,this).setPosition(v,T),ve(tn,this).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-v),ve(tn,this).setOffset(null,-O),oe(this.hot.rootElement,z_)}else Ee(this.hot.rootElement,Y_),En(ba,this,!1),ve(Rs,this).length=0}function bue(t){ve(ba,this)&&(ve(rn,this).eventPageX=t.pageX,this.refreshPositions())}function Sue(t,e,r,n){!this.hot.getSelectedRangeLast()||!ve(ba,this)||(ve(Rs,this).indexOf(e.col)>-1?Ee(this.hot.rootElement,sw):oe(this.hot.rootElement,sw),n.row=!0,n.column=!0,n.cell=!0,En(di,this,e.col),ve(rn,this).TD=r)}function Rue(){const t=ve(rn,this).col,e=ve(Rs,this).length;if(En(di,this,void 0),En(ba,this,!1),Ee(this.hot.rootElement,[z_,sw,Y_]),this.hot.selection.isSelectedByColumnHeader()&&oe(this.hot.rootElement,Y_),e<1||t===void 0)return;const r=ve(Rs,this)[0],n=this.hot.toPhysicalColumn(r),i=this.dragColumns(ve(Rs,this),t);if(ve(Rs,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualColumn(n),s=o+e-1;this.hot.selectColumns(o,s)}}function Eue(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,r=t.holder.scrollTop,n=e+r;ve(tn,this).setPosition(n),ve(tn,this).setSize(null,t.hider.offsetHeight-n)}function Tue(){this.moveBySettingsOrLoad()}function _ue(t,e){KV(t,e),e.add(t)}function Wr(t,e,r){KV(t,e),e.set(t,r)}function KV(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jt(t,e,r){return t.set(zi(t,e),r),r}function ge(t,e){return t.get(zi(t,e))}function zi(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const cw="manualColumnResize",Mue=130,XV="manualColumnWidths";var Es=new WeakMap,hw=new WeakMap,Bn=new WeakMap,dw=new WeakMap,Ro=new WeakMap,Pue=new WeakMap,Ac=new WeakMap,fw=new WeakMap,Tn=new WeakMap,Ts=new WeakMap,Yl=new WeakMap,gw=new WeakMap,df=new WeakMap,ff=new WeakMap,jn=new WeakMap,gf=new WeakMap,Eo=new WeakSet;class Iue extends rt{static get PLUGIN_KEY(){return cw}static get PLUGIN_PRIORITY(){return Mue}constructor(e){super(e),_ue(this,Eo),Wr(this,Es,null),Wr(this,hw,null),Wr(this,Bn,[]),Wr(this,dw,null),Wr(this,Ro,null),Wr(this,Pue,null),Wr(this,Ac,null),Wr(this,fw,null),Wr(this,Tn,this.hot.rootDocument.createElement("DIV")),Wr(this,Ts,this.hot.rootDocument.createElement("DIV")),Wr(this,Yl,null),Wr(this,gw,!1),Wr(this,df,0),Wr(this,ff,null),Wr(this,jn,void 0),Wr(this,gf,void 0),oe(ge(Tn,this),"manualColumnResizer"),oe(ge(Ts,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[cw]}enablePlugin(){var e=this;this.enabled||(Jt(jn,this,new Js),ge(jn,this).addLocalHook("init",()=>zi(Eo,this,Oue).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ge(jn,this)),this.addHook("modifyColWidth",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zi(Eo,e,kue).call(e,...n)},1),this.addHook("beforeStretchingColumnWidth",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zi(Eo,e,Lue).call(e,...n)},1),this.addHook("beforeColumnResize",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zi(Eo,e,$ue).call(e,...n)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Jt(gf,this,ge(jn,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",XV,ge(jn,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",XV,e),e.value}setManualSize(e,r){const n=Math.max(r,20),i=this.hot.toPhysicalColumn(e);return ge(jn,this).setValueAtIndex(i,n),n}clearManualSize(e){const r=this.hot.toPhysicalColumn(e);ge(jn,this).setValueAtIndex(r,null)}setupHandlePosition(e){if(!e.parentNode)return;Jt(Es,this,e);const{_wt:r}=this.hot.view,n=r.wtTable.getCoords(ge(Es,this)),i=n.col;if(i<0)return;const o=dr(ge(Es,this)),s=ge(Es,this).getBoundingClientRect(),a=i<r.getSetting("fixedColumnsStart");let l;a&&(l=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ge(Es,this),n.row,n.col)),l||(l=r.wtOverlays.topOverlay.getRelativeCellPosition(ge(Es,this),n.row,n.col)),Jt(hw,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),Jt(Bn,this,[]);const u=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&u){const c=this.hot.getSelectedRange();k(c,h=>{const d=h.getTopStartCorner().col,f=h.getBottomEndCorner().col;Ce(d,f,g=>{ge(Bn,this).includes(g)||ge(Bn,this).push(g)})})}ge(Bn,this).includes(ge(hw,this))||Jt(Bn,this,[ge(hw,this)]),Jt(fw,this,l.start-6),Jt(Ac,this,parseInt(s.width,10)),ge(Tn,this).style.top=`${l.top}px`,ge(Tn,this).style[this.inlineDir]=`${ge(fw,this)+ge(Ac,this)}px`,ge(Tn,this).style.height=`${o}px`,this.hot.rootElement.appendChild(ge(Tn,this))}refreshHandlePosition(){ge(Tn,this).style[this.inlineDir]=`${ge(fw,this)+ge(dw,this)}px`}setupGuidePosition(){const e=parseInt(dr(ge(Tn,this)),10),r=parseInt(ge(Tn,this).style.top,10)+e,n=this.hot.view.getTableHeight();oe(ge(Tn,this),"active"),oe(ge(Ts,this),"active"),ge(Ts,this).style.top=`${r}px`,this.refreshGuidePosition(),ge(Ts,this).style.height=`${n-e}px`,this.hot.rootElement.appendChild(ge(Ts,this))}refreshGuidePosition(){ge(Ts,this).style[this.inlineDir]=ge(Tn,this).style[this.inlineDir]}hideHandleAndGuide(){Ee(ge(Tn,this),"active"),Ee(ge(Ts,this),"active")}checkIfColumnHeader(e){const r=qa(e,["THEAD"],this.hot.rootElement),{topOverlay:n,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(r)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},r=(n,i)=>{const o=this.hot.runHooks("beforeColumnResize",ge(Ro,this),n,!0);o!==void 0&&Jt(Ro,this,o),this.setManualSize(n,ge(Ro,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ge(Ro,this),n,!0),i&&e()};ge(df,this)>=2&&(ge(Bn,this).length>1?(k(ge(Bn,this),i=>{r(i)}),e()):k(ge(Bn,this),i=>{r(i,!0)})),Jt(df,this,0),Jt(ff,this,null)}bindEvents(){const{rootWindow:e,rootElement:r}=this.hot;this.eventManager.addEventListener(r,"mouseover",n=>zi(Eo,this,xue).call(this,n)),this.eventManager.addEventListener(r,"mousedown",n=>zi(Eo,this,Aue).call(this,n)),this.eventManager.addEventListener(e,"mousemove",n=>zi(Eo,this,Hue).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>zi(Eo,this,Nue).call(this)),this.eventManager.addEventListener(ge(Tn,this),"contextmenu",()=>zi(Eo,this,Due).call(this))}destroy(){super.destroy()}}function Oue(){const t=this.hot.getSettings()[cw],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((r,n)=>{ge(jn,this).setValueAtIndex(n,r)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((r,n)=>{ge(jn,this).setValueAtIndex(n,r)})},!0),Jt(gf,this,t)):t===!0&&Array.isArray(ge(gf,this))&&this.hot.batchExecution(()=>{ge(gf,this).forEach((r,n)=>{ge(jn,this).setValueAtIndex(n,r)})},!0)}function xue(t){if(!$H(t.target)&&ge(gw,this)!==!0&&this.checkIfColumnHeader(t.target)){const e=this.getClosestTHParent(t.target);if(!e)return;const r=e.getAttribute("colspan");e&&(r===null||r==="1")&&(ge(Yl,this)||this.setupHandlePosition(e))}}function Aue(t){t.target.parentNode===this.hot.rootElement&&_e(t.target,"manualColumnResizer")&&(this.setupHandlePosition(ge(Es,this)),this.setupGuidePosition(),Jt(Yl,this,!0),ge(ff,this)===null&&(Jt(ff,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ge(ff,this))),Jt(df,this,ge(df,this)+1),this.startX=t.pageX,Jt(Ro,this,ge(Ac,this)))}function Hue(t){if(ge(Yl,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();Jt(dw,this,ge(Ac,this)+e),k(ge(Bn,this),r=>{Jt(Ro,this,this.setManualSize(r,ge(dw,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function Nue(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(r,n)=>{this.hot.runHooks("beforeColumnResize",ge(Ro,this),r,!1),n&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ge(Ro,this),r,!1)};ge(Yl,this)&&(this.hideHandleAndGuide(),Jt(Yl,this,!1),ge(Ro,this)!==ge(Ac,this)&&(ge(Bn,this).length>1?(k(ge(Bn,this),n=>{e(n)}),t()):k(ge(Bn,this),n=>{e(n,!0)})),this.setupHandlePosition(ge(Es,this)))}function Due(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ge(Tn,this)),this.hot.rootElement.removeChild(ge(Ts,this)),Jt(Yl,this,!1),Jt(gw,this,!0),this.hot._registerImmediate(()=>{Jt(gw,this,!1)})}function kue(t,e){let r=t;if(this.enabled){const n=this.hot.toPhysicalColumn(e),i=ge(jn,this).getValueAtIndex(n);this.hot.getSettings()[cw]&&i&&(r=i)}return r}function Lue(t,e){const r=ge(jn,this).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof r=="number"?r:t}function $ue(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function G_(t,e,r){return(e=Fue(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fue(t){var e=Vue(t,"string");return typeof e=="symbol"?e:e+""}function Vue(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const q_=0,ZV=1,JV=2,Hc="px";let QV=class{constructor(e){G_(this,"hot",void 0),G_(this,"_element",null),G_(this,"state",q_),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=JV}build(){this.state===q_&&(this._element=this.hot.rootDocument.createElement("div"),this.state=ZV)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=q_}isAppended(){return this.state===JV}isBuilt(){return this.state>=ZV}setPosition(e,r){e!==void 0&&(this._element.style.top=e+Hc),r!==void 0&&(this._element.style.left=r+Hc)}getPosition(){return{top:this._element.style.top?parseInt(this._element.style.top,10):0,left:this._element.style.left?parseInt(this._element.style.left,10):0}}setSize(e,r){e&&(this._element.style.width=e+Hc),r&&(this._element.style.height=r+Hc)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,r){e&&(this._element.style.marginTop=e+Hc),r&&(this._element.style.marginLeft=r+Hc)}getOffset(){return{top:this._element.style.marginTop?parseInt(this._element.style.marginTop,10):0,left:this._element.style.marginLeft?parseInt(this._element.style.marginLeft,10):0}}};const Wue="ht__manualRowMove--backlight";class Bue extends QV{build(){super.build(),oe(this._element,Wue)}}const jue="ht__manualRowMove--guideline";class Uue extends QV{build(){super.build(),oe(this._element,jue)}}function zue(t,e){eW(t,e),e.add(t)}function Nc(t,e,r){eW(t,e),e.set(t,r)}function eW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gl(t,e,r){return t.set(Sa(t,e),r),r}function Oe(t,e){return t.get(Sa(t,e))}function Sa(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}de.getSingleton().register("beforeRowMove"),de.getSingleton().register("afterRowMove");const K_="manualRowMove",Yue=140,tW="ht__manualRowMove",mw="show-ui",X_="on-moving--rows",Z_="after-selection--rows";var nn=new WeakMap,Ra=new WeakMap,_s=new WeakMap,Ea=new WeakMap,_n=new WeakMap,pw=new WeakMap,ql=new WeakSet;class Gue extends rt{constructor(){super(...arguments),zue(this,ql),Nc(this,nn,new Bue(this.hot)),Nc(this,Ra,new Uue(this.hot)),Nc(this,_s,[]),Nc(this,Ea,void 0),Nc(this,_n,{}),Nc(this,pw,void 0)}static get PLUGIN_KEY(){return K_}static get PLUGIN_PRIORITY(){return Yue}isEnabled(){return!!this.hot.getSettings()[K_]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sa(ql,e,que).call(e,...n)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sa(ql,e,Xue).call(e,...n)}),this.addHook("afterScrollHorizontally",()=>Sa(ql,this,Jue).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sa(ql,e,Que).call(e,...n)}),this.buildPluginUI(),this.registerEvents(),oe(this.hot.rootElement,tW),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){Ee(this.hot.rootElement,tW),this.unregisterEvents(),Oe(nn,this).destroy(),Oe(Ra,this).destroy(),super.disablePlugin()}moveRow(e,r){return this.moveRows([e],r)}moveRows(e,r){const n=Oe(pw,this),i=this.isMovePossible(e,r),o=this.hot.runHooks("beforeRowMove",e,r,n,i);if(Gl(pw,this,void 0),o===!1)return;i&&this.hot.rowIndexMapper.moveIndexes(e,r);const s=i&&this.isRowOrderChanged(e,r);return this.hot.runHooks("afterRowMove",e,r,n,i,s),s}dragRow(e,r){return this.dragRows([e],r)}dragRows(e,r){const n=this.countFinalIndex(e,r);return Gl(pw,this,r),this.moveRows(e,n)}isMovePossible(e,r){const n=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+r>n,o=r<0,s=e.some(l=>l<0),a=e.some(l=>l>=n);return!(i||o||s||a)}isRowOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}countFinalIndex(e,r){const n=hn(e,(i,o)=>(o<r&&(i+=1),i),0);return r-n}getRowsHeight(e,r){const n=this.hot.rowIndexMapper;let i=0;for(let o=e;o<=r;o++){const s=n.getRenderableFromVisualIndex(o);s!==null&&(i+=this.hot.view._wt.wtTable.getRowHeight(s)||this.hot.view.getDefaultRowHeight())}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[K_];if(Array.isArray(e))this.moveRows(e,0);else if(e!==void 0){const r=this.persistentStateLoad();r.length&&this.moveRows(r,0)}}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),r=[];if(!e)return r;const{from:n,to:i}=e,o=Math.min(n.row,i.row),s=Math.max(n.row,i.row);return Ce(o,s,a=>{r.push(a)}),r}refreshPositions(){const e=Oe(_n,this).coords,r=this.hot.getFirstFullyVisibleRow(),n=this.hot.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&r>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r-1,-1)),this.isFixedRowBottom(e.row)&&n<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n+1,1),void 0,!0);const o=this.hot.view._wt.wtTable,s=Oe(_n,this).TD,a=this.hot.rootElement,l=kr(a),u=Ih(a),c=o.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,f=Oe(_n,this).eventPageY-d+c,g=o.hider.offsetHeight,w=o.TBODY.offsetTop,v=Oe(nn,this).getOffset().top,b=Oe(nn,this).getSize().height,p=s.offsetHeight/2,_=s.offsetHeight;let O=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const T=f>=O+p;this.isFixedRowTop(e.row)&&(O+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Oe(_n,this).row=r>0?r-1:r:T?(Oe(_n,this).row=e.row+1,O+=e.row===0?_-1:_):Oe(_n,this).row=e.row;let M=f,P=O;f+b+v>=g?M=g-b-v:f+v<w&&(M=w+Math.abs(v)),O>=g-1&&(P=g-1),Oe(nn,this).setPosition(M),Oe(Ra,this).setPosition(P)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",r=>Sa(ql,this,Kue).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>Sa(ql,this,Zue).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Oe(nn,this).build(),Oe(Ra,this).build()}destroy(){Oe(nn,this).destroy(),Oe(Ra,this).destroy(),super.destroy()}}function que(t,e,r,n){const{wtTable:i,wtViewport:o}=this.hot.view._wt,s=this.hot.selection.isSelectedByRowHeader(),a=this.hot.getSelectedRangeLast();if(!a||!s||Oe(Ea,this)||t.button!==0){Gl(Ea,this,!1),Oe(_s,this).length=0,Ee(this.hot.rootElement,[X_,mw]);return}const l=Oe(Ra,this).isBuilt()&&!Oe(Ra,this).isAppended(),u=Oe(nn,this).isBuilt()&&!Oe(nn,this).isAppended();l&&u&&(Oe(Ra,this).appendTo(i.hider),Oe(nn,this).appendTo(i.hider));const{from:c,to:h}=a,d=Math.min(c.row,h.row),f=Math.max(c.row,h.row);if(e.col<0&&e.row>=d&&e.row<=f){n.row=!0,Gl(Ea,this,!0),Oe(_n,this).eventPageY=t.pageY,Oe(_n,this).coords=e,Oe(_n,this).TD=r,Gl(_s,this,this.prepareRowsToMoving());const g=i.holder.scrollLeft+o.getRowHeaderWidth(),w=this.getRowsHeight(d,e.row-1)+(t.clientY-r.getBoundingClientRect().top);Oe(nn,this).setPosition(null,g),Oe(nn,this).setSize(i.hider.offsetWidth-g,this.getRowsHeight(d,f)),Oe(nn,this).setOffset(-w,null),oe(this.hot.rootElement,X_),this.refreshPositions()}else Ee(this.hot.rootElement,Z_),Gl(Ea,this,!1),Oe(_s,this).length=0}function Kue(t){Oe(Ea,this)&&(Oe(_n,this).eventPageY=t.pageY,this.refreshPositions())}function Xue(t,e,r,n){!this.hot.getSelectedRangeLast()||!Oe(Ea,this)||(Oe(_s,this).indexOf(e.row)>-1?Ee(this.hot.rootElement,mw):oe(this.hot.rootElement,mw),n.row=!0,n.column=!0,n.cell=!0,Oe(_n,this).coords=e,Oe(_n,this).TD=r)}function Zue(){const t=Oe(_n,this).row,e=Oe(_s,this).length;if(Gl(Ea,this,!1),Ee(this.hot.rootElement,[X_,mw,Z_]),this.hot.selection.isSelectedByRowHeader()&&oe(this.hot.rootElement,Z_),e<1||t===void 0)return;const r=Oe(_s,this)[0],n=this.hot.toPhysicalRow(r),i=this.dragRows(Oe(_s,this),t);if(Oe(_s,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualRow(n),s=o+e-1;this.hot.selectRows(o,s)}}function Jue(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),r=t.holder.scrollLeft,n=e+r;Oe(nn,this).setPosition(null,n),Oe(nn,this).setSize(t.hider.offsetWidth-n)}function Que(){this.moveBySettingsOrLoad()}function ece(t,e){rW(t,e),e.add(t)}function Br(t,e,r){rW(t,e),e.set(t,r)}function rW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zt(t,e,r){return t.set(Ms(t,e),r),r}function fe(t,e){return t.get(Ms(t,e))}function Ms(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const ww="manualRowResize",tce=30,nW="manualRowHeights";var To=new WeakMap,vw=new WeakMap,Un=new WeakMap,mf=new WeakMap,Ta=new WeakMap,J_=new WeakMap,Dc=new WeakMap,yw=new WeakMap,on=new WeakMap,_o=new WeakMap,Kl=new WeakMap,Cw=new WeakMap,pf=new WeakMap,wf=new WeakMap,Yi=new WeakMap,vf=new WeakMap,_a=new WeakSet;class rce extends rt{static get PLUGIN_KEY(){return ww}static get PLUGIN_PRIORITY(){return tce}constructor(e){super(e),ece(this,_a),Br(this,To,null),Br(this,vw,null),Br(this,Un,[]),Br(this,mf,null),Br(this,Ta,null),Br(this,J_,null),Br(this,Dc,null),Br(this,yw,null),Br(this,on,this.hot.rootDocument.createElement("DIV")),Br(this,_o,this.hot.rootDocument.createElement("DIV")),Br(this,Kl,!1),Br(this,Cw,!1),Br(this,pf,0),Br(this,wf,null),Br(this,Yi,void 0),Br(this,vf,void 0),oe(fe(on,this),"manualRowResizer"),oe(fe(_o,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[ww]}enablePlugin(){this.enabled||(zt(Yi,this,new Js),fe(Yi,this).addLocalHook("init",()=>Ms(_a,this,uce).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,fe(Yi,this)),this.addHook("modifyRowHeight",(e,r)=>Ms(_a,this,lce).call(this,e,r)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){zt(vf,this,fe(Yi,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",nW,fe(Yi,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",nW,e),e.value}setManualSize(e,r){const n=this.hot.toPhysicalRow(e),i=Math.max(r,this.hot.view.getDefaultRowHeight());return fe(Yi,this).setValueAtIndex(n,i),i}getLastDesiredRowHeight(){return fe(mf,this)}setupHandlePosition(e){zt(To,this,e);const{view:r}=this.hot,{_wt:n}=r,i=n.wtTable.getCoords(fe(To,this)),o=i.row;if(o<0)return;const s=ir(fe(To,this)),a=fe(To,this).getBoundingClientRect(),l=o<n.getSetting("fixedRowsTop"),u=o>=r.countNotHiddenRowIndexes(0,1)-n.getSetting("fixedRowsBottom");let c;l?c=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(fe(To,this),i.row,i.col):u&&(c=n.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(fe(To,this),i.row,i.col)),c||(c=n.wtOverlays.inlineStartOverlay.getRelativeCellPosition(fe(To,this),i.row,i.col)),zt(vw,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),zt(Un,this,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();k(d,f=>{const g=f.getTopStartCorner().row,w=f.getBottomStartCorner().row;Ce(g,w,v=>{fe(Un,this).includes(v)||fe(Un,this).push(v)})})}fe(Un,this).includes(fe(vw,this))||zt(Un,this,[fe(vw,this)]),zt(yw,this,c.top-6),zt(Dc,this,parseInt(a.height,10)),fe(on,this).style.top=`${fe(yw,this)+fe(Dc,this)}px`,fe(on,this).style[this.inlineDir]=`${c.start}px`,fe(on,this).style.width=`${s}px`,this.hot.rootElement.appendChild(fe(on,this))}refreshHandlePosition(){fe(on,this).style.top=`${fe(yw,this)+fe(mf,this)}px`}setupGuidePosition(){const e=parseInt(ir(fe(on,this)),10),r=parseInt(fe(on,this).style[this.inlineDir],10)+e,n=this.hot.view.getTableWidth();oe(fe(on,this),"active"),oe(fe(_o,this),"active"),fe(_o,this).style.top=fe(on,this).style.top,fe(_o,this).style[this.inlineDir]=`${r}px`,fe(_o,this).style.width=`${n-e}px`,this.hot.rootElement.appendChild(fe(_o,this))}refreshGuidePosition(){fe(_o,this).style.top=fe(on,this).style.top}hideHandleAndGuide(){Ee(fe(on,this),"active"),Ee(fe(_o,this),"active")}checkIfRowHeader(e){const r=qa(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:n,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:o}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.TBODY,i.clone.wtTable.TBODY,o.clone.wtTable.TBODY].includes(r)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const r=this.hot.view._wt.wtTable.getRowHeight(e);return r!==void 0&&fe(Ta,this)<r?r:fe(Ta,this)}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},r=(n,i)=>{const o=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!0);o!==void 0&&zt(Ta,this,o),this.setManualSize(n,fe(Ta,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!0),i&&e()};fe(pf,this)>=2&&(fe(Un,this).length>1?(k(fe(Un,this),i=>{r(i)}),e()):k(fe(Un,this),i=>{r(i,!0)})),zt(pf,this,0),zt(wf,this,null)}bindEvents(){const{rootElement:e,rootWindow:r}=this.hot;this.eventManager.addEventListener(e,"mouseover",n=>Ms(_a,this,nce).call(this,n)),this.eventManager.addEventListener(e,"mousedown",n=>Ms(_a,this,ice).call(this,n)),this.eventManager.addEventListener(r,"mousemove",n=>Ms(_a,this,oce).call(this,n)),this.eventManager.addEventListener(r,"mouseup",()=>Ms(_a,this,sce).call(this)),this.eventManager.addEventListener(fe(on,this),"contextmenu",()=>Ms(_a,this,ace).call(this))}destroy(){super.destroy()}}function nce(t){if(!$H(t.target)&&fe(Cw,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(fe(Kl,this)||this.setupHandlePosition(e))}}function ice(t){_e(t.target,"manualRowResizer")&&(this.setupHandlePosition(fe(To,this)),this.setupGuidePosition(),zt(Kl,this,!0),fe(wf,this)===null&&(zt(wf,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(fe(wf,this))),zt(pf,this,fe(pf,this)+1),zt(J_,this,t.pageY),zt(Ta,this,fe(Dc,this)))}function oce(t){fe(Kl,this)&&(zt(mf,this,fe(Dc,this)+(t.pageY-fe(J_,this))),k(fe(Un,this),e=>{zt(Ta,this,this.setManualSize(e,fe(mf,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function sce(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(r,n)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!1),n&&t(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!1)};fe(Kl,this)&&(this.hideHandleAndGuide(),zt(Kl,this,!1),fe(Ta,this)!==fe(Dc,this)&&(fe(Un,this).length>1?(k(fe(Un,this),n=>{e(n)}),t()):k(fe(Un,this),n=>{e(n,!0)})),this.setupHandlePosition(fe(To,this)))}function ace(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(fe(on,this)),this.hot.rootElement.removeChild(fe(_o,this)),zt(Kl,this,!1),zt(Cw,this,!0),this.hot._registerImmediate(()=>{zt(Cw,this,!1)})}function lce(t,e){let r=t;if(this.enabled){const n=this.hot.toPhysicalRow(e),i=fe(Yi,this).getValueAtIndex(n);this.hot.getSettings()[ww]&&i&&(r=i)}return r}function uce(){const t=this.hot.getSettings()[ww],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((r,n)=>{fe(Yi,this).setValueAtIndex(n,r)}):Array.isArray(t)?(t.forEach((r,n)=>{fe(Yi,this).setValueAtIndex(n,r)}),zt(vf,this,t)):t===!0&&Array.isArray(fe(vf,this))&&fe(vf,this).forEach((r,n)=>{fe(Yi,this).setValueAtIndex(n,r)})},!0)}var iW={},oW;function cce(){if(oW)return iW;oW=1;var t=zg();return t("flatMap"),iW}cce();var sW={},aW={},Q_,lW;function hce(){if(lW)return Q_;lW=1;var t=ur(),e=hr(),r=Qi(),n=IC();return Q_=function(i,o){(!o||typeof i!="string")&&e(i);var s=n(i);return r(e(s!==void 0?t(s,i):i))},Q_}var uW;function dce(){if(uW)return aW;uW=1;var t=bt(),e=ur(),r=ln(),n=hr(),i=Qi(),o=hce(),s=db(),a=un(),l=Fs(),u=mb(),c=Ws(),h=!l&&!u("flatMap",function(){}),d=!l&&!h&&c("flatMap",TypeError),f=l||h||d,g=s(function(){for(var w=this.iterator,v=this.mapper,b,p;;){if(p=this.inner)try{if(b=n(e(p.next,p.iterator)),!b.done)return b.value;this.inner=null}catch(_){a(w,"throw",_)}if(b=n(e(this.next,w)),this.done=!!b.done)return;try{this.inner=o(v(b.value,this.counter++),!1)}catch(_){a(w,"throw",_)}}});return t({target:"Iterator",proto:!0,real:!0,forced:f},{flatMap:function(v){n(this);try{r(v)}catch(b){a(this,"throw",b)}return d?e(d,this,v):new g(i(this),{mapper:v,inner:null})}}),aW}var cW;function fce(){return cW||(cW=1,dce()),sW}fce();function gce(t,e,r){mce(t,e),e.set(t,r)}function mce(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xl(t,e,r){return(e=pce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pce(t){var e=wce(t,"string");return typeof e=="symbol"?e:e+""}function wce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hW(t,e){return t.get(dW(t,e))}function bw(t,e,r){return t.set(dW(t,e),r),r}function dW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Zl=new WeakMap;class Mo{constructor(e,r,n,i,o,s){Xl(this,"row",void 0),Xl(this,"col",void 0),Xl(this,"rowspan",void 0),Xl(this,"colspan",void 0),Xl(this,"removed",!1),Xl(this,"cellCoordsFactory",void 0),Xl(this,"cellRangeFactory",void 0),gce(this,Zl,null),this.row=e,this.col=r,this.rowspan=n,this.colspan=i,this.cellCoordsFactory=o,this.cellRangeFactory=s}static NEGATIVE_VALUES_WARNING(e){let{row:r,col:n,rowspan:i,colspan:o}=e;return at`The merged cell declared with {row: ${r}, col: ${n},\x20
750
+ rowspan: ${i}, colspan: ${o}} contains negative values, which is\x20
751
+ not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:r,col:n}=e;return at`The merged cell declared at [${r}, ${n}] is positioned\x20
752
+ (or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){let{row:r,col:n}=e;return at`The merged cell declared at [${r}, ${n}] has both "rowspan"\x20
753
+ and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){let{row:r,col:n}=e;return at`The merged cell declared at [${r}, ${n}] has "rowspan"\x20
754
+ or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){let{row:r,col:n,rowspan:i,colspan:o}=e;return r<0||n<0||i<0||o<0}static isSingleCell(e){let{rowspan:r,colspan:n}=e;return n===1&&r===1}static containsZeroSpan(e){let{rowspan:r,colspan:n}=e;return n===0||r===0}static isOutOfBounds(e,r,n){return e.row<0||e.col<0||e.row>=r||e.row+e.rowspan-1>=r||e.col>=n||e.col+e.colspan-1>=n}normalize(e){const r=e.countRows(),n=e.countCols();this.row<0?this.row=0:this.row>r-1&&(this.row=r-1),this.col<0?this.col=0:this.col>n-1&&(this.col=n-1),this.row+this.rowspan>r-1&&(this.rowspan=r-this.row),this.col+this.colspan>n-1&&(this.colspan=n-this.col),bw(Zl,this,null)}includes(e,r){return this.row<=e&&this.col<=r&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=r}includesHorizontally(e){return this.col<=e&&this.col+this.colspan-1>=e}includesVertically(e){return this.row<=e&&this.row+this.rowspan-1>=e}shift(e,r){const n=e[0]||e[1],i=r+Math.abs(e[0]||e[1])-1,o=e[0]?"colspan":"rowspan",s=e[0]?"col":"row",a=Math.min(r,i),l=Math.max(r,i),u=this[s],c=this[s]+this[o]-1;if(u>=r&&(this[s]+=n),n>0)r<=c&&r>u&&(this[o]+=n);else if(n<0){if(a<=u&&l>=c)return this.removed=!0,bw(Zl,this,null),!1;if(u>=a&&u<=l){const h=l-u+1,d=Math.abs(n)-h;this[s]-=d+n,this[o]-=h}else if(u<=a&&c>=l)this[o]+=n;else if(u<=a&&c>=a&&c<l){const h=c-a+1;this[o]-=h}}return bw(Zl,this,null),!0}isFarther(e,r){return e?r==="down"?e.row+e.rowspan-1<this.row+this.rowspan-1:r==="up"?e.row>this.row:r==="right"?e.col+e.colspan-1<this.col+this.colspan-1:r==="left"?e.col>this.col:null:!0}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return hW(Zl,this)||bw(Zl,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),hW(Zl,this)}}function vce(t,e){yce(t,e),e.add(t)}function yce(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sw(t,e,r){return(e=Cce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cce(t){var e=bce(t,"string");return typeof e=="symbol"?e:e+""}function bce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jl(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Ma=new WeakSet;class Rw{constructor(e){vce(this,Ma),Sw(this,"plugin",void 0),Sw(this,"mergedCells",[]),Sw(this,"mergedCellsMatrix",new Map),Sw(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:r,col:n}=e;return at`The merged cell declared at [${r}, ${n}], overlaps\x20
755
+ with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
756
+ fix your setup.`}get(e,r){var n;return this.mergedCellsMatrix.has(e)&&(n=this.mergedCellsMatrix.get(e).get(r))!==null&&n!==void 0?n:!1}getByRange(e){const{row:r,col:n}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.mergedCells.length;let a=!1;for(let l=0;l<s;l++){const u=this.mergedCells[l],{row:c,col:h,rowspan:d,colspan:f}=u;if(c>=r&&c+d-1<=i&&h>=n&&h+f-1<=o){a=u;break}}return a}filterOverlappingMergeCells(e){const r=new Set;return this.mergedCells.forEach(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i;for(let u=o;u<o+l;u++)for(let c=s;c<s+a;c++)r.add(`r${u},c${c}`)}),e.filter(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i,u=new Set;let c=!1;for(let h=o;h<o+l;h++){for(let d=s;d<s+a;d++){const f=`r${h},c${d}`;if(r.has(f)){st(Rw.IS_OVERLAPPING_WARNING(i)),c=!0;break}u.add(f)}if(c)break}return c||r.add(...u),!c})}getWithinRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{row:n,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),a=[];for(let l=n;l<=o;l++)for(let u=i;u<=s;u++){const c=this.get(l,u);c&&(r||!r&&c.row===l&&c.col===u)&&a.push(c)}return a}add(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=e.row,i=e.col,o=e.rowspan,s=e.colspan,a=new Mo(n,i,o,s,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(n,i),u=r?!1:this.isOverlapping(a);return!l&&!u?(this.hot&&a.normalize(this.hot),this.mergedCells.push(a),Jl(Ma,this,fW).call(this,a),a):(u&&st(Rw.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,r){const n=this.get(e,r),i=n?this.mergedCells.indexOf(n):-1;return n&&i!==-1?(this.mergedCells.splice(i,1),Jl(Ma,this,Sce).call(this,n),n):!1}clear(){k(this.mergedCells,e=>{let{row:r,col:n,rowspan:i,colspan:o}=e;Ce(r,r+i,s=>{Ce(n,n+o,a=>{const l=this.hot.getCell(s,a);l&&(l.removeAttribute("rowspan"),l.removeAttribute("colspan"),l.style.display="")})})}),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const r=e.getRange();for(let n=0;n<this.mergedCells.length;n++)if(this.mergedCells[n].getRange().overlaps(r))return!0;return!1}isFirstRenderableMergedCell(e,r){const n=this.get(e,r);if(!n)return!1;const{row:i,col:o,rowspan:s,colspan:a}=n,l=this.hot.view.getActiveOverlayName(),u=["top","top_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleRow(),c=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleColumn(),h=Ze(u,i,i+s-1),d=Ze(c,o,o+a-1);return this.hot.rowIndexMapper.getNearestNotHiddenIndex(h,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(d,1)===r}getFirstRenderableCoords(e,r){const n=this.get(e,r);if(!n||this.isFirstRenderableMergedCell(e,r))return this.hot._createCellCoords(e,r);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(n.row,1),o=this.hot.columnIndexMapper.getNearestNotHiddenIndex(n.col,1);return this.hot._createCellCoords(i,o)}getStartMostColumnIndex(e,r){const n=Jl(Ma,this,Ew).call(this,e,"col",-1);let i=r;for(let o=0;o<n.length;o++)if(n[o]<=r){i=n[o];break}return i}getEndMostColumnIndex(e,r){const n=Jl(Ma,this,Ew).call(this,e,"col",1);let i=r;for(let o=0;o<n.length;o++)if(n[o]>=r){i=n[o];break}return i}getTopMostRowIndex(e,r){const n=Jl(Ma,this,Ew).call(this,e,"row",-1);let i=r;for(let o=0;o<n.length;o++)if(n[o]<=r){i=n[o];break}return i}getBottomMostRowIndex(e,r){const n=Jl(Ma,this,Ew).call(this,e,"row",1);let i=r;for(let o=0;o<n.length;o++)if(n[o]>=r){i=n[o];break}return i}shiftCollections(e,r,n){const i=[0,0];switch(e){case"right":i[0]+=n;break;case"left":i[0]-=n;break;case"down":i[1]+=n;break;case"up":i[1]-=n;break}const o=[];this.mergedCells.forEach(s=>{s.shift(i,r),s.removed&&o.push(s)}),o.forEach(s=>{this.mergedCells.splice(this.mergedCells.indexOf(s),1)}),this.mergedCellsMatrix.clear(),this.mergedCells.forEach(s=>{Jl(Ma,this,fW).call(this,s)})}}function Ew(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const n=new Map,i=r===1?t.getTopStartCorner():t.getBottomEndCorner(),o=r===1?t.getBottomEndCorner():t.getTopStartCorner();for(let s=i.row;r===1?s<=o.row:s>=o.row;s+=r)for(let a=i.col;r===1?a<=o.col:a>=o.col;a+=r){const l=e==="row"?s:a,u=this.get(s,a);let c=l;u&&(c=r===1?u[e]+u[`${e}span`]-1:u[e]),n.has(l)||n.set(l,new Set),n.get(l).add(c)}return Array.from(new Set(Array.from(n.entries()).filter(s=>{let[,a]=s;return a.size===1}).flatMap(s=>{let[,a]=s;return Array.from(a)})))}function fW(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let r=t.col;r<t.col+t.colspan;r++)this.mergedCellsMatrix.has(e)||this.mergedCellsMatrix.set(e,new Map),this.mergedCellsMatrix.get(e).set(r,t)}function Sce(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let r=t.col;r<t.col+t.colspan;r++)this.mergedCellsMatrix.get(e).delete(r)}function eM(t,e,r){return(e=Rce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rce(t){var e=Ece(t,"string");return typeof e=="symbol"?e:e+""}function Ece(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Tce{constructor(e){eM(this,"plugin",void 0),eM(this,"mergedCellsCollection",void 0),eM(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}getDirection(e,r){let n=null;return r[0]===e[0]&&r[1]===e[1]&&r[3]===e[3]?n="down":r[2]===e[2]&&r[1]===e[1]&&r[3]===e[3]?n="up":r[1]===e[1]&&r[2]===e[2]?n="right":n="left",n}snapDragArea(e,r,n,i){const o=r.slice(0),s=this.getAutofillSize(e,r,n),[a,l,u,c]=e,d=["up","down"].indexOf(n)>-1?u-a+1:c-l+1,f=Math.floor(s/d)*d,g=s-f,w=this.getFarthestCollection(e,r,n,i);if(w){if(n==="down"){const v=w.row+w.rowspan-a-g;o[2]+v>=this.plugin.hot.countRows()?o[2]-=g:o[2]+=g?v:0}else if(n==="right"){const v=w.col+w.colspan-l-g;o[3]+v>=this.plugin.hot.countCols()?o[3]-=g:o[3]+=g?v:0}else if(n==="up"){const v=u-g-w.row+1;o[0]+v<0?o[0]+=g:o[0]-=g?v:0}else if(n==="left"){const v=c-g-w.col+1;o[1]+v<0?o[1]+=g:o[1]-=g?v:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:n,foundMergedCells:i,fillSize:s,dragArea:o,cycleLength:d}),o}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),fr(this.currentFillData,e)}getAutofillSize(e,r,n){const[i,o,s,a]=e,[l,u,c,h]=r;switch(n){case"up":return i-l;case"down":return c-s;case"left":return o-u;case"right":return h-a;default:return null}}getDragArea(e,r,n){const[i,o,s,a]=e,[l,u,c,h]=r;switch(n){case"up":return[l,u,i-1,a];case"down":{const d=this.mergedCellsCollection.get(c,a),f=d?d.rowspan-1:0;return[s+1,o,c+f,a]}case"left":return[l,u,s,o-1];case"right":{const d=this.mergedCellsCollection.get(c,a),f=d?d.colspan-1:0;return[i,a+f,c,h]}default:return null}}getFarthestCollection(e,r,n,i){const[o,s,a,l]=e,u=["up","down"].indexOf(n)>-1,c=u?a:l,h=u?o:s,d=this.getAutofillSize(e,r,n),f=u?a-o+1:l-s+1,g=Math.floor(d/f)*f,w=d-g;let v=null,b=null,p=null;switch(n){case"up":v="includesVertically",p=c-w+1;break;case"left":v="includesHorizontally",p=c-w+1;break;case"down":v="includesVertically",p=h+w-1;break;case"right":v="includesHorizontally",p=h+w-1;break}return k(i,_=>{_[v](p)&&_.isFarther(b,n)&&(b=_)}),b}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const r=this.getRangeFromChanges(e),n=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,o=(u,c)=>{switch(i){case"up":return u.row-c>=r.from.row;case"down":return u.row+u.rowspan-1+c<=r.to.row;case"left":return u.col-c>=r.from.column;case"right":return u.col+u.colspan-1+c<=r.to.column;default:return null}};let s=0,a=null,l=1;do for(let u=0;u<n.length;u+=1){if(a=n[u],s=l*this.currentFillData.cycleLength,o(a,s))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:a.row-s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"left":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col-s,colspan:a.colspan},!0);break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+s,colspan:a.colspan},!0);break}u===n.length-1&&(l+=1)}while(o(a,s));this.currentFillData=null,this.plugin.hot.render(),n.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const r={min:null,max:null},n={min:null,max:null};return k(e,i=>{const o=i[0],s=this.plugin.hot.propToCol(i[1]);(r.min===null||o<r.min)&&(r.min=o),(r.max===null||o>r.max)&&(r.max=o),(n.min===null||s<n.min)&&(n.min=s),(n.max===null||s>n.max)&&(n.max=s)}),{from:{row:r.min,column:n.min},to:{row:r.max,column:n.max}}}dragAreaOverlapsCollections(e,r,n){const i=this.getDragArea(e,r,n),[o,s,a,l]=i,u=this.plugin.hot._createCellCoords(o,s),c=this.plugin.hot._createCellCoords(a,l),h=this.plugin.hot._createCellRange(u,u,c);if(this.mergedCellsCollection.getWithinRange(h,!0).length===0)return!1;const f=this.mergedCellsCollection.getWithinRange(h,!1);return f.length===0?!0:n==="up"||n==="down"?!f.every(g=>{let{colspan:w}=g;return w===h.getWidth()}):!f.every(g=>{let{rowspan:w}=g;return w===h.getHeight()})}}function tM(t,e,r){return(e=_ce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _ce(t){var e=Mce(t,"string");return typeof e=="symbol"?e:e+""}function Mce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Pce{constructor(e){tM(this,"plugin",void 0),tM(this,"hot",void 0),tM(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,r,n,i){const o=Math.min(n[0],n[2]),s=Math.min(n[1],n[3]),a=Math.max(n[0],n[2]),l=Math.max(n[1],n[3]);if(i===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,r))return;const c=this.plugin.mergedCellsCollection.get(e,r);if(!c)return;const h=c.getLastRow(),d=c.getLastColumn();if(o<=c.row&&s<=c.col&&a>=h&&l>=d)return`${this.fullySelectedMergedCellClassName}-${i}`;if(this.isMergeCellFullySelected(c,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,r){const n=[];if(!r||!e)return!1;for(let i=0;i<e.rowspan;i+=1)for(let o=0;o<e.colspan;o+=1)n.push(this.hot._createCellCoords(e.row+i,e.col+o));for(let i=0;i<n.length;i+=1){const o=[];for(let s=0;s<r.length;s+=1)o[s]=r[s].includes(n[i]);if(!o.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let r=0;r<=7;r+=1)e.push(`${this.fullySelectedMergedCellClassName}-${r}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}}function Ice(t){return{key:"mergeCells",name(){const e=this.getSelectedLast();if(e){const r=t.mergedCellsCollection.get(e[0],e[1]);if(r.row===e[0]&&r.col===e[1]&&r.row+r.rowspan-1===e[2]&&r.col+r.colspan-1===e[3])return this.getTranslatedPhrase(nE)}return this.getTranslatedPhrase(rE)},callback(){const e=this.getSelectedRangeLast();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:r,to:n}=e;t.toggleMerge(e),this.selectCell(r.row,r.col,n.row,n.col,!1)},disabled(){const e=this.getSelectedLast();return e?Mo.isSingleCell({row:e[0],col:e[1],rowspan:e[2]-e[0]+1,colspan:e[3]-e[1]+1})||this.selection.isSelectedByCorner():!0},hidden:!1}}function yf(t,e,r){return(e=Oce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Oce(t){var e=xce(t,"string");return typeof e=="symbol"?e:e+""}function xce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gW{constructor(e){yf(this,"data",void 0),yf(this,"next",null),yf(this,"prev",null),this.data=e}}class Tw{constructor(){yf(this,"first",null),yf(this,"last",null)}push(e){const r=new gW(e);if(this.first===null)this.first=r,this.last=r;else{const n=this.last;this.last=r,r.prev=n,n.next=r}return r}unshift(e){const r=new gW(e);if(this.first===null)this.first=r,this.last=r;else{const n=this.first;this.first=r,r.next=n,n.prev=r}}inorder(e){let r=this.first;for(;r;){const n=e(r);if(r===this.last||n===!0)break;r=r.next}}remove(e){if(this.first===null)return!1;let r=this.first,n,i;for(;r;){if(r.data===e)return n=r.next,i=r.prev,n&&(n.prev=i),i&&(i.next=n),r===this.first&&(this.first=n),r===this.last&&(this.last=i),!0;r=r.next}return!1}hasCycle(){let e=this.first,r=this.first;for(;;){if(e===null||(e=e.next,e===null))return!1;if(e=e.next,r=r.next,e===r)return!0}}pop(){if(this.last===null)return null;const e=this.last;return this.last=this.last.prev,e}shift(){if(this.first===null)return null;const e=this.first;return this.first=this.first.next,e}recursiveReverse(){function e(n,i){i&&(e(i,i.next),i.next=n)}if(!this.first)return;e(this.first,this.first.next),this.first.next=null;const r=this.first;this.first=this.last,this.last=r}reverse(){if(!this.first||!this.first.next)return;let e=this.first.next,r=this.first,n;for(;e;)n=e.next,e.next=r,r.prev=e,r=e,e=n;this.first.next=null,this.last.prev=null,n=this.first,this.first=r,this.last=n}}function Ace(t,e){mW(t,e),e.add(t)}function Ql(t,e,r){mW(t,e),e.set(t,r)}function mW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lt(t,e){return t.get(_w(t,e))}function zn(t,e,r){return t.set(_w(t,e),r),r}function _w(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Po=new WeakMap,Io=new WeakMap,Oo=new WeakMap,xo=new WeakMap,rM=new WeakMap,Mw=new WeakMap,Pw=new WeakMap,nM=new WeakSet;class Hce{constructor(e){let{mergedCellsGetter:r,rowIndexMapper:n,columnIndexMapper:i}=e;Ace(this,nM),Ql(this,Po,new Tw),Ql(this,Io,new Tw),Ql(this,Oo,null),Ql(this,xo,null),Ql(this,rM,null),Ql(this,Mw,null),Ql(this,Pw,null),zn(rM,this,r),zn(Mw,this,n),zn(Pw,this,i)}getCurrentVerticalNode(){return lt(xo,this).data}getFirstVerticalNode(){return lt(Io,this).first.data}getNextVerticalNode(){return lt(xo,this).next.data}getPrevVerticalNode(){return lt(xo,this).prev.data}getCurrentHorizontalNode(){return lt(Oo,this).data}getFirstHorizontalNode(){return lt(Po,this).first.data}getNextHorizontalNode(){return lt(Oo,this).next.data}getPrevHorizontalNode(){return lt(Oo,this).prev.data}setPrevNodeAsActive(){zn(xo,this,lt(xo,this).prev),zn(Oo,this,lt(Oo,this).prev)}setNextNodeAsActive(){zn(xo,this,lt(xo,this).next),zn(Oo,this,lt(Oo,this).next)}buildFocusOrder(e){const r=e.getTopStartCorner(),n=e.getBottomEndCorner(),i=new WeakSet;zn(Po,this,new Tw);for(let s=r.row;s<=n.row;s++)if(!lt(Mw,this).isHidden(s))for(let a=r.col;a<=n.col;a++){if(lt(Pw,this).isHidden(a))continue;const l=_w(nM,this,pW).call(this,e,lt(Po,this),i,s,a);l&&zn(Oo,this,l)}lt(Po,this).first&&(lt(Po,this).first.prev=lt(Po,this).last,lt(Po,this).last.next=lt(Po,this).first);const o=new WeakSet;zn(Io,this,new Tw);for(let s=r.col;s<=n.col;s++)if(!lt(Pw,this).isHidden(s))for(let a=r.row;a<=n.row;a++){if(lt(Mw,this).isHidden(a))continue;const l=_w(nM,this,pW).call(this,e,lt(Io,this),o,a,s);l&&zn(xo,this,l)}lt(Io,this).first&&(lt(Io,this).first.prev=lt(Io,this).last,lt(Io,this).last.next=lt(Io,this).first)}setActiveNode(e,r){return lt(Po,this).inorder(n=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=n.data;if(e>=i&&e<=o&&r>=s&&r<=a)return zn(Oo,this,n),!1}),lt(Io,this).inorder(n=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=n.data;if(e>=i&&e<=o&&r>=s&&r<=a)return zn(xo,this,n),!1}),this}}function pW(t,e,r,n,i){const o=t.getTopStartCorner(),s=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=lt(rM,this).call(this,n,i);if(l&&r.has(l))return null;const u={colStart:i,colEnd:i,rowStart:n,rowEnd:n};if(l){if(r.add(l),l.row<o.row||l.row+l.rowspan-1>s.row||l.col<o.col||l.col+l.colspan-1>s.col)return null;u.colStart=l.col,u.colEnd=l.col+l.colspan-1,u.rowStart=l.row,u.rowEnd=l.row+l.rowspan-1}const c=e.push(u);return n===a.row&&i===a.col||l&&a.row>=l.row&&a.row<=l.row+l.rowspan-1&&a.col>=l.col&&a.col<=l.col+l.colspan-1?c:null}function wW(t,e,r){const{view:n,rowIndexMapper:i}=t,o=n.getStylesHandler(),s=n.getDefaultRowHeight();let a=0;for(let u=e;u<e+r;u++)if(!i.isHidden(u)){var l;a+=(l=t.getRowHeight(u))!==null&&l!==void 0?l:s,u===0&&!o.isClassicTheme()&&(a+=1)}return a}function Nce(t){const{hot:e}=t,{rowIndexMapper:r,columnIndexMapper:n}=e,i=new Map;function o(){}function s(a,l,u){const c=t.mergedCellsCollection.get(l,u);if(!$e(c)){a.removeAttribute("rowspan"),a.removeAttribute("colspan"),Ug()&&i.has(l)&&!e.getSettings().rowHeaders&&(a.style.height=`${i.get(l)}px`,i.delete(l)),a.style.display="";return}const{row:h,col:d,colspan:f,rowspan:g}=c,[w,v]=t.translateMergedCellToRenderable(h,g,d,f),b=t.getSetting("virtualized");if(Ug()&&d===0&&!e.getSettings().rowHeaders){const A=wW(e,h,g);i.set(l,A/g)}const p=r.getRenderableFromVisualIndex(l),_=n.getRenderableFromVisualIndex(u),O=w-p+1,T=v-_+1;let M=r.getNearestNotHiddenIndex(h,1),P=n.getNearestNotHiddenIndex(d,1);if(b){const A=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(A)||(M=Math.max(M,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(A)||(P=Math.max(P,e.getFirstRenderedVisibleColumn()))}const G=Math.min(g,O),j=Math.min(f,T);M===l&&P===u?(a.setAttribute("rowspan",G),a.setAttribute("colspan",j)):(a.removeAttribute("rowspan"),a.removeAttribute("colspan"),a.style.display="none")}return{before:o,after:s}}function Dce(t,e){vW(t,e),e.add(t)}function Iw(t,e,r){vW(t,e),e.set(t,r)}function vW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function iM(t,e,r){return(e=kce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kce(t){var e=Lce(t,"string");return typeof e=="symbol"?e:e+""}function Lce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Cf(t,e,r){return t.set(mt(t,e),r),r}function St(t,e){return t.get(mt(t,e))}function mt(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}de.getSingleton().register("beforeMergeCells"),de.getSingleton().register("afterMergeCells"),de.getSingleton().register("beforeUnmergeCells"),de.getSingleton().register("afterUnmergeCells");const oM="mergeCells",$ce=150,yW=oM;var fi=new WeakMap,gi=new WeakMap,Ao=new WeakMap,CW=new WeakMap,yt=new WeakSet;class Fce extends rt{constructor(){super(...arguments),Dce(this,yt),iM(this,"mergedCellsCollection",null),iM(this,"autofillCalculations",null),iM(this,"selectionCalculations",null),Iw(this,fi,null),Iw(this,gi,{row:0,col:0}),Iw(this,Ao,new Hce({mergedCellsGetter:(e,r)=>this.mergedCellsCollection.get(e,r),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),Iw(this,CW,Nce(this))}static get PLUGIN_KEY(){return oM}static get PLUGIN_PRIORITY(){return $ce}static get DEFAULT_SETTINGS(){return{[g$]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[oM]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new Rw(this),this.autofillCalculations=new Tce(this),this.selectionCalculations=new Pce(this),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Vce).call(e,...n)}),this.addHook("modifyTransformFocus",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Bce).call(e,...n)}),this.addHook("modifyTransformStart",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,jce).call(e,...n)}),this.addHook("modifyTransformEnd",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Uce).call(e,...n)}),this.addHook("beforeSelectionHighlightSet",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,zce).call(e,...n)}),this.addHook("beforeSetRangeStart",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,SW).call(e,...n)}),this.addHook("beforeSetRangeStartOnly",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,SW).call(e,...n)}),this.addHook("beforeSelectionFocusSet",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Gce).call(e,...n)}),this.addHook("afterSelectionFocusSet",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,qce).call(e,...n)}),this.addHook("afterSelectionEnd",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Kce).call(e,...n)}),this.addHook("modifyGetCellCoords",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,bW).call(e,...n)}),this.addHook("modifyGetCoordsElement",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,bW).call(e,...n)}),this.addHook("afterIsMultipleSelection",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Wce).call(e,...n)}),this.addHook("afterRenderer",function(){return St(CW,e).after(...arguments)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Yce).call(e,...n)}),this.addHook("afterGetCellMeta",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Xce).call(e,...n)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Zce).call(e,...n)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Jce).call(e,...n)}),this.addHook("modifyAutofillRange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,Qce).call(e,...n)}),this.addHook("afterCreateCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,ehe).call(e,...n)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,the).call(e,...n)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,rhe).call(e,...n)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,nhe).call(e,...n)}),this.addHook("afterChange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,ihe).call(e,...n)}),this.addHook("beforeDrawBorders",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,ohe).call(e,...n)}),this.addHook("afterDrawSelection",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,she).call(e,...n)}),this.addHook("beforeRemoveCellClassNames",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,ahe).call(e,...n)}),this.addHook("beforeBeginEditing",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,lhe).call(e,...n)}),this.addHook("modifyRowHeightByOverlayName",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mt(yt,e,uhe).call(e,...n)}),this.addHook("beforeUndoStackChange",(r,n)=>{if(n==="MergeCells")return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(),super.updatePlugin()}ifChromeForceRepaint(){if(!YH())return;const e=[];let r=[];this.mergedCellsCollection.mergedCells.forEach(n=>{const{row:i,rowspan:o}=n;for(let s=i+1;s<i+o;s++)r.push(s)}),r=[...new Set(r)],r.forEach(n=>{const i=this.hot.rowIndexMapper.getRenderableFromVisualIndex(n);this.hot.view._wt.wtOverlays.getOverlays(!0).map(o=>(o==null?void 0:o.name)==="master"?o:o.clone.wtTable).forEach(o=>{const s=o.getRow(i);s&&(s.style.background=kg(s,"backgroundColor").replace(")",", 0.99)"),e.push(s))})}),this.hot._registerTimeout(()=>{e.forEach(n=>{var i;n.style.background=(i=kg(n,"backgroundColor"))===null||i===void 0?void 0:i.replace(", 0.99)",")")})},1)}validateSetting(e){return e?Mo.containsNegativeValues(e)?(st(Mo.NEGATIVE_VALUES_WARNING(e)),!1):Mo.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(st(Mo.IS_OUT_OF_BOUNDS_WARNING(e)),!1):Mo.isSingleCell(e)?(st(Mo.IS_SINGLE_CELL(e)),!1):Mo.containsZeroSpan(e)?(st(Mo.ZERO_SPAN_WARNING(e)),!1):!0:!1}generateFromSettings(){const e=this.getSetting("cells").filter(i=>this.validateSetting(i)),r=this.mergedCellsCollection.filterOverlappingMergeCells(e),n=[];r.forEach(i=>{const{row:o,col:s,rowspan:a,colspan:l}=i,u=this.hot._createCellCoords(o,s),c=this.hot._createCellCoords(o+a-1,s+l-1),h=this.hot._createCellRange(u,u,c);this.mergeRange(h,!0,!0);for(let d=o;d<o+a;d++)for(let f=s;f<s+l;f++)(d!==o||f!==s)&&n.push([d,f,null])}),n.length!==0&&this.hot.setDataAtCell(n,void 0,void 0,this.pluginName)}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?!0:this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:r,to:n}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(r.row,r.col,n.row,n.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:r,to:n}=e;this.unmergeRange(e,!0),this.hot.selectCell(r.row,r.col,n.row,n.col,!1)}mergeRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=e.getTopStartCorner(),o=e.getBottomEndCorner(),s={row:i.row,col:i.col,rowspan:o.row-i.row+1,colspan:o.col-i.col+1},a=[];let l=null;return this.canMergeRange(s,r)?(this.hot.runHooks("beforeMergeCells",e,r),Ce(0,s.rowspan-1,c=>{Ce(0,s.colspan-1,h=>{let d=null;a[c]||(a[c]=[]),c===0&&h===0?d=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s.row),this.hot.toPhysicalColumn(s.col)):this.hot.setCellMeta(s.row+c,s.col+h,"hidden",!0),a[c][h]=d})}),this.hot.setCellMeta(s.row,s.col,"spanned",!0),this.mergedCellsCollection.add(s,r)?(n?l=[s.row,s.col,a]:this.hot.populateFromArray(s.row,s.col,a,void 0,void 0,this.pluginName),r||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,s,r),l):!0):!1}unmergeRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=this.mergedCellsCollection.getWithinRange(e);n.length!==0&&(this.hot.runHooks("beforeUnmergeCells",e,r),k(n,i=>{this.mergedCellsCollection.remove(i.row,i.col),Ce(0,i.rowspan-1,o=>{Ce(0,i.colspan-1,s=>{this.hot.removeCellMeta(i.row+o,i.col+s,"hidden"),this.hot.removeCellMeta(i.row+o,i.col+s,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,r),this.hot.render())}toggleMerge(e){const{from:r,to:n}=e.clone().normalize(),i=this.mergedCellsCollection.get(r.row,r.col);i.row===r.row&&i.col===r.col&&i.row+i.rowspan-1===n.row&&i.col+i.colspan-1===n.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,r,n,i){const o=this.hot._createCellCoords(e,r),s=this.hot._createCellCoords(n,i);this.mergeRange(this.hot._createCellRange(o,o,s))}unmerge(e,r,n,i){const o=this.hot._createCellCoords(e,r),s=this.hot._createCellCoords(n,i);this.unmergeRange(this.hot._createCellRange(o,o,s))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const n=this.hot.getSelectedRangeLast();n&&!n.isSingleHeader()&&(this.toggleMerge(n),this.hot.render())},runOnlyIf:n=>!n.altKey,group:yW})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(yW)}modifyViewportRowStart(e,r){const n=this.hot.rowIndexMapper,i=n.getVisualFromRenderableIndex(e.startRow);for(let o=0;o<r;o+=1){const s=this.mergedCellsCollection.get(i,o);if($e(s)){const a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(s.row,1));if(a<e.startRow){e.startRow=a,this.modifyViewportRowStart(e,r);return}}}}modifyViewportRowEnd(e,r){const n=this.hot.rowIndexMapper,i=n.getVisualFromRenderableIndex(e.endRow);for(let o=0;o<r;o+=1){const s=this.mergedCellsCollection.get(i,o);if($e(s)){const a=s.row+s.rowspan-1,l=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(a,-1));if(l>e.endRow){e.endRow=l,this.modifyViewportRowEnd(e,r);return}}}}modifyViewportColumnStart(e,r){const n=this.hot.columnIndexMapper,i=n.getVisualFromRenderableIndex(e.startColumn);for(let o=0;o<r;o+=1){const s=this.mergedCellsCollection.get(o,i);if($e(s)){const a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(s.col,1));if(a<e.startColumn){e.startColumn=a,this.modifyViewportColumnStart(e,r);return}}}}modifyViewportColumnEnd(e,r){const n=this.hot.columnIndexMapper,i=n.getVisualFromRenderableIndex(e.endColumn);for(let o=0;o<r;o+=1){const s=this.mergedCellsCollection.get(o,i);if($e(s)){const a=s.col+s.colspan-1,l=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(a,-1));if(l>e.endColumn){e.endColumn=l,this.modifyViewportColumnEnd(e,r);return}}}}translateMergedCellToRenderable(e,r,n,i){const{rowIndexMapper:o,columnIndexMapper:s}=this.hot;let a,l;r===0?a=o.getNearestNotHiddenIndex(e,1):a=o.getNearestNotHiddenIndex(e+r-1,-1),i===0?l=s.getNearestNotHiddenIndex(n,1):l=s.getNearestNotHiddenIndex(n+i-1,-1);const u=e>=0?o.getRenderableFromVisualIndex(a):e,c=n>=0?s.getRenderableFromVisualIndex(l):n;return[u,c]}}function Vce(){this.generateFromSettings(),this.hot.render()}function Wce(t){if(t){const e=this.mergedCellsCollection.mergedCells,r=this.hot.getSelectedRangeLast(),n=r.getTopStartCorner(),i=r.getBottomEndCorner();for(let o=0;o<e.length;o+=1)if(n.row===e[o].row&&n.col===e[o].col&&i.row===e[o].row+e[o].rowspan-1&&i.col===e[o].col+e[o].colspan-1)return!1}return t}function Bce(t){St(gi,this).row=t.row,St(gi,this).col=t.col}function jce(t){const e=this.hot.getSelectedRangeLast(),{highlight:r}=e,{columnIndexMapper:n,rowIndexMapper:i}=this.hot;St(fi,this)&&(i.getRenderableFromVisualIndex(St(fi,this).row)!==null&&(r.row=St(fi,this).row),n.getRenderableFromVisualIndex(St(fi,this).col)!==null&&(r.col=St(fi,this).col),Cf(fi,this,null));const o=this.mergedCellsCollection.get(r.row,r.col);if(!o)return;const s=o.col,a=o.col+o.colspan-1;if(t.col<0){const c=r.col>=s&&r.col<=a?s-1:a,h=n.getNearestNotHiddenIndex(c,-1);h===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,r.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(h,r.col)-1,1)}else if(t.col>0){const c=r.col>=s&&r.col<=a?a+1:s,h=n.getNearestNotHiddenIndex(c,1);h===null?t.col=this.hot.view.countRenderableColumnsInRange(r.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(r.col,h)-1,1)}const l=o.row,u=o.row+o.rowspan-1;if(t.row<0){const c=r.row>=l&&r.row<=u?l-1:u,h=i.getNearestNotHiddenIndex(c,-1);h===null?t.row=-this.hot.view.countRenderableRowsInRange(0,r.row):t.row=-Math.max(this.hot.view.countRenderableRowsInRange(h,r.row)-1,1)}else if(t.row>0){const c=r.row>=l&&r.row<=u?u+1:l,h=i.getNearestNotHiddenIndex(c,1);h===null?t.row=this.hot.view.countRenderableRowsInRange(r.row,this.hot.countRows()):t.row=Math.max(this.hot.view.countRenderableRowsInRange(r.row,h)-1,1)}}function Uce(t){const e=this.hot.getSelectedRangeLast(),r=e.clone(),{to:n}=e,{columnIndexMapper:i,rowIndexMapper:o}=this.hot,s=(a,l)=>{r.expand(this.hot._createCellCoords(a,l));for(let u=0;u<this.mergedCellsCollection.mergedCells.length;u+=1)r.expandByRange(this.mergedCellsCollection.mergedCells[u].getRange())};if(t.col<0){let a=this.mergedCellsCollection.getStartMostColumnIndex(e,n.col)+t.col;s(n.row,a),e.getHorizontalDirection()==="E-W"&&r.getHorizontalDirection()==="E-W"&&(a=r.getTopStartCorner().col);const l=i.getNearestNotHiddenIndex(a,1);l!==null&&(t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(l,n.col)-1,1))}else if(t.col>0){let a=this.mergedCellsCollection.getEndMostColumnIndex(e,n.col)+t.col;s(n.row,a),e.getHorizontalDirection()==="W-E"&&r.getHorizontalDirection()==="W-E"&&(a=r.getBottomEndCorner().col);const l=i.getNearestNotHiddenIndex(a,-1);l!==null&&(t.col=Math.max(this.hot.view.countRenderableColumnsInRange(n.col,l)-1,1))}if(t.row<0){let a=this.mergedCellsCollection.getTopMostRowIndex(e,n.row)+t.row;s(a,n.col),e.getVerticalDirection()==="S-N"&&r.getVerticalDirection()==="S-N"&&(a=r.getTopStartCorner().row);const l=o.getNearestNotHiddenIndex(a,1);l!==null&&(t.row=-Math.max(this.hot.view.countRenderableRowsInRange(l,n.row)-1,1))}else if(t.row>0){let a=this.mergedCellsCollection.getBottomMostRowIndex(e,n.row)+t.row;s(a,n.col),e.getVerticalDirection()==="N-S"&&r.getVerticalDirection()==="N-S"&&(a=r.getBottomStartCorner().row);const l=o.getNearestNotHiddenIndex(a,-1);l!==null&&(t.row=Math.max(this.hot.view.countRenderableRowsInRange(n.row,l)-1,1))}}function zce(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){Cf(fi,this,e.clone());return}for(let n=0;n<this.mergedCellsCollection.mergedCells.length;n+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[n].getRange(),!1);for(let n=0;n<this.mergedCellsCollection.mergedCells.length;n+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[n].getRange(),!1);const r=this.mergedCellsCollection.get(e.row,e.col);Cf(fi,this,e.clone()),r&&e.assign(r)}function bW(t,e,r,n){if(t<0||e<0)return;const i=this.mergedCellsCollection.get(t,e);if(!i)return;const{row:o,col:s,colspan:a,rowspan:l}=i,u=o,c=s,h=o+l-1,d=s+a-1;if(n==="render"&&this.getSetting("virtualized")){const f=this.hot.view.getActiveOverlayName(),g=["top","top_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleRow(),w=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleColumn();return[Ze(g,u,h),Ze(w,c,d),Ze(this.hot.getLastRenderedVisibleRow(),u,h),Ze(this.hot.getLastRenderedVisibleColumn(),c,d)]}return[u,c,h,d]}function Yce(t){t.items.push({name:"---------"},Ice(this))}function SW(){Cf(fi,this,null)}function Gce(){if(St(fi,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),r=t.getHorizontalDirection(),n=St(fi,this).clone().normalize();St(Ao,this).setActiveNode(n.row,n.col),St(gi,this).row>0||St(gi,this).col>0?St(Ao,this).setPrevNodeAsActive():(r==="E-W"&&St(gi,this).col<0||e==="S-N"&&St(gi,this).row<0)&&St(Ao,this).setNextNodeAsActive()}function qce(t,e){const r=this.hot.getSelectedRangeLast(),{columnIndexMapper:n,rowIndexMapper:i}=this.hot;let o=null,s=null;if(St(gi,this).col<0){const{rowEnd:a,colEnd:l}=St(Ao,this).getPrevHorizontalNode();s=n.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(St(gi,this).col>0){const{rowStart:a,colStart:l}=St(Ao,this).getNextHorizontalNode();s=n.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}else if(St(gi,this).row<0){const{rowEnd:a,colEnd:l}=St(Ao,this).getPrevVerticalNode();s=n.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(St(gi,this).row>0){const{rowStart:a,colStart:l}=St(Ao,this).getNextVerticalNode();s=n.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}if(o!==null||s!==null){const a=this.hot._createCellCoords(o,s),l=this.mergedCellsCollection.get(a.row,a.col),u=this.hot.selection.highlight.getFocus();t=a.row,e=a.col,l?r.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(l.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(l.col,1)}):r.highlight.assign(a),u.clear(),u.add(a).commit()}St(Ao,this).setActiveNode(t,e),Cf(gi,this,{row:0,col:0})}function Kce(){this.hot.getSelectedRangeLast().isHeader()||St(Ao,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function Xce(t,e,r){const n=this.mergedCellsCollection.get(t,e);n&&(n.row!==t||n.col!==e?r.copyable=!1:(r.rowspan=n.rowspan,r.colspan=n.colspan))}function Zce(t){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function Jce(t){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function Qce(t,e){const r=this.autofillCalculations.getDirection(e,t);if(this.autofillCalculations.dragAreaOverlapsCollections(e,t,r))return e;const n=this.hot._createCellCoords(e[0],e[1]),i=this.hot._createCellCoords(e[2],e[3]),o=this.hot._createCellRange(n,n,i),s=this.mergedCellsCollection.getWithinRange(o);return s.length===0?t:this.autofillCalculations.snapDragArea(e,t,r,s)}function ehe(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function the(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function rhe(t,e,r){r!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function nhe(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function ihe(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function ohe(t,e){if(e&&e==="area"){const r=this.hot.getSelectedRangeLast(),n=this.mergedCellsCollection.getWithinRange(r);k(n,i=>{r.getBottomEndCorner().row===i.getLastRow()&&r.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function she(t,e,r,n){if(r)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,r,n)}function ahe(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function lhe(t,e,r,n){if(!(n instanceof MouseEvent))return;const i=this.hot.getSelectedRangeLast(),o=this.mergedCellsCollection.getByRange(i);if(!o)return;const s=this.hot._createCellCoords(o.row,o.col),a=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1);return this.hot.selection.getLayerLevel()===0&&i.isEqual(this.hot._createCellRange(s,s,a))}function uhe(t,e,r){if(this.hot.getSettings().rowHeaders||r==="bottom"||r==="bottom_inline_start_corner")return t;let n,i;if(r==="master")n=this.hot.getFirstRenderedVisibleColumn(),i=this.hot.getLastRenderedVisibleColumn();else{const d=this.hot.view.getOverlayByName(r);n=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getFirstRenderedColumn()),i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(e,n))return t;const s=this.hot._createCellCoords(e,n),a=this.hot._createCellCoords(e,i),l=this.hot._createCellRange(s,s,a),u=this.mergedCellsCollection.getWithinRange(l,!0),c=u.reduce((d,f)=>{let{rowspan:g}=f;return Math.max(d,g)},1);let h=0;return u.length>1&&u[0].rowspan<c&&(h=c-u[0].rowspan),u.forEach(d=>{let{rowspan:f}=d,g=0;r==="top"||r==="top_inline_start_corner"?g=Math.min(c,this.hot.view.countNotHiddenFixedRowsTop()-e):g=f-h,t=Math.max(t??0,wW(this.hot,e,g))}),t}function che(t,e){return function(r,n){const[,...i]=r,[,...o]=n;return function s(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.multiColumnSorting,g=(d.compareFunctionFactory?d.compareFunctionFactory:$$(u.type))(l,u,d)(c,h);if(g===vo){const w=a+1;if(typeof e[w]<"u")return s(w)}return g}(0)}}const RW="sort";function hhe(t,e,r){const n=[];return r===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&n.push(`${RW}-${t.getIndexOfColumnInSortQueue(e)+1}`),n}function dhe(t){const e=t.className.split(" "),r=new RegExp(`^${RW}-[0-9]{1,2}$`);return e.filter(n=>r.test(n))}function fhe(t,e,r){return(e=ghe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ghe(t){var e=mhe(t,"string");return typeof e=="symbol"?e:e+""}function mhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ow="multiColumnSorting",phe=170,EW=Ow;L$(Ow,che);class whe extends K${constructor(){super(...arguments),fhe(this,"pluginKey",Ow)}static get PLUGIN_KEY(){return Ow}static get PLUGIN_PRIORITY(){return phe}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return e.row===-1&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,sp)),!1},runOnlyIf:()=>{var e,r;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingle())&&this.hot.selection.isCellVisible(n)&&n.isHeader()},relativeToGroup:Qs,position:"before",group:EW})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(EW)}sort(e){super.sort(e)}clearSort(){super.clearSort()}isSorted(){return super.isSorted()}getSortConfig(e){return super.getSortConfig(e)}setSortConfig(e){super.setSortConfig(e)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];super.updateHeaderClasses(e,...n),Ee(e,dhe(e)),this.enabled!==!1&&oe(e,hhe(...n))}onAfterOnCellMouseDown(e,r){RT(r.row,r.col,e)!==!1&&this.wasClickableHeaderClicked(e,r.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(r.col),this.sort(this.getNextSortConfig(r.col,sp))):this.sort(this.getColumnNextConfig(r.col)))}}function TW(t,e,r){return(e=vhe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vhe(t){var e=yhe(t,"string");return typeof e=="symbol"?e:e+""}function yhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Che="multipleSelectionHandles",bhe=160;class She extends rt{constructor(){super(...arguments),TW(this,"dragged",[]),TW(this,"lastSetCell",null)}static get PLUGIN_KEY(){return Che}static get PLUGIN_PRIORITY(){return bhe}isEnabled(){return es()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:r}=this.hot;function n(i){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const o=e.dragged.indexOf(i);if(o===-1)return!1;o===0?e.dragged=e.dragged.slice(0,1):o===1&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(r,"touchstart",i=>{let o;if(_e(i.target,"topSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1;if(_e(i.target,"bottomSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1}),this.eventManager.addEventListener(r,"touchend",i=>{if(_e(i.target,"topSelectionHandle-HitArea"))return n.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(_e(i.target,"bottomSelectionHandle-HitArea"))return n.call(e,"bottom"),e.touchStartRange=void 0,i.preventDefault(),!1}),this.eventManager.addEventListener(r,"touchmove",i=>{const{rootDocument:o}=this.hot;let s,a,l,u,c,h;if(e.dragged.length===0)return;const d=o.elementFromPoint(i.touches[0].clientX,i.touches[0].clientY);!d||d===e.lastSetCell||((d.nodeName==="TD"||d.nodeName==="TH")&&(s=e.hot.getCoords(d),s.col===-1&&(s.col=0),a=e.hot.getSelectedRangeLast(),l=a.getWidth(),u=a.getHeight(),c=a.getDirection(),l===1&&u===1&&e.hot.selection.setRangeEnd(s),h=e.getCurrentRangeCoords(a,s,e.touchStartRange.direction,c,e.dragged[0]),h.start!==null&&e.hot.selection.setRangeStart(h.start),e.hot.selection.setRangeEnd(h.end),e.lastSetCell=d),i.preventDefault())})}getCurrentRangeCoords(e,r,n,i,o){const s=e.getTopStartCorner(),a=e.getBottomEndCorner(),l=e.getBottomStartCorner(),u=e.getTopEndCorner();let c={start:null,end:null};switch(n){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":o==="top"?c={start:this.hot._createCellCoords(r.row,e.highlight.col),end:this.hot._createCellCoords(l.row,r.col)}:c={start:this.hot._createCellCoords(e.highlight.row,r.col),end:this.hot._createCellCoords(r.row,s.col)};break;case"SE-NW":o==="bottom"&&(c={start:this.hot._createCellCoords(a.row,r.col),end:this.hot._createCellCoords(r.row,s.col)});break}break;case"NW-SE":switch(i){case"NE-SW":o==="top"?c={start:r,end:l}:c.end=r;break;case"NW-SE":o==="top"?c={start:r,end:a}:c.end=r;break;case"SE-NW":o==="top"?c={start:r,end:s}:c.end=r;break;case"SW-NE":o==="top"?c={start:r,end:u}:c.end=r;break}break;case"SW-NE":switch(i){case"NW-SE":o==="bottom"?c={start:this.hot._createCellCoords(r.row,s.col),end:this.hot._createCellCoords(l.row,r.col)}:c={start:this.hot._createCellCoords(s.row,r.col),end:this.hot._createCellCoords(r.row,a.col)};break;case"SW-NE":o==="top"?c={start:this.hot._createCellCoords(e.highlight.row,r.col),end:this.hot._createCellCoords(r.row,a.col)}:c={start:this.hot._createCellCoords(r.row,s.col),end:this.hot._createCellCoords(s.row,r.col)};break;case"SE-NW":o==="bottom"?c={start:this.hot._createCellCoords(r.row,u.col),end:this.hot._createCellCoords(s.row,r.col)}:o==="top"&&(c={start:l,end:r});break}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":o==="top"&&(c.end=r);break;case"SE-NW":o==="top"?c.end=r:c={start:r,end:s};break}break}return c}isDragged(){return this.dragged.length>0}}function sM(){let{label:t="",colspan:e=1,origColspan:r=1,collapsible:n=!1,crossHiddenColumns:i=[],isCollapsed:o=!1,isHidden:s=!1,isRoot:a=!1,isPlaceholder:l=!1,headerClassNames:u=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{label:t,colspan:e,origColspan:r,collapsible:n,isCollapsed:o,crossHiddenColumns:i,isHidden:s,isRoot:a,isPlaceholder:l,headerClassNames:u}}function _W(){return{label:"",isPlaceholder:!0}}function Rhe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const r=[];if(e===0)return r;k(t,i=>{const o=[];let s=0;r.push(o),k(i,a=>{const l=sM();if($e(a)){const{label:c,colspan:h,headerClassName:d}=a;l.label=Lt(c),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h),typeof d=="string"&&(l.headerClassNames=[...d.split(" ")])}else l.label=Lt(a);s+=l.origColspan;let u=!1;if(s>=e&&(l.colspan=l.origColspan-(s-e),l.origColspan=l.colspan,u=!0),o.push(l),l.colspan>1)for(let c=0;c<l.colspan-1;c++)o.push(_W());return!u})});const n=Math.max(...qe(r,i=>i.length));return k(r,i=>{if(i.length<n){const o=qe(new Array(n-i.length),()=>sM());i.splice(i.length,0,...o)}}),r}function aM(t,e,r){Ehe(t,e),e.set(t,r)}function Ehe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gi(t,e){return t.get(MW(t,e))}function bf(t,e,r){return t.set(MW(t,e),r),r}function MW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const PW=["label","collapsible"];var Ps=new WeakMap,eu=new WeakMap,lM=new WeakMap;class The{constructor(){aM(this,Ps,[]),aM(this,eu,0),aM(this,lM,1/0)}setColumnsLimit(e){bf(lM,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];bf(Ps,this,Rhe(e,Gi(lM,this))),bf(eu,this,Gi(Ps,this).length)}getData(){return Gi(Ps,this)}mergeWith(e){k(e,r=>{let{row:n,col:i,...o}=r;const s=this.getHeaderSettings(n,i);s!==null&&fr(s,o,PW)})}map(e){k(Gi(Ps,this),r=>{k(r,n=>{const i=e({...n});$e(i)&&fr(n,i,PW)})})}getHeaderSettings(e,r){var n;if(e>=Gi(eu,this)||e<0)return null;const i=Gi(Ps,this)[e];return Array.isArray(i)===!1||r>=i.length?null:(n=i[r])!==null&&n!==void 0?n:null}getHeadersSettings(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=[];if(e>=Gi(eu,this)||e<0)return i;const o=Gi(Ps,this)[e];let s=0;for(let a=r;a<o.length;a++){const l=o[a];if(l.isPlaceholder)throw new Error("The first column settings cannot overlap the other header layers");if(s+=l.colspan,i.push(l),l.colspan>1&&(a+=l.colspan-1),s===n)break;if(s>n)throw new Error("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return Gi(eu,this)}getColumnsCount(){return Gi(eu,this)>0?Gi(Ps,this)[0].length:0}clear(){bf(Ps,this,[]),bf(eu,this,0)}}function uM(t,e,r){return(e=_he(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _he(t){var e=Mhe(t,"string");return typeof e=="symbol"?e:e+""}function Mhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const IW="DF-pre-order";function OW(t,e){let r=t.call(e,this);for(let n=0;n<this.childs.length;n++){if(r===!1)return!1;r=OW.call(this.childs[n],t,e)}return r}const Phe="DF-post-order";function xW(t,e){for(let r=0;r<this.childs.length;r++)if(xW.call(this.childs[r],t,e)===!1)return!1;return t.call(e,this)}const AW="BF";function Ihe(t,e){const r=[this];function n(){if(r.length===0)return;const i=r.shift();r.push(...i.childs),t.call(e,i)!==!1&&n()}n()}const Ohe=AW,HW=new Map([[IW,OW],[Phe,xW],[AW,Ihe]]);class xw{constructor(e){uM(this,"data",{}),uM(this,"parent",null),uM(this,"childs",[]),this.data=e}addChild(e){e.parent=this,this.childs.push(e)}cloneTree(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this;const r=new xw({...e.data});for(let n=0;n<e.childs.length;n++)r.addChild(this.cloneTree(e.childs[n]));return r}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let r=0;r<e.childs.length;r++)this.addChild(e.childs[r])}walkDown(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ohe;if(!HW.has(r))throw new Error(`Traversal strategy "${r}" does not exist`);HW.get(r).call(this,e,this)}walkUp(e){const r=this,n=i=>{e.call(r,i)!==!1&&i.parent!==null&&n(i.parent)};n(this)}}function cM(t,e,r){xhe(t,e),e.set(t,r)}function xhe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sn(t,e){return t.get(NW(t,e))}function Ahe(t,e,r){return t.set(NW(t,e),r),r}function NW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var kc=new WeakMap,tu=new WeakMap,Lc=new WeakMap;class Hhe{constructor(e){cM(this,kc,new Map),cM(this,tu,new Map),cM(this,Lc,null),Ahe(Lc,this,e)}getRoots(){return Array.from(sn(kc,this).values())}getRootByColumn(e){let r;return sn(tu,this).has(e)&&(r=sn(kc,this).get(sn(tu,this).get(e))),r}getNode(e,r){const n=this.getRootByColumn(r);if(!n)return;const i=r-sn(tu,this).get(r);let o=0,s;return n.walkDown(a=>{const{data:{origColspan:l,headerLevel:u}}=a;if(e===u){if(i>=o&&i<=o+l-1)return s=a,s.data.isRoot=r===s.data.columnIndex,!1;o+=l}}),s}rebuildTreeIndex(){let e=0;sn(tu,this).clear(),k(sn(kc,this),r=>{let[,{data:{colspan:n}}]=r;for(let i=e;i<e+n;i++)sn(tu,this).set(i,e);e+=n})}buildTree(){this.clear();const e=sn(Lc,this).getColumnsCount();let r=0;for(;r<e;){const n=sn(Lc,this).getHeaderSettings(0,r),i=new xw;sn(kc,this).set(r,i),this.buildLeaves(i,r,0,n.origColspan),r+=n.origColspan}this.rebuildTreeIndex()}buildLeaves(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;const o=sn(Lc,this).getHeadersSettings(n,r,i);n+=1,k(o,s=>{const a={...s,headerLevel:n-1,columnIndex:r};let l;n===1?(e.data=a,l=e):(l=new xw(a),e.addChild(l)),n<sn(Lc,this).getLayersCount()&&this.buildLeaves(l,r,n,s.origColspan),r+=s.origColspan})}clear(){sn(kc,this).clear(),sn(tu,this).clear()}}function DW(t,e){t.walkDown(r=>{let{data:n,childs:i}=r;if(!n.isHidden&&(e(n.columnIndex),i.length===0))for(let o=1;o<n.colspan;o++)e(n.columnIndex+o)})}function Aw(t,e){let{childs:r}=t;if(r.length!==0)return r[0].data[e]}function Hw(t){return Aw(t,"origColspan")===t.data.origColspan}function hM(t){const{data:e,childs:r}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Hw(t))return hM(r[0]);e.isCollapsed=!1;const i=r.slice(1),o=new Set;let s=0;if(i.length>0)k(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;s+=l.colspan,DW(a,u=>{o.add(u)})});else{const{colspan:a,origColspan:l,columnIndex:u}=e;s=l-a;for(let c=1;c<l;c++)o.add(u+c)}return t.walkUp(a=>{const{data:l}=a;l.colspan+=s,l.colspan>=l.origColspan?(l.colspan=l.origColspan,l.isCollapsed=!1):Hw(a)&&(l.isCollapsed=Aw(a,"isCollapsed"))}),{rollbackModification:()=>dM(t),affectedColumns:Array.from(o),colspanCompensation:s}}function dM(t){var e;const{data:r,childs:n}=t;if(r.isCollapsed||r.isHidden||r.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Hw(t))return dM(n[0]);r.isCollapsed=!0;const o=n.slice(1),s=new Set;if(o.length>0)k(o,l=>{DW(l,u=>{s.add(u)}),l.data.clonedTree=l.cloneTree(),l.walkDown(u=>{let{data:c}=u;c.isHidden=!0})});else{const{origColspan:l,columnIndex:u}=r;for(let c=1;c<l;c++){const h=u+c;s.add(h)}}const a=r.colspan-((e=Aw(t,"colspan"))!==null&&e!==void 0?e:1);return t.walkUp(l=>{const{data:u}=l;u.colspan-=a,u.colspan<=1?(u.colspan=1,u.isCollapsed=!0):Hw(l)&&(u.isCollapsed=Aw(l,"isCollapsed"))}),{rollbackModification:()=>hM(t),affectedColumns:Array.from(s),colspanCompensation:a}}function Nhe(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(at`The passed node is not the last node on the tree. Only for\x20
757
+ the last node, the hide column modification can be applied.`);const{crossHiddenColumns:r}=t.data;if(r.includes(e))return;let n=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return n=!0,!1}),!n&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.push(e),o.colspan>1?o.colspan-=1:o.isHidden=!0})}function Dhe(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(at`The passed node is not the last node on the tree. Only for\x20
758
+ the last node, the show column modification can be applied.`);const{crossHiddenColumns:r}=t.data;if(!r.includes(e))return;let n=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return n=!0,!1}),!n&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.splice(o.crossHiddenColumns.indexOf(e),1),!o.isHidden&&o.colspan<o.origColspan&&(o.colspan+=1),o.isHidden=!1})}const kW=new Map([["collapse",dM],["expand",hM],["hide-column",Nhe],["show-column",Dhe]]);function khe(t,e,r){if(!kW.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return kW.get(t)(e,r)}function Nw(t){const e=[];return k(t,r=>{r.walkDown(n=>{const i=n.data,{origColspan:o,columnIndex:s,headerLevel:a,crossHiddenColumns:l}=i,u=$he(e,a);let c=!1;for(let h=s;h<s+o;h++)if(l.includes(h)||c)u.push(_W());else{const f=Lhe(i);f.isRoot=!0,u.push(f),c=!0}})}),e}function Lhe(t){const{crossHiddenColumns:e,...r}=sM(t);return r}function $he(t,e){let r;return Array.isArray(t[e])?r=t[e]:(r=[],t[e]=r),r}function fM(t,e,r){Fhe(t,e),e.set(t,r)}function Fhe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sf(t,e,r){return t.set(LW(t,e),r),r}function Yt(t,e){return t.get(LW(t,e))}function LW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Ho=new WeakMap,Mn=new WeakMap,ru=new WeakMap;class Vhe{constructor(){fM(this,Ho,new The),fM(this,Mn,new Hhe(Yt(Ho,this))),fM(this,ru,[[]])}setState(e){Yt(Ho,this).setData(e);let r=!1;try{Yt(Mn,this).buildTree()}catch{Yt(Mn,this).clear(),Yt(Ho,this).clear(),r=!0}return Sf(ru,this,Nw(Yt(Mn,this).getRoots())),r}setColumnsLimit(e){Yt(Ho,this).setColumnsLimit(e)}mergeStateWith(e){const r=qe(e,n=>{let{row:i,...o}=n;return{row:i<0?this.rowCoordsToLevel(i):i,...o}});Yt(Ho,this).mergeWith(r),Yt(Mn,this).buildTree(),Sf(ru,this,Nw(Yt(Mn,this).getRoots()))}mapState(e){Yt(Ho,this).map(e),Yt(Mn,this).buildTree(),Sf(ru,this,Nw(Yt(Mn,this).getRoots()))}mapNodes(e){return hn(Yt(Mn,this).getRoots(),(r,n)=>(n.walkDown(i=>{const o=e(i.data);o!==void 0&&r.push(o)}),r),[])}triggerNodeModification(e,r,n){r<0&&(r=this.rowCoordsToLevel(r));const i=Yt(Mn,this).getNode(r,n);let o;return i&&(o=khe(e,i,n),Sf(ru,this,Nw(Yt(Mn,this).getRoots()))),o}triggerColumnModification(e,r){return this.triggerNodeModification(e,-1,r)}rowCoordsToLevel(e){if(e>=0)return null;const r=e+Math.max(this.getLayersCount(),1);return r<0?null:r}levelToRowCoords(e){if(e<0)return null;const r=e-Math.max(this.getLayersCount(),1);return r>=0?null:r}getHeaderSettings(e,r){var n,i;return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:(n=(i=Yt(ru,this)[e])===null||i===void 0?void 0:i[r])!==null&&n!==void 0?n:null}getHeaderTreeNodeData(e,r){const n=this.getHeaderTreeNode(e,r);return n?{...n.data}:null}getHeaderTreeNode(e,r){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const n=Yt(Mn,this).getNode(e,r);return n||null}findTopMostEntireHeaderLevel(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const n=r-e+1;let i=!1,o=null;for(let s=e;s<=r;s++){const a=Yt(Mn,this).getRootByColumn(s);if(!a)break;i=!0,a.walkDown(l=>{const{columnIndex:u,headerLevel:c,origColspan:h,isHidden:d}=l.data;d||h<=n&&u>=e&&u+h-1<=r&&(o===null||c<o)&&(o=c)},IW)}return i&&o===null?-1:this.levelToRowCoords(o??0)}findLeftMostColumnIndex(e,r){var n;const{isRoot:i}=(n=this.getHeaderSettings(e,r))!==null&&n!==void 0?n:{isRoot:!0};if(i)return r;let o=r-1;for(;o>=0;){var s;const{isRoot:a}=(s=this.getHeaderSettings(e,o))!==null&&s!==void 0?s:{isRoot:!0};if(a)break;o-=1}return o}findRightMostColumnIndex(e,r){var n;const{isRoot:i,origColspan:o}=(n=this.getHeaderSettings(e,r))!==null&&n!==void 0?n:{isRoot:!0,origColspan:1};if(i)return r+o-1;let s=r+1;for(;s<this.getColumnsCount();){var a;const{isRoot:l}=(a=this.getHeaderSettings(e,s))!==null&&a!==void 0?a:{isRoot:!0};if(l)break;s+=1}return s-1}getLayersCount(){return Yt(Ho,this).getLayersCount()}getColumnsCount(){return Yt(Ho,this).getColumnsCount()}clear(){Sf(ru,this,[]),Yt(Ho,this).clear(),Yt(Mn,this).clear()}}function Rf(t,e,r){return(e=Whe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Whe(t){var e=Bhe(t,"string");return typeof e=="symbol"?e:e+""}function Bhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class jhe{constructor(e,r){Rf(this,"hot",void 0),Rf(this,"nestedHeaderSettingsGetter",void 0),Rf(this,"layersCount",0),Rf(this,"container",void 0),Rf(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=r,this.widthsMap=this.hot.columnIndexMapper.createAndRegisterIndexMap("nestedHeaders.widthsMap","physicalIndexToValue")}setLayersCount(e){return this.layersCount=e,this}getWidth(e){return this.widthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e))}buildWidthsMap(){const e=this.hot.getCurrentThemeName();this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),e&&this.container.classList.add(e),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const r=this.container.querySelectorAll("tr:last-of-type th"),n=r.length;this.widthsMap.clear();for(let i=0;i<n;i++){const o=this.hot.columnIndexMapper.getVisualFromRenderableIndex(i),s=this.hot.toPhysicalColumn(o);this.widthsMap.setValueAtIndex(s,r[i].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:r,columnIndexMapper:n}=this.hot,i=r.createDocumentFragment(),o=r.createElement("table"),s=!!this.hot.getSettings().dropdownMenu,a=n.getRenderableIndexesLength();for(let l=0;l<this.layersCount;l++){const u=r.createElement("tr");for(let c=0;c<a;c++){let h=n.getVisualFromRenderableIndex(c);h===null&&(h=c);const d=r.createElement("th"),f=this.nestedHeaderSettingsGetter(l,h);if(f&&(!f.isPlaceholder||f.isHidden)){let g=f.label;s&&(g+='<button class="changeType"></button>'),Iu(d,g),d.colSpan=f.colspan,u.appendChild(d)}}o.appendChild(u)}i.appendChild(o),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}function Uhe(t,e){FW(t,e),e.add(t)}function $W(t,e,r){return(e=zhe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zhe(t){var e=Yhe(t,"string");return typeof e=="symbol"?e:e+""}function Yhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ef(t,e,r){FW(t,e),e.set(t,r)}function FW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Is(t,e,r){return t.set(Gt(t,e),r),r}function Ue(t,e){return t.get(Gt(t,e))}function Gt(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const VW="nestedHeaders",Ghe=280;var pt=new WeakMap,Pa=new WeakMap,Tf=new WeakMap,Dw=new WeakMap,kw=new WeakMap,Qt=new WeakSet;class qhe extends rt{constructor(){super(...arguments),Uhe(this,Qt),Ef(this,pt,new Vhe),Ef(this,Pa,null),Ef(this,Tf,null),Ef(this,Dw,!1),Ef(this,kw,null),$W(this,"ghostTable",new jhe(this.hot,(e,r)=>this.getHeaderSettings(e,r))),$W(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return VW}static get PLUGIN_PRIORITY(){return Ghe}isEnabled(){return!!this.hot.getSettings()[VW]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:r}=this.hot.getSettings();(!Array.isArray(r)||!Array.isArray(r[0]))&&st(at`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
759
+ passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>Gt(Qt,this,cde).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,hde).call(e,...i)}),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,Jhe).call(e,...i)}),this.addHook("afterOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,Qhe).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,ede).call(e,...i)}),this.addHook("beforeOnCellMouseUp",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,tde).call(e,...i)}),this.addHook("beforeSelectionHighlightSet",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,rde).call(e,...i)}),this.addHook("modifyTransformStart",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,nde).call(e,...i)}),this.addHook("afterSelection",()=>Gt(Qt,this,Lw).call(this)),this.addHook("afterSelectionFocusSet",()=>Gt(Qt,this,Lw).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,Khe).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",n=>Gt(Qt,this,ode).call(this,n)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,ade).call(e,...i)}),this.addHook("modifyColumnHeaderValue",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,lde).call(e,...i)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,Xhe).call(e,...i)}),this.addHook("beforeCopy",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,Zhe).call(e,...i)}),this.addHook("beforeSelectColumns",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,ide).call(e,...i)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,sde).call(e,...i)}),this.addHook("modifyFocusedElement",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return Gt(Qt,e,ude).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>Gt(Qt,this,Lw).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>Gt(Qt,this,Lw).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();Ue(pt,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=Ue(pt,this).setState(e)),this.detectedOverlappedHeaders&&st(at`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
760
+ is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((r,n)=>{const i=r===!0?"hide-column":"show-column";Ue(pt,this).triggerColumnModification(i,n)}),!Ue(Pa,this)&&this.enabled&&Is(Pa,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(r=>{r.forEach(n=>{let{op:i,index:o,newValue:s}=n;if(i==="replace"){const a=s===!0?"hide-column":"show-column";Ue(pt,this).triggerColumnModification(a,o)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),Ue(pt,this).clear(),Ue(Pa,this).unsubscribe(),Is(Pa,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return Ue(pt,this)}getLayersCount(){return Ue(pt,this).getLayersCount()}getHeaderSettings(e,r){return Ue(pt,this).getHeaderSettings(e,r)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,r=e.getSetting("columnHeaders").length,n=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,o=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let s=0;s<r;s++){const a=n.childNodes[s];if(!a)break;const l=i.childNodes[s],u=o?o.childNodes[s]:null;for(let c=0,h=a.childNodes.length;c<h;c++)a.childNodes[c].removeAttribute("colspan"),Ee(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),Ee(l.childNodes[c],"hiddenHeader")),o&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),Ee(u.childNodes[c],"hiddenHeader"))}}headerRendererFactory(e){var r=this;const n=this.hot.view._wt.getSetting("fixedColumnsStart");return(i,o)=>{var s;const{columnIndexMapper:a,view:l}=this.hot;let u=a.getVisualFromRenderableIndex(i);u===null&&(u=i),o.removeAttribute("colspan"),Ee(o,"hiddenHeader"),Ee(o,"hiddenHeaderText");const{colspan:c,isHidden:h,isPlaceholder:d,headerClassNames:f}=(s=Ue(pt,this).getHeaderSettings(e,u))!==null&&s!==void 0?s:{};if(d||h)oe(o,"hiddenHeader");else if(c>1){var g,w,v;const{wtOverlays:b}=l._wt,p=(g=b.topInlineStartCornerOverlay)===null||g===void 0?void 0:g.clone.wtTable.THEAD.contains(o),_=(w=b.inlineStartOverlay)===null||w===void 0?void 0:w.clone.wtTable.THEAD.contains(o);((v=b.topOverlay)===null||v===void 0?void 0:v.clone.wtTable.THEAD.contains(o))&&u<n&&oe(o,"hiddenHeaderText");const T=p||_?Math.min(c,n-i):c;T>1&&o.setAttribute("colspan",T)}if(this.hot.view.appendColHeader(u,o,function(){return r.getColumnHeaderValue(...arguments)},e),!d&&!h){const b=o.querySelector("div.relative");b&&f&&f.length>0&&(Ee(b,this.hot.getColumnMeta(u).headerClassName),oe(b,f))}}}getColumnHeaderValue(e,r){var n;const{isHidden:i,isPlaceholder:o}=(n=Ue(pt,this).getHeaderSettings(r,e))!==null&&n!==void 0?n:{};return o||i?"":this.hot.getColHeader(e,r)}destroy(){Is(pt,this,null),Ue(Pa,this)!==null&&(Ue(Pa,this).unsubscribe(),Is(Pa,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return Ue(pt,this).getHeaderTreeNodeData(e.row,e.col)}}function Lw(){var t;const e=(t=this.hot)===null||t===void 0?void 0:t.getSelectedRangeLast();if(!e)return;const{highlight:r}=e;if(r.isHeader()&&r.col>=0){const i=Ue(pt,this).findLeftMostColumnIndex(r.row,r.col),o=this.hot.selection.highlight.getFocus();o.visualCellRange.highlight.col=i,o.visualCellRange.from.col=i,o.visualCellRange.to.col=i,o.commit()}}function Khe(t,e){var r;const n=this.hot.getSelectedRangeLast();if(!n)return t;const{highlight:i}=n,{navigableHeaders:o}=this.hot.getSettings(),s=this.hot.selection.isSelectedByColumnHeader(),a=o?i.row:(r=Ue(kw,this))===null||r===void 0?void 0:r.row,l=s?t:i.col,u=a<0&&l>=0;if(Is(kw,this,null),!u)return t;const c=this.hot.getFirstFullyVisibleColumn(),h=this.hot.getLastFullyVisibleColumn(),d=h-c+1,f=Ue(pt,this).findLeftMostColumnIndex(a,l),g=Ue(pt,this).findRightMostColumnIndex(a,l),w=g-f+1;if(f<c&&g>h)return f;if(s){let v=null;return f>=c&&g>h?w>d?(e.value="start",v=f):(e.value="end",v=g):f<c&&g<=h&&(w>d?(e.value="end",v=g):(e.value="start",v=f)),v}return f<=c?f:g}function Xhe(t,e,r){const n=Ue(pt,this).getHeaderTreeNodeData(e,t);if(!n)return t;const{columnCursor:i,selectionType:o,selectionWidth:s}=r,{isRoot:a,colspan:l}=Ue(pt,this).getHeaderSettings(e,t);if(o===fR){if(!a)return n.columnIndex}else if(o===CD&&(l>s-i||!a))return null;return t}function Zhe(t,e,r){let{columnHeadersCount:n}=r;if(n!==0)for(let o=0;o<e.length;o++){const{startRow:s,startCol:a,endRow:l,endCol:u}=e[o],c=l-s+1,h=a-u+1;if(s>=0||h===1)break;for(let d=a;d<=u;d++)for(let f=s;f<=l;f++){var i;const g=c+f,w=d-a;if(w===0)continue;((i=Ue(pt,this).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[g][w]="")}}}function Jhe(t,e,r,n){this._getHeaderTreeNodeDataByCoords(e)&&(n.column=!0)}function Qhe(t,e){const r=this._getHeaderTreeNodeDataByCoords(e);if(!r)return;Is(Tf,this,e.clone()),Is(Dw,this,!0);const{selection:n}=this.hot,i=n.isSelected()?n.getSelectedRange().current():null,o=[],{columnIndex:s,origColspan:a}=r,l=!n.inInSelection(e);t.shiftKey&&i?e.col<i.from.col?o.push(i.getTopEndCorner().col,s,e.row):e.col>i.from.col?o.push(i.getTopStartCorner().col,s+a-1,e.row):o.push(s,s+a-1,e.row):(_S(t)||Qa(t)&&l||O3(t))&&o.push(s,s+a-1,e.row),n.selectColumns(...o)}function ede(t,e,r,n){if(!this.hot.view.isMouseDown()||n.column)return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:o,origColspan:s}=i,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),u=a.getBottomEndCorner(),{from:c}=a;n.column=!0,n.cell=!0;const h=[],d=Ze(e.row,-1/0,-1);e.col<c.col?h.push(u.col,o,d):e.col>c.col?h.push(l.col,o+s-1,d):h.push(o,o+s-1,d),this.hot.selection.selectColumns(...h)}function tde(){Is(Dw,this,!1)}function rde(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!Ue(Dw,this)||!t)return;const e=this.hot.getSelectedRangeLast(),r=e.getTopStartCorner().col,n=e.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=Ue(pt,this).getHeaderTreeNodeData(Ue(Tf,this).row,Ue(Tf,this).col);if(e.setHighlight(Ue(Tf,this)),o>e.getWidth()||i<r||i+o-1>n){const s=Ue(pt,this).findTopMostEntireHeaderLevel(Ze(r,i,i+o-1),Ze(n,i,i+o-1));e.highlight.row=s,e.highlight.col=e.from.col}}function nde(t){const{highlight:e}=this.hot.getSelectedRangeLast(),r=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(r.isHeader()&&r.col>=0))return;const i=Ue(pt,this).findLeftMostColumnIndex(r.row,r.col),o=Ue(pt,this).findRightMostColumnIndex(r.row,r.col);if(t.col<0){const s=e.col>=i&&e.col<=o?i-1:o,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,-1);a===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,e.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(a,e.col)-1,1)}else if(t.col>0){const s=e.col>=i&&e.col<=o?o+1:i,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,1);a===null?t.col=this.hot.view.countRenderableColumnsInRange(e.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(e.col,a)-1,1)}}function ide(t,e,r){const n=t.row,i=this._getHeaderTreeNodeDataByCoords({row:n,col:t.col}),o=this._getHeaderTreeNodeDataByCoords({row:n,col:e.col});Is(kw,this,r.clone()),e.col<t.col?(i&&(t.col=i.columnIndex+i.origColspan-1),o&&(e.col=o.columnIndex)):e.col>=t.col&&(i&&(t.col=i.columnIndex),o&&(e.col=o.columnIndex+o.origColspan-1))}function ode(t){if(Ue(pt,this).getLayersCount()>0){t.length=0;for(let e=0;e<Ue(pt,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}}function sde(t){const e=Ue(pt,this).getLayersCount();let r=t.startColumn,n=!!e;for(let i=0;i<e;i++){const o=Ue(pt,this).findLeftMostColumnIndex(i,t.startColumn),s=this.hot.columnIndexMapper.getRenderableFromVisualIndex(o);if(o>=0&&(n=!1),Xr(s)&&s<t.startColumn){r=s;break}}t.startColumn=n?Ue(pt,this).getHeaderTreeNodeData(0,r).columnIndex:r}function ade(t,e){const r=this.ghostTable.getWidth(e);return t>r?t:r}function lde(t,e,r){var n;const{label:i}=(n=Ue(pt,this).getHeaderTreeNodeData(r,e))!==null&&n!==void 0?n:{label:""};return i}function ude(t,e){if(t<0)return this.hot.getCell(t,Ue(pt,this).findLeftMostColumnIndex(t,e),!0)}function cde(){this.updatePlugin()}function hde(t,e){e||this.updatePlugin()}function _f(t,e,r){return(e=dde(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dde(t){var e=fde(t,"string");return typeof e=="symbol"?e:e+""}function fde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gde{constructor(e,r){_f(this,"hot",void 0),_f(this,"data",null),_f(this,"plugin",void 0),_f(this,"parentReference",new WeakMap),_f(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=r,this.plugin=e}setData(e){this.data=e}getData(){return this.data}getRawSourceData(){let e=null;return this.plugin.disableCoreAPIModifiers(),e=this.hot.getSourceData(),this.plugin.enableCoreAPIModifiers(),e}updateWithData(e){this.setData(e),this.rewriteCache()}rewriteCache(){this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},Ce(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,r,n){this.cache.levels[r]||(this.cache.levels[r]=[],this.cache.levelCount+=1),this.cache.levels[r].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:n,row:this.cache.rows.length-1,level:r}),this.hasChildren(e)&&k(e.__children,i=>{this.cacheNode(i,r+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,r,n,i){let o=!1,s=r;if(isNaN(s)&&s.end)return s;let a=e;return a||(a={__children:this.data},o=!0,s-=1),n!=null&&s===n?{result:a,end:!0}:i!=null&&a===i?{result:s,end:!0}:(s+=1,a.__children&&k(a.__children,l=>{if(this.parentReference.set(l,o?null:a),s=this.readTreeNodes(l,s,n,i),isNaN(s)&&s.end)return!1}),s)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return Fe(this.data[0],(r,n)=>{e[n]=null}),e}getRowIndex(e){return e==null?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let r=null;isNaN(e)?r=e:r=this.getDataObject(e);const n=this.getRowParent(e);return n==null?this.data.indexOf(r):n.__children.indexOf(r)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let r=0,n=e;return isNaN(n)||(n=this.getDataObject(n)),!n||!n.__children?0:(k(n.__children,i=>{r+=1,i.__children&&(r+=this.countChildren(i))}),r)}getRowParent(e){let r;return isNaN(e)?r=e:r=this.getDataObject(e),this.getRowObjectParent(r)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let r=null;return isNaN(e)?r=e:r=this.getDataObject(e),r?this.getRowObjectLevel(r):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let r=e;return isNaN(r)||(r=this.getDataObject(r)),!!(r.__children&&r.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,r){var n;return((n=e.__children)===null||n===void 0?void 0:n[r])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var r;let n=e;return isNaN(n)||(n=this.getDataObject(n)),n&&!!n.__children&&((r=n.__children)===null||r===void 0?void 0:r.length)!==0}addChild(e,r){let n=r;this.hot.runHooks("beforeAddChild",e,n);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let o=e;e||(o=this.mockParent()),o.__children||(o.__children=[]),n||(n=this.mockNode()),o.__children.push(n),this.rewriteCache();const s=this.getRowIndex(n);this.hot.rowIndexMapper.insertIndexes(s,1),this.hot.runHooks("afterCreateRow",s,1),this.hot.runHooks("afterAddChild",e,n)}addChildAtIndex(e,r,n){let i=n,o;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,r),e){const a=this.getRowIndex(e)+r+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(r,null,i),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(a,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",a,1),o=a}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",r,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),o=this.getRowIndex(this.data[r]);i=this.getDataObject(o),this.hot.runHooks("afterAddChild",e,i,r)}addSibling(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const n=this.translateTrimmedRow(e),i=this.getRowParent(n),o=this.getRowIndexWithinParent(n);switch(r){case"below":this.addChildAtIndex(i,o+1,null);break;case"above":this.addChildAtIndex(i,o,null);break}}detachFromParent(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=null;const i=[];Array.isArray(e)?(Ce(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),Ce(0,i.length-2,d=>{this.detachFromParent(i[d],!1)}),n=i[i.length-1]):n=e;const o=this.getRowIndex(n),s=this.countChildren(n),a=this.getRowIndexWithinParent(n),l=this.getRowParent(n),u=this.getRowParent(l),c=this.getRowIndex(u);let h=null;if(this.hot.runHooks("beforeDetachChild",l,n),a!=null){const d=Array.from(new Array(o+s+1).keys()).splice(-1*(s+1));if(this.hot.runHooks("beforeRemoveRow",o,s+1,d,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",o,s+1,d,this.plugin.pluginName),u){h=c+this.countChildren(u);const f=this.getChild(u,this.countChildren(u)-1),g=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",g+1,s+1,this.plugin.pluginName),u.__children.push(n)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,s+1,this.plugin.pluginName),this.data.push(n)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,s+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,n,this.getRowIndex(n)),r&&this.hot.render()}filterData(e,r,n){const i=[];k(n,o=>{i.push(this.getDataObject(o))}),k(i,o=>{const s=this.getRowIndexWithinParent(o),a=this.getRowParent(o);a===null?this.data.splice(s,1):a.__children.splice(s,1)}),this.rewriteCache()}spliceData(e,r,n){const i=this.getDataObject(e-1);let o=null,s=e;i&&i.__children&&i.__children.length===0?(o=i,s=0):e<this.countAllRows()&&(o=this.getRowParent(e),s=this.getRowIndexWithinParent(e)),o?n?o.__children.splice(s,r,...n):o.__children.splice(s,r):n?this.data.splice(s,r,...n):this.data.splice(s,r),this.rewriteCache()}syncRowWithRawSource(e){let r=e,n=r;do n=this.getRowParent(n),n!==null&&(r=n);while(n!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(r),"__children",r.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,r,n,i){const o=r===this.hot.countRows(),s=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=s.__children.slice(a,a+1),u=e>r;let c=o?this.getRowParent(r-1):this.getRowParent(r);c==null&&(c=this.getRowParent(r-1)),c==null&&(c=this.getDataObject(r-1)),c?c.__children||(c.__children=[]):(c=this.getDataObject(r),c.__children=[]);const h=o||n||i?c.__children.length:this.getRowIndexWithinParent(r),d=s===c;c.__children.splice(h,0,l[0]),s.__children.splice(a+(u&&d?1:0),1),this.syncRowWithRawSource(s),d||this.syncRowWithRawSource(c)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}}function WW(t,e,r){return(e=mde(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mde(t){var e=pde(t,"string");return typeof e=="symbol"?e:e+""}function pde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gM{constructor(e,r){WW(this,"hot",void 0),WW(this,"plugin",void 0),this.hot=r,this.plugin=e}}class No extends gM{static get CSS_CLASSES(){return{indicatorContainer:"ht_nestingLevels",parent:"ht_nestingParent",indicator:"ht_nestingLevel",emptyIndicator:"ht_nestingLevel_empty",button:"ht_nestingButton",expandButton:"ht_nestingExpand",collapseButton:"ht_nestingCollapse"}}constructor(e,r){super(e,r),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,r){const n=this.hot.toPhysicalRow(e),i=this.dataManager.getRowLevel(n),o=this.dataManager.getDataObject(n),s=r.getElementsByTagName("DIV")[0],a=s.querySelector("span.rowHeader"),l=s.querySelectorAll('[class^="ht_nesting"]'),u=this.hot.getSettings().ariaTags;if(k(l,c=>{c&&s.removeChild(c)}),oe(r,No.CSS_CLASSES.indicatorContainer),i){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);s.innerHTML="",Ce(0,i-1,()=>{const d=c.createElement("SPAN");oe(d,No.CSS_CLASSES.emptyIndicator),s.appendChild(d)}),s.appendChild(h)}if(this.dataManager.hasChildren(o)){const c=this.hot.rootDocument.createElement("DIV");u&&Pe(c,[Ga()]),oe(r,No.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(n)?(oe(c,`${No.CSS_CLASSES.button} ${No.CSS_CLASSES.expandButton}`),u&&Pe(r,[ei(!1)])):(oe(c,`${No.CSS_CLASSES.button} ${No.CSS_CLASSES.collapseButton}`),u&&Pe(r,[ei(!0)])),s.appendChild(c)}}updateRowHeaderWidth(e){let r=e;r||(r=this.dataManager.cache.levelCount);const n=this.hot.view.getStylesHandler();let i=11;n.isClassicTheme()||(i=n.getCSSVariableValue("cell-horizontal-padding")*2),this.rowHeaderWidthCache=Math.max(50,i+10*r+25),this.hot.render()}}class wde extends gM{constructor(e,r){var n;super(e,r),n=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;n.lastCollapsedRows=n.collapsedRows.slice(0),n.expandMultipleChildren(n.lastCollapsedRows,i)},shiftStash:function(i,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;o==null&&(o=1/0),k(n.lastCollapsedRows,(a,l)=>{a>=i&&a<o&&(n.lastCollapsedRows[l]=a+s)})},applyStash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;n.collapseMultipleChildren(n.lastCollapsedRows,i),n.lastCollapsedRows=void 0},trimStash:(i,o)=>{Ce(i,i+o-1,s=>{const a=this.lastCollapsedRows.indexOf(s);a>-1&&this.lastCollapsedRows.splice(a,1)})}}}collapseChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(o)):(o=this.dataManager.getDataObject(e),s=e),this.dataManager.hasChildren(o)&&k(o.__children,l=>{i.push(this.dataManager.getRowIndex(l))}),a=this.collapseRows(i,!0,!1),n&&this.trimRows(a),r&&this.renderAndAdjust(),this.collapsedRows.indexOf(s)===-1&&this.collapsedRows.push(s),a}collapseMultipleChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];k(e,o=>{i.push(...this.collapseChildren(o,!1,!1))}),n&&this.trimRows(i),r&&this.renderAndAdjust()}collapseRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.collapseRows([e],r)}collapseRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return k(e,o=>{i.push(o),r&&this.collapseChildRows(o,i)}),n&&this.trimRows(i),i}collapseChildRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);k(i.__children,o=>{const s=this.dataManager.getRowIndex(o);r.push(s),this.collapseChildRows(s,r)})}n&&this.trimRows(r)}expandRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.expandRows([e],r)}expandRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return k(e,o=>{i.push(o),r&&this.expandChildRows(o,i)}),n&&this.untrimRows(i),i}expandChildRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);k(i.__children,o=>{if(!this.isAnyParentCollapsed(o)){const s=this.dataManager.getRowIndex(o);r.push(s),this.expandChildRows(s,r)}})}n&&this.untrimRows(r)}expandChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(e)):(o=this.dataManager.getDataObject(e),s=e),this.collapsedRows.splice(this.collapsedRows.indexOf(s),1),this.dataManager.hasChildren(o)&&k(o.__children,l=>{const u=this.dataManager.getRowIndex(l);i.push(u)}),a=this.expandRows(i,!0,!1),n&&this.untrimRows(a),r&&this.renderAndAdjust(),a}expandMultipleChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];k(e,o=>{i.push(...this.expandChildren(o,!1,!1))}),n&&this.untrimRows(i),r&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),r=[];k(e,n=>{this.dataManager.hasChildren(n)&&r.push(n)}),this.collapseMultipleChildren(r),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),r=[];k(e,n=>{this.dataManager.hasChildren(n)&&r.push(n)}),this.expandMultipleChildren(r),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{k(e,r=>{this.plugin.collapsedRowsMap.setValueAtIndex(r,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{k(e,r=>{this.plugin.collapsedRowsMap.setValueAtIndex(r,!1)})},!0)}areChildrenCollapsed(e){let r=isNaN(e)?e:this.dataManager.getDataObject(e),n=!0;return r===null&&(r={__children:this.dataManager.data}),this.dataManager.hasChildren(r)&&k(r.__children,i=>{const o=this.dataManager.getRowIndex(i);if(!this.plugin.collapsedRowsMap.getValueAtIndex(o))return n=!1,!1}),n}isAnyParentCollapsed(e){let r=e;for(;r!==null;){r=this.dataManager.getRowParent(r);const n=this.dataManager.getRowIndex(r);if(this.collapsedRows.indexOf(n)>-1)return!0}return!1}toggleState(e,r){if(r.col>=0)return;const n=this.translateTrimmedRow(r.row);_e(e.target,No.CSS_CLASSES.button)&&(this.areChildrenCollapsed(n)?this.expandChildren(n):this.collapseChildren(n),_i(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function vde(t,e,r){yde(t,e),e.set(t,r)}function yde(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cde(t,e,r){return(e=bde(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bde(t){var e=Sde(t,"string");return typeof e=="symbol"?e:e+""}function Sde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rde(t,e){return t.get(Ede(t,e))}function Ede(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var BW=new WeakMap;class Tde extends gM{constructor(){super(...arguments),Cde(this,"dataManager",this.plugin.dataManager),vde(this,BW,{row_above:(e,r)=>{const n=r[r.length-1];this.dataManager.addSibling(n.start.row,"above")},row_below:(e,r)=>{const n=r[r.length-1];this.dataManager.addSibling(n.start.row,"below")}})}appendOptions(e){const r=[{key:"add_child",name(){return this.getTranslatedPhrase(SE)},callback:()=>{const n=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),i=this.dataManager.getDataObject(n);this.dataManager.addChild(i)},disabled:()=>{const n=this.hot.getSelectedLast();return!n||n[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(RE)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const n=this.hot.getSelectedLast(),i=this.dataManager.translateTrimmedRow(n[0]);return!this.dataManager.getRowParent(i)||!n||n[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return Ce(0,e.items.length-1,n=>{if(n===0)return k(r,(i,o)=>{e.items.splice(n+o,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return Ce(0,e.items.length-1,r=>{const n=Rde(BW,this)[e.items[r].key];n!=null&&(e.items[r].callback=n)}),e}}function $w(t,e,r){return(e=_de(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _de(t){var e=Mde(t,"string");return typeof e=="symbol"?e:e+""}function Mde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Pde{constructor(e){$w(this,"plugin",void 0),$w(this,"hot",void 0),$w(this,"dataManager",void 0),$w(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,r,n,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:r,dropIndex:n,movePossible:i}))return!1;this.movedToCollapsed=!1;const s=n===this.hot.countRows(),a=s?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(n);let l=!0;const u=e.map(g=>{if(!l)return!1;const w=this.dataManager.translateTrimmedRow(g);return l=this.shouldAllowMoving(w,a),w}),c=u.indexOf(a)===-1;if(!l||!c)return!1;const h=this.getBaseParent(u),d=this.getTargetParent(s,a),f=h===d;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(d),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(u,a,f),this.moveRows(u,a,d),this.dataManager.rewriteCache(),this.moveCellsMeta(u,a),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,r,n,i,i&&this.isRowOrderChanged(e,r)),this.hot.render(),this.selectCells(e,n),!1}displayAPICompatibilityWarning(e){const{rows:r,finalIndex:n,dropIndex:i,movePossible:o}=e;let s=!1;return $t(i)&&(st(at`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
761
+ when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",r,n,i,o,!1),s=!0),s}shouldAllowMoving(e,r){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===r||r===0)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,r){let n=this.dataManager.getRowParent(e?r-1:r);return n==null&&(n=this.dataManager.getRowParent(r-1)),n}shiftCollapsibleParentsLocations(e,r,n){n||(Math.max(...e)<=r?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],r,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(r,e[0],e.length))}moveRows(e,r,n){const i=r===this.dataManager.getRowIndex(n)+this.dataManager.countChildren(n)+1;this.hot.batchRender(()=>{e.forEach(o=>{this.dataManager.moveRow(o,r,this.movedToCollapsed,i)})})}moveCellsMeta(e,r){const n=[],i=Math.max(...e)<r;e.forEach(o=>{n.push(this.hot.getCellMetaAtRow(o))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(r-(i?n.length:0),0,...n)}selectCells(e,r){const n=e.length;let i=0,o=0;if(this.movedToCollapsed){let s=null;e[n-1]<r?s=this.dataManager.translateTrimmedRow(r-n):s=this.dataManager.translateTrimmedRow(r);const a=this.dataManager.getRowParent(s===null?this.hot.countSourceRows()-1:s-1),l=this.dataManager.getRowIndex(a);i=this.dataManager.untranslateTrimmedRow(l),o=i}else e[n-1]<r?(o=r-1,i=o-n+1):(i=r,o=i+n-1);this.hot.selectCells([[i,0,o,this.hot.countCols()-1]],!1)}isRowOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}}function Ide(t,e){UW(t,e),e.add(t)}function jW(t,e,r){UW(t,e),e.set(t,r)}function UW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mM(t,e,r){return(e=Ode(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ode(t){var e=xde(t,"string");return typeof e=="symbol"?e:e+""}function xde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fw(t,e){return t.get(Sr(t,e))}function Vw(t,e,r){return t.set(Sr(t,e),r),r}function Sr(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Ww="nestedRows",Ade=300,zW=Ww,Hde="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var Bw=new WeakMap,$c=new WeakMap,Ir=new WeakSet;class Nde extends rt{constructor(){super(...arguments),Ide(this,Ir),mM(this,"dataManager",null),mM(this,"headersUI",null),mM(this,"collapsedRowsMap",null),jW(this,Bw,!1),jW(this,$c,!1)}static get PLUGIN_KEY(){return Ww}static get PLUGIN_PRIORITY(){return Ade}isEnabled(){return!!this.hot.getSettings()[Ww]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new rd),this.dataManager=new gde(this,this.hot),this.collapsingUI=new wde(this,this.hot),this.headersUI=new No(this,this.hot),this.contextMenuUI=new Tde(this,this.hot),this.rowMoveController=new Pde(this),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,qde).call(e,...n)}),this.addHook("beforeViewRender",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,Kde).call(e,...n)}),this.addHook("modifyRowData",function(){return e.onModifyRowData(...arguments)}),this.addHook("modifySourceLength",function(){return e.onModifySourceLength(...arguments)}),this.addHook("beforeDataSplice",function(){return e.onBeforeDataSplice(...arguments)}),this.addHook("filterData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,Lde).call(e,...n)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,$de).call(e,...n)}),this.addHook("afterGetRowHeader",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,Fde).call(e,...n)}),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,kde).call(e,...n)}),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,Bde).call(e,...n)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,Wde).call(e,...n)}),this.addHook("beforeAddChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,jde).call(e,...n)}),this.addHook("afterAddChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,Ude).call(e,...n)}),this.addHook("beforeDetachChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,zde).call(e,...n)}),this.addHook("afterDetachChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,Yde).call(e,...n)}),this.addHook("modifyRowHeaderWidth",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,Vde).call(e,...n)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,Gde).call(e,...n)}),this.addHook("beforeRowMove",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Sr(Ir,e,Dde).call(e,...n)}),this.addHook("beforeLoadData",r=>Sr(Ir,this,YW).call(this,r)),this.addHook("beforeUpdateData",r=>Sr(Ir,this,YW).call(this,r)),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("nestedRows"),this.unregisterShortcuts(),super.disablePlugin()}updatePlugin(){this.disablePlugin();const e=this.dataManager.getData();this.enablePlugin(),this.dataManager.updateWithData(e),super.updatePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast(),r=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(r)?this.collapsingUI.expandChildren(r):this.collapsingUI.collapseChildren(r),!1},runOnlyIf:()=>{var e,r;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingle())&&this.hot.selection.isCellVisible(n)&&n.col===-1&&n.row>=0},group:zW,relativeToGroup:Qs,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(zW)}disableCoreAPIModifiers(){Vw($c,this,!0)}enableCoreAPIModifiers(){Vw($c,this,!1)}onModifyRowData(e){if(!Fw($c,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!Fw($c,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,r,n){return Fw($c,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,r,n),!1)}destroy(){super.destroy()}}function Dde(t,e,r,n){return this.rowMoveController.onBeforeRowMove(t,e,r,n)}function kde(t,e,r){this.collapsingUI.toggleState(t,e,r)}function Lde(t,e,r){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(r[0],e),this.collapsingUI.collapsedRowsStash.shiftStash(r[0],null,-1*e),this.dataManager.filterData(t,e,r),Vw(Bw,this,!0),this.dataManager.getData().slice()}function $de(t){return this.contextMenuUI.appendOptions(t)}function Fde(t,e){this.headersUI.appendLevelIndicators(t,e)}function Vde(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function Wde(t,e,r,n){n!==this.pluginName&&this.hot._registerTimeout(()=>{Vw(Bw,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function Bde(t,e,r){const n=Array.from(r.reduce((i,o)=>{if(this.dataManager.isParent(o)){const s=this.dataManager.getDataObject(o).__children;return i.add(o),Array.isArray(s)&&s.forEach(a=>i.add(this.dataManager.getRowIndex(a))),i}return i.add(o)},new Set));r.length=0,r.push(...n)}function jde(){this.collapsingUI.collapsedRowsStash.stash()}function Ude(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function zde(){this.collapsingUI.collapsedRowsStash.stash()}function Yde(t,e,r){this.collapsingUI.collapsedRowsStash.shiftStash(r,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function Gde(){this.dataManager.rewriteCache()}function qde(){this.headersUI.updateRowHeaderWidth()}function Kde(t,e){Fw(Bw,this)&&(e.skipRender=!0)}function YW(t){if(!W5(t)){MS(Hde),this.hot.getSettings()[Ww]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function pM(t,e,r){return(e=Xde(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xde(t){var e=Zde(t,"string");return typeof e=="symbol"?e:e+""}function Zde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jde{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;pM(this,"rootWindow",void 0),pM(this,"prefix",void 0),pM(this,"savedKeys",[]),this.rootWindow=r,this.prefix=e,this.loadSavedKeys()}saveValue(e,r){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(r)),this.savedKeys.indexOf(e)===-1&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,r){const n=typeof e>"u"?r:e,i=this.rootWindow.localStorage.getItem(`${this.prefix}_${n}`);return i===null?void 0:JSON.parse(i)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){k(this.savedKeys,(e,r)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[r]}`)}),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),r=typeof e=="string"?JSON.parse(e):void 0;this.savedKeys=r||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}function Qde(t,e,r){return(e=efe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function efe(t){var e=tfe(t,"string");return typeof e=="symbol"?e:e+""}function tfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}de.getSingleton().register("persistentStateSave"),de.getSingleton().register("persistentStateLoad"),de.getSingleton().register("persistentStateReset");const GW="persistentState",rfe=0;class nfe extends rt{constructor(){super(...arguments),Qde(this,"storage",void 0)}static get PLUGIN_KEY(){return GW}static get PLUGIN_PRIORITY(){return rfe}isEnabled(){return!!this.hot.getSettings()[GW]}enablePlugin(){this.enabled||(this.storage||(this.storage=new Jde(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,r)=>this.saveValue(e,r)),this.addHook("persistentStateLoad",(e,r)=>this.loadValue(e,r)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,r){r.value=this.storage.loadValue(e)}saveValue(e,r){this.storage.saveValue(e,r)}resetValue(e){typeof e>"u"?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function ife(t,e){ofe(t,e),e.add(t)}function ofe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wM(t,e,r){return(e=sfe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sfe(t){var e=afe(t,"string");return typeof e=="symbol"?e:e+""}function afe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const vM="search",lfe=190,ufe="htSearchResult",cfe=function(t,e,r,n,i){t.getCellMeta(e,r).isSearchResult=i},hfe=function(t,e,r){return $t(t)||t===null||!t.toLocaleLowerCase||t.length===0||$t(e)||e===null?!1:e.toString().toLocaleLowerCase(r.locale).indexOf(t.toLocaleLowerCase(r.locale))!==-1};var yM=new WeakSet;class dfe extends rt{constructor(){super(...arguments),ife(this,yM),wM(this,"callback",cfe),wM(this,"queryMethod",hfe),wM(this,"searchResultClass",ufe)}static get PLUGIN_KEY(){return vM}static get PLUGIN_PRIORITY(){return lfe}isEnabled(){return this.hot.getSettings()[vM]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[vM];this.updatePluginSettings(r),this.addHook("beforeRenderer",function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return qW(yM,e,KW).call(e,...i)}),super.enablePlugin()}disablePlugin(){var e=this;const r=function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return qW(yM,e,KW).call(e,...i)};this.hot.addHook("beforeRenderer",r),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",r)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getCallback(),n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const i=this.hot.countRows(),o=this.hot.countCols(),s=[],a=this.hot;return Ce(0,i-1,l=>{Ce(0,o-1,u=>{const c=this.hot.getDataAtCell(l,u),h=this.hot.getCellMeta(l,u),d=h.search.callback||r,g=(h.search.queryMethod||n)(e,c,h);if(g){const w={row:l,col:u,data:c};s.push(w)}d&&d(a,l,u,c,g)})}),s}getCallback(){return this.callback}setCallback(e){this.callback=e}getQueryMethod(){return this.queryMethod}setQueryMethod(e){this.queryMethod=e}getSearchResultClass(){return this.searchResultClass}setSearchResultClass(e){this.searchResultClass=e}updatePluginSettings(e){$e(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function KW(t,e,r,n,i,o){const s=o.className||[];let a=[];typeof s=="string"?a=s.split(" "):a.push(...s),this.isEnabled()&&o.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),o.className=a.join(" ")}function jw(t,e,r){return(e=ffe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ffe(t){var e=gfe(t,"string");return typeof e=="symbol"?e:e+""}function gfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class XW{constructor(e){jw(this,"viewportWidth",void 0),jw(this,"overwriteColumnWidthFn",void 0),jw(this,"baseWidths",new Map),jw(this,"stretchedWidths",new Map),this.overwriteColumnWidthFn=e}prepare(e){let{viewportWidth:r}=e;this.viewportWidth=r,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,r){this.baseWidths.set(e,r)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}}class mfe extends XW{calculate(){const e=Array.from(this.baseWidths).reduce((h,d)=>{let[,f]=d;return h+f},0);if(this.viewportWidth-e<0){this.stretchedWidths.clear();return}const n=this.viewportWidth/e,i=[],o=[];let s=this.viewportWidth,a=0;if(this.baseWidths.forEach((h,d)=>{const f=Math.round(h*n),g=this.overwriteColumnWidthFn(f,d);f===g&&f>=Du?(i.push([d,g]),a+=g):f!==g&&(i.push([d,g]),o.push(d),s-=g)}),s<=Du){this.stretchedWidths.clear();return}const l=s/a;let u=-1,c=0;i.forEach((h,d)=>{let[f,g]=h,w=g;o.includes(f)||(w=Math.round(g*l)),this.stretchedWidths.set(f,w),u=f,d<i.length-1&&(c+=w)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(u,Math.round(this.viewportWidth-c))}}function ZW(t,e,r){pfe(t,e),e.set(t,r)}function pfe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function CM(t,e){return t.get(JW(t,e))}function Uw(t,e,r){return t.set(JW(t,e),r),r}function JW(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var zw=new WeakMap,Mf=new WeakMap;class wfe extends XW{constructor(){super(...arguments),ZW(this,zw,0),ZW(this,Mf,-1)}prepare(e){super.prepare(e),Uw(zw,this,0),Uw(Mf,this,-1)}setColumnBaseWidth(e,r){super.setColumnBaseWidth(e,r),Uw(Mf,this,e),Uw(zw,this,r)}calculate(){if(CM(Mf,this)===-1)return;const e=Array.from(this.baseWidths).reduce((n,i)=>{let[,o]=i;return n+o},0),r=Math.max(this.viewportWidth-e+CM(zw,this),0);this.stretchedWidths.set(CM(Mf,this),r)}}function vfe(t,e){QW(t,e),e.add(t)}function Yw(t,e,r){QW(t,e),e.set(t,r)}function QW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function er(t,e){return t.get(Fc(t,e))}function bM(t,e,r){return t.set(Fc(t,e),r),r}function Fc(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const yfe="stretchColumns";var jr=new WeakMap,Vc=new WeakMap,SM=new WeakMap,Gw=new WeakMap,Pf=new WeakSet;class Cfe{constructor(e){vfe(this,Pf),Yw(this,jr,void 0),Yw(this,Vc,void 0),Yw(this,SM,new Map([["all",new mfe(Fc(Pf,this,eB).bind(this))],["last",new wfe(Fc(Pf,this,eB).bind(this))]])),Yw(this,Gw,"none"),bM(jr,this,e),bM(Vc,this,er(jr,this).columnIndexMapper.createAndRegisterIndexMap(yfe,"physicalIndexToValue"))}useStrategy(e){bM(Gw,this,er(SM,this).has(e)?e:"none")}refreshStretching(){if(er(Gw,this)==="none"){er(Vc,this).clear();return}er(jr,this).batchExecution(()=>{er(Vc,this).clear();const e=er(SM,this).get(er(Gw,this));let n=er(jr,this).view.getViewportWidth();Fc(Pf,this,bfe).call(this)&&(n-=_r(er(jr,this).rootDocument)),e.prepare({viewportWidth:n});for(let i=0;i<er(jr,this).countCols();i++)er(jr,this).columnIndexMapper.isHidden(er(jr,this).toPhysicalColumn(i))||e.setColumnBaseWidth(i,Fc(Pf,this,Sfe).call(this,i));e.calculate(),e.getWidths().forEach(i=>{let[o,s]=i;er(Vc,this).setValueAtIndex(er(jr,this).toPhysicalColumn(o),s)})},!0)}getStretchedWidth(e){return er(Vc,this).getValueAtIndex(er(jr,this).toPhysicalColumn(e))}}function bfe(){const{view:t}=er(jr,this);if(t.isVerticallyScrollableByWindow())return!1;const e=t.getViewportHeight(),r=er(jr,this).countRows(),n=t.getStylesHandler().getDefaultRowHeight();let i=0,o=!1;for(let a=0;a<r;a++){var s;if(i+=((s=er(jr,this).getRowHeight(a))!==null&&s!==void 0?s:n)+(a===0?1:0),i>e){o=!0;break}}return o}function Sfe(t){var e;return(e=er(jr,this).getColWidth(t,"StretchColumns"))!==null&&e!==void 0?e:Du}function eB(t,e){return er(jr,this).runHooks("beforeStretchingColumnWidth",t,e)}function Rfe(t,e){tB(t,e),e.add(t)}function RM(t,e,r){tB(t,e),e.set(t,r)}function tB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function EM(t,e,r){return t.set(qw(t,e),r),r}function Os(t,e){return t.get(qw(t,e))}function qw(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Efe="stretchColumns",Tfe=155;var Wc=new WeakMap,Kw=new WeakMap,If=new WeakMap,TM=new WeakSet;class _fe extends rt{constructor(){super(...arguments),Rfe(this,TM),RM(this,Wc,new Cfe(this.hot)),RM(this,Kw,null),RM(this,If,new ResizeObserver(e=>{requestAnimationFrame(()=>{var r;(r=this.hot)!==null&&r!==void 0&&r.view.isHorizontallyScrollableByWindow()&&e.forEach(n=>{let{contentRect:i}=n;Os(Kw,this)!==null&&Os(Kw,this)!==i.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),EM(Kw,this,i.width)})})}))}static get PLUGIN_KEY(){return Efe}static get PLUGIN_PRIORITY(){return Tfe}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(Os(Wc,this).useStrategy(this.hot.getSettings().stretchH),Os(If,this).observe(this.hot.rootElement),this.addHook("beforeRender",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return qw(TM,e,Pfe).call(e,...n)}),this.addHook("modifyColWidth",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return qw(TM,e,Mfe).call(e,...n)},10),super.enablePlugin())}updatePlugin(){Os(Wc,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),Os(If,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return Os(Wc,this).getStretchedWidth(e)}destroy(){Os(If,this).disconnect(),EM(If,this,null),EM(Wc,this,null),super.destroy()}}function Mfe(t,e,r){if(r===this.pluginName)return;const n=this.getColumnWidth(e);return typeof n=="number"?n:t}function Pfe(t){t&&Os(Wc,this).refreshStretching()}function Ife(t,e){Ofe(t,e),e.add(t)}function Ofe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xw(t,e,r){return(e=xfe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xfe(t){var e=Afe(t,"string");return typeof e=="symbol"?e:e+""}function Afe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _M(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Hfe="touchScroll",Nfe=200;var Zw=new WeakSet;class Dfe extends rt{constructor(){super(...arguments),Ife(this,Zw),Xw(this,"scrollbars",[]),Xw(this,"clones",[]),Xw(this,"lockedCollection",!1),Xw(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return Hfe}static get PLUGIN_PRIORITY(){return Nfe}static get SETTING_KEYS(){return!0}isEnabled(){return zH()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>_M(Zw,this,kfe).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>_M(Zw,this,Lfe).call(this)),this.addHook("afterMomentumScroll",()=>_M(Zw,this,$fe).call(this))}}function kfe(){if(this.lockedCollection)return;const{topOverlay:t,bottomOverlay:e,inlineStartOverlay:r,topInlineStartCornerOverlay:n,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(t),e.clone&&this.scrollbars.push(e),this.scrollbars.push(r),n&&this.scrollbars.push(n),i&&i.clone&&this.scrollbars.push(i),this.clones=[],t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),r.needFullRender&&this.clones.push(r.clone.wtTable.holder.parentNode),n&&this.clones.push(n.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function Lfe(){this.freezeOverlays=!0,k(this.clones,t=>{oe(t,"hide-tween")})}function $fe(){this.freezeOverlays=!1,k(this.clones,t=>{Ee(t,"hide-tween"),oe(t,"show-tween")}),this.hot._registerTimeout(()=>{k(this.clones,t=>{Ee(t,"show-tween")})},400),k(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function Ffe(t,e){Vfe(t,e),e.add(t)}function Vfe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wfe(t,e,r){return(e=Bfe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bfe(t){var e=jfe(t,"string");return typeof e=="symbol"?e:e+""}function jfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ufe(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Jw="trimRows",zfe=330;var rB=new WeakSet;class Yfe extends rt{constructor(){super(...arguments),Ffe(this,rB),Wfe(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return Jw}static get PLUGIN_PRIORITY(){return zfe}isEnabled(){return!!this.hot.getSettings()[Jw]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new rd),this.trimmedRowsMap.addLocalHook("init",()=>Ufe(rB,this,Gfe).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[Jw];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),k(e,r=>{this.trimmedRowsMap.setValueAtIndex(r,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const r=this.getTrimmedRows(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeTrimRow",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{k(e,s=>{this.trimmedRowsMap.setValueAtIndex(s,!0)})},!0),this.hot.runHooks("afterTrimRow",r,i,n,n&&i.length>r.length))}trimRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.trimRows(r)}untrimRows(e){const r=this.getTrimmedRows(),n=this.isValidConfig(e);let i=r;const o=this.trimmedRowsMap.getValues().slice(),s=e.length>0;n&&s&&(k(e,l=>{o[l]=!1}),i=hn(o,(l,u,c)=>(u&&l.push(c),l),[])),this.hot.runHooks("beforeUntrimRow",r,i,n&&s)!==!1&&(n&&s&&this.trimmedRowsMap.setValues(o),this.hot.runHooks("afterUntrimRow",r,i,n&&s,n&&i.length<r.length))}untrimRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.untrimRows(r)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const r=this.hot.countSourceRows();return e.every(n=>Number.isInteger(n)&&n>=0&&n<r)}destroy(){super.destroy()}}function Gfe(){const t=this.hot.getSettings()[Jw];Array.isArray(t)&&this.hot.batchExecution(()=>{k(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}function qfe(t,e,r){return(e=Kfe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kfe(t){var e=Xfe(t,"string");return typeof e=="symbol"?e:e+""}function Xfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class mi{constructor(e){qfe(this,"actionType",""),this.actionType=e}undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}function Qw(t,e,r){return(e=Zfe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zfe(t){var e=Jfe(t,"string");return typeof e=="symbol"?e:e+""}function Jfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class MM extends mi{constructor(e){let{stateBefore:r,range:n,type:i,alignment:o}=e;super("cell_alignment"),Qw(this,"stateBefore",void 0),Qw(this,"range",void 0),Qw(this,"type",void 0),Qw(this,"alignment",void 0),this.stateBefore=r,this.range=n,this.type=i,this.alignment=o}static startRegisteringEvents(e,r){e.addHook("beforeCellAlignment",(n,i,o,s)=>{r.done(()=>new MM({stateBefore:n,range:i,type:o,alignment:s}))})}undo(e,r){k(this.range,n=>{n.forAll((i,o)=>{i>=0&&o>=0&&e.setCellMeta(i,o,"className",this.stateBefore[i][o]||" htLeft")})}),e.addHookOnce("afterViewRender",r),e.render()}redo(e,r){ia(this.range,this.type,this.alignment,(n,i)=>e.getCellMeta(n,i),(n,i,o,s)=>e.setCellMeta(n,i,o,s)),e.addHookOnce("afterViewRender",r),e.render()}}function nB(t,e,r){return(e=Qfe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qfe(t){var e=ege(t,"string");return typeof e=="symbol"?e:e+""}function ege(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class PM extends mi{constructor(e){let{columns:r,finalIndex:n}=e;super("col_move"),nB(this,"columns",void 0),nB(this,"finalColumnIndex",void 0),this.columns=r.slice(),this.finalColumnIndex=n}static startRegisteringEvents(e,r){e.addHook("beforeColumnMove",(n,i)=>{n!==!1&&r.done(()=>new PM({columns:n,finalIndex:i}))})}undo(e,r){const n=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",r),x_(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),n.moveColumn(a,s)}),e.render(),e.deselectCell(),e.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)}redo(e,r){const n=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",r),n.moveColumns(this.columns.slice(),this.finalColumnIndex),e.render(),e.deselectCell(),e.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)}}function iB(t,e,r){return(e=tge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tge(t){var e=rge(t,"string");return typeof e=="symbol"?e:e+""}function rge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class IM extends mi{constructor(e){let{currentSortState:r,newSortState:n}=e;super("col_sort"),iB(this,"previousSortState",void 0),iB(this,"nextSortState",void 0),this.previousSortState=r,this.nextSortState=n}static startRegisteringEvents(e,r){e.addHook("beforeColumnSort",(n,i,o)=>{o&&r.done(()=>new IM({currentSortState:n,newSortState:i}))})}undo(e,r){const n=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting"),o=i.isEnabled()?i:n;this.previousSortState.length?o.sort(this.previousSortState):o.clearSort(),r()}redo(e,r){const n=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting");(i.isEnabled()?i:n).sort(this.nextSortState),r()}}function oB(t,e,r){return(e=nge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nge(t){var e=ige(t,"string");return typeof e=="symbol"?e:e+""}function ige(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class OM extends mi{constructor(e){let{index:r,amount:n}=e;super("insert_col"),oB(this,"index",void 0),oB(this,"amount",void 0),this.index=r,this.amount=n}static startRegisteringEvents(e,r){e.addHook("afterCreateCol",(n,i,o)=>{r.done(()=>new OM({index:n,amount:i}),o)})}undo(e,r){e.addHookOnce("afterRemoveCol",r),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,r){e.addHookOnce("afterCreateCol",r),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}}function sB(t,e,r){return(e=oge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oge(t){var e=sge(t,"string");return typeof e=="symbol"?e:e+""}function sge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xM extends mi{constructor(e){let{index:r,amount:n}=e;super("insert_row"),sB(this,"index",void 0),sB(this,"amount",void 0),this.index=r,this.amount=n}static startRegisteringEvents(e,r){e.addHook("afterCreateRow",(n,i,o)=>{r.done(()=>new xM({index:n,amount:i}),o)})}undo(e,r){const n=e.countRows(),i=e.getSettings().minSpareRows;this.index>=n&&this.index-i<n&&(this.index-=i),e.addHookOnce("afterRemoveRow",r),e.alter("remove_row",this.index,this.amount,"UndoRedo.undo")}redo(e,r){e.addHookOnce("afterCreateRow",r),e.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")}}function ev(t,e,r){return(e=age(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function age(t){var e=lge(t,"string");return typeof e=="symbol"?e:e+""}function lge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class AM extends mi{constructor(e){let{changes:r,selected:n,countCols:i,countRows:o}=e;super("change"),ev(this,"changes",void 0),ev(this,"selected",void 0),ev(this,"countCols",void 0),ev(this,"countRows",void 0),this.changes=r,this.selected=n,this.countCols=i,this.countRows=o}static startRegisteringEvents(e,r){e.addHook("beforeChange",function(n,i){const o=n&&n.length;if(!o||!n.find(l=>{const[,,u,c]=l;return u!==c}))return;const a=()=>{const l=n.reduce((c,h)=>(c.push([...h]),c),[]);l.forEach(c=>{c[1]=e.propToCol(c[1])});const u=o>1?this.getSelected():[[l[0][0],l[0][1]]];return new AM({changes:l,selected:u,countCols:e.countCols(),countRows:e.countRows()})};r.done(a,i)})}undo(e,r){const n=Kr(this.changes);for(let s=0,a=n.length;s<a;s++)n[s].splice(3,1);e.addHookOnce("afterChange",r),e.setDataAtCell(n,null,null,"UndoRedo.undo");const i=e.countRows()-this.countRows;i>0&&e.alter("remove_row",null,i,"UndoRedo.undo");const o=e.countCols()-this.countCols;o>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,o,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1)}redo(e,r){const n=Kr(this.changes);for(let i=0,o=n.length;i<o;i++)n[i].splice(2,1);e.addHookOnce("afterChange",r),e.setDataAtCell(n,null,null,"UndoRedo.redo"),this.selected&&e.selectCells(this.selected,!1,!1)}}function aB(t,e,r){return(e=uge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uge(t){var e=cge(t,"string");return typeof e=="symbol"?e:e+""}function cge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class HM extends mi{constructor(e){let{conditionsStack:r,previousConditionsStack:n}=e;super("filter"),aB(this,"conditionsStack",void 0),aB(this,"previousConditionsStack",void 0),this.conditionsStack=r,this.previousConditionsStack=n}static startRegisteringEvents(e,r){e.addHook("beforeFilter",(n,i)=>{r.done(()=>new HM({conditionsStack:n,previousConditionsStack:i}))})}undo(e,r){const n=e.getPlugin("filters");e.addHookOnce("afterViewRender",r),n.importConditions(this.previousConditionsStack),n.filter()}redo(e,r){const n=e.getPlugin("filters");e.addHookOnce("afterViewRender",r),n.importConditions(this.conditionsStack),n.filter()}}function hge(t,e,r){return(e=dge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dge(t){var e=fge(t,"string");return typeof e=="symbol"?e:e+""}function fge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class NM extends mi{constructor(e){let{data:r,cellRange:n}=e;super("merge_cells"),hge(this,"cellRange",void 0),this.cellRange=n,this.data=r}static startRegisteringEvents(e,r){e.addHook("beforeMergeCells",(n,i)=>{if(i)return;const o=n.getTopStartCorner(),s=n.getBottomEndCorner(),a=e.getData(o.row,o.col,s.row,s.col);r.done(()=>new NM({data:a,cellRange:n}))})}undo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.unmergeRange(this.cellRange,!0);const i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.data,void 0,void 0,"MergeCells")}redo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.mergeRange(this.cellRange)}}function lB(t,e,r,n,i){const o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return Ce(n,i,l=>{Ce(e,r,u=>{const c=t.getCellMeta(u,l);if(Object.keys(c).length!==s){const h=Object.fromEntries(Object.entries(c).filter(d=>{let[f]=d;return o.includes(f)===!1}));a.push([c.visualRow,c.visualCol,h])}})}),a}function xs(t,e,r){return(e=gge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gge(t){var e=mge(t,"string");return typeof e=="symbol"?e:e+""}function mge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class DM extends mi{constructor(e){let{index:r,indexes:n,data:i,amount:o,headers:s,columnPositions:a,rowPositions:l,fixedColumnsStart:u,removedCellMetas:c}=e;super("remove_col"),xs(this,"index",void 0),xs(this,"indexes",void 0),xs(this,"data",void 0),xs(this,"amount",void 0),xs(this,"headers",void 0),xs(this,"columnPositions",void 0),xs(this,"rowPositions",void 0),xs(this,"fixedColumnsStart",void 0),xs(this,"removedCellMetas",void 0),this.index=r,this.indexes=n,this.data=i,this.amount=o,this.headers=s,this.columnPositions=a.slice(0),this.rowPositions=l.slice(0),this.fixedColumnsStart=u,this.removedCellMetas=c}static startRegisteringEvents(e,r){e.addHook("beforeRemoveCol",(n,i,o,s)=>{const a=()=>{const l=e.getSourceDataArray(),u=(e.countCols()+n)%e.countCols(),c=u+i-1,h=[],d=[],f=[];return Ce(l.length-1,g=>{const w=[],v=l[g];Ce(u,c,b=>{w.push(v[e.toPhysicalColumn(b)])}),h.push(w)}),Ce(i-1,g=>{f.push(e.toPhysicalColumn(u+g))}),Array.isArray(e.getSettings().colHeaders)&&Ce(i-1,g=>{d.push(e.getSettings().colHeaders[e.toPhysicalColumn(u+g)]||null)}),new DM({index:u,indexes:f,data:h,amount:i,headers:d,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:lB(e,0,e.countRows(),u,c)})};r.done(a,s)})}undo(e,r){const n=e.getSettings();n.fixedColumnsStart=this.fixedColumnsStart;const i=this.indexes.slice(0).sort(),o=(c,h,d)=>d[this.indexes.indexOf(i[h])],s=this.data.length,a=[];for(let c=0;c<s;c++)a.push(qe(this.data[c],o));const l=qe(this.headers,o),u=[];e.columnIndexMapper.setIndexesSequence(this.columnPositions),e.alter("insert_col_start",e.toVisualColumn(this.indexes[0]),this.indexes.length,"UndoRedo.undo"),e.batchExecution(()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),k(e.getSourceDataArray(),(c,h)=>{k(i,(d,f)=>{c[d]=a[h][f],u.push([h,d,c[d]])})}),typeof this.headers<"u"&&k(l,(c,h)=>{e.getSettings().colHeaders[i[h]]=c}),this.removedCellMetas.forEach(c=>{let[h,d,f]=c;e.setCellMetaObject(h,d,f)}),e.addHookOnce("afterViewRender",r),e.setSourceDataAtCell(u,null,null,"UndoRedo.undo")}redo(e,r){e.addHookOnce("afterRemoveCol",r),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function Bc(t,e,r){return(e=pge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pge(t){var e=wge(t,"string");return typeof e=="symbol"?e:e+""}function wge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class kM extends mi{constructor(e){let{index:r,data:n,fixedRowsBottom:i,fixedRowsTop:o,rowIndexesSequence:s,removedCellMetas:a}=e;super("remove_row"),Bc(this,"index",void 0),Bc(this,"data",void 0),Bc(this,"fixedRowsBottom",void 0),Bc(this,"fixedRowsTop",void 0),Bc(this,"rowIndexesSequence",void 0),Bc(this,"removedCellMetas",void 0),this.index=r,this.data=n,this.fixedRowsBottom=i,this.fixedRowsTop=o,this.rowIndexesSequence=s,this.removedCellMetas=a}static startRegisteringEvents(e,r){e.addHook("beforeRemoveRow",(n,i,o,s)=>{const a=()=>{const l=e.toPhysicalRow(n),u=l+i-1,c=Kr(e.getSourceData(l,0,l+i-1,e.countSourceCols()-1));return new kM({index:l,data:c,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:lB(e,l,u,0,e.countCols()-1)})};r.done(a,s)})}undo(e,r){const n=e.getSettings(),i=[];n.fixedRowsBottom=this.fixedRowsBottom,n.fixedRowsTop=this.fixedRowsTop,this.data.forEach((o,s)=>{Object.keys(o).forEach(a=>{const l=parseInt(a,10);i.push([this.index+s,isNaN(l)?a:l,o[a]])})}),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),e.alter("insert_row_above",e.toVisualRow(this.index),this.data.length,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),this.removedCellMetas.forEach(o=>{let[s,a,l]=o;e.setCellMetaObject(s,a,l)}),e.addHookOnce("afterViewRender",r),e.setSourceDataAtCell(i,null,null,"UndoRedo.undo")}redo(e,r){e.addHookOnce("afterRemoveRow",r),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}function uB(t,e,r){return(e=vge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vge(t){var e=yge(t,"string");return typeof e=="symbol"?e:e+""}function yge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class LM extends mi{constructor(e){let{rows:r,finalIndex:n}=e;super("row_move"),uB(this,"rows",void 0),uB(this,"finalRowIndex",void 0),this.rows=r.slice(),this.finalRowIndex=n}static startRegisteringEvents(e,r){e.addHook("beforeRowMove",(n,i)=>{n!==!1&&r.done(()=>new LM({rows:n,finalIndex:i}))})}undo(e,r){const n=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",r),x_(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),n.moveRow(a,s)}),e.render(),e.deselectCell(),e.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)}redo(e,r){const n=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",r),n.moveRows(this.rows.slice(),this.finalRowIndex),e.render(),e.deselectCell(),e.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)}}function Cge(t,e,r){return(e=bge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bge(t){var e=Sge(t,"string");return typeof e=="symbol"?e:e+""}function Sge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $M extends mi{constructor(e){let{cellRange:r}=e;super("unmerge_cells"),Cge(this,"cellRange",void 0),this.cellRange=r}static startRegisteringEvents(e,r){e.addHook("afterUnmergeCells",(n,i)=>{i||r.done(()=>new $M({cellRange:n}))})}undo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.mergeRange(this.cellRange,!0)}redo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.unmergeRange(this.cellRange,!0),e.render()}}function Rge(t,e){[MM,PM,IM,OM,xM,AM,HM,NM,DM,kM,LM,$M].forEach(r=>r.startRegisteringEvents(t,e))}function Ege(t,e){Tge(t,e),e.add(t)}function Tge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function FM(t,e,r){return(e=_ge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _ge(t){var e=Mge(t,"string");return typeof e=="symbol"?e:e+""}function Mge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function VM(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const cB="undoRedo",Pge="undoRedo",Ige=1e3;de.getSingleton().register("beforeUndo"),de.getSingleton().register("afterUndo"),de.getSingleton().register("beforeRedo"),de.getSingleton().register("afterRedo");const hB=new Set;var tv=new WeakSet;class Oge extends rt{static get PLUGIN_KEY(){return Pge}static get PLUGIN_PRIORITY(){return Ige}static get SETTING_KEYS(){return!0}constructor(e){super(e),Ege(this,tv),FM(this,"doneActions",[]),FM(this,"undoneActions",[]),FM(this,"ignoreNewActions",!1),Rge(e,this)}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){var e=this;this.enabled||(this.addHook("afterChange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return VM(tv,e,xge).call(e,...n)}),this.registerShortcuts(),VM(tv,this,Age).call(this),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts(),VM(tv,this,Hge).call(this)}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:o=>!o.altKey,group:cB};r.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(cB)}done(e,r){if(this.ignoreNewActions||r==="UndoRedo.undo"||r==="UndoRedo.redo"||r==="auto")return;const i=this.doneActions.slice();if(this.hot.runHooks("beforeUndoStackChange",i,r)===!1)return;const s=e(),a=this.undoneActions.slice();this.doneActions.push(s),this.hot.runHooks("afterUndoStackChange",i,this.doneActions.slice()),this.hot.runHooks("beforeRedoStackChange",a),this.undoneActions.length=0,this.hot.runHooks("afterRedoStackChange",a,this.undoneActions.slice())}undo(){if(!this.isUndoAvailable())return;const e=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",e);const r=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());const n=Kr(r);if(this.hot.runHooks("beforeUndo",n)===!1)return;this.ignoreNewActions=!0;const o=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",o),r.undo(this.hot,()=>{this.ignoreNewActions=!1,this.undoneActions.push(r)}),this.hot.runHooks("afterRedoStackChange",o,this.undoneActions.slice()),this.hot.runHooks("afterUndo",n)}redo(){if(!this.isRedoAvailable())return;const e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);const r=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const n=Kr(r);if(this.hot.runHooks("beforeRedo",n)===!1)return;this.ignoreNewActions=!0;const o=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",o),r.redo(this.hot,()=>{this.ignoreNewActions=!1,this.doneActions.push(r)}),this.hot.runHooks("afterUndoStackChange",o,this.doneActions.slice()),this.hot.runHooks("afterRedo",n)}isUndoAvailable(){return this.doneActions.length>0}isRedoAvailable(){return this.undoneActions.length>0}clear(){this.doneActions.length=0,this.undoneActions.length=0}destroy(){this.clear(),this.doneActions=null,this.undoneActions=null,super.destroy()}}function xge(t,e){e==="loadData"&&this.clear()}function Age(){const t=e=>{hB.has(e)||(st(at`The "${e}" method is deprecated and it will be removed\x20
762
+ from the Core API in the future. Please use the method from the UndoRedo plugin\x20
763
+ (e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),hB.add(e))};this.hot.undo=()=>{t("undo"),this.undo()},this.hot.redo=()=>{t("redo"),this.redo()},this.hot.isUndoAvailable=()=>(t("isUndoAvailable"),this.isUndoAvailable()),this.hot.isRedoAvailable=()=>(t("isRedoAvailable"),this.isRedoAvailable()),this.hot.clearUndo=()=>{t("clear"),this.clear()},this.hot.undoRedo=this}function Hge(){delete this.hot.undo,delete this.hot.redo,delete this.hot.isUndoAvailable,delete this.hot.isRedoAvailable,delete this.hot.clearUndo,delete this.hot.undoRedo}function Nge(){Qe(pd),Qe(Kee),Qe(yd),Qe(_te),Qe(Nte),Qe(K$),Qe(Ire),Qe(fne),Qe(Op),Qe(Sie),Qe(qie),Qe(roe),Qe($p),Qe(Loe),Qe(Aae),Qe(hle),Qe($le),Qe(Xle),Qe(lue),Qe(yue),Qe(Iue),Qe(Gue),Qe(rce),Qe(Fce),Qe(whe),Qe(She),Qe(qhe),Qe(Nde),Qe(nfe),Qe(dfe),Qe(_fe),Qe(Dfe),Qe(Yfe),Qe(Oge)}function Dge(){PJ(),ZQ(),see(),wee(),Nge()}Dge();const kge=jj`
764
+ /* Checkbox y focos genéricos */
765
+ .hot-scope .handsontable input[type='checkbox'] {
766
+ accent-color: ${`var(--hot-primary, ${Tr})`};
767
+ }
768
+
769
+ .hot-scope .handsontable input:focus,
770
+ .hot-scope .handsontable select:focus,
771
+ .hot-scope .handsontable textarea:focus {
772
+ box-shadow: ${"0 0 0 2px color-mix(in srgb, var(--hot-primary, #25cc89) 25%, transparent)"};
773
+ border-color: ${`var(--hot-primary, ${Tr})`};
774
+ outline: none;
775
+ }
776
+
777
+ .pika-single .pika-table td.is-selected .pika-button {
778
+ background: ${`var(--hot-primary, ${Tr})`};
779
+ }
780
+
781
+ .handsontableInputHolder .handsontableInput {
782
+ box-shadow: ${`
783
+ inset 0 0 0 var(--ht-cell-editor-border-width, 2px) var(--hot-primary, ${Tr}),
784
+ 0 0 var(--ht-cell-editor-shadow-blur-radius, 0) 0 var(--hot-primary, transparent);
785
+ `}
786
+ }
787
+
788
+ /* Celda activa */
789
+ .hot-scope .handsontable .current {
790
+ outline: ${`1px solid var(--hot-primary, ${Tr})`};
791
+ outline-offset: -1px;
792
+ }
793
+
794
+ /* Capas de selección (todas las áreas, incluyendo selección por filas/columnas) */
795
+ .hot-scope .handsontable [class^="ht__selection"] .area,
796
+ .hot-scope .handsontable [class*=" ht__selection"] .area {
797
+ background-color: ${`color-mix(in srgb, var(--hot-primary, ${Tr}) 20%, transparent);`};
798
+ border-color: ${`var(--hot-primary, ${Tr}) !important;`};
799
+ }
800
+
801
+ /* Bordes de selección (cuadro que dibuja Handsontable) */
802
+ .hot-scope .handsontable .wtBorder {
803
+ background: ${`var(--hot-primary, ${Tr}) !important;`};
804
+ }
805
+
806
+ .hot-scope .handsontable .wtBorder.corner {
807
+ border-color: ${`var(--hot-primary, ${Tr}) !important;`};
808
+ }
809
+
810
+ /* Encabezados (headers) resaltados al seleccionar filas/columnas */
811
+ //.hot-scope .ht_clone_left.handsontable th.ht__highlight,
812
+ //.hot-scope .ht_clone_left.handsontable th.ht__active_highlight,
813
+ //.hot-scope .ht_clone_top.handsontable th.ht__highlight,
814
+ //.hot-scope .ht_clone_top.handsontable th.ht__active_highlight {
815
+ // background-color: ${`var(--hot-primary, ${Tr}) !important;`};
816
+ // border-color: ${`var(--hot-primary, ${Tr}) !important;`};
817
+ //}
818
+
819
+ .hot-scope .ht_clone_left.handsontable th.ht__active_highlight,
820
+ .hot-scope .ht_clone_top.handsontable th.ht__active_highlight {
821
+ background-color: ${`var(--hot-primary, ${Tr}) !important;`};
822
+ border-color: ${`var(--hot-primary, ${Tr}) !important;`};
823
+ box-shadow: ${"0 -1px 0 0 var(--hot-primary)"};
824
+ }
825
+
826
+ .hot-scope .handsontable thead tr th.ht__active_highlight {
827
+ box-shadow: ${`-1px 0 0 0 var(--hot-primary, ${Tr}) !important;`}
828
+ }
829
+
830
+ .hot-scope .handsontable .handsontable td.area:before {
831
+ background-color: ${`var(--hot-primary, ${Tr});`}
832
+ }
833
+ `,Lge=Xe.div`
834
+ /* Este contenedor define la variable que todo Handsontable interno consumirá */
835
+ `;function $ge({onUpdateItemData:t,...e}){var a,l;const r=((a=e.item)==null?void 0:a.row_num)??0,n=((l=e.item)==null?void 0:l.row_start)??0,i=(u,c)=>{const h=[...e.item.items];h[u]=c,t==null||t(u,c),e.onUpdate({...e.item,items:h})},o=Array.from({length:r},(u,c)=>{const h={};return e.item.items.forEach((d,f)=>{var b;const g=n-f,w=`${d.column}${f+c+g}`,v=(b=d==null?void 0:d.value)==null?void 0:b.find(p=>(p==null?void 0:p.cell)===w);h[`${d.column}-${f}`]=v==null?void 0:v.value}),h}),s={autocomplete:"autocomplete",check:"checkbox",datetime:"date",dropdown:"dropdown",handsontable:"handsontable",number:"numeric",password:"password",select:"select",textarea:"text",input:"text",time:"time"};return he.jsxs(ne.Fragment,{children:[he.jsx(kge,{}),he.jsx(Lge,{className:"hot-scope",children:he.jsx(ML,{data:o,rowHeaders:!0,colHeaders:!0,height:"auto",autoWrapRow:!0,autoWrapCol:!0,licenseKey:"non-commercial-and-evaluation",afterChange:(u,c)=>{u==null||u.forEach(({"0":h,"1":d,"3":f})=>{const{"0":g,"1":w}=d.toString().replace(/[^a-zA-Z0-9\-]/g,"").split("-"),v=e.item.items.find(b=>b.column===g);if(v&&["edit","Autofill.fill"].includes(c)){const b=v.value??[];if(h>0)for(let p=0;p<h;p++)b[p]||(b[p]={value:c==="Autofill.fill"?f:"",cell:`${g}${n+p}`});b[h]={value:f,cell:`${g}${n+h}`},i(parseInt(w),{...v,value:b})}})},children:e.item.items.map((u,c)=>{var f;const h=s[u.type],d={};return h=="select"&&(d.selectOptions=(f=u.option)==null?void 0:f.map(g=>g.value)),h=="numeric"&&(d.numericFormat={pattern:"0.########"}),he.jsx(_0,{readOnly:e.mode!==Hv.READ,type:h,title:u.alias,data:`${u.column}-${c}`,...d},c)})})})]})}const Fge={form:jU,table:$ge},Vge=({tab:t,mode:e,onUpdate:r,config:n,activeItemOptions:i,onItemOptions:o,itemOptions:s})=>{const a=(l,u)=>{const c=[...t.items];c[l]={...c[l],...u},r({items:c})};return he.jsxs(ne.Fragment,{children:[i&&he.jsx(uU,{config:n,languageConfig:n==null?void 0:n.formOptions,onSpanChange:l=>o==null?void 0:o({...s,span:l}),onSizeChange:l=>{o==null||o({...s,size:l})},span:s.span,size:s.size}),t.items.map((l,u)=>{const c=Fge[l.type];return he.jsxs(nU,{children:[he.jsx(Dv.Title,{theme:n==null?void 0:n.theme,level:3,children:l.alias}),c&&he.jsx(c,{itemOptions:s,config:n,item:l,onUpdate:h=>a(u,h),mode:e})]},u)})]})};function Wge({activeKey:t,tabs:e,mode:r=Hv.READ,setActiveKey:n,updateTab:i,config:o,activeOptions:s=!1}){var u,c;const[a,l]=ne.useState({size:"middle",span:24});return he.jsx(gU,{size:a.size,theme:o==null?void 0:o.theme,tabPosition:((c=(u=o==null?void 0:o.components)==null?void 0:u.Tabs)==null?void 0:c.tabPosition)??"bottom",type:"card",activeKey:t,onChange:h=>n==null?void 0:n(h),items:e.map((h,d)=>({key:d.toString(),label:he.jsx("span",{children:h.sheet||"Sin nombre"}),children:he.jsx(Vge,{activeItemOptions:s,itemOptions:a,onItemOptions:l,config:o,tab:h,onUpdate:f=>i==null?void 0:i(d,f),mode:r})}))})}const Bge=Xe.div`
836
+ width: 100%;
837
+ display: flex;
838
+ justify-content: center;
839
+ `,jge=({clientId:t,templateId:e,onData:r,options:n})=>{const{lastMessage:i}=$B(Kj(QP.applyActions,n),{queryParams:{Authorization:`Bearer ${t}`,"X-ws-identifier":e}});return ne.useEffect(()=>{r==null||r(i==null?void 0:i.data)},[i==null?void 0:i.data]),he.jsx(he.Fragment,{})};function Uge({token:t,identity:e,apiBaseUrl:r,protocol:n,waitKeyboard:i=1500,config:o,activeOptions:s,textLoading:a}){var P;Jc.API_GO_XCEL_HOST=`${r}`;const[l,u]=ne.useState(!0),[c,h]=ne.useState(),{tabs:d,activeKey:f,setActiveKey:g,addTab:w,removeTab:v,updateTab:b,setTabs:p}=Gj(),[_]=zj(async G=>{O(G)},i),O=async G=>{Jc.applyAction(t,{template__uuid:`${c==null?void 0:c.uuid}`,actions:G}).then(j=>{console.log(j)}).catch(j=>{console.error(j)}).finally(()=>{})},T=(G,j)=>{p(G==null?void 0:G.map((A,q)=>({...A,items:A.items.map((Q,ue)=>({...Q,items:Q.items.map((J,Z)=>{var ie,ee,te,ae;return{...J,value:(J==null?void 0:J.value)??((ae=(te=(ee=(ie=j==null?void 0:j[q])==null?void 0:ie.items)==null?void 0:ee[ue])==null?void 0:te.items[Z])==null?void 0:ae.value)??void 0}})}))})))},M=async()=>{u(!0),Jc.readTemplateIdentity(t,e).then(G=>{h(G);const{configuration:j}=(G==null?void 0:G.template_configuration)??{},A=G.values;j&&T(j,A)}).catch(G=>{console.error(G)}).finally(()=>{u(!1)})};return ne.useEffect(()=>{M()},[]),he.jsxs(he.Fragment,{children:[he.jsx(Xj,{primary:(P=o==null?void 0:o.theme)==null?void 0:P.primaryColor}),c&&he.jsx(jge,{options:{apiBaseUrl:`${r}`,protocol:n},onData:G=>{if(G){const j=JSON.parse(G);T(j.notification)}},clientId:t,templateId:c.uuid}),l?he.jsx(Bge,{children:he.jsx(tU,{text:a,theme:o==null?void 0:o.theme})}):he.jsx(he.Fragment,{children:he.jsx(Wge,{activeOptions:s,config:o,activeKey:f,setActiveKey:G=>g(G),addTab:w,removeTab:v,updateTab:(G,j)=>{const A=b(G,j);_(A)},tabs:d},d.length)})]})}function zge(t){return he.jsx(Uge,{...t})}an.GoXcelInterpret=zge,Object.defineProperty(an,Symbol.toStringTag,{value:"Module"})});