ui-layout-manager-dev 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("react"),
|
|
1
|
+
"use strict";var e=require("react"),n=require("react/jsx-runtime"),r=require("@dnd-kit/core"),t="undefined"!=typeof document?document.currentScript:null;function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i,a={exports:{}},c={exports:{}},l={};var u,s,f,d,p,y,v,h,m,g,b,w,x,S,O,j={};
|
|
2
2
|
/** @license React v16.13.1
|
|
3
3
|
* react-is.development.js
|
|
4
4
|
*
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/function
|
|
9
|
+
*/function E(){return s||(s=1,"production"===process.env.NODE_ENV?c.exports=function(){if(i)return l;i=1;var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,t=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var i=e.$$typeof;switch(i){case n:switch(e=e.type){case s:case f:case t:case a:case o:case p:return e;default:switch(e=e&&e.$$typeof){case u:case d:case h:case v:case c:return e;default:return i}}case r:return i}}}function S(e){return x(e)===f}return l.AsyncMode=s,l.ConcurrentMode=f,l.ContextConsumer=u,l.ContextProvider=c,l.Element=n,l.ForwardRef=d,l.Fragment=t,l.Lazy=h,l.Memo=v,l.Portal=r,l.Profiler=a,l.StrictMode=o,l.Suspense=p,l.isAsyncMode=function(e){return S(e)||x(e)===s},l.isConcurrentMode=S,l.isContextConsumer=function(e){return x(e)===u},l.isContextProvider=function(e){return x(e)===c},l.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},l.isForwardRef=function(e){return x(e)===d},l.isFragment=function(e){return x(e)===t},l.isLazy=function(e){return x(e)===h},l.isMemo=function(e){return x(e)===v},l.isPortal=function(e){return x(e)===r},l.isProfiler=function(e){return x(e)===a},l.isStrictMode=function(e){return x(e)===o},l.isSuspense=function(e){return x(e)===p},l.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===t||e===f||e===a||e===o||e===p||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===v||e.$$typeof===c||e.$$typeof===u||e.$$typeof===d||e.$$typeof===g||e.$$typeof===b||e.$$typeof===w||e.$$typeof===m)},l.typeOf=x,l}():c.exports=(u||(u=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,t=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case n:var v=e.type;switch(v){case l:case u:case t:case i:case o:case f:return v;default:var h=v&&v.$$typeof;switch(h){case c:case s:case y:case p:case a:return h;default:return d}}case r:return d}}}var w=l,x=u,S=c,O=a,E=n,C=s,R=t,k=y,T=p,I=r,P=i,D=o,L=f,N=!1;function z(e){return b(e)===u}j.AsyncMode=w,j.ConcurrentMode=x,j.ContextConsumer=S,j.ContextProvider=O,j.Element=E,j.ForwardRef=C,j.Fragment=R,j.Lazy=k,j.Memo=T,j.Portal=I,j.Profiler=P,j.StrictMode=D,j.Suspense=L,j.isAsyncMode=function(e){return N||(N=!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(e)||b(e)===l},j.isConcurrentMode=z,j.isContextConsumer=function(e){return b(e)===c},j.isContextProvider=function(e){return b(e)===a},j.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},j.isForwardRef=function(e){return b(e)===s},j.isFragment=function(e){return b(e)===t},j.isLazy=function(e){return b(e)===y},j.isMemo=function(e){return b(e)===p},j.isPortal=function(e){return b(e)===r},j.isProfiler=function(e){return b(e)===i},j.isStrictMode=function(e){return b(e)===o},j.isSuspense=function(e){return b(e)===f},j.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===t||e===u||e===i||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===h||e.$$typeof===m||e.$$typeof===g||e.$$typeof===v)},j.typeOf=b}()),j)),c.exports}
|
|
10
10
|
/*
|
|
11
11
|
object-assign
|
|
12
12
|
(c) Sindre Sorhus
|
|
13
13
|
@license MIT
|
|
14
|
-
*/function D(){if(f)return d;f=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return d=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,o){for(var i,a,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),c=1;c<arguments.length;c++){for(var s in i=Object(arguments[c]))t.call(i,s)&&(l[s]=i[s]);if(e){a=e(i);for(var u=0;u<a.length;u++)n.call(i,a[u])&&(l[a[u]]=i[a[u]])}}return l},d}function O(){if(v)return p;v=1;return p="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function k(){return g?h:(g=1,h=Function.call.bind(Object.prototype.hasOwnProperty))}function T(){if(b)return y;b=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=O(),n={},r=k();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,a,l,c){if("production"!==process.env.NODE_ENV)for(var s in o)if(r(o,s)){var u;try{if("function"!=typeof o[s]){var d=Error((l||"React class")+": "+a+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=o[s](i,s,l,a,null,t)}catch(e){u=e}if(!u||u instanceof Error||e((l||"React class")+": type specification of "+a+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in n)){n[u.message]=!0;var f=c?c():"";e("Failed "+a+" type: "+u.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},y=o}function j(){if(w)return m;w=1;var e=R(),t=D(),n=O(),r=k(),o=T(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),m=function(l,c){var s="function"==typeof Symbol&&Symbol.iterator;var u="<<anonymous>>",d={array:h("array"),bigint:h("bigint"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:v(a),arrayOf:function(e){return v(function(t,r,o,i,a){if("function"!=typeof e)return new p("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new p("Invalid "+i+" `"+a+"` of type `"+b(l)+"` supplied to `"+o+"`, expected an array.");for(var c=0;c<l.length;c++){var s=e(l,c,o,i,a+"["+c+"]",n);if(s instanceof Error)return s}return null})},element:v(function(e,t,n,r,o){var i=e[t];return l(i)?null:new p("Invalid "+r+" `"+o+"` of type `"+b(i)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:v(function(t,n,r,o,i){var a=t[n];return e.isValidElementType(a)?null:new p("Invalid "+o+" `"+i+"` of type `"+b(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return v(function(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||u;return new p("Invalid "+o+" `"+i+"` of type `"+(((l=t[n]).constructor&&l.constructor.name?l.constructor.name:u)+"` supplied to `")+r+"`, expected instance of `"+a+"`.")}var l;return null})},node:v(function(e,t,n,r,o){return y(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return v(function(t,o,i,a,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var c=t[o],s=b(c);if("object"!==s)return new p("Invalid "+a+" `"+l+"` of type `"+s+"` supplied to `"+i+"`, expected an object.");for(var u in c)if(r(c,u)){var d=e(c,u,i,a,l+"."+u,n);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"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]).":"Invalid argument supplied to oneOf, expected an array."),a;return v(function(t,n,r,o,i){for(var a=t[n],l=0;l<e.length;l++)if(f(a,e[l]))return null;var c=JSON.stringify(e,function(e,t){return"symbol"===m(t)?String(t):t});return new p("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+c+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+t+"."),a}return v(function(t,o,i,a,l){for(var c=[],s=0;s<e.length;s++){var u=(0,e[s])(t,o,i,a,l,n);if(null==u)return null;u.data&&r(u.data,"expectedType")&&c.push(u.data.expectedType)}return new p("Invalid "+a+" `"+l+"` supplied to `"+i+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")})},shape:function(e){return v(function(t,r,o,i,a){var l=t[r],c=b(l);if("object"!==c)return new p("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var s in e){var u=e[s];if("function"!=typeof u)return g(o,i,a,s,m(u));var d=u(l,s,o,i,a+"."+s,n);if(d)return d}return null})},exact:function(e){return v(function(o,i,a,l,c){var s=o[i],u=b(s);if("object"!==u)return new p("Invalid "+l+" `"+c+"` of type `"+u+"` supplied to `"+a+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var v=e[f];if(r(e,f)&&"function"!=typeof v)return g(a,l,c,f,m(v));if(!v)return new p("Invalid "+l+" `"+c+"` key `"+f+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=v(s,f,a,l,c+"."+f,n);if(h)return h}return null})}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function v(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,a,l,s,d,f,v){if(s=s||u,f=f||l,v!==n){if(c){var h=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 h.name="Invariant Violation",h}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var g=s+":"+l;!t[g]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+s+"`. 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."),t[g]=!0,r++)}}return null==a[l]?o?null===a[l]?new p("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `null`."):new p("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(a,l,s,d,f)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function h(e){return v(function(t,n,r,o,i,a){var l=t[n];return b(l)!==e?new p("Invalid "+o+" `"+i+"` of type `"+m(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function g(e,t,n,r,o){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function y(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(y);if(null===e||l(e))return!0;var t=function(e){var t=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!y(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!y(o[1]))return!1}return!0;default:return!1}}function b(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function m(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=m(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},m}function M(){if(E)return x;E=1;var e=O();function t(){}function n(){}return n.resetWarningCache=t,x=function(){function r(t,n,r,o,i,a){if(a!==e){var l=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 l.name="Invariant Violation",l}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function N(){if(C)return a.exports;if(C=1,"production"!==process.env.NODE_ENV){var e=R();a.exports=j()(e.isElement,true)}else a.exports=M()();return a.exports}var L=o(N());function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function I(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,F(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function P(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=V(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function z(e,t,n){return(t=F(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach(function(t){z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,t)||V(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function V(e,t){if(e){if("string"==typeof e)return A(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}var W={INITIALIZE:1,INITIALIZE_FLEXBOX:2,APPLY_SIZES:3,ERROR:4,TRANSFORMATIONS:5,MOVE_HANDLE_BAR:6},U=W=Object.freeze(W),H={UPDATE_SIZE:1},Y=H=Object.freeze(H),K=function(){return I(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.containers={},this.containerRefs={},this.ldf=t,this.numberOfContainers=0,this.registeredContainers=0,this.layoutLoaded=!1,this.numberOfContainers=this.ldf.containers?Object.keys(this.ldf.containers).length:0,this.worker=null},[{key:"startWorker",value:function(){try{this.worker=new Worker(new URL("./Worker/LayoutWorker.js","undefined"==typeof document?require("url").pathToFileURL(__filename).href:r&&"SCRIPT"===r.tagName.toUpperCase()&&r.src||new URL("index.js",document.baseURI).href),{type:"module"}),this.worker.onmessage=this.handleWorkerMessage.bind(this),this.worker.onerror=function(e){return console.error("Worker error:",e)},this.sendToWorker(U.INITIALIZE,{ldf:this.ldf})}catch(e){console.error("Failed to create worker:",e)}}},{key:"sendToWorker",value:function(e,t){this.worker||this.startWorker(),this.worker.postMessage({code:e,args:t})}},{key:"registerContainer",value:function(e,t,n){e in this.containers||(this.registeredContainers+=1),this.containers[e]=t,this.containerRefs[e]=n,console.log("Registered container with id: ".concat(e," ")),this.registeredContainers!==this.numberOfContainers||this.layoutLoaded||(console.log("All containers registered, layout is ready."),this.sendToWorker(U.INITIALIZE_FLEXBOX))}},{key:"unregisterContainer",value:function(e){delete this.containers[e]}},{key:"handleRootResize",value:function(){if(this.layoutLoaded){var e={};for(var t in this.containerRefs)if(this.containerRefs.hasOwnProperty(t)){var n=this.containerRefs[t].getBoundingClientRect();e[t]={width:n.width,height:n.height}}this.sendToWorker(U.APPLY_SIZES,{sizes:e})}}},{key:"moveHandleBar",value:function(e){for(var t={},n=0,r=[e.parent,e.sibling1,e.sibling2];n<r.length;n++){var o=r[n],i=this.containerRefs[o].getBoundingClientRect();t[o]={width:i.width,height:i.height}}e.sizes=t,this.sendToWorker(U.MOVE_HANDLE_BAR,{metadata:e}),this.handleRootResize()}},{key:"applyTransformations",value:function(e,t){var n=this;requestAnimationFrame(function(){var r,o=P(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;switch(i.type){case Y.UPDATE_SIZE:n.containers[i.id].current.updateStyles(i.args.style);break;case Y.REMOVE_NODE:break;default:console.warn("Unknown transformation was requested.")}}}catch(e){o.e(e)}finally{o.f()}t&&(n.layoutLoaded=!0)})}},{key:"handleWorkerMessage",value:function(e){var t;switch(e.data.type){case U.INITIALIZE_FLEXBOX:t=e.data.data,this.applyTransformations(t,!0);break;case U.TRANSFORMATIONS:t=e.data.data,this.applyTransformations(t,!1);break;case U.ERROR:console.error("Error from worker:",e.data)}}},{key:"destroy",value:function(){this.worker&&(this.worker.terminate(),this.worker=null)}}])}(),X=e.createContext(null);function q(n){var r=n.layout,o=n.children,i=e.useMemo(function(){return new K(r)},[r]);return e.useEffect(function(){return function(){i.destroy()}},[i]),t.jsx(X.Provider,{value:i,children:o})}function J(){var t=e.useContext(X);if(!t)throw new Error("useLayoutController must be used within a LayoutControllerProvider");return t}function Z(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}q.propTypes={layout:L.object.isRequired,children:L.node.isRequired};Z(".handleBarHorizontalContainer {\n position: relative;\n width: 100%;\n height: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarHorizontal {\n position: absolute;\n top: 50%;\n height: 1px;\n left: 0;\n right: 0;\n transform: translateY(-50%);\n transition: all 0.2s ease;\n}\n\n.handleBarHorizontal:hover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarHorizontalHover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalContainer {\n position: relative;\n height: 100%;\n width: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarVertical {\n position: absolute;\n top: 0;\n width: 1px;\n left: 50%;\n bottom: 0;\n transform: translateX(-50%);\n transition: all 0.3s ease;\n}\n\n.handleBarVertical:hover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalHover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}");var G=function(n){var r=n.orientation,o=n.parent,i=n.sibling1,a=n.sibling2,l=J(),c=e.useRef(null),s=e.useRef(null),u=e.useRef(null),d=function(e){var t,n,u;e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",f),document.addEventListener("mouseup",p),"horizontal"===r?(t="clientY",n="height",u="handleBarHorizontalHover"):"vertical"===r&&(t="clientX",n="width",u="handleBarVerticalHover");for(var d,v,h=l.containerRefs[o],g=l.containerRefs[i],y=l.containerRefs[a],b=l.ldf.containers[o],m=0;m<b.children.length;m++)b.children[m].containerId===i?d=b.children[m].size:b.children[m].containerId===a&&(v=b.children[m].size);c.current={downValueY:e[t],hoverClass:u,downKey:t,propKey:n,parentSize:h.getBoundingClientRect()[n],parentRef:h,sibling1Ref:g,sibling2Ref:y,sibling1LayoutConfig:d,sibling2LayoutConfig:v,sibling1Size:g.getBoundingClientRect()[n],sibling2Size:y.getBoundingClientRect()[n]},s.current.classList.add(u)};var f=function(e){if(c.current){e.preventDefault(),e.stopPropagation();var t=c.current,n=e[t.downKey]-t.downValueY,r=t.sibling1Size+n,s=t.sibling2Size-n;clearTimeout(u.current),u.current=setTimeout(function(){var n,r,c;l.moveHandleBar({handle:(n=e,r=t.parentRef,c=r.getBoundingClientRect(),{x:n.clientX-c.left,y:n.clientY-c.top}),parent:o,sibling1:i,sibling2:a})},4);var d=Object.keys(t.sibling1LayoutConfig);if(!(d.includes("min")&&r<=t.sibling1LayoutConfig.min.value||d.includes("max")&&r>=t.sibling1LayoutConfig.max.value)){var f=Object.keys(t.sibling2LayoutConfig);if(!(f.includes("min")&&s<=t.sibling2LayoutConfig.min.value||f.includes("max")&&s>=t.sibling2LayoutConfig.max.value)){var p=t.sibling1LayoutConfig.initial.type,v=t.sibling2LayoutConfig.initial.type;if("fill"===p&&"fill"===v&&r>50&&s>50)return l.containerRefs[i].style[t.propKey]=r+"px",void(l.containerRefs[a].style[t.propKey]=s+"px");"fill"!==p&&(l.containerRefs[i].style[t.propKey]=r+"px"),"fill"!==v&&(l.containerRefs[a].style[t.propKey]=s+"px")}}}},p=function(e){e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",p),clearTimeout(u.current),s.current&&c.current&&s.current.classList.remove(c.current.hoverClass),c.current=null};return e.useEffect(function(){return function(){document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",p),u.current&&(clearTimeout(u.current),u.current=null)}},[]),t.jsx(e.Fragment,{children:"horizontal"===r?t.jsx("div",{onMouseDown:function(e){return d(e)},className:"handleBarHorizontalContainer",children:t.jsx("div",{ref:s,className:"handleBarHorizontal"})}):"vertical"===r?t.jsx("div",{onMouseDown:function(e){return d(e)},className:"handleBarVerticalContainer",children:t.jsx("div",{ref:s,className:"handleBarVertical"})}):null})};G.propTypes={orientation:L.string,sibling1:L.string,sibling2:L.string,parent:L.string};Z(".relative-container {\n position: relative;\n}\n\n.relative-container.hiding-horizontal {\n width: 0px !important;\n}\n\n.relative-container.hiding-vertical {\n height: 0px !important;\n}");var Q=e.createContext({});Q.displayName="ComponentRegistryContext";Z(".lazyContainer {\n position: absolute;\n top: 0px;\n bottom: 0px;\n left: 0px;\n right: 0px;\n}");var ee=function(n){var r=n.content,o=e.useContext(Q),i=e.useMemo(function(){if(o&&r&&"component"in r&&r.component in o)return e.lazy(o[r.component])},[o,r]);return t.jsx("div",{className:"lazyContainer",children:t.jsx(e.Suspense,{fallback:t.jsx("div",{children:"Loading..."}),children:i&&t.jsx(i,{})})})};ee.propTypes={content:L.object};var te=function(n){var r=n.node,o=J(),i=e.useRef(null),a=e.useRef(null),l=$(e.useState(null),2),c=l[0],s=l[1],u=e.useCallback(function(e){for(var n=[],r=0;r<e.children.length;r++){var i=e.children[r];if("container"===i.type){var a=o.ldf.containers[e.children[r].containerId];a.parent=e,n.push(t.jsx(te,{meta:e.children[r],id:a.id,node:a},r))}else"handleBar"===i.type&&("horizontal"===e.orientation?n.push(t.jsx(G,{orientation:"vertical",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},r)):"vertical"===e.orientation&&n.push(t.jsx(G,{orientation:"horizontal",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},r)))}return n},[o]),d=e.useRef({});return d.current={updateStyles:function(e){var t="hiding-"+a.current;for(var n in e)if("display"===n&&"none"===e[n]){if(i.current.classList.contains(t))return;i.current.classList.add(t)}else if("display"===n&&"flex"===e[n]){if(!i.current.classList.contains(t))return;i.current.classList.remove(t)}else i.current.style[n]=e[n]}},e.useLayoutEffect(function(){if(r&&o&&i.current){a.current=r.parent.orientation;var e=r.children&&r.children.length>0;return e?"horizontal"===r.orientation?(i.current.style.display="flex",i.current.style.flexDirection="row",i.current.style.width="100%"):"vertical"===r.orientation?(i.current.style.display="flex",i.current.style.flexDirection="column",i.current.style.height="100%"):console.warn("Unknown orientation:",r.orientation):r.background?i.current.style.background=r.background:i.current.style.background="transparent",s(e?u(r):t.jsx(ee,{content:r})),o.registerContainer(r.id,d,i.current),function(){o.unregisterContainer(r.id)}}},[r,o,u]),t.jsx("div",{ref:i,className:"relative-container",children:c})};te.propTypes={node:L.object};const ne="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function re(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function oe(e){return"nodeType"in e}function ie(e){var t,n;return e?re(e)?e:oe(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function ae(e){const{Document:t}=ie(e);return e instanceof t}function le(e){return!re(e)&&e instanceof ie(e).HTMLElement}function ce(e){return e instanceof ie(e).SVGElement}function se(e){return e?re(e)?e.document:oe(e)?ae(e)?e:le(e)||ce(e)?e.ownerDocument:document:document:document}const ue=ne?e.useLayoutEffect:e.useEffect;function de(t){const n=e.useRef(t);return ue(()=>{n.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)},[])}function fe(t,n){void 0===n&&(n=[t]);const r=e.useRef(t);return ue(()=>{r.current!==t&&(r.current=t)},n),r}function pe(t,n){const r=e.useRef();return e.useMemo(()=>{const e=t(r.current);return r.current=e,e},[...n])}function ve(t){const n=e.useRef();return e.useEffect(()=>{n.current=t},[t]),n.current}let he={};function ge(t,n){return e.useMemo(()=>{if(n)return n;const e=null==he[t]?0:he[t]+1;return he[t]=e,t+"-"+e},[t,n])}function ye(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const be=ye(1),me=ye(-1);function we(e){if(!e)return!1;const{KeyboardEvent:t}=ie(e.target);return t&&e instanceof t}function xe(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=ie(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Ee="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ce(e){return e.matches(Ee)?e:e.querySelector(Ee)}const Se={display:"none"};function Re(t){let{id:n,value:r}=t;return e.createElement("div",{id:n,style:Se},r)}function De(t){let{id:n,announcement:r,ariaLiveType:o="assertive"}=t;return e.createElement("div",{id:n,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},r)}const Oe=e.createContext(null);const ke={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Te={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function je(t){let{announcements:r=Te,container:o,hiddenTextDescribedById:i,screenReaderInstructions:a=ke}=t;const{announce:l,announcement:c}=function(){const[t,n]=e.useState("");return{announce:e.useCallback(e=>{null!=e&&n(e)},[]),announcement:t}}(),s=ge("DndLiveRegion"),[u,d]=e.useState(!1);if(e.useEffect(()=>{d(!0)},[]),function(t){const n=e.useContext(Oe);e.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(t)},[t,n])}(e.useMemo(()=>({onDragStart(e){let{active:t}=e;l(r.onDragStart({active:t}))},onDragMove(e){let{active:t,over:n}=e;r.onDragMove&&l(r.onDragMove({active:t,over:n}))},onDragOver(e){let{active:t,over:n}=e;l(r.onDragOver({active:t,over:n}))},onDragEnd(e){let{active:t,over:n}=e;l(r.onDragEnd({active:t,over:n}))},onDragCancel(e){let{active:t,over:n}=e;l(r.onDragCancel({active:t,over:n}))}}),[l,r])),!u)return null;const f=e.createElement(e.Fragment,null,e.createElement(Re,{id:i,value:a.draggable}),e.createElement(De,{id:s,announcement:c}));return o?n.createPortal(f,o):f}var Me;function Ne(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Me||(Me={}));const Le=Object.freeze({x:0,y:0});function Ae(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ie(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const Pe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=Ie(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Ae)};function ze(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Le}function Be(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const _e=Be(1);const $e={ignoreTransform:!1};function Fe(e,t){void 0===t&&(t=$e);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=ie(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,c=e.left-a-(1-o)*parseFloat(n),s=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:s,right:c+u,bottom:s+d,left:c}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:c}}function Ve(e){return Fe(e,{ignoreTransform:!0})}function We(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(ae(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!le(o)||ce(o))return n;if(n.includes(o))return n;const i=ie(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=ie(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=ie(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Ue(e){const[t]=We(e,1);return null!=t?t:null}function He(e){return ne&&e?re(e)?e:oe(e)?ae(e)||e===se(e).scrollingElement?window:le(e)?e:null:null:null}function Ye(e){return re(e)?e.scrollX:e.scrollLeft}function Ke(e){return re(e)?e.scrollY:e.scrollTop}function Xe(e){return{x:Ye(e),y:Ke(e)}}var qe;function Je(e){return!(!ne||!e)&&e===document.scrollingElement}function Ze(e){const t={x:0,y:0},n=Je(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(qe||(qe={}));const Ge={x:.2,y:.2};function Qe(e,t,n,r,o){let{top:i,left:a,right:l,bottom:c}=n;void 0===r&&(r=10),void 0===o&&(o=Ge);const{isTop:s,isBottom:u,isLeft:d,isRight:f}=Ze(e),p={x:0,y:0},v={x:0,y:0},h=t.height*o.y,g=t.width*o.x;return!s&&i<=t.top+h?(p.y=qe.Backward,v.y=r*Math.abs((t.top+h-i)/h)):!u&&c>=t.bottom-h&&(p.y=qe.Forward,v.y=r*Math.abs((t.bottom-h-c)/h)),!f&&l>=t.right-g?(p.x=qe.Forward,v.x=r*Math.abs((t.right-g-l)/g)):!d&&a<=t.left+g&&(p.x=qe.Backward,v.x=r*Math.abs((t.left+g-a)/g)),{direction:p,speed:v}}function et(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function tt(e){return e.reduce((e,t)=>be(e,Xe(t)),Le)}const nt=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Ye(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Ke(t),0)}]];class rt{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=We(t),r=tt(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of nt)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ot{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function it(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var at,lt;function ct(e){e.preventDefault()}function st(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(at||(at={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(lt||(lt={}));const ut={start:[lt.Space,lt.Enter],cancel:[lt.Esc],end:[lt.Space,lt.Enter,lt.Tab]},dt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case lt.Right:return{...n,x:n.x+25};case lt.Left:return{...n,x:n.x-25};case lt.Down:return{...n,y:n.y+25};case lt.Up:return{...n,y:n.y-25}}};class ft{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ot(se(t)),this.windowListeners=new ot(ie(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(at.Resize,this.handleCancel),this.windowListeners.add(at.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(at.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Fe),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Ue(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(Le)}handleKeyDown(e){if(we(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=ut,coordinateGetter:i=dt,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=n.current,s=c?{x:c.left,y:c.top}:Le;this.referenceCoordinates||(this.referenceCoordinates=s);const u=i(e,{active:t,context:n.current,currentCoordinates:s});if(u){const t=me(u,s),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:d,minScroll:f}=Ze(n),p=et(n),v={x:Math.min(o===lt.Right?p.right-p.width/2:p.right,Math.max(o===lt.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(o===lt.Down?p.bottom-p.height/2:p.bottom,Math.max(o===lt.Down?p.top:p.top+p.height/2,u.y))},h=o===lt.Right&&!l||o===lt.Left&&!c,g=o===lt.Down&&!s||o===lt.Up&&!i;if(h&&v.x!==u.x){const e=n.scrollLeft+t.x,i=o===lt.Right&&e<=d.x||o===lt.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===lt.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&v.y!==u.y){const e=n.scrollTop+t.y,i=o===lt.Down&&e<=d.y||o===lt.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===lt.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,be(me(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function pt(e){return Boolean(e&&"distance"in e)}function vt(e){return Boolean(e&&"delay"in e)}ft.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ut,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class ht{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=ie(e);return e instanceof t?e:se(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=se(i),this.documentListeners=new ot(this.document),this.listeners=new ot(n),this.windowListeners=new ot(ie(i)),this.initialCoordinates=null!=(r=xe(o))?r:Le,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(at.Resize,this.handleCancel),this.windowListeners.add(at.DragStart,ct),this.windowListeners.add(at.VisibilityChange,this.handleCancel),this.windowListeners.add(at.ContextMenu,ct),this.documentListeners.add(at.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(vt(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(pt(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(at.Click,st,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(at.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=xe(e))?t:Le,c=me(r,l);if(!n&&a){if(pt(a)){if(null!=a.tolerance&&it(c,a.tolerance))return this.handleCancel();if(it(c,a.distance))return this.handleStart()}return vt(a)&&it(c,a.tolerance)?this.handleCancel():void this.handlePending(a,c)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===lt.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const gt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class yt extends ht{constructor(e){const{event:t}=e,n=se(t.target);super(e,gt,n)}}yt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const bt={move:{name:"mousemove"},end:{name:"mouseup"}};var mt;!function(e){e[e.RightClick=2]="RightClick"}(mt||(mt={}));(class extends ht{constructor(e){super(e,bt,se(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==mt.RightClick&&(null==r||r({event:n}),!0)}}];const wt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var xt,Et;function Ct(t){let{acceleration:n,activator:r=xt.Pointer,canScroll:o,draggingRect:i,enabled:a,interval:l=5,order:c=Et.TreeOrder,pointerCoordinates:s,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=t;const v=function(e){let{delta:t,disabled:n}=e;const r=ve(t);return pe(e=>{if(n||!r||!e)return St;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[qe.Backward]:e.x[qe.Backward]||-1===o.x,[qe.Forward]:e.x[qe.Forward]||1===o.x},y:{[qe.Backward]:e.y[qe.Backward]||-1===o.y,[qe.Forward]:e.y[qe.Forward]||1===o.y}}},[n,t,r])}({delta:f,disabled:!a}),[h,g]=function(){const t=e.useRef(null);return[e.useCallback((e,n)=>{t.current=setInterval(e,n)},[]),e.useCallback(()=>{null!==t.current&&(clearInterval(t.current),t.current=null)},[])]}(),y=e.useRef({x:0,y:0}),b=e.useRef({x:0,y:0}),m=e.useMemo(()=>{switch(r){case xt.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case xt.DraggableRect:return i}},[r,i,s]),w=e.useRef(null),x=e.useCallback(()=>{const e=w.current;if(!e)return;const t=y.current.x*b.current.x,n=y.current.y*b.current.y;e.scrollBy(t,n)},[]),E=e.useMemo(()=>c===Et.TreeOrder?[...u].reverse():u,[c,u]);e.useEffect(()=>{if(a&&u.length&&m){for(const e of E){if(!1===(null==o?void 0:o(e)))continue;const t=u.indexOf(e),r=d[t];if(!r)continue;const{direction:i,speed:a}=Qe(e,r,m,n,p);for(const e of["x","y"])v[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return g(),w.current=e,h(x,l),y.current=a,void(b.current=i)}y.current={x:0,y:0},b.current={x:0,y:0},g()}else g()},[n,x,o,g,a,l,JSON.stringify(m),JSON.stringify(v),h,u,E,d,JSON.stringify(p)])}(class extends ht{constructor(e){super(e,wt)}static setup(){return window.addEventListener(wt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(wt.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(xt||(xt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Et||(Et={}));const St={x:{[qe.Backward]:!1,[qe.Forward]:!1},y:{[qe.Backward]:!1,[qe.Forward]:!1}};var Rt,Dt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Rt||(Rt={})),function(e){e.Optimized="optimized"}(Dt||(Dt={}));const Ot=new Map;function kt(e,t){return pe(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Tt(t){let{callback:n,disabled:r}=t;const o=de(n),i=e.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[r]);return e.useEffect(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function jt(e){return new rt(Fe(e),e)}function Mt(t,n,r){void 0===n&&(n=jt);const[o,i]=e.useState(null);function a(){i(e=>{if(!t)return null;var o;if(!1===t.isConnected)return null!=(o=null!=e?e:r)?o:null;const i=n(t);return JSON.stringify(e)===JSON.stringify(i)?e:i})}const l=function(t){let{callback:n,disabled:r}=t;const o=de(n),i=e.useMemo(()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,r]);return e.useEffect(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(e){if(t)for(const n of e){const{type:e,target:r}=n;if("childList"===e&&r instanceof HTMLElement&&r.contains(t)){a();break}}}}),c=Tt({callback:a});return ue(()=>{a(),t?(null==c||c.observe(t),null==l||l.observe(document.body,{childList:!0,subtree:!0})):(null==c||c.disconnect(),null==l||l.disconnect())},[t]),o}const Nt=[];function Lt(t,n){void 0===n&&(n=[]);const r=e.useRef(null);return e.useEffect(()=>{r.current=null},n),e.useEffect(()=>{const e=t!==Le;e&&!r.current&&(r.current=t),!e&&r.current&&(r.current=null)},[t]),r.current?me(t,r.current):Le}function At(t){return e.useMemo(()=>t?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(t):null,[t])}const It=[];function Pt(t){let{measure:n}=t;const[r,o]=e.useState(null),i=e.useCallback(e=>{for(const{target:t}of e)if(le(t)){o(e=>{const r=n(t);return e?{...e,width:r.width,height:r.height}:r});break}},[n]),a=Tt({callback:i}),l=e.useCallback(e=>{const t=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return le(t)?t:e}(e);null==a||a.disconnect(),t&&(null==a||a.observe(t)),o(t?n(t):null)},[n,a]),[c,s]=function(t){const n=de(t),r=e.useRef(null),o=e.useCallback(e=>{e!==r.current&&(null==n||n(e,r.current)),r.current=e},[]);return[r,o]}(l);return e.useMemo(()=>({nodeRef:c,rect:r,setRef:s}),[r,c,s])}const zt=[{sensor:yt,options:{}},{sensor:ft,options:{}}],Bt={current:{}},_t={draggable:{measure:Ve},droppable:{measure:Ve,strategy:Rt.WhileDragging,frequency:Dt.Optimized},dragOverlay:{measure:Fe}};class $t extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Ft={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $t,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ne},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:_t,measureDroppableContainers:Ne,windowRect:null,measuringScheduled:!1},Vt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ne,draggableNodes:new Map,over:null,measureDroppableContainers:Ne},Wt=e.createContext(Vt),Ut=e.createContext(Ft);function Ht(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $t}}}function Yt(e,t){switch(t.type){case Me.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Me.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Me.DragEnd:case Me.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Me.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new $t(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Me.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new $t(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Me.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new $t(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Kt(t){let{disabled:n}=t;const{active:r,activatorEvent:o,draggableNodes:i}=e.useContext(Wt),a=ve(o),l=ve(null==r?void 0:r.id);return e.useEffect(()=>{if(!n&&!o&&a&&null!=l){if(!we(a))return;if(document.activeElement===a.target)return;const e=i.get(l);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Ce(e);if(t){t.focus();break}}})}},[o,n,i,l,a]),null}const Xt=e.createContext({...Le,scaleX:1,scaleY:1});var qt;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(qt||(qt={}));const Jt=e.memo(function(t){var r,o,i,a;let{id:l,accessibility:c,autoScroll:s=!0,children:u,sensors:d=zt,collisionDetection:f=Pe,measuring:p,modifiers:v,...h}=t;const g=e.useReducer(Yt,void 0,Ht),[y,b]=g,[m,w]=function(){const[t]=e.useState(()=>new Set),n=e.useCallback(e=>(t.add(e),()=>t.delete(e)),[t]);return[e.useCallback(e=>{let{type:n,event:r}=e;t.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[t]),n]}(),[x,E]=e.useState(qt.Uninitialized),C=x===qt.Initialized,{draggable:{active:S,nodes:R,translate:D},droppable:{containers:O}}=y,k=null!=S?R.get(S):null,T=e.useRef({initial:null,translated:null}),j=e.useMemo(()=>{var e;return null!=S?{id:S,data:null!=(e=null==k?void 0:k.data)?e:Bt,rect:T}:null},[S,k]),M=e.useRef(null),[N,L]=e.useState(null),[A,I]=e.useState(null),P=fe(h,Object.values(h)),z=ge("DndDescribedBy",l),B=e.useMemo(()=>O.getEnabled(),[O]),_=($=p,e.useMemo(()=>({draggable:{..._t.draggable,...null==$?void 0:$.draggable},droppable:{..._t.droppable,...null==$?void 0:$.droppable},dragOverlay:{..._t.dragOverlay,...null==$?void 0:$.dragOverlay}}),[null==$?void 0:$.draggable,null==$?void 0:$.droppable,null==$?void 0:$.dragOverlay]));var $;const{droppableRects:F,measureDroppableContainers:V,measuringScheduled:W}=function(t,n){let{dragging:r,dependencies:o,config:i}=n;const[a,l]=e.useState(null),{frequency:c,measure:s,strategy:u}=i,d=e.useRef(t),f=function(){switch(u){case Rt.Always:return!1;case Rt.BeforeDragging:return r;default:return!r}}(),p=fe(f),v=e.useCallback(function(e){void 0===e&&(e=[]),p.current||l(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),h=e.useRef(null),g=pe(e=>{if(f&&!r)return Ot;if(!e||e===Ot||d.current!==t||null!=a){const e=new Map;for(let n of t){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){e.set(n.id,n.rect.current);continue}const t=n.node.current,r=t?new rt(s(t),t):null;n.rect.current=r,r&&e.set(n.id,r)}return e}return e},[t,a,r,f,s]);return e.useEffect(()=>{d.current=t},[t]),e.useEffect(()=>{f||v()},[r,f]),e.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),e.useEffect(()=>{f||"number"!=typeof c||null!==h.current||(h.current=setTimeout(()=>{v(),h.current=null},c))},[c,f,v,...o]),{droppableRects:g,measureDroppableContainers:v,measuringScheduled:null!=a}}(B,{dragging:C,dependencies:[D.x,D.y],config:_.droppable}),U=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return pe(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(R,S),H=e.useMemo(()=>A?xe(A):null,[A]),Y=function(){const e=!1===(null==N?void 0:N.autoScrollEnabled),t="object"==typeof s?!1===s.enabled:!1===s,n=C&&!e&&!t;if("object"==typeof s)return{...s,enabled:n};return{enabled:n}}(),K=function(e,t){return kt(e,t)}(U,_.draggable.measure);!function(t){let{activeNode:n,measure:r,initialRect:o,config:i=!0}=t;const a=e.useRef(!1),{x:l,y:c}="boolean"==typeof i?{x:i,y:i}:i;ue(()=>{if(!l&&!c||!n)return void(a.current=!1);if(a.current||!o)return;const e=null==n?void 0:n.node.current;if(!e||!1===e.isConnected)return;const t=ze(r(e),o);if(l||(t.x=0),c||(t.y=0),a.current=!0,Math.abs(t.x)>0||Math.abs(t.y)>0){const n=Ue(e);n&&n.scrollBy({top:t.y,left:t.x})}},[n,l,c,o,r])}({activeNode:null!=S?R.get(S):null,config:Y.layoutShiftCompensation,initialRect:K,measure:_.draggable.measure});const X=Mt(U,_.draggable.measure,K),q=Mt(U?U.parentElement:null),J=e.useRef({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Z=O.getNodeFor(null==(r=J.current.over)?void 0:r.id),G=Pt({measure:_.dragOverlay.measure}),Q=null!=(o=G.nodeRef.current)?o:U,ee=C?null!=(i=G.rect)?i:X:null,te=Boolean(G.nodeRef.current&&G.rect),re=ze(oe=te?null:X,kt(oe));var oe;const ae=At(Q?ie(Q):null),le=function(t){const n=e.useRef(t),r=pe(e=>t?e&&e!==Nt&&t&&n.current&&t.parentNode===n.current.parentNode?e:We(t):Nt,[t]);return e.useEffect(()=>{n.current=t},[t]),r}(C?null!=Z?Z:U:null),ce=function(t,n){void 0===n&&(n=Fe);const[r]=t,o=At(r?ie(r):null),[i,a]=e.useState(It);function l(){a(()=>t.length?t.map(e=>Je(e)?o:new rt(n(e),e)):It)}const c=Tt({callback:l});return ue(()=>{null==c||c.disconnect(),l(),t.forEach(e=>null==c?void 0:c.observe(e))},[t]),i}(le),se=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(v,{transform:{x:D.x-re.x,y:D.y-re.y,scaleX:1,scaleY:1},activatorEvent:A,active:j,activeNodeRect:X,containerNodeRect:q,draggingNodeRect:ee,over:J.current.over,overlayNodeRect:G.rect,scrollableAncestors:le,scrollableAncestorRects:ce,windowRect:ae}),de=H?be(H,D):null,ve=function(t){const[n,r]=e.useState(null),o=e.useRef(t),i=e.useCallback(e=>{const t=He(e.target);t&&r(e=>e?(e.set(t,Xe(t)),new Map(e)):null)},[]);return e.useEffect(()=>{const e=o.current;if(t!==e){n(e);const a=t.map(e=>{const t=He(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,Xe(t)]):null}).filter(e=>null!=e);r(a.length?new Map(a):null),o.current=t}return()=>{n(t),n(e)};function n(e){e.forEach(e=>{const t=He(e);null==t||t.removeEventListener("scroll",i)})}},[i,t]),e.useMemo(()=>t.length?n?Array.from(n.values()).reduce((e,t)=>be(e,t),Le):tt(t):Le,[t,n])}(le),he=Lt(ve),ye=Lt(ve,[X]),me=be(se,he),we=ee?_e(ee,se):null,Ee=j&&we?f({active:j,collisionRect:we,droppableRects:F,droppableContainers:B,pointerCoordinates:de}):null,Ce=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}(Ee,"id"),[Se,Re]=e.useState(null),De=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(te?se:be(se,ye),null!=(a=null==Se?void 0:Se.rect)?a:null,X),ke=e.useRef(null),Te=e.useCallback((e,t)=>{let{sensor:r,options:o}=t;if(null==M.current)return;const i=R.get(M.current);if(!i)return;const a=e.nativeEvent,l=new r({active:M.current,activeNode:i,event:a,options:o,context:J,onAbort(e){if(!R.get(e))return;const{onDragAbort:t}=P.current,n={id:e};null==t||t(n),m({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!R.get(e))return;const{onDragPending:o}=P.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),m({type:"onDragPending",event:i})},onStart(e){const t=M.current;if(null==t)return;const r=R.get(t);if(!r)return;const{onDragStart:o}=P.current,i={activatorEvent:a,active:{id:t,data:r.data,rect:T}};n.unstable_batchedUpdates(()=>{null==o||o(i),E(qt.Initializing),b({type:Me.DragStart,initialCoordinates:e,active:t}),m({type:"onDragStart",event:i}),L(ke.current),I(a)})},onMove(e){b({type:Me.DragMove,coordinates:e})},onEnd:c(Me.DragEnd),onCancel:c(Me.DragCancel)});function c(e){return async function(){const{active:t,collisions:r,over:o,scrollAdjustedTranslate:i}=J.current;let l=null;if(t&&i){const{cancelDrop:n}=P.current;if(l={activatorEvent:a,active:t,collisions:r,delta:i,over:o},e===Me.DragEnd&&"function"==typeof n){await Promise.resolve(n(l))&&(e=Me.DragCancel)}}M.current=null,n.unstable_batchedUpdates(()=>{b({type:e}),E(qt.Uninitialized),Re(null),L(null),I(null),ke.current=null;const t=e===Me.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=P.current[t];null==e||e(l),m({type:t,event:l})}})}}ke.current=l},[R]),Ne=e.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent,i=R.get(r);if(null!==M.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},M.current=r,Te(n,t))},[R,Te]),Ae=function(t,n){return e.useMemo(()=>t.reduce((e,t)=>{const{sensor:r}=t;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:n(e.handler,t)}))]},[]),[t,n])}(d,Ne);!function(t){e.useEffect(()=>{if(!ne)return;const e=t.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const t of e)null==t||t()}},t.map(e=>{let{sensor:t}=e;return t}))}(d),ue(()=>{X&&x===qt.Initializing&&E(qt.Initialized)},[X,x]),e.useEffect(()=>{const{onDragMove:e}=P.current,{active:t,activatorEvent:r,collisions:o,over:i}=J.current;if(!t||!r)return;const a={active:t,activatorEvent:r,collisions:o,delta:{x:me.x,y:me.y},over:i};n.unstable_batchedUpdates(()=>{null==e||e(a),m({type:"onDragMove",event:a})})},[me.x,me.y]),e.useEffect(()=>{const{active:e,activatorEvent:t,collisions:r,droppableContainers:o,scrollAdjustedTranslate:i}=J.current;if(!e||null==M.current||!t||!i)return;const{onDragOver:a}=P.current,l=o.get(Ce),c=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,s={active:e,activatorEvent:t,collisions:r,delta:{x:i.x,y:i.y},over:c};n.unstable_batchedUpdates(()=>{Re(c),null==a||a(s),m({type:"onDragOver",event:s})})},[Ce]),ue(()=>{J.current={activatorEvent:A,active:j,activeNode:U,collisionRect:we,collisions:Ee,droppableRects:F,draggableNodes:R,draggingNode:Q,draggingNodeRect:ee,droppableContainers:O,over:Se,scrollableAncestors:le,scrollAdjustedTranslate:me},T.current={initial:ee,translated:we}},[j,U,Ee,we,R,Q,ee,F,O,Se,le,me]),Ct({...Y,delta:D,draggingRect:we,pointerCoordinates:de,scrollableAncestors:le,scrollableAncestorRects:ce});const Ie=e.useMemo(()=>({active:j,activeNode:U,activeNodeRect:X,activatorEvent:A,collisions:Ee,containerNodeRect:q,dragOverlay:G,draggableNodes:R,droppableContainers:O,droppableRects:F,over:Se,measureDroppableContainers:V,scrollableAncestors:le,scrollableAncestorRects:ce,measuringConfiguration:_,measuringScheduled:W,windowRect:ae}),[j,U,X,A,Ee,q,G,R,O,F,Se,V,le,ce,_,W,ae]),Be=e.useMemo(()=>({activatorEvent:A,activators:Ae,active:j,activeNodeRect:X,ariaDescribedById:{draggable:z},dispatch:b,draggableNodes:R,over:Se,measureDroppableContainers:V}),[A,Ae,j,X,b,z,R,Se,V]);return e.createElement(Oe.Provider,{value:w},e.createElement(Wt.Provider,{value:Be},e.createElement(Ut.Provider,{value:Ie},e.createElement(Xt.Provider,{value:De},u)),e.createElement(Kt,{disabled:!1===(null==c?void 0:c.restoreFocus)})),e.createElement(je,{...c,hiddenTextDescribedById:z}))});var Zt=e.createContext(null),Gt=function(n){var r=n.children,o=$(e.useState({activeId:null,activeData:null,overId:null,overData:null,isDragging:!1}),2),i=o[0],a=o[1],l=$(e.useState(null),2),c=l[0],s=l[1],u=e.useCallback(function(e){var t,n,r,o;a({activeId:null!==(t=null===(n=e.active)||void 0===n?void 0:n.id)&&void 0!==t?t:null,activeData:null!==(r=null===(o=e.active)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.current)&&void 0!==r?r:null,overId:null,overData:null,isDragging:!0})},[]),d=e.useCallback(function(e){a(function(t){var n,r,o,i;return _(_({},t),{},{overId:null!==(n=null===(r=e.over)||void 0===r?void 0:r.id)&&void 0!==n?n:null,overData:null!==(o=null===(i=e.over)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.current)&&void 0!==o?o:null})})},[]),f=e.useCallback(function(e){var t,n,r,o,i,l,c,u;s({activeId:null!==(t=null===(n=e.active)||void 0===n?void 0:n.id)&&void 0!==t?t:null,activeData:null!==(r=null===(o=e.active)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.current)&&void 0!==r?r:null,overId:null!==(i=null===(l=e.over)||void 0===l?void 0:l.id)&&void 0!==i?i:null,overData:null!==(c=null===(u=e.over)||void 0===u||null===(u=u.data)||void 0===u?void 0:u.current)&&void 0!==c?c:null}),a({activeId:null,activeData:null,overId:null,overData:null,isDragging:!1})},[]),p=e.useMemo(function(){return{dragState:i,drop:c,handleDragStart:u,handleDragOver:d,clearDrag:f}},[i,c,u,d,f]);return t.jsx(Zt.Provider,{value:p,children:r})},Qt=function(){var t=e.useContext(Zt);if(!t)throw new Error("useDragState must be used inside DragProvider");return t};Z(".root-container {\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.relative-container {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.drag-overlay {\n position: fixed;\n pointer-events: none;\n z-index: 9999;\n}");var en=function(){var n,r=J(),o=Qt(),i=o.dragState,a=o.handleDragStart,l=o.handleDragOver,c=o.clearDrag,s=e.useRef(null),u=e.useRef(null),d=e.useRef(!1),f=e.useRef({});f.current={};var p=$(e.useState(null),2),v=p[0],h=p[1],g=e.useCallback(function(e){for(var n=[],o=0;o<e.children.length;o++){var i=e.children[o];if("container"===i.type){var a=r.ldf.containers[e.children[o].containerId];a.parent=e,n.push(t.jsx(te,{meta:e.children[o],id:a.id,node:a},o))}else"handleBar"===i.type&&("horizontal"===e.orientation?n.push(t.jsx(G,{orientation:"vertical",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},o)):"vertical"===e.orientation&&n.push(t.jsx(G,{orientation:"horizontal",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},o)))}return n},[r]);e.useLayoutEffect(function(){if(r){var e=r.ldf.containers[r.ldf.layoutRoot],t=e.children&&e.children.length>0;r.registerContainer(e.id,f,s.current),t&&("horizontal"===e.orientation?s.current.style.flexDirection="row":"vertical"===e.orientation&&(s.current.style.flexDirection="column")),h(t?g(e):null);var n=new ResizeObserver(function(e){d.current||(d.current=!0);var t,n=P(e);try{var o=function(){var e=t.value.contentRect,n=e.width,o=e.height;clearTimeout(u.current),u.current=setTimeout(function(){d.current=!1,r.handleRootResize(n,o)},1)};for(n.s();!(t=n.n()).done;)o()}catch(e){n.e(e)}finally{n.f()}});return n.observe(s.current),function(){r.unregisterContainer(r.ldf.layoutRoot),n.disconnect()}}},[r]);var y,b,m=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.useMemo(()=>[...n].filter(e=>null!=e),[...n])}((y=yt,b={activationConstraint:{distance:8}},e.useMemo(()=>({sensor:y,options:null!=b?b:{}}),[y,b]))),w=$(e.useState({left:0,top:0}),2),x=w[0],E=w[1];return e.useEffect(function(){if(i.isDragging){var e=function(e){E({left:e.clientX,top:e.clientY})};return window.addEventListener("pointermove",e),function(){window.removeEventListener("pointermove",e)}}},[i.isDragging]),t.jsxs(Jt,{sensors:m,onDragStart:a,onDragOver:l,onDragEnd:c,onDragCancel:c,children:[t.jsx("div",{className:"root-container",children:t.jsx("div",{ref:s,className:"relative-container",children:v})}),i.isDragging&&t.jsx("div",{className:"drag-overlay",style:x,children:null==i||null===(n=i.activeData)||void 0===n?void 0:n.preview})]})};Z("");var tn=function(e){var n=e.ldf,r=e.registry;return t.jsx(Gt,{children:t.jsx(q,{layout:n,children:t.jsx(Q.Provider,{value:r,children:t.jsx(en,{})})})})};tn.propTypes={ldf:L.object,registry:L.object},exports.LayoutManager=tn,exports.useDragState=Qt;
|
|
14
|
+
*/function C(){if(d)return f;d=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return f=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},r=0;r<10;r++)n["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(n).map(function(e){return n[e]}).join(""))return!1;var t={};return"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},t)).join("")}catch(e){return!1}}()?Object.assign:function(t,o){for(var i,a,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(t),l=1;l<arguments.length;l++){for(var u in i=Object(arguments[l]))n.call(i,u)&&(c[u]=i[u]);if(e){a=e(i);for(var s=0;s<a.length;s++)r.call(i,a[s])&&(c[a[s]]=i[a[s]])}}return c},f}function R(){if(y)return p;y=1;return p="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function k(){return h?v:(h=1,v=Function.call.bind(Object.prototype.hasOwnProperty))}function T(){if(g)return m;g=1;var e=function(){};if("production"!==process.env.NODE_ENV){var n=R(),r={},t=k();e=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}}function o(o,i,a,c,l){if("production"!==process.env.NODE_ENV)for(var u in o)if(t(o,u)){var s;try{if("function"!=typeof o[u]){var f=Error((c||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}s=o[u](i,u,c,a,null,n)}catch(e){s=e}if(!s||s instanceof Error||e((c||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in r)){r[s.message]=!0;var d=l?l():"";e("Failed "+a+" type: "+s.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},m=o}function I(){if(w)return b;w=1;var e=E(),n=C(),r=R(),t=k(),o=T(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}),b=function(c,l){var u="function"==typeof Symbol&&Symbol.iterator;var s="<<anonymous>>",f={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:y(a),arrayOf:function(e){return y(function(n,t,o,i,a){if("function"!=typeof e)return new p("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var c=n[t];if(!Array.isArray(c))return new p("Invalid "+i+" `"+a+"` of type `"+g(c)+"` supplied to `"+o+"`, expected an array.");for(var l=0;l<c.length;l++){var u=e(c,l,o,i,a+"["+l+"]",r);if(u instanceof Error)return u}return null})},element:y(function(e,n,r,t,o){var i=e[n];return c(i)?null:new p("Invalid "+t+" `"+o+"` of type `"+g(i)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:y(function(n,r,t,o,i){var a=n[r];return e.isValidElementType(a)?null:new p("Invalid "+o+" `"+i+"` of type `"+g(a)+"` supplied to `"+t+"`, expected a single ReactElement type.")}),instanceOf:function(e){return y(function(n,r,t,o,i){if(!(n[r]instanceof e)){var a=e.name||s;return new p("Invalid "+o+" `"+i+"` of type `"+(((c=n[r]).constructor&&c.constructor.name?c.constructor.name:s)+"` supplied to `")+t+"`, expected instance of `"+a+"`.")}var c;return null})},node:y(function(e,n,r,t,o){return m(e[n])?null:new p("Invalid "+t+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(e){return y(function(n,o,i,a,c){if("function"!=typeof e)return new p("Property `"+c+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var l=n[o],u=g(l);if("object"!==u)return new p("Invalid "+a+" `"+c+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var s in l)if(t(l,s)){var f=e(l,s,i,a,c+"."+s,r);if(f instanceof Error)return f}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"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]).":"Invalid argument supplied to oneOf, expected an array."),a;return y(function(n,r,t,o,i){for(var a=n[r],c=0;c<e.length;c++)if(d(a,e[c]))return null;var l=JSON.stringify(e,function(e,n){return"symbol"===b(n)?String(n):n});return new p("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+t+"`, expected one of "+l+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var n=0;n<e.length;n++){var o=e[n];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+n+"."),a}return y(function(n,o,i,a,c){for(var l=[],u=0;u<e.length;u++){var s=(0,e[u])(n,o,i,a,c,r);if(null==s)return null;s.data&&t(s.data,"expectedType")&&l.push(s.data.expectedType)}return new p("Invalid "+a+" `"+c+"` supplied to `"+i+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return y(function(n,t,o,i,a){var c=n[t],l=g(c);if("object"!==l)return new p("Invalid "+i+" `"+a+"` of type `"+l+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var s=e[u];if("function"!=typeof s)return h(o,i,a,u,b(s));var f=s(c,u,o,i,a+"."+u,r);if(f)return f}return null})},exact:function(e){return y(function(o,i,a,c,l){var u=o[i],s=g(u);if("object"!==s)return new p("Invalid "+c+" `"+l+"` of type `"+s+"` supplied to `"+a+"`, expected `object`.");var f=n({},o[i],e);for(var d in f){var y=e[d];if(t(e,d)&&"function"!=typeof y)return h(a,c,l,d,b(y));if(!y)return new p("Invalid "+c+" `"+l+"` key `"+d+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=y(u,d,a,c,l+"."+d,r);if(v)return v}return null})}};function d(e,n){return e===n?0!==e||1/e==1/n:e!=e&&n!=n}function p(e,n){this.message=e,this.data=n&&"object"==typeof n?n:{},this.stack=""}function y(e){if("production"!==process.env.NODE_ENV)var n={},t=0;function o(o,a,c,u,f,d,y){if(u=u||s,d=d||c,y!==r){if(l){var v=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 v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=u+":"+c;!n[h]&&t<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+u+"`. 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."),n[h]=!0,t++)}}return null==a[c]?o?null===a[c]?new p("The "+f+" `"+d+"` is marked as required in `"+u+"`, but its value is `null`."):new p("The "+f+" `"+d+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(a,c,u,f,d)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function v(e){return y(function(n,r,t,o,i,a){var c=n[r];return g(c)!==e?new p("Invalid "+o+" `"+i+"` of type `"+b(c)+"` supplied to `"+t+"`, expected `"+e+"`.",{expectedType:e}):null})}function h(e,n,r,t,o){return new p((e||"React class")+": "+n+" type `"+r+"."+t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||c(e))return!0;var n=function(e){var n=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof n)return n}(e);if(!n)return!1;var r,t=n.call(e);if(n!==e.entries){for(;!(r=t.next()).done;)if(!m(r.value))return!1}else for(;!(r=t.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function g(e){var n=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,n){return"symbol"===e||!!n&&("Symbol"===n["@@toStringTag"]||"function"==typeof Symbol&&n instanceof Symbol)}(n,e)?"symbol":n}function b(e){if(null==e)return""+e;var n=g(e);if("object"===n){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return n}function w(e){var n=b(e);switch(n){case"array":case"object":return"an "+n;case"boolean":case"date":case"regexp":return"a "+n;default:return n}}return p.prototype=Error.prototype,f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},b}function P(){if(S)return x;S=1;var e=R();function n(){}function r(){}return r.resetWarningCache=n,x=function(){function t(n,r,t,o,i,a){if(a!==e){var c=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 c.name="Invariant Violation",c}}function o(){return t}t.isRequired=t;var i={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:o,element:t,elementType:t,instanceOf:o,node:t,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:n};return i.PropTypes=i,i}}function D(){if(O)return a.exports;if(O=1,"production"!==process.env.NODE_ENV){var e=E();a.exports=I()(e.isElement,true)}else a.exports=P()();return a.exports}var L=o(D());function N(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function z(e,n,r){return n&&function(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,V(t.key),t)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=W(e))||n){r&&(e=r);var t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function _(e,n,r){return(n=V(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function A(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,t)}return r}function M(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?A(Object(r),!0).forEach(function(n){_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var t,o,i,a,c=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,0===n);else for(;!(l=(t=i.call(r)).done)&&(c.push(t.value),c.length!==n);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,n)||W(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,n);if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}function W(e,n){if(e){if("string"==typeof e)return N(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?N(e,n):void 0}}var F={INITIALIZE:1,INITIALIZE_FLEXBOX:2,APPLY_SIZES:3,ERROR:4,TRANSFORMATIONS:5,MOVE_HANDLE_BAR:6},H=F=Object.freeze(F),q={UPDATE_SIZE:1},U=q=Object.freeze(q),Y=function(){return z(function e(n){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.containers={},this.containerRefs={},this.ldf=n,this.numberOfContainers=0,this.registeredContainers=0,this.layoutLoaded=!1,this.numberOfContainers=this.ldf.containers?Object.keys(this.ldf.containers).length:0,this.worker=null},[{key:"startWorker",value:function(){try{this.worker=new Worker(new URL("./Worker/LayoutWorker.js","undefined"==typeof document?require("url").pathToFileURL(__filename).href:t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("index.js",document.baseURI).href),{type:"module"}),this.worker.onmessage=this.handleWorkerMessage.bind(this),this.worker.onerror=function(e){return console.error("Worker error:",e)},this.sendToWorker(H.INITIALIZE,{ldf:this.ldf})}catch(e){console.error("Failed to create worker:",e)}}},{key:"sendToWorker",value:function(e,n){this.worker||this.startWorker(),this.worker.postMessage({code:e,args:n})}},{key:"registerContainer",value:function(e,n,r){e in this.containers||(this.registeredContainers+=1),this.containers[e]=n,this.containerRefs[e]=r,console.log("Registered container with id: ".concat(e," ")),this.registeredContainers!==this.numberOfContainers||this.layoutLoaded||(console.log("All containers registered, layout is ready."),this.sendToWorker(H.INITIALIZE_FLEXBOX))}},{key:"unregisterContainer",value:function(e){delete this.containers[e]}},{key:"handleRootResize",value:function(){if(this.layoutLoaded){var e={};for(var n in this.containerRefs)if(this.containerRefs.hasOwnProperty(n)){var r=this.containerRefs[n].getBoundingClientRect();e[n]={width:r.width,height:r.height}}this.sendToWorker(H.APPLY_SIZES,{sizes:e})}}},{key:"moveHandleBar",value:function(e){for(var n={},r=0,t=[e.parent,e.sibling1,e.sibling2];r<t.length;r++){var o=t[r],i=this.containerRefs[o].getBoundingClientRect();n[o]={width:i.width,height:i.height}}e.sizes=n,this.sendToWorker(H.MOVE_HANDLE_BAR,{metadata:e}),this.handleRootResize()}},{key:"applyTransformations",value:function(e,n){var r=this;requestAnimationFrame(function(){var t,o=$(e);try{for(o.s();!(t=o.n()).done;){var i=t.value;switch(i.type){case U.UPDATE_SIZE:r.containers[i.id].current.updateStyles(i.args.style);break;case U.REMOVE_NODE:break;default:console.warn("Unknown transformation was requested.")}}}catch(e){o.e(e)}finally{o.f()}n&&(r.layoutLoaded=!0)})}},{key:"handleWorkerMessage",value:function(e){var n;switch(e.data.type){case H.INITIALIZE_FLEXBOX:n=e.data.data,this.applyTransformations(n,!0);break;case H.TRANSFORMATIONS:n=e.data.data,this.applyTransformations(n,!1);break;case H.ERROR:console.error("Error from worker:",e.data)}}},{key:"destroy",value:function(){this.worker&&(this.worker.terminate(),this.worker=null)}}])}(),X=e.createContext(null);function Z(r){var t=r.layout,o=r.children,i=e.useMemo(function(){return new Y(t)},[t]);return e.useEffect(function(){return function(){i.destroy()}},[i]),n.jsx(X.Provider,{value:i,children:o})}function K(){var n=e.useContext(X);if(!n)throw new Error("useLayoutController must be used within a LayoutControllerProvider");return n}function J(e,n){void 0===n&&(n={});var r=n.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}Z.propTypes={layout:L.object.isRequired,children:L.node.isRequired};J(".handleBarHorizontalContainer {\n position: relative;\n width: 100%;\n height: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarHorizontal {\n position: absolute;\n top: 50%;\n height: 1px;\n left: 0;\n right: 0;\n transform: translateY(-50%);\n transition: all 0.2s ease;\n}\n\n.handleBarHorizontal:hover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarHorizontalHover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalContainer {\n position: relative;\n height: 100%;\n width: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarVertical {\n position: absolute;\n top: 0;\n width: 1px;\n left: 50%;\n bottom: 0;\n transform: translateX(-50%);\n transition: all 0.3s ease;\n}\n\n.handleBarVertical:hover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalHover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}");var G=function(r){var t=r.orientation,o=r.parent,i=r.sibling1,a=r.sibling2,c=K(),l=e.useRef(null),u=e.useRef(null),s=e.useRef(null),f=function(e){var n,r,s;e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",p),"horizontal"===t?(n="clientY",r="height",s="handleBarHorizontalHover"):"vertical"===t&&(n="clientX",r="width",s="handleBarVerticalHover");for(var f,y,v=c.containerRefs[o],h=c.containerRefs[i],m=c.containerRefs[a],g=c.ldf.containers[o],b=0;b<g.children.length;b++)g.children[b].containerId===i?f=g.children[b].size:g.children[b].containerId===a&&(y=g.children[b].size);l.current={downValueY:e[n],hoverClass:s,downKey:n,propKey:r,parentSize:v.getBoundingClientRect()[r],parentRef:v,sibling1Ref:h,sibling2Ref:m,sibling1LayoutConfig:f,sibling2LayoutConfig:y,sibling1Size:h.getBoundingClientRect()[r],sibling2Size:m.getBoundingClientRect()[r]},u.current.classList.add(s)};var d=function(e){if(l.current){e.preventDefault(),e.stopPropagation();var n=l.current,r=e[n.downKey]-n.downValueY,t=n.sibling1Size+r,u=n.sibling2Size-r;clearTimeout(s.current),s.current=setTimeout(function(){var r,t,l;c.moveHandleBar({handle:(r=e,t=n.parentRef,l=t.getBoundingClientRect(),{x:r.clientX-l.left,y:r.clientY-l.top}),parent:o,sibling1:i,sibling2:a})},4);var f=Object.keys(n.sibling1LayoutConfig);if(!(f.includes("min")&&t<=n.sibling1LayoutConfig.min.value||f.includes("max")&&t>=n.sibling1LayoutConfig.max.value)){var d=Object.keys(n.sibling2LayoutConfig);if(!(d.includes("min")&&u<=n.sibling2LayoutConfig.min.value||d.includes("max")&&u>=n.sibling2LayoutConfig.max.value)){var p=n.sibling1LayoutConfig.initial.type,y=n.sibling2LayoutConfig.initial.type;if("fill"===p&&"fill"===y&&t>50&&u>50)return c.containerRefs[i].style[n.propKey]=t+"px",void(c.containerRefs[a].style[n.propKey]=u+"px");"fill"!==p&&(c.containerRefs[i].style[n.propKey]=t+"px"),"fill"!==y&&(c.containerRefs[a].style[n.propKey]=u+"px")}}}},p=function(e){e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",p),clearTimeout(s.current),u.current&&l.current&&u.current.classList.remove(l.current.hoverClass),l.current=null};return e.useEffect(function(){return function(){document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",p),s.current&&(clearTimeout(s.current),s.current=null)}},[]),n.jsx(e.Fragment,{children:"horizontal"===t?n.jsx("div",{onMouseDown:function(e){return f(e)},className:"handleBarHorizontalContainer",children:n.jsx("div",{ref:u,className:"handleBarHorizontal"})}):"vertical"===t?n.jsx("div",{onMouseDown:function(e){return f(e)},className:"handleBarVerticalContainer",children:n.jsx("div",{ref:u,className:"handleBarVertical"})}):null})};G.propTypes={orientation:L.string,sibling1:L.string,sibling2:L.string,parent:L.string};J(".relative-container {\n position: relative;\n}\n\n.relative-container.hiding-horizontal {\n width: 0px !important;\n}\n\n.relative-container.hiding-vertical {\n height: 0px !important;\n}");var Q=e.createContext({});Q.displayName="ComponentRegistryContext";J(".lazyContainer {\n position: absolute;\n top: 0px;\n bottom: 0px;\n left: 0px;\n right: 0px;\n}");var ee=function(r){var t=r.content,o=e.useContext(Q),i=e.useMemo(function(){if(o&&t&&"component"in t&&t.component in o)return e.lazy(o[t.component])},[o,t]);return n.jsx("div",{className:"lazyContainer",children:n.jsx(e.Suspense,{fallback:n.jsx("div",{children:"Loading..."}),children:i&&n.jsx(i,{})})})};ee.propTypes={content:L.object};var ne=function(r){var t=r.node,o=K(),i=e.useRef(null),a=e.useRef(null),c=B(e.useState(null),2),l=c[0],u=c[1],s=e.useCallback(function(e){for(var r=[],t=0;t<e.children.length;t++){var i=e.children[t];if("container"===i.type){var a=o.ldf.containers[e.children[t].containerId];a.parent=e,r.push(n.jsx(ne,{meta:e.children[t],id:a.id,node:a},t))}else"handleBar"===i.type&&("horizontal"===e.orientation?r.push(n.jsx(G,{orientation:"vertical",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},t)):"vertical"===e.orientation&&r.push(n.jsx(G,{orientation:"horizontal",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},t)))}return r},[o]),f=e.useRef({});return f.current={updateStyles:function(e){var n="hiding-"+a.current;for(var r in e)if("display"===r&&"none"===e[r]){if(i.current.classList.contains(n))return;i.current.classList.add(n)}else if("display"===r&&"flex"===e[r]){if(!i.current.classList.contains(n))return;i.current.classList.remove(n)}else i.current.style[r]=e[r]}},e.useLayoutEffect(function(){if(t&&o&&i.current){a.current=t.parent.orientation;var e=t.children&&t.children.length>0;return e?"horizontal"===t.orientation?(i.current.style.display="flex",i.current.style.flexDirection="row",i.current.style.width="100%"):"vertical"===t.orientation?(i.current.style.display="flex",i.current.style.flexDirection="column",i.current.style.height="100%"):console.warn("Unknown orientation:",t.orientation):t.background?i.current.style.background=t.background:i.current.style.background="transparent",u(e?s(t):n.jsx(ee,{content:t})),o.registerContainer(t.id,f,i.current),function(){o.unregisterContainer(t.id)}}},[t,o,s]),n.jsx("div",{ref:i,className:"relative-container",children:l})};ne.propTypes={node:L.object};var re=e.createContext(null),te=function(r){var t=r.children,o=B(e.useState({activeId:null,activeData:null,overId:null,overData:null,isDragging:!1}),2),i=o[0],a=o[1],c=B(e.useState(null),2),l=c[0],u=c[1],s=e.useCallback(function(e){var n,r,t,o;a({activeId:null!==(n=null===(r=e.active)||void 0===r?void 0:r.id)&&void 0!==n?n:null,activeData:null!==(t=null===(o=e.active)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.current)&&void 0!==t?t:null,overId:null,overData:null,isDragging:!0})},[]),f=e.useCallback(function(e){a(function(n){var r,t,o,i;return M(M({},n),{},{overId:null!==(r=null===(t=e.over)||void 0===t?void 0:t.id)&&void 0!==r?r:null,overData:null!==(o=null===(i=e.over)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.current)&&void 0!==o?o:null})})},[]),d=e.useCallback(function(e){var n,r,t,o,i,c,l,s;u({activeId:null!==(n=null===(r=e.active)||void 0===r?void 0:r.id)&&void 0!==n?n:null,activeData:null!==(t=null===(o=e.active)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.current)&&void 0!==t?t:null,overId:null!==(i=null===(c=e.over)||void 0===c?void 0:c.id)&&void 0!==i?i:null,overData:null!==(l=null===(s=e.over)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.current)&&void 0!==l?l:null}),a({activeId:null,activeData:null,overId:null,overData:null,isDragging:!1})},[]),p=e.useMemo(function(){return{dragState:i,drop:l,handleDragStart:s,handleDragOver:f,clearDrag:d}},[i,l,s,f,d]);return n.jsx(re.Provider,{value:p,children:t})},oe=function(){var n=e.useContext(re);if(!n)throw new Error("useDragState must be used inside DragProvider");return n};J(".root-container {\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.relative-container {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.drag-overlay {\n position: fixed;\n pointer-events: none;\n z-index: 9999;\n}");var ie=function(){var t,o=K(),i=oe(),a=i.dragState,c=i.handleDragStart,l=i.handleDragOver,u=i.clearDrag,s=e.useRef(null),f=e.useRef(null),d=e.useRef(!1),p=e.useRef({});p.current={};var y=B(e.useState(null),2),v=y[0],h=y[1],m=e.useCallback(function(e){for(var r=[],t=0;t<e.children.length;t++){var i=e.children[t];if("container"===i.type){var a=o.ldf.containers[e.children[t].containerId];a.parent=e,r.push(n.jsx(ne,{meta:e.children[t],id:a.id,node:a},t))}else"handleBar"===i.type&&("horizontal"===e.orientation?r.push(n.jsx(G,{orientation:"vertical",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},t)):"vertical"===e.orientation&&r.push(n.jsx(G,{orientation:"horizontal",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},t)))}return r},[o]);e.useLayoutEffect(function(){if(o){var e=o.ldf.containers[o.ldf.layoutRoot],n=e.children&&e.children.length>0;o.registerContainer(e.id,p,s.current),n&&("horizontal"===e.orientation?s.current.style.flexDirection="row":"vertical"===e.orientation&&(s.current.style.flexDirection="column")),h(n?m(e):null);var r=new ResizeObserver(function(e){d.current||(d.current=!0);var n,r=$(e);try{var t=function(){var e=n.value.contentRect,r=e.width,t=e.height;clearTimeout(f.current),f.current=setTimeout(function(){d.current=!1,o.handleRootResize(r,t)},1)};for(r.s();!(n=r.n()).done;)t()}catch(e){r.e(e)}finally{r.f()}});return r.observe(s.current),function(){o.unregisterContainer(o.ldf.layoutRoot),r.disconnect()}}},[o]);var g=r.useSensors(r.useSensor(r.PointerSensor,{activationConstraint:{distance:8}})),b=B(e.useState({left:0,top:0}),2),w=b[0],x=b[1];return e.useEffect(function(){if(a.isDragging){var e=function(e){x({left:e.clientX,top:e.clientY})};return window.addEventListener("pointermove",e),function(){window.removeEventListener("pointermove",e)}}},[a.isDragging]),n.jsxs(r.DndContext,{sensors:g,onDragStart:c,onDragOver:l,onDragEnd:u,onDragCancel:u,children:[n.jsx("div",{className:"root-container",children:n.jsx("div",{ref:s,className:"relative-container",children:v})}),a.isDragging&&n.jsx("div",{className:"drag-overlay",style:w,children:null==a||null===(t=a.activeData)||void 0===t?void 0:t.preview})]})};J("");var ae=function(e){var r=e.ldf,t=e.registry;return n.jsx(te,{children:n.jsx(Z,{layout:r,children:n.jsx(Q.Provider,{value:t,children:n.jsx(ie,{})})})})};ae.propTypes={ldf:L.object,registry:L.object},exports.LayoutManager=ae,exports.useDragState=oe;
|
|
15
15
|
//# sourceMappingURL=index.js.map
|