iobroker.javascript
Version:
Rules Engine for ioBroker
111 lines (96 loc) • 1.19 MB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BLZa2V1g.js","./createSvgIcon-C_ElRFrf.js","./iobroker_javascript__loadShare__react__loadShare__-B-pIv4x_.js","./_commonjsHelpers-Cpj98o6Y.js","./iobroker_javascript__mf_v__runtimeInit__mf_v__-CmuPLb0X.js","./index-DeFm7TiX.js","./inheritsLoose-CLw44UEv.js","./preload-helper-Dp1pzeXC.js","./index-DUBaHZ92.css","./index-T5pCS60x.js","./ScriptEditorVanillaMonaco-BWe9MiKn.js","./ScriptEditor-CpRWvDSw.js","./Save--0ldNXLf.js","./OpenAiDialog-BYXyaWDU.js","./index-BompUVvy.js"])))=>i.map(i=>d[i]);
import{a as IT,b as xT,r as DT,l as AT}from"./iobroker_javascript__mf_v__runtimeInit__mf_v__-CmuPLb0X.js";import{j as p,c as dt,g as R_,r as O_,_ as qp,i as dy,P as ee}from"./createSvgIcon-C_ElRFrf.js";import{i as M_,y as RT,_ as OT,a as MT,m as NT,S as hy,T as py}from"./inheritsLoose-CLw44UEv.js";import{R as X,i as G}from"./iobroker_javascript__loadShare__react__loadShare__-B-pIv4x_.js";import{i as y,C as di,I as lo,a as zl,b as LT,c as N_,F as BT,d as PT,e as Kl,f as Zp,g as FT,h as jT,j as zT,k as UT,M as HT,l as WT,m as VT,n as GT,_ as KT,o as xl,p as YT,q as JT,r as Dl,s as gy,t as XT,u as qT,v as ZT,w as QT,x as my,y as bc,z as ek,A as tk,B as sk,D as ok,E as ik,G as nk,H as L_,J as B_,K as P_,L as rk,N as ak,O as lk,P as ck,Q as uk,R as dk}from"./index-DeFm7TiX.js";import{g as hi,c as nn}from"./_commonjsHelpers-Cpj98o6Y.js";import{_ as mn}from"./preload-helper-Dp1pzeXC.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(l){if(l.ep)return;l.ep=!0;const u=i(l);fetch(l.href,u)}})();var F_,fy=M_;F_=fy.createRoot,fy.hydrateRoot;var j_={exports:{}},nt={};/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var vc=60103,yc=60106,Or=60107,Mr=60108,Nr=60114,Lr=60109,Br=60110,Pr=60112,Fr=60113,Tg=60120,jr=60115,zr=60116,z_=60121,U_=60122,H_=60117,W_=60129,V_=60131;if(typeof Symbol=="function"&&Symbol.for){var xt=Symbol.for;vc=xt("react.element"),yc=xt("react.portal"),Or=xt("react.fragment"),Mr=xt("react.strict_mode"),Nr=xt("react.profiler"),Lr=xt("react.provider"),Br=xt("react.context"),Pr=xt("react.forward_ref"),Fr=xt("react.suspense"),Tg=xt("react.suspense_list"),jr=xt("react.memo"),zr=xt("react.lazy"),z_=xt("react.block"),U_=xt("react.server.block"),H_=xt("react.fundamental"),W_=xt("react.debug_trace_mode"),V_=xt("react.legacy_hidden")}function Cs(a){if(typeof a=="object"&&a!==null){var s=a.$$typeof;switch(s){case vc:switch(a=a.type,a){case Or:case Nr:case Mr:case Fr:case Tg:return a;default:switch(a=a&&a.$$typeof,a){case Br:case Pr:case zr:case jr:case Lr:return a;default:return s}}case yc:return s}}}var hk=Lr,pk=vc,gk=Pr,mk=Or,fk=zr,$k=jr,bk=yc,vk=Nr,yk=Mr,_k=Fr;nt.ContextConsumer=Br;nt.ContextProvider=hk;nt.Element=pk;nt.ForwardRef=gk;nt.Fragment=mk;nt.Lazy=fk;nt.Memo=$k;nt.Portal=bk;nt.Profiler=vk;nt.StrictMode=yk;nt.Suspense=_k;nt.isAsyncMode=function(){return!1};nt.isConcurrentMode=function(){return!1};nt.isContextConsumer=function(a){return Cs(a)===Br};nt.isContextProvider=function(a){return Cs(a)===Lr};nt.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===vc};nt.isForwardRef=function(a){return Cs(a)===Pr};nt.isFragment=function(a){return Cs(a)===Or};nt.isLazy=function(a){return Cs(a)===zr};nt.isMemo=function(a){return Cs(a)===jr};nt.isPortal=function(a){return Cs(a)===yc};nt.isProfiler=function(a){return Cs(a)===Nr};nt.isStrictMode=function(a){return Cs(a)===Mr};nt.isSuspense=function(a){return Cs(a)===Fr};nt.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===Or||a===Nr||a===W_||a===Mr||a===Fr||a===Tg||a===V_||typeof a=="object"&&a!==null&&(a.$$typeof===zr||a.$$typeof===jr||a.$$typeof===Lr||a.$$typeof===Br||a.$$typeof===Pr||a.$$typeof===H_||a.$$typeof===z_||a[0]===U_)};nt.typeOf=Cs;j_.exports=nt;var wk=j_.exports;function Yl(a,s){const i=getComputedStyle(s);if(!i)return;let r=a===ut.Horizontal?s.clientWidth:s.clientHeight;return r!==0?(a===ut.Horizontal?r-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight):r-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),r):void 0}/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function Al(a,s,i=[],r={condition:!0}){const{condition:l}=r,u=function(d,g){var m={};for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&g.indexOf(f)<0&&(m[f]=d[f]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var v=0;for(f=Object.getOwnPropertySymbols(d);v<f.length;v++)g.indexOf(f[v])<0&&Object.prototype.propertyIsEnumerable.call(d,f[v])&&(m[f[v]]=d[f[v]])}return m}(r,["condition"]);G.useEffect(()=>(l&&window.addEventListener(a,s,u),()=>{l&&window.removeEventListener(a,s)}),[a,s,l,...i])}(function(a,s){s===void 0&&(s={});var i=s.insertAt;if(typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",i==="top"&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=a:l.appendChild(document.createTextNode(a))}})(`/* === Main Container === */
.__dbk__container {
height: 100%;
width: 100%;
display: flex;
overflow: hidden;
}
.__dbk__container.Horizontal {
flex-direction: row;
}
.__dbk__container.Vertical {
flex-direction: column;
}
/* ====== */
/* === Wrapper for each child element === */
.__dbk__child-wrapper {
height: 100%;
width: 100%;
}
/* ====== */
/* === Gutter === */
.__dbk__gutter {
display: flex;
align-items: center;
justify-content: center;
}
/* .__dbk__gutter > div {
background: red;
} */
.__dbk__gutter.Horizontal {
height: 100%;
padding: 0 2px;
flex-direction: column;
}
.__dbk__gutter.Horizontal:hover {
cursor: col-resize;
}
.__dbk__gutter.Vertical {
width: 100%;
padding: 2px 0;
flex-direction: row;
}
.__dbk__gutter.Vertical:hover {
cursor: row-resize;
}
.__dbk__gutter.Light {
background: #EDF0EF;
}
.__dbk__gutter.Light:hover > .__dbk__dragger {
background: #76747B;
}
.__dbk__gutter.Dark {
background: #020203;
}
.__dbk__gutter.Dark:hover > .__dbk__dragger {
background: #9995A3;
}
/* ====== */
/* === Gutter's Dragger === */
.__dbk__dragger {
border-radius: 2px;
}
.__dbk__dragger.Horizontal {
width: 4px;
height: 24px;
}
.__dbk__dragger.Vertical {
width: 24px;
height: 4px;
}
.__dbk__dragger.Light {
background: #A6ACB5;
}
.__dbk__dragger.Dark {
background: #434252;
}
/* ====== */`);const Ck=X.forwardRef(({className:a,theme:s,draggerClassName:i,direction:r=ut.Vertical,onDragging:l},u)=>{const d=`__dbk__gutter ${r} ${a||s}`,g=`__dbk__dragger ${r} ${i||s}`;return p.jsx("div",Object.assign({className:d,ref:u,dir:r,onMouseDown:l,onTouchStart:Ul?l:void 0},{children:p.jsx("div",{className:g},void 0)}),void 0)});var us;function Qp(a,s,i){let r,l;return s?(r=a/2,l=a):i?(r=a,l=a/2):(r=a,l=a),{aGutterSize:r,bGutterSize:l}}function Tk(a,s){switch(s.type){case us.SetIsReadyToCompute:return Object.assign(Object.assign({},a),{isReady:s.payload.isReady});case us.CreatePairs:{const{direction:i,children:r,gutters:l}=s.payload,u=r[0].parentNode;if(!u)throw new Error("Cannot create pairs - parent is undefined.");const d=Yl(i,u);if(d===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${d}.`);const g=[];return r.forEach((m,f)=>{if(f>0){const v=r[f-1],w=r[f],_=l[f-1],S=i===ut.Horizontal?v.getBoundingClientRect().left:v.getBoundingClientRect().top,k=i===ut.Horizontal?w.getBoundingClientRect().right:w.getBoundingClientRect().bottom,C=i===ut.Horizontal?v.getBoundingClientRect().width+_.getBoundingClientRect().width+w.getBoundingClientRect().width:v.getBoundingClientRect().height+_.getBoundingClientRect().height+w.getBoundingClientRect().height,E=i===ut.Horizontal?_.getBoundingClientRect().width:_.getBoundingClientRect().height,A={idx:f-1,a:v,b:w,gutter:_,parent:u,start:S,end:k,size:C,gutterSize:E,aSizePct:100/r.length,bSizePct:100/r.length};g.push(A)}}),Object.assign(Object.assign({},a),{pairs:g})}case us.StartDragging:{const{gutterIdx:i}=s.payload;return Object.assign(Object.assign({},a),{isDragging:!0,draggingIdx:i})}case us.StopDragging:return Object.assign(Object.assign({},a),{isDragging:!1});case us.CalculateSizes:{const{direction:i,gutterIdx:r}=s.payload,l=a.pairs[r],u=Yl(i,l.parent);if(!u)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const d=l.gutter[i===ut.Horizontal?"clientWidth":"clientHeight"],g=r===0,m=r===a.pairs.length-1,{aGutterSize:f,bGutterSize:v}=Qp(d,g,m);let w,_,S,k,C;return i===ut.Horizontal?(w=l.a.getBoundingClientRect().left,_=l.b.getBoundingClientRect().right,k=(l.a.getBoundingClientRect().width+f)/u*100,C=(l.b.getBoundingClientRect().width+v)/u*100,S=l.a.getBoundingClientRect().width+f+v+l.b.getBoundingClientRect().width):(w=l.a.getBoundingClientRect().top,_=l.b.getBoundingClientRect().bottom,k=(l.a.getBoundingClientRect().height+f)/u*100,C=(l.b.getBoundingClientRect().height+v)/u*100,S=l.a.getBoundingClientRect().height+f+v+l.b.getBoundingClientRect().height),a.pairs[r]=Object.assign(Object.assign({},l),{start:w,end:_,size:S,aSizePct:k,bSizePct:C,gutterSize:d}),Object.assign({},a)}default:return a}}function G_(a,s=0,i=[]){return G.Children.toArray(a).reduce((r,l,u)=>(wk.isFragment(l)?r.push.apply(r,G_(l.props.children,s+1,i.concat(l.key||u))):G.isValidElement(l)?r.push(G.cloneElement(l,{key:i.concat(String(l.key)).join(".")})):typeof l!="string"&&typeof l!="number"||r.push(l),r),[])}(function(a){a[a.SetIsReadyToCompute=0]="SetIsReadyToCompute",a[a.CreatePairs=1]="CreatePairs",a[a.CalculateSizes=2]="CalculateSizes",a[a.StartDragging=3]="StartDragging",a[a.StopDragging=4]="StopDragging"})(us||(us={}));const $y=a=>"changedTouches"in a;var ut,eg;(function(a){a.Horizontal="Horizontal",a.Vertical="Vertical"})(ut||(ut={})),function(a){a.Light="Light",a.Dark="Dark"}(eg||(eg={}));const Ul=typeof window<"u"&&"ontouchstart"in window;function wp(a){return a===ut.Horizontal?"col-resize":"row-resize"}const kk={isReady:!1,isDragging:!1,pairs:[]};function by({direction:a=ut.Horizontal,minWidths:s=[],minHeights:i=[],initialSizes:r,gutterTheme:l=eg.Dark,gutterClassName:u,draggerClassName:d,children:g,onResizeStarted:m,onResizeFinished:f,classes:v=[]}){const w=G_(g),[_,S]=G.useReducer(Tk,kk),k=G.useRef(null),C=G.useRef([]),E=G.useRef([]);C.current=[],E.current=[];const A=X.useCallback(ce=>{S({type:us.SetIsReadyToCompute,payload:{isReady:ce}})},[]),R=X.useCallback((ce,de)=>{S({type:us.StartDragging,payload:{gutterIdx:de}});const J=_.pairs[de];m==null||m(J.idx),J.a.style.userSelect="none",J.b.style.userSelect="none",J.gutter.style.cursor=wp(ce),J.parent.style.cursor=wp(ce),document.body.style.cursor=wp(ce)},[_.pairs]),O=X.useCallback(()=>{S({type:us.StopDragging});const ce=[];for(let J=0;J<_.pairs.length;J++){const we=_.pairs[J],me=Yl(a,we.parent);if(me===void 0)throw new Error("Cannot call the 'onResizeFinished' callback - parentSize is undefined");if(we.gutterSize===void 0)throw new Error("Cannot call 'onResizeFinished' callback - gutterSize is undefined");const Pe=J===0,Y=J===_.pairs.length-1,et=we.a.getBoundingClientRect()[a===ut.Horizontal?"width":"height"],{aGutterSize:q,bGutterSize:oe}=Qp(we.gutterSize,Pe,Y),F=(et+q)/me*100;if(ce.push(F),Y){const H=(we.b.getBoundingClientRect()[a===ut.Horizontal?"width":"height"]+oe)/me*100;ce.push(H)}}if(_.draggingIdx===void 0)throw new Error("Could not reset cursor and user-select because 'state.draggingIdx' is undefined");const de=_.pairs[_.draggingIdx];f==null||f(de.idx,ce),de.a.style.userSelect="",de.b.style.userSelect="",de.gutter.style.cursor="",de.parent.style.cursor="",document.body.style.cursor=""},[_.draggingIdx,_.pairs,a]),Z=X.useCallback((ce,de)=>{S({type:us.CalculateSizes,payload:{direction:ce,gutterIdx:de}})},[]),ae=X.useCallback((ce,de,J)=>{S({type:us.CreatePairs,payload:{direction:ce,children:de,gutters:J}})},[]),se=X.useCallback((ce,de,J,we)=>{const me=de[0].parentNode;if(!me)throw new Error("Cannot set initial sizes - parent is undefined");if(Yl(ce,me)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");de.forEach((Pe,Y)=>{const et=Y===0,q=Y===de.length-1;let oe,F=0;de.length>1&&(F=J[q?Y-1:Y].getBoundingClientRect()[ce===ut.Horizontal?"width":"height"],F=et||q?F/2:F),oe=we&&Y<we.length?`calc(${we[Y]}% - ${F}px)`:`calc(${100/de.length}% - ${F}px)`,ce===ut.Horizontal?(Pe.style.width=oe,Pe.style.height="100%"):(Pe.style.height=oe,Pe.style.width="100%")})},[]),ge=X.useCallback((ce,de)=>{if(_.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const J=_.pairs[_.draggingIdx];if(J.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(J.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const we=J.aSizePct+J.bSizePct,me=de/J.size*we,Pe=we-de/J.size*we,Y=_.draggingIdx===0,et=_.draggingIdx===_.pairs.length-1,{aGutterSize:q,bGutterSize:oe}=Qp(J.gutterSize,Y,et),F=`calc(${me}% - ${q}px)`,H=`calc(${Pe}% - ${oe}px)`;ce===ut.Horizontal?(J.a.style.width=F,J.b.style.width=H):(J.a.style.height=F,J.b.style.height=H)},[_.draggingIdx,_.pairs,a]),K=X.useCallback((ce,de,J)=>{if(!_.isDragging)return;if(_.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const we=_.pairs[_.draggingIdx];if(we.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(we.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(we.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let me=function(et,q){const oe=$y(q)?q.changedTouches[0]:q;return et===ut.Horizontal?oe.clientX:oe.clientY}(de,ce)-we.start,Pe=16,Y=16;J.length>_.draggingIdx&&(Pe=J[_.draggingIdx]),J.length>=_.draggingIdx+1&&(Y=J[_.draggingIdx+1]),me<we.gutterSize+Pe&&(me=we.gutterSize+Pe),me>=we.size-(we.gutterSize+Y)&&(me=we.size-(we.gutterSize+Y)),ge(de,me)},[_.isDragging,_.draggingIdx,_.pairs,ge]),je=()=>{if(_.isDragging){if(_.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");Z(a,_.draggingIdx),O()}},Me=ce=>{_.isDragging&&($y(ce)&&ce.preventDefault(),K(ce,a,a===ut.Horizontal?s:i))};function qe(ce,de){if(!ce.current)throw new Error("Can't add element to ref object - ref isn't initialized");de&&!ce.current.includes(de)&&ce.current.push(de)}return Al("mouseup",je,[_.isDragging,O]),Al("mousemove",Me,[a,_.isDragging,K,s,i]),Al("touchend",je,[_.isDragging,O],{condition:Ul}),Al("touchmove",Me,[a,_.isDragging,K,s,i],{condition:Ul,passive:!Ul}),G.useEffect(function(){if(!k.current)return;const ce=k.current.parentElement;if(!ce)return;const de=new ResizeObserver(()=>{const J=getComputedStyle(ce),we=a===ut.Horizontal?ce.clientWidth:ce.clientHeight;A(!!J&&!!we)});return de.observe(ce),()=>{de.disconnect()}},[k.current,a]),G.useEffect(function(){if(_.isReady&&(!C.current||C.current[0].offsetParent)){if(!C.current||!E.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");w.length<=1?se(a,C.current,E.current,r):(se(a,C.current,E.current,r),ae(a,C.current,E.current))}},[g,_.isReady,a,se,ae,r]),p.jsx("div",Object.assign({className:`__dbk__container ${a}`,ref:k},{children:_.isReady&&w.map((ce,de)=>p.jsxs(X.Fragment,{children:[p.jsx("div",Object.assign({ref:J=>qe(C,J),className:"__dbk__child-wrapper "+(de<v.length?v[de]:"")},{children:ce}),void 0),de<w.length-1&&p.jsx(Ck,{ref:J=>qe(E,J),className:u,theme:l,draggerClassName:d,direction:a,onDragging:()=>{return Z(a,J=de),void R(a,J);var J}},void 0)]},de))}),void 0)}const{loadShare:Sk}=xT,{initPromise:Ek}=IT,Ik=Ek.then(a=>Sk("@iobroker/adapter-react-v5",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),xk=await Ik.then(a=>a());var b=xk;const K_=G.createContext({dragDropManager:void 0});function Ir(a){"@babel/helpers - typeof";return Ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Ir(a)}function Dk(a,s){if(Ir(a)!="object"||!a)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var r=i.call(a,s);if(Ir(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function Ak(a){var s=Dk(a,"string");return Ir(s)=="symbol"?s:s+""}function Rk(a,s,i){return(s=Ak(s))in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function rs(a){return"Minified Redux error #"+a+"; visit https://redux.js.org/Errors?code="+a+" for the full message or use the non-minified dev environment for full errors. "}var vy=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),yy=function(){return Math.random().toString(36).substring(7).split("").join(".")},_y={INIT:"@@redux/INIT"+yy(),REPLACE:"@@redux/REPLACE"+yy()};function Ok(a){if(typeof a!="object"||a===null)return!1;for(var s=a;Object.getPrototypeOf(s)!==null;)s=Object.getPrototypeOf(s);return Object.getPrototypeOf(a)===s}function Y_(a,s,i){var r;if(typeof s=="function"&&typeof i=="function"||typeof i=="function"&&typeof arguments[3]=="function")throw new Error(rs(0));if(typeof s=="function"&&typeof i>"u"&&(i=s,s=void 0),typeof i<"u"){if(typeof i!="function")throw new Error(rs(1));return i(Y_)(a,s)}if(typeof a!="function")throw new Error(rs(2));var l=a,u=s,d=[],g=d,m=!1;function f(){g===d&&(g=d.slice())}function v(){if(m)throw new Error(rs(3));return u}function w(C){if(typeof C!="function")throw new Error(rs(4));if(m)throw new Error(rs(5));var E=!0;return f(),g.push(C),function(){if(E){if(m)throw new Error(rs(6));E=!1,f();var R=g.indexOf(C);g.splice(R,1),d=null}}}function _(C){if(!Ok(C))throw new Error(rs(7));if(typeof C.type>"u")throw new Error(rs(8));if(m)throw new Error(rs(9));try{m=!0,u=l(u,C)}finally{m=!1}for(var E=d=g,A=0;A<E.length;A++){var R=E[A];R()}return C}function S(C){if(typeof C!="function")throw new Error(rs(10));l=C,_({type:_y.REPLACE})}function k(){var C,E=w;return C={subscribe:function(R){if(typeof R!="object"||R===null)throw new Error(rs(11));function O(){R.next&&R.next(v())}O();var Z=E(O);return{unsubscribe:Z}}},C[vy]=function(){return this},C}return _({type:_y.INIT}),r={dispatch:_,subscribe:w,getState:v,replaceReducer:S},r[vy]=k,r}function De(a,s,...i){if(Mk()&&s===void 0)throw new Error("invariant requires an error message argument");if(!a){let r;if(s===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let l=0;r=new Error(s.replace(/%s/g,function(){return i[l++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function Mk(){return typeof process<"u"&&!0}function Nk(a,s,i){return s.split(".").reduce((r,l)=>r&&r[l]?r[l]:i||null,a)}function Lk(a,s){return a.filter(i=>i!==s)}function J_(a){return typeof a=="object"}function Bk(a,s){const i=new Map,r=u=>{i.set(u,i.has(u)?i.get(u)+1:1)};a.forEach(r),s.forEach(r);const l=[];return i.forEach((u,d)=>{u===1&&l.push(d)}),l}function Pk(a,s){return a.filter(i=>s.indexOf(i)>-1)}const kg="dnd-core/INIT_COORDS",_c="dnd-core/BEGIN_DRAG",Sg="dnd-core/PUBLISH_DRAG_SOURCE",wc="dnd-core/HOVER",Cc="dnd-core/DROP",Tc="dnd-core/END_DRAG";function wy(a,s){return{type:kg,payload:{sourceClientOffset:s||null,clientOffset:a||null}}}const Fk={type:kg,payload:{clientOffset:null,sourceClientOffset:null}};function jk(a){return function(i=[],r={publishSource:!0}){const{publishSource:l=!0,clientOffset:u,getSourceClientOffset:d}=r,g=a.getMonitor(),m=a.getRegistry();a.dispatch(wy(u)),zk(i,g,m);const f=Wk(i,g);if(f==null){a.dispatch(Fk);return}let v=null;if(u){if(!d)throw new Error("getSourceClientOffset must be defined");Uk(d),v=d(f)}a.dispatch(wy(u,v));const _=m.getSource(f).beginDrag(g,f);if(_==null)return;Hk(_),m.pinSource(f);const S=m.getSourceType(f);return{type:_c,payload:{itemType:S,item:_,sourceId:f,clientOffset:u||null,sourceClientOffset:v||null,isSourcePublic:!!l}}}}function zk(a,s,i){De(!s.isDragging(),"Cannot call beginDrag while dragging."),a.forEach(function(r){De(i.getSource(r),"Expected sourceIds to be registered.")})}function Uk(a){De(typeof a=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Hk(a){De(J_(a),"Item must be an object.")}function Wk(a,s){let i=null;for(let r=a.length-1;r>=0;r--)if(s.canDragSource(a[r])){i=a[r];break}return i}function Vk(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function Gk(a){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{},r=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable}))),r.forEach(function(l){Vk(a,l,i[l])})}return a}function Kk(a){return function(i={}){const r=a.getMonitor(),l=a.getRegistry();Yk(r),qk(r).forEach((d,g)=>{const m=Jk(d,g,l,r),f={type:Cc,payload:{dropResult:Gk({},i,m)}};a.dispatch(f)})}}function Yk(a){De(a.isDragging(),"Cannot call drop while not dragging."),De(!a.didDrop(),"Cannot call drop twice during one drag operation.")}function Jk(a,s,i,r){const l=i.getTarget(a);let u=l?l.drop(r,a):void 0;return Xk(u),typeof u>"u"&&(u=s===0?{}:r.getDropResult()),u}function Xk(a){De(typeof a>"u"||J_(a),"Drop result must either be an object or undefined.")}function qk(a){const s=a.getTargetIds().filter(a.canDropOnTarget,a);return s.reverse(),s}function Zk(a){return function(){const i=a.getMonitor(),r=a.getRegistry();Qk(i);const l=i.getSourceId();return l!=null&&(r.getSource(l,!0).endDrag(i,l),r.unpinSource()),{type:Tc}}}function Qk(a){De(a.isDragging(),"Cannot call endDrag while not dragging.")}function tg(a,s){return s===null?a===null:Array.isArray(a)?a.some(i=>i===s):a===s}function eS(a){return function(i,{clientOffset:r}={}){tS(i);const l=i.slice(0),u=a.getMonitor(),d=a.getRegistry(),g=u.getItemType();return oS(l,d,g),sS(l,u,d),iS(l,u,d),{type:wc,payload:{targetIds:l,clientOffset:r||null}}}}function tS(a){De(Array.isArray(a),"Expected targetIds to be an array.")}function sS(a,s,i){De(s.isDragging(),"Cannot call hover while not dragging."),De(!s.didDrop(),"Cannot call hover after drop.");for(let r=0;r<a.length;r++){const l=a[r];De(a.lastIndexOf(l)===r,"Expected targetIds to be unique in the passed array.");const u=i.getTarget(l);De(u,"Expected targetIds to be registered.")}}function oS(a,s,i){for(let r=a.length-1;r>=0;r--){const l=a[r],u=s.getTargetType(l);tg(u,i)||a.splice(r,1)}}function iS(a,s,i){a.forEach(function(r){i.getTarget(r).hover(s,r)})}function nS(a){return function(){if(a.getMonitor().isDragging())return{type:Sg}}}function rS(a){return{beginDrag:jk(a),publishDragSource:nS(a),hover:eS(a),drop:Kk(a),endDrag:Zk(a)}}class aS{receiveBackend(s){this.backend=s}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const s=this,{dispatch:i}=this.store;function r(u){return(...d)=>{const g=u.apply(s,d);typeof g<"u"&&i(g)}}const l=rS(this);return Object.keys(l).reduce((u,d)=>{const g=l[d];return u[d]=r(g),u},{})}dispatch(s){this.store.dispatch(s)}constructor(s,i){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=s,this.monitor=i,s.subscribe(this.handleRefCountChange)}}function lS(a,s){return{x:a.x+s.x,y:a.y+s.y}}function X_(a,s){return{x:a.x-s.x,y:a.y-s.y}}function cS(a){const{clientOffset:s,initialClientOffset:i,initialSourceClientOffset:r}=a;return!s||!i||!r?null:X_(lS(s,r),i)}function uS(a){const{clientOffset:s,initialClientOffset:i}=a;return!s||!i?null:X_(s,i)}const wr=[],Eg=[];wr.__IS_NONE__=!0;Eg.__IS_ALL__=!0;function dS(a,s){return a===wr?!1:a===Eg||typeof s>"u"?!0:Pk(s,a).length>0}class hS{subscribeToStateChange(s,i={}){const{handlerIds:r}=i;De(typeof s=="function","listener must be a function."),De(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let l=this.store.getState().stateId;const u=()=>{const d=this.store.getState(),g=d.stateId;try{g===l||g===l+1&&!dS(d.dirtyHandlerIds,r)||s()}finally{l=g}};return this.store.subscribe(u)}subscribeToOffsetChange(s){De(typeof s=="function","listener must be a function.");let i=this.store.getState().dragOffset;const r=()=>{const l=this.store.getState().dragOffset;l!==i&&(i=l,s())};return this.store.subscribe(r)}canDragSource(s){if(!s)return!1;const i=this.registry.getSource(s);return De(i,`Expected to find a valid source. sourceId=${s}`),this.isDragging()?!1:i.canDrag(this,s)}canDropOnTarget(s){if(!s)return!1;const i=this.registry.getTarget(s);if(De(i,`Expected to find a valid target. targetId=${s}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(s),l=this.getItemType();return tg(r,l)&&i.canDrop(this,s)}isDragging(){return!!this.getItemType()}isDraggingSource(s){if(!s)return!1;const i=this.registry.getSource(s,!0);if(De(i,`Expected to find a valid source. sourceId=${s}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(s),l=this.getItemType();return r!==l?!1:i.isDragging(this,s)}isOverTarget(s,i={shallow:!1}){if(!s)return!1;const{shallow:r}=i;if(!this.isDragging())return!1;const l=this.registry.getTargetType(s),u=this.getItemType();if(u&&!tg(l,u))return!1;const d=this.getTargetIds();if(!d.length)return!1;const g=d.indexOf(s);return r?g===d.length-1:g>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return cS(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return uS(this.store.getState().dragOffset)}constructor(s,i){this.store=s,this.registry=i}}const Cy=typeof global<"u"?global:self,q_=Cy.MutationObserver||Cy.WebKitMutationObserver;function Z_(a){return function(){const i=setTimeout(l,0),r=setInterval(l,50);function l(){clearTimeout(i),clearInterval(r),a()}}}function pS(a){let s=1;const i=new q_(a),r=document.createTextNode("");return i.observe(r,{characterData:!0}),function(){s=-s,r.data=s}}const gS=typeof q_=="function"?pS:Z_;class mS{enqueueTask(s){const{queue:i,requestFlush:r}=this;i.length||(r(),this.flushing=!0),i[i.length]=s}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:s}=this;for(;this.index<s.length;){const i=this.index;if(this.index++,s[i].call(),this.index>this.capacity){for(let r=0,l=s.length-this.index;r<l;r++)s[r]=s[r+this.index];s.length-=this.index,this.index=0}}s.length=0,this.index=0,this.flushing=!1},this.registerPendingError=s=>{this.pendingErrors.push(s),this.requestErrorThrow()},this.requestFlush=gS(this.flush),this.requestErrorThrow=Z_(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class fS{call(){try{this.task&&this.task()}catch(s){this.onError(s)}finally{this.task=null,this.release(this)}}constructor(s,i){this.onError=s,this.release=i,this.task=null}}class $S{create(s){const i=this.freeTasks,r=i.length?i.pop():new fS(this.onError,l=>i[i.length]=l);return r.task=s,r}constructor(s){this.onError=s,this.freeTasks=[]}}const Q_=new mS,bS=new $S(Q_.registerPendingError);function vS(a){Q_.enqueueTask(bS.create(a))}const Ig="dnd-core/ADD_SOURCE",xg="dnd-core/ADD_TARGET",Dg="dnd-core/REMOVE_SOURCE",kc="dnd-core/REMOVE_TARGET";function yS(a){return{type:Ig,payload:{sourceId:a}}}function _S(a){return{type:xg,payload:{targetId:a}}}function wS(a){return{type:Dg,payload:{sourceId:a}}}function CS(a){return{type:kc,payload:{targetId:a}}}function TS(a){De(typeof a.canDrag=="function","Expected canDrag to be a function."),De(typeof a.beginDrag=="function","Expected beginDrag to be a function."),De(typeof a.endDrag=="function","Expected endDrag to be a function.")}function kS(a){De(typeof a.canDrop=="function","Expected canDrop to be a function."),De(typeof a.hover=="function","Expected hover to be a function."),De(typeof a.drop=="function","Expected beginDrag to be a function.")}function sg(a,s){if(s&&Array.isArray(a)){a.forEach(i=>sg(i,!1));return}De(typeof a=="string"||typeof a=="symbol",s?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var cs;(function(a){a.SOURCE="SOURCE",a.TARGET="TARGET"})(cs||(cs={}));let SS=0;function ES(){return SS++}function IS(a){const s=ES().toString();switch(a){case cs.SOURCE:return`S${s}`;case cs.TARGET:return`T${s}`;default:throw new Error(`Unknown Handler Role: ${a}`)}}function Ty(a){switch(a[0]){case"S":return cs.SOURCE;case"T":return cs.TARGET;default:throw new Error(`Cannot parse handler ID: ${a}`)}}function ky(a,s){const i=a.entries();let r=!1;do{const{done:l,value:[,u]}=i.next();if(u===s)return!0;r=!!l}while(!r);return!1}class xS{addSource(s,i){sg(s),TS(i);const r=this.addHandler(cs.SOURCE,s,i);return this.store.dispatch(yS(r)),r}addTarget(s,i){sg(s,!0),kS(i);const r=this.addHandler(cs.TARGET,s,i);return this.store.dispatch(_S(r)),r}containsHandler(s){return ky(this.dragSources,s)||ky(this.dropTargets,s)}getSource(s,i=!1){return De(this.isSourceId(s),"Expected a valid source ID."),i&&s===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(s)}getTarget(s){return De(this.isTargetId(s),"Expected a valid target ID."),this.dropTargets.get(s)}getSourceType(s){return De(this.isSourceId(s),"Expected a valid source ID."),this.types.get(s)}getTargetType(s){return De(this.isTargetId(s),"Expected a valid target ID."),this.types.get(s)}isSourceId(s){return Ty(s)===cs.SOURCE}isTargetId(s){return Ty(s)===cs.TARGET}removeSource(s){De(this.getSource(s),"Expected an existing source."),this.store.dispatch(wS(s)),vS(()=>{this.dragSources.delete(s),this.types.delete(s)})}removeTarget(s){De(this.getTarget(s),"Expected an existing target."),this.store.dispatch(CS(s)),this.dropTargets.delete(s),this.types.delete(s)}pinSource(s){const i=this.getSource(s);De(i,"Expected an existing source."),this.pinnedSourceId=s,this.pinnedSource=i}unpinSource(){De(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(s,i,r){const l=IS(s);return this.types.set(l,i),s===cs.SOURCE?this.dragSources.set(l,r):s===cs.TARGET&&this.dropTargets.set(l,r),l}constructor(s){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=s}}const DS=(a,s)=>a===s;function AS(a,s){return!a&&!s?!0:!a||!s?!1:a.x===s.x&&a.y===s.y}function RS(a,s,i=DS){if(a.length!==s.length)return!1;for(let r=0;r<a.length;++r)if(!i(a[r],s[r]))return!1;return!0}function OS(a=wr,s){switch(s.type){case wc:break;case Ig:case xg:case kc:case Dg:return wr;case _c:case Sg:case Tc:case Cc:default:return Eg}const{targetIds:i=[],prevTargetIds:r=[]}=s.payload,l=Bk(i,r);if(!(l.length>0||!RS(i,r)))return wr;const d=r[r.length-1],g=i[i.length-1];return d!==g&&(d&&l.push(d),g&&l.push(g)),l}function MS(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function NS(a){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{},r=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable}))),r.forEach(function(l){MS(a,l,i[l])})}return a}const Sy={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function LS(a=Sy,s){const{payload:i}=s;switch(s.type){case kg:case _c:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case wc:return AS(a.clientOffset,i.clientOffset)?a:NS({},a,{clientOffset:i.clientOffset});case Tc:case Cc:return Sy;default:return a}}function BS(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function Zi(a){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{},r=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable}))),r.forEach(function(l){BS(a,l,i[l])})}return a}const PS={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function FS(a=PS,s){const{payload:i}=s;switch(s.type){case _c:return Zi({},a,{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case Sg:return Zi({},a,{isSourcePublic:!0});case wc:return Zi({},a,{targetIds:i.targetIds});case kc:return a.targetIds.indexOf(i.targetId)===-1?a:Zi({},a,{targetIds:Lk(a.targetIds,i.targetId)});case Cc:return Zi({},a,{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case Tc:return Zi({},a,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return a}}function jS(a=0,s){switch(s.type){case Ig:case xg:return a+1;case Dg:case kc:return a-1;default:return a}}function zS(a=0){return a+1}function US(a,s,i){return s in a?Object.defineProperty(a,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[s]=i,a}function HS(a){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{},r=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable}))),r.forEach(function(l){US(a,l,i[l])})}return a}function WS(a={},s){return{dirtyHandlerIds:OS(a.dirtyHandlerIds,{type:s.type,payload:HS({},s.payload,{prevTargetIds:Nk(a,"dragOperation.targetIds",[])})}),dragOffset:LS(a.dragOffset,s),refCount:jS(a.refCount,s),dragOperation:FS(a.dragOperation,s),stateId:zS(a.stateId)}}function VS(a,s=void 0,i={},r=!1){const l=GS(r),u=new hS(l,new xS(l)),d=new aS(l,u),g=a(d,s,i);return d.receiveBackend(g),d}function GS(a){const s=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Y_(WS,a&&s&&s({name:"dnd-core",instanceId:"dnd-core"}))}function KS(a,s){if(a==null)return{};var i=YS(a,s),r,l;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);for(l=0;l<u.length;l++)r=u[l],!(s.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(a,r)&&(i[r]=a[r])}return i}function YS(a,s){if(a==null)return{};var i={},r=Object.keys(a),l,u;for(u=0;u<r.length;u++)l=r[u],!(s.indexOf(l)>=0)&&(i[l]=a[l]);return i}let Ey=0;const Hl=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ew=G.memo(function(s){var{children:i}=s,r=KS(s,["children"]);const[l,u]=JS(r);return G.useEffect(()=>{if(u){const d=tw();return++Ey,()=>{--Ey===0&&(d[Hl]=null)}}},[]),p.jsx(K_.Provider,{value:l,children:i})});function JS(a){if("manager"in a)return[{dragDropManager:a.manager},!1];const s=XS(a.backend,a.context,a.options,a.debugMode),i=!a.context;return[s,i]}function XS(a,s=tw(),i,r){const l=s;return l[Hl]||(l[Hl]={dragDropManager:VS(a,s,i,r)}),l[Hl]}function tw(){return typeof global<"u"?global:window}var qS=function a(s,i){if(s===i)return!0;if(s&&i&&typeof s=="object"&&typeof i=="object"){if(s.constructor!==i.constructor)return!1;var r,l,u;if(Array.isArray(s)){if(r=s.length,r!=i.length)return!1;for(l=r;l--!==0;)if(!a(s[l],i[l]))return!1;return!0}if(s.constructor===RegExp)return s.source===i.source&&s.flags===i.flags;if(s.valueOf!==Object.prototype.valueOf)return s.valueOf()===i.valueOf();if(s.toString!==Object.prototype.toString)return s.toString()===i.toString();if(u=Object.keys(s),r=u.length,r!==Object.keys(i).length)return!1;for(l=r;l--!==0;)if(!Object.prototype.hasOwnProperty.call(i,u[l]))return!1;for(l=r;l--!==0;){var d=u[l];if(!a(s[d],i[d]))return!1}return!0}return s!==s&&i!==i};const ZS=hi(qS),li=typeof window<"u"?G.useLayoutEffect:G.useEffect;function QS(a,s,i){const[r,l]=G.useState(()=>s(a)),u=G.useCallback(()=>{const d=s(a);ZS(r,d)||(l(d),i&&i())},[r,a,i]);return li(u),[r,u]}function eE(a,s,i){const[r,l]=QS(a,s,i);return li(function(){const d=a.getHandlerId();if(d!=null)return a.subscribeToStateChange(l,{handlerIds:[d]})},[a,l]),r}function sw(a,s,i){return eE(s,a||(()=>({})),()=>i.reconnect())}function ow(a,s){const i=[];return typeof a!="function"&&i.push(a),G.useMemo(()=>typeof a=="function"?a():a,i)}function tE(a){return G.useMemo(()=>a.hooks.dragSource(),[a])}function sE(a){return G.useMemo(()=>a.hooks.dragPreview(),[a])}let Cp=!1,Tp=!1;class oE{receiveHandlerId(s){this.sourceId=s}getHandlerId(){return this.sourceId}canDrag(){De(!Cp,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Cp=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Cp=!1}}isDragging(){if(!this.sourceId)return!1;De(!Tp,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Tp=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Tp=!1}}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}isDraggingSource(s){return this.internalMonitor.isDraggingSource(s)}isOverTarget(s,i){return this.internalMonitor.isOverTarget(s,i)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(s){return this.internalMonitor.subscribeToOffsetChange(s)}canDragSource(s){return this.internalMonitor.canDragSource(s)}canDropOnTarget(s){return this.internalMonitor.canDropOnTarget(s)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.sourceId=null,this.internalMonitor=s.getMonitor()}}let kp=!1;class iE{receiveHandlerId(s){this.targetId=s}getHandlerId(){return this.targetId}subscribeToStateChange(s,i){return this.internalMonitor.subscribeToStateChange(s,i)}canDrop(){if(!this.targetId)return!1;De(!kp,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return kp=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{kp=!1}}isOver(s){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,s):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(s){this.targetId=null,this.internalMonitor=s.getMonitor()}}function nE(a,s,i){const r=i.getRegistry(),l=r.addTarget(a,s);return[l,()=>r.removeTarget(l)]}function rE(a,s,i){const r=i.getRegistry(),l=r.addSource(a,s);return[l,()=>r.removeSource(l)]}function og(a,s,i,r){let l;if(l!==void 0)return!!l;if(a===s)return!0;if(typeof a!="object"||!a||typeof s!="object"||!s)return!1;const u=Object.keys(a),d=Object.keys(s);if(u.length!==d.length)return!1;const g=Object.prototype.hasOwnProperty.bind(s);for(let m=0;m<u.length;m++){const f=u[m];if(!g(f))return!1;const v=a[f],w=s[f];if(l=void 0,l===!1||l===void 0&&v!==w)return!1}return!0}function ig(a){return a!==null&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,"current")}function aE(a){if(typeof a.type=="string")return;const s=a.type.displayName||a.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${s} into a <div>, or turn it into a drag source or a drop target itself.`)}function lE(a){return(s=null,i=null)=>{if(!G.isValidElement(s)){const u=s;return a(u,i),u}const r=s;return aE(r),cE(r,i?u=>a(u,i):a)}}function iw(a){const s={};return Object.keys(a).forEach(i=>{const r=a[i];if(i.endsWith("Ref"))s[i]=a[i];else{const l=lE(r);s[i]=()=>l}}),s}function Iy(a,s){typeof a=="function"?a(s):a.current=s}function cE(a,s){const i=a.ref;return De(typeof i!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),i?G.cloneElement(a,{ref:r=>{Iy(i,r),Iy(s,r)}}):G.cloneElement(a,{ref:s})}class uE{receiveHandlerId(s){this.handlerId!==s&&(this.handlerId=s,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(s){this.dragSourceOptionsInternal=s}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(s){this.dragPreviewOptionsInternal=s}reconnect(){const s=this.reconnectDragSource();this.reconnectDragPreview(s)}reconnectDragSource(){const s=this.dragSource,i=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return i&&this.disconnectDragSource(),this.handlerId?s?(i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=s,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,s,this.dragSourceOptions)),i):(this.lastConnectedDragSource=s,i):i}reconnectDragPreview(s=!1){const i=this.dragPreview,r=s||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!i){this.lastConnectedDragPreview=i;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=i,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,i,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!og(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!og(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(s){this.hooks=iw({dragSource:(i,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,ig(i)?this.dragSourceRef=i:this.dragSourceNode=i,this.reconnectDragSource()},dragPreview:(i,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,ig(i)?this.dragPreviewRef=i:this.dragPreviewNode=i,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=s}}class dE{get connectTarget(){return this.dropTarget}reconnect(){const s=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();s&&this.disconnectDropTarget();const i=this.dropTarget;if(this.handlerId){if(!i){this.lastConnectedDropTarget=i;return}s&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=i,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,i,this.dropTargetOptions))}}receiveHandlerId(s){s!==this.handlerId&&(this.handlerId=s,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(s){this.dropTargetOptionsInternal=s}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!og(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(s){this.hooks=iw({dropTarget:(i,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,ig(i)?this.dropTargetRef=i:this.dropTargetNode=i,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=s}}function fn(){const{dragDropManager:a}=G.useContext(K_);return De(a!=null,"Expected drag drop context"),a}function hE(a,s){const i=fn(),r=G.useMemo(()=>new uE(i.getBackend()),[i]);return li(()=>(r.dragSourceOptions=a||null,r.reconnect(),()=>r.disconnectDragSource()),[r,a]),li(()=>(r.dragPreviewOptions=s||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,s]),r}function pE(){const a=fn();return G.useMemo(()=>new oE(a),[a])}class gE{beginDrag(){const s=this.spec,i=this.monitor;let r=null;return typeof s.item=="object"?r=s.item:typeof s.item=="function"?r=s.item(i):r={},r??null}canDrag(){const s=this.spec,i=this.monitor;return typeof s.canDrag=="boolean"?s.canDrag:typeof s.canDrag=="function"?s.canDrag(i):!0}isDragging(s,i){const r=this.spec,l=this.monitor,{isDragging:u}=r;return u?u(l):i===s.getSourceId()}endDrag(){const s=this.spec,i=this.monitor,r=this.connector,{end:l}=s;l&&l(i.getItem(),i),r.reconnect()}constructor(s,i,r){this.spec=s,this.monitor=i,this.connector=r}}function mE(a,s,i){const r=G.useMemo(()=>new gE(a,s,i),[s,i]);return G.useEffect(()=>{r.spec=a},[a]),r}function fE(a){return G.useMemo(()=>{const s=a.type;return De(s!=null,"spec.type must be defined"),s},[a])}function $E(a,s,i){const r=fn(),l=mE(a,s,i),u=fE(a);li(function(){if(u!=null){const[g,m]=rE(u,l,r);return s.receiveHandlerId(g),i.receiveHandlerId(g),m}},[r,s,i,l,u])}function bE(a,s){const i=ow(a);De(!i.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=pE(),l=hE(i.options,i.previewOptions);return $E(i,r,l),[sw(i.collect,r,l),tE(l),sE(l)]}function vE(a){return G.useMemo(()=>a.hooks.dropTarget(),[a])}function yE(a){const