@hachej/boring-ui-cli 0.1.24 → 0.1.26
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/server/cli.js +465 -44
- package/dist/server/pluginDiscovery.js +36 -0
- package/dist/server/pluginFrontRuntime.js +1458 -0
- package/package.json +7 -7
- package/public/assets/DebugDrawer-kRj0QGoh.js +1 -0
- package/public/assets/_baseUniq-BaoahSEi.js +1 -0
- package/public/assets/angular-ts-BrjP3tb8.js +1 -1
- package/public/assets/angular-ts-BwZT4LLn.js +1 -1
- package/public/assets/apl-CORt7UWP.js +1 -1
- package/public/assets/apl-dKokRX4l.js +1 -1
- package/public/assets/arc-BGT9Yoor.js +1 -0
- package/public/assets/architectureDiagram-Q4EWVU46-8Fsx8Bw5.js +36 -0
- package/public/assets/astro-CbQHKStN.js +1 -1
- package/public/assets/astro-HNnZUWAn.js +1 -1
- package/public/assets/blade-BjGOyj-B.js +1 -1
- package/public/assets/blade-D4QpJJKB.js +1 -1
- package/public/assets/{blockDiagram-DXYQGD6D-DEkkj6Fh.js → blockDiagram-DXYQGD6D-CSD_8P6t.js} +5 -5
- package/public/assets/{c4Diagram-AHTNJAMY-CEZo72O7.js → c4Diagram-AHTNJAMY-BANFpiWc.js} +1 -1
- package/public/assets/channel-BdMajkgC.js +1 -0
- package/public/assets/{chunk-4BX2VUAB-kct9rMc4.js → chunk-4BX2VUAB-DwXbCZ7y.js} +1 -1
- package/public/assets/{chunk-4TB4RGXK-przR2bht.js → chunk-4TB4RGXK-Dk2hp0kY.js} +3 -3
- package/public/assets/{chunk-55IACEB6-BtFWJCbx.js → chunk-55IACEB6-CFeiGe8t.js} +1 -1
- package/public/assets/{chunk-EDXVE4YY-wnitHF3B.js → chunk-EDXVE4YY-B0SJv4ej.js} +1 -1
- package/public/assets/{chunk-FMBD7UC4-8PDhdiie.js → chunk-FMBD7UC4-BakGwea6.js} +1 -1
- package/public/assets/{chunk-OYMX7WX6-TDftW5K8.js → chunk-OYMX7WX6-Dq0T_fTM.js} +2 -2
- package/public/assets/{chunk-QZHKN3VN-B5vnQXaM.js → chunk-QZHKN3VN-B5OglTTC.js} +1 -1
- package/public/assets/{chunk-YZCP3GAM-CGg2izn8.js → chunk-YZCP3GAM-NDaB-kfw.js} +1 -1
- package/public/assets/classDiagram-6PBFFD2Q-B-lcy3NJ.js +1 -0
- package/public/assets/classDiagram-v2-HSJHXN6E-B-lcy3NJ.js +1 -0
- package/public/assets/clone-CQaScT6j.js +1 -0
- package/public/assets/cobol-nBiQ_Alo.js +1 -1
- package/public/assets/cobol-nwyudZeR.js +1 -1
- package/public/assets/{cose-bilkent-S5V4N54A-CjXKbjHV.js → cose-bilkent-S5V4N54A-C_XiHCxn.js} +1 -1
- package/public/assets/crystal-DNxU26gB.js +1 -1
- package/public/assets/crystal-tKQVLTB8.js +1 -1
- package/public/assets/{dagre-KV5264BT-D-wBcwT7.js → dagre-KV5264BT-DeKC0ZTS.js} +2 -2
- package/public/assets/diagram-5BDNPKRD-BI21qA6c.js +10 -0
- package/public/assets/diagram-G4DWMVQ6-DXlN6VCm.js +24 -0
- package/public/assets/diagram-MMDJMWI5-BCJkUUZU.js +43 -0
- package/public/assets/diagram-TYMM5635-C-KOEBZV.js +24 -0
- package/public/assets/edge-BkV0erSs.js +1 -1
- package/public/assets/edge-FbVlp4U3.js +1 -1
- package/public/assets/elixir-CDX3lj18.js +1 -1
- package/public/assets/elixir-CkH2-t6x.js +1 -1
- package/public/assets/{erDiagram-SMLLAGMA-CUWacc8b.js → erDiagram-SMLLAGMA-_vucZwTa.js} +2 -2
- package/public/assets/erb-B12qg9BL.js +1 -1
- package/public/assets/erb-BYCe7drp.js +1 -1
- package/public/assets/{flowDiagram-DWJPFMVM-DVIhUX7Z.js → flowDiagram-DWJPFMVM-CWye_WgN.js} +4 -4
- package/public/assets/{ganttDiagram-T4ZO3ILL-g3ncLabH.js → ganttDiagram-T4ZO3ILL-Cg6T_N_V.js} +3 -3
- package/public/assets/gitGraphDiagram-UUTBAWPF-CI6tYFw1.js +106 -0
- package/public/assets/glimmer-js-ByusRIyA.js +1 -1
- package/public/assets/glimmer-js-Rg0-pVw9.js +1 -1
- package/public/assets/glimmer-ts-BfAWNZQY.js +1 -1
- package/public/assets/glimmer-ts-U6CK756n.js +1 -1
- package/public/assets/{graph-CDl50skT.js → graph-Ci4pDE3A.js} +1 -1
- package/public/assets/hack-CaT9iCJl.js +1 -1
- package/public/assets/hack-i7_Ulhet.js +1 -1
- package/public/assets/haml-B8DHNrY2.js +1 -1
- package/public/assets/haml-D5jkg6IW.js +1 -1
- package/public/assets/handlebars-BL8al0AC.js +1 -1
- package/public/assets/handlebars-BpdQsYii.js +1 -1
- package/public/assets/highlighted-body-OFNGDK62-xGLlGy3l.js +1 -0
- package/public/assets/html-GMplVEZG.js +1 -1
- package/public/assets/html-derivative-BFtXZ54Q.js +1 -1
- package/public/assets/html-derivative-DlHx6ybY.js +1 -1
- package/public/assets/html-pp8916En.js +1 -1
- package/public/assets/index-BNz332Xu.js +1669 -0
- package/public/assets/index-D5qFagsx.css +1 -0
- package/public/assets/infoDiagram-42DDH7IO-CigcPMhk.js +2 -0
- package/public/assets/{ishikawaDiagram-UXIWVN3A-BbjR1GdS.js → ishikawaDiagram-UXIWVN3A-CDZTRajH.js} +4 -4
- package/public/assets/jinja-4LBKfQ-Z.js +1 -1
- package/public/assets/jinja-f2NsQr07.js +1 -1
- package/public/assets/{journeyDiagram-VCZTEJTY-DJHw1u4a.js → journeyDiagram-VCZTEJTY-C9MHFDJ6.js} +4 -4
- package/public/assets/just-Cw27pwNe.js +1 -1
- package/public/assets/just-VxiPbLrw.js +1 -1
- package/public/assets/{kanban-definition-6JOO6SKY-agbEFS20.js → kanban-definition-6JOO6SKY-Hpr02Gir.js} +7 -7
- package/public/assets/{layout-BtrYpvUW.js → layout-uDkQb6eL.js} +1 -1
- package/public/assets/{linear-C4IQ6Sya.js → linear-D9bVI_aq.js} +1 -1
- package/public/assets/liquid-C0sCDyMI.js +1 -1
- package/public/assets/liquid-DYVedYrR.js +1 -1
- package/public/assets/marko-CnJfTvn9.js +1 -1
- package/public/assets/marko-DjSrsDqO.js +1 -1
- package/public/assets/mdc-BMNejdWA.js +1 -1
- package/public/assets/mdc-DTYItulj.js +1 -1
- package/public/assets/{min-DDWmdqiX.js → min-T0CPelcS.js} +1 -1
- package/public/assets/{mindmap-definition-QFDTVHPH-By9_uC_s.js → mindmap-definition-QFDTVHPH-BxDJYpMb.js} +8 -8
- package/public/assets/nim-BIad80T-.js +1 -1
- package/public/assets/nim-CVrawwO9.js +1 -1
- package/public/assets/perl-C0TMdlhV.js +1 -1
- package/public/assets/perl-NvoQZIq0.js +1 -1
- package/public/assets/php-Dhbhpdrm.js +1 -1
- package/public/assets/php-R6g_5hLQ.js +1 -1
- package/public/assets/pieDiagram-DEJITSTG-C214NdS2.js +30 -0
- package/public/assets/pug-CGlum2m_.js +1 -1
- package/public/assets/pug-DKIMFp6K.js +1 -1
- package/public/assets/{quadrantDiagram-34T5L4WZ-BszNW2Gc.js → quadrantDiagram-34T5L4WZ-B4hldTdV.js} +3 -3
- package/public/assets/razor-BDqjjVU7.js +1 -1
- package/public/assets/razor-Uh8Bk_45.js +1 -1
- package/public/assets/{requirementDiagram-MS252O5E-fdyCkRN5.js → requirementDiagram-MS252O5E-Cv-IZSGz.js} +1 -1
- package/public/assets/rst-BrH8l1NY.js +1 -1
- package/public/assets/rst-CRjBmOyv.js +1 -1
- package/public/assets/ruby-Dw2BHqvy.js +1 -1
- package/public/assets/ruby-Wjq7vjNf.js +1 -1
- package/public/assets/{sankeyDiagram-XADWPNL6-tg2HOfl2.js → sankeyDiagram-XADWPNL6-C52Wx9t_.js} +2 -2
- package/public/assets/{sequenceDiagram-FGHM5R23-GF78cQ5y.js → sequenceDiagram-FGHM5R23-C9gRx_I2.js} +5 -5
- package/public/assets/soy-8wufbnw4.js +1 -1
- package/public/assets/soy-Brmx7dQM.js +1 -1
- package/public/assets/{stateDiagram-FHFEXIEX-C709lyuE.js → stateDiagram-FHFEXIEX-BVweWFAE.js} +1 -1
- package/public/assets/stateDiagram-v2-QKLJ7IA2-CftkpTOS.js +1 -0
- package/public/assets/svelte-C_ipcX3V.js +1 -1
- package/public/assets/svelte-Cy7k_4gC.js +1 -1
- package/public/assets/templ-DhtptRzy.js +1 -1
- package/public/assets/templ-P3uqSqPl.js +1 -1
- package/public/assets/{timeline-definition-GMOUNBTQ-D2y-83yP.js → timeline-definition-GMOUNBTQ-Boc8Q03t.js} +3 -3
- package/public/assets/ts-tags-DQrlYJgV.js +1 -1
- package/public/assets/ts-tags-zn1MmPIZ.js +1 -1
- package/public/assets/twig-DNn4PbVi.js +1 -1
- package/public/assets/twig-xg9kU7Mw.js +1 -1
- package/public/assets/vennDiagram-DHZGUBPP-BE8XjSYZ.js +34 -0
- package/public/assets/vue-D2xRrEX4.js +1 -1
- package/public/assets/vue-DN_0RTcg.js +1 -1
- package/public/assets/vue-vine-BoDAl6tE.js +1 -1
- package/public/assets/vue-vine-CQOfvN7w.js +1 -1
- package/public/assets/{wardley-RL74JXVD-NEg4mPyC.js → wardley-RL74JXVD-MQjS4K_T.js} +1 -1
- package/public/assets/{wardleyDiagram-NUSXRM2D-BbXAj99t.js → wardleyDiagram-NUSXRM2D-CKUw97nD.js} +2 -2
- package/public/assets/{xychartDiagram-5P7HB3ND-C8Y3cC5f.js → xychartDiagram-5P7HB3ND-OkP2T3uc.js} +3 -3
- package/public/index.html +2 -2
- package/templates/front-canonical.tsx +4 -2
- package/public/assets/CodeEditor-DQqOn4xz-BnYIpEQ0.js +0 -31
- package/public/assets/FileTree-DjPzfDMq-jOFMfLV-.js +0 -21
- package/public/assets/MarkdownEditor-BbSy0bLV-_8qFqqna.js +0 -254
- package/public/assets/_baseUniq-DysFpiFw.js +0 -1
- package/public/assets/arc-D0sqkACA.js +0 -1
- package/public/assets/architectureDiagram-Q4EWVU46-DnyELkA2.js +0 -36
- package/public/assets/channel-Ci4DEwaO.js +0 -1
- package/public/assets/classDiagram-6PBFFD2Q-0PAZNzgC.js +0 -1
- package/public/assets/classDiagram-v2-HSJHXN6E-0PAZNzgC.js +0 -1
- package/public/assets/clone-_lPYOTLf.js +0 -1
- package/public/assets/diagram-5BDNPKRD-Ch4e4G6h.js +0 -10
- package/public/assets/diagram-G4DWMVQ6-a_PPD1uY.js +0 -24
- package/public/assets/diagram-MMDJMWI5-D9Lkv8IB.js +0 -43
- package/public/assets/diagram-TYMM5635-BlfaVidf.js +0 -24
- package/public/assets/gitGraphDiagram-UUTBAWPF-DpPqglKx.js +0 -106
- package/public/assets/highlighted-body-OFNGDK62-BcVhfY0-.js +0 -1
- package/public/assets/index-C9S_GD0T.js +0 -1330
- package/public/assets/index-CrFvzn5a.js +0 -9
- package/public/assets/index-Css1pwyY.css +0 -1
- package/public/assets/index-Vcq4gwWv.js +0 -1
- package/public/assets/infoDiagram-42DDH7IO-COfGVlDB.js +0 -2
- package/public/assets/pieDiagram-DEJITSTG-DfzJSvMR.js +0 -30
- package/public/assets/stateDiagram-v2-QKLJ7IA2-BbgcVrKo.js +0 -1
- package/public/assets/vennDiagram-DHZGUBPP-BOsWwU4c.js +0 -34
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{bM as ir,r as h,bN as or,j as y,aP as un,bl as J,b_ as ln,b$ as cn,bX as dn,bW as fn}from"./index-C9S_GD0T.js";import{s as hn}from"./index-CrFvzn5a.js";/**
|
|
2
|
-
* @license lucide-react v1.8.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const gn=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],pn=ir("folder-open",gn);/**
|
|
7
|
-
* @license lucide-react v1.8.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const vn=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],yn=ir("folder",vn),ar=h.createContext(null);function A(){const t=h.useContext(ar);if(t===null)throw new Error("No Tree Api Provided");return t}const sr=h.createContext(null);function mn(){const t=h.useContext(sr);if(t===null)throw new Error("Provide a NodesContext");return t}const ur=h.createContext(null);function bn(){const t=h.useContext(ur);if(t===null)throw new Error("Provide a DnDContext");return t}const lr=h.createContext(0);function cr(){h.useContext(lr)}function de(t,e,r){return Math.max(Math.min(t,r),e)}function dr(t){return t&&t.isLeaf}function fr(t){return t&&t.isInternal&&!t.isOpen}function hr(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const gr=(t,e)=>{let r=t;for(;r;){if(r.id===e.id)return!0;r=r.parent}return!1},pr=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function Je(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let r of t.children){const n=Je(r,e);if(n)return n}return null}function ye(t,e){if(e(t),t.children)for(let r of t.children)ye(r,e)}function vr(t){const e=mr(t);let r;for(let n=0;n<e.length;++n)if(e[n]===t){r=On(e,n);break}r==null||r.focus()}function yr(t){const e=mr(t);let r;for(let n=0;n<e.length;++n)if(e[n]===t){r=Sn(e,n);break}r==null||r.focus()}function On(t,e){return e+1<t.length?t[e+1]:t[0]}function Sn(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function mr(t){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(e=>e===t||!t.contains(e))}function ie(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function br(t){return t===null?null:W(t)}function W(t){return typeof t=="string"?t:t.id}function Or(t,...e){if(t)return t(...e)}function Sr(t){return new Promise((e,r)=>{let n=0;function i(){n+=1,n===100&&r(),t()?e():setTimeout(i,10)}i()})}function Ir(t){var e,r;const n=t.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(e=t.root.children)===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0}function Dr(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const In=Object.freeze(Object.defineProperty({__proto__:null,access:ie,bound:de,dfs:Je,focusNextElement:vr,focusPrevElement:yr,getInsertIndex:Ir,getInsertParentId:Dr,identify:W,identifyNull:br,indexOf:pr,isClosed:fr,isDescendant:gr,isItem:dr,isOpenWithEmptyChildren:hr,safeRun:Or,waitFor:Sr,walk:ye},Symbol.toStringTag,{value:"Module"})),Dn={display:"flex",alignItems:"center",zIndex:1},Tn={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},wn={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Cn=or.memo(function({top:e,left:r,indent:n}){const i={position:"absolute",pointerEvents:"none",top:e-2+"px",left:r+"px",right:n+"px"};return y.jsxs("div",{style:Object.assign(Object.assign({},Dn),i),children:[y.jsx("div",{style:Object.assign({},wn)}),y.jsx("div",{style:Object.assign({},Tn)})]})});function En({node:t,attrs:e,innerRef:r,children:n}){return y.jsx("div",Object.assign({},e,{ref:r,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:n}))}function _n(t){return y.jsxs("div",{ref:t.dragHandle,style:t.style,children:[y.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"🌳":t.node.isOpen?"🗁":"🗀"})," ",t.node.isEditing?y.jsx(Nn,Object.assign({},t)):y.jsx(xn,Object.assign({},t))]})}function xn(t){return y.jsx(y.Fragment,{children:y.jsx("span",{children:t.node.data.name})})}function Nn({node:t}){const e=h.useRef();return h.useEffect(()=>{var r,n;(r=e.current)===null||r===void 0||r.focus(),(n=e.current)===null||n===void 0||n.select()},[]),y.jsx("input",{ref:e,defaultValue:t.data.name,onBlur:()=>t.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&t.reset(),r.key==="Enter"&&t.submit(((n=e.current)===null||n===void 0?void 0:n.value)||"")}})}function Ee(t){return{type:"EDIT",id:t}}function Pn(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t}function G(t){return{type:"FOCUS",id:t}}function Rn(){return{type:"TREE_BLUR"}}function kn(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t}class me{constructor(e){this.handleClick=r=>{r.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex}get isRoot(){return this.id===ae}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var e;return this.isSelected&&!(!((e=this.prev)===null||e===void 0)&&e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(!((e=this.next)===null||e===void 0)&&e.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,r;const n=this.childIndex;return(r=(e=this.parent)===null||e===void 0?void 0:e.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(e){if(!e)return!1;let r=e;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new me(Object.assign({},this))}edit(){return this.tree.edit(this)}}const ae="__REACT_ARBORIST_INTERNAL_ROOT__";function ct(t){var e;function r(o,a,s){const u=t.accessId(o),c=new me({tree:t,data:o,level:a,parent:s,id:u,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),d=t.accessChildren(o);return d&&(c.children=d.map(p=>r(p,a+1,c))),c}const n=new me({tree:t,id:ae,data:{id:ae},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=(e=t.props.data)!==null&&e!==void 0?e:[];return n.children=i.map(o=>r(o,0,n)),n}const Be={open(t,e){return{type:"VISIBILITY_OPEN",id:t,filtered:e}},close(t,e){return{type:"VISIBILITY_CLOSE",id:t,filtered:e}},toggle(t,e){return{type:"VISIBILITY_TOGGLE",id:t,filtered:e}},clear(t){return{type:"VISIBILITY_CLEAR",filtered:t}}};function dt(t={},e){if(e.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},t),{[e.id]:!0});if(e.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},t),{[e.id]:!1});if(e.type==="VISIBILITY_TOGGLE"){const r=t[e.id];return Object.assign(Object.assign({},t),{[e.id]:!r})}else return e.type==="VISIBILITY_CLEAR"?{}:t}function An(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:dt(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:dt(t.unfiltered,e)}):t}const Z=t=>{var e;return{nodes:{open:{filtered:{},unfiltered:(e=t==null?void 0:t.initialOpenState)!==null&&e!==void 0?e:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},$={clear:()=>({type:"SELECTION_CLEAR"}),only:t=>({type:"SELECTION_ONLY",id:W(t)}),add:t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(W)}),remove:t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(W)}),set:t=>Object.assign({type:"SELECTION_SET"},t),mostRecent:t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:W(t)}),anchor:t=>({type:"SELECTION_ANCHOR",id:t===null?null:W(t)})};function Mn(t=Z().nodes.selection,e){const r=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}}const ee={cursor(t){return{type:"DND_CURSOR",cursor:t}},dragStart(t,e){return{type:"DND_DRAG_START",id:t,dragIds:e}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(t,e){return{type:"DND_HOVERING",parentId:t,index:e}}};function jn(t=Z().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return Z().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}const Ln={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},$n=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e}px, ${r}px)`}},Fn=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e+10}px, ${r+10}px)`}};function Tr({offset:t,mouse:e,id:r,dragIds:n,isDragging:i}){return y.jsxs(Hn,{isDragging:i,children:[y.jsx(Un,{offset:t,children:y.jsx(Bn,{id:r,dragIds:n})}),y.jsx(zn,{mouse:e,count:n.length})]})}const Hn=h.memo(function(e){return e.isDragging?y.jsx("div",{style:Ln,children:e.children}):null});function Un(t){return y.jsx("div",{className:"row preview",style:$n(t.offset),children:t.children})}function zn(t){const{count:e,mouse:r}=t;return e>1?y.jsx("div",{className:"selected-count",style:Fn(r),children:e}):null}const Bn=h.memo(function(e){const r=A(),n=r.get(e.id);return n?y.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function We(){return We=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},We.apply(null,arguments)}function ft(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qe(t,e){return qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},qe(t,e)}function Wn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,qe(t,e)}var ht=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function qn(t,e){return!!(t===e||ht(t)&&ht(e))}function Vn(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!qn(t[r],e[r]))return!1;return!0}function _e(t,e){e===void 0&&(e=Vn);var r,n=[],i,o=!1;function a(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return o&&r===this&&e(s,n)||(i=t.apply(this,s),o=!0,r=this,n=s),i}return a}var Gn=typeof performance=="object"&&typeof performance.now=="function",gt=Gn?function(){return performance.now()}:function(){return Date.now()};function pt(t){cancelAnimationFrame(t.id)}function Kn(t,e){var r=gt();function n(){gt()-r>=e?t.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var xe=-1;function vt(t){if(t===void 0&&(t=!1),xe===-1||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(e),xe=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return xe}var K=null;function yt(t){if(t===void 0&&(t=!1),K===null||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?K="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?K="negative":K="positive-ascending"),document.body.removeChild(e),K}return K}var Yn=150,Xn=function(e,r){return e};function Qn(t){var e,r=t.getItemOffset,n=t.getEstimatedTotalSize,i=t.getItemSize,o=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,s=t.getStopIndexForStartIndex,u=t.initInstanceProps,c=t.shouldResetStyleCacheOnItemSizeChange,d=t.validateProps;return e=(function(p){Wn(b,p);function b(S){var l;return l=p.call(this,S)||this,l._instanceProps=u(l.props,ft(l)),l._outerRef=void 0,l._resetIsScrollingTimeoutId=null,l.state={instance:ft(l),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof l.props.initialScrollOffset=="number"?l.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},l._callOnItemsRendered=void 0,l._callOnItemsRendered=_e(function(f,g,v,O){return l.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:g,visibleStartIndex:v,visibleStopIndex:O})}),l._callOnScroll=void 0,l._callOnScroll=_e(function(f,g,v){return l.props.onScroll({scrollDirection:f,scrollOffset:g,scrollUpdateWasRequested:v})}),l._getItemStyle=void 0,l._getItemStyle=function(f){var g=l.props,v=g.direction,O=g.itemSize,w=g.layout,D=l._getItemStyleCache(c&&O,c&&w,c&&v),E;if(D.hasOwnProperty(f))E=D[f];else{var _=r(l.props,f,l._instanceProps),T=i(l.props,f,l._instanceProps),x=v==="horizontal"||w==="horizontal",N=v==="rtl",H=x?_:0;D[f]=E={position:"absolute",left:N?void 0:H,right:N?H:void 0,top:x?0:_,height:x?"100%":T,width:x?T:"100%"}}return E},l._getItemStyleCache=void 0,l._getItemStyleCache=_e(function(f,g,v){return{}}),l._onScrollHorizontal=function(f){var g=f.currentTarget,v=g.clientWidth,O=g.scrollLeft,w=g.scrollWidth;l.setState(function(D){if(D.scrollOffset===O)return null;var E=l.props.direction,_=O;if(E==="rtl")switch(yt()){case"negative":_=-O;break;case"positive-descending":_=w-v-O;break}return _=Math.max(0,Math.min(_,w-v)),{isScrolling:!0,scrollDirection:D.scrollOffset<_?"forward":"backward",scrollOffset:_,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._onScrollVertical=function(f){var g=f.currentTarget,v=g.clientHeight,O=g.scrollHeight,w=g.scrollTop;l.setState(function(D){if(D.scrollOffset===w)return null;var E=Math.max(0,Math.min(w,O-v));return{isScrolling:!0,scrollDirection:D.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._outerRefSetter=function(f){var g=l.props.outerRef;l._outerRef=f,typeof g=="function"?g(f):g!=null&&typeof g=="object"&&g.hasOwnProperty("current")&&(g.current=f)},l._resetIsScrollingDebounced=function(){l._resetIsScrollingTimeoutId!==null&&pt(l._resetIsScrollingTimeoutId),l._resetIsScrollingTimeoutId=Kn(l._resetIsScrolling,Yn)},l._resetIsScrolling=function(){l._resetIsScrollingTimeoutId=null,l.setState({isScrolling:!1},function(){l._getItemStyleCache(-1,null)})},l}b.getDerivedStateFromProps=function(l,f){return Jn(l,f),d(l),null};var m=b.prototype;return m.scrollTo=function(l){l=Math.max(0,l),this.setState(function(f){return f.scrollOffset===l?null:{scrollDirection:f.scrollOffset<l?"forward":"backward",scrollOffset:l,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(l,f){f===void 0&&(f="auto");var g=this.props,v=g.itemCount,O=g.layout,w=this.state.scrollOffset;l=Math.max(0,Math.min(l,v-1));var D=0;if(this._outerRef){var E=this._outerRef;O==="vertical"?D=E.scrollWidth>E.clientWidth?vt():0:D=E.scrollHeight>E.clientHeight?vt():0}this.scrollTo(o(this.props,l,f,w,this._instanceProps,D))},m.componentDidMount=function(){var l=this.props,f=l.direction,g=l.initialScrollOffset,v=l.layout;if(typeof g=="number"&&this._outerRef!=null){var O=this._outerRef;f==="horizontal"||v==="horizontal"?O.scrollLeft=g:O.scrollTop=g}this._callPropsCallbacks()},m.componentDidUpdate=function(){var l=this.props,f=l.direction,g=l.layout,v=this.state,O=v.scrollOffset,w=v.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var D=this._outerRef;if(f==="horizontal"||g==="horizontal")if(f==="rtl")switch(yt()){case"negative":D.scrollLeft=-O;break;case"positive-ascending":D.scrollLeft=O;break;default:var E=D.clientWidth,_=D.scrollWidth;D.scrollLeft=_-E-O;break}else D.scrollLeft=O;else D.scrollTop=O}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&pt(this._resetIsScrollingTimeoutId)},m.render=function(){var l=this.props,f=l.children,g=l.className,v=l.direction,O=l.height,w=l.innerRef,D=l.innerElementType,E=l.innerTagName,_=l.itemCount,T=l.itemData,x=l.itemKey,N=x===void 0?Xn:x,H=l.layout,B=l.outerElementType,en=l.outerTagName,tn=l.style,rn=l.useIsScrolling,nn=l.width,at=this.state.isScrolling,Ce=v==="horizontal"||H==="horizontal",on=Ce?this._onScrollHorizontal:this._onScrollVertical,st=this._getRangeToRender(),an=st[0],sn=st[1],ut=[];if(_>0)for(var te=an;te<=sn;te++)ut.push(h.createElement(f,{data:T,key:N(te,T),index:te,isScrolling:rn?at:void 0,style:this._getItemStyle(te)}));var lt=n(this.props,this._instanceProps);return h.createElement(B||en||"div",{className:g,onScroll:on,ref:this._outerRefSetter,style:We({position:"relative",height:O,width:nn,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:v},tn)},h.createElement(D||E||"div",{children:ut,ref:w,style:{height:Ce?"100%":lt,pointerEvents:at?"none":void 0,width:Ce?lt:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var l=this.props.itemCount;if(l>0){var f=this._getRangeToRender(),g=f[0],v=f[1],O=f[2],w=f[3];this._callOnItemsRendered(g,v,O,w)}}if(typeof this.props.onScroll=="function"){var D=this.state,E=D.scrollDirection,_=D.scrollOffset,T=D.scrollUpdateWasRequested;this._callOnScroll(E,_,T)}},m._getRangeToRender=function(){var l=this.props,f=l.itemCount,g=l.overscanCount,v=this.state,O=v.isScrolling,w=v.scrollDirection,D=v.scrollOffset;if(f===0)return[0,0,0,0];var E=a(this.props,D,this._instanceProps),_=s(this.props,E,D,this._instanceProps),T=!O||w==="backward"?Math.max(1,g):1,x=!O||w==="forward"?Math.max(1,g):1;return[Math.max(0,E-T),Math.max(0,Math.min(f-1,_+x)),E,_]},b})(h.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Jn=function(e,r){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,r.instance},Zn=Qn({getItemOffset:function(e,r){var n=e.itemSize;return r*n},getItemSize:function(e,r){var n=e.itemSize;return n},getEstimatedTotalSize:function(e){var r=e.itemCount,n=e.itemSize;return n*r},getOffsetForIndexAndAlignment:function(e,r,n,i,o,a){var s=e.direction,u=e.height,c=e.itemCount,d=e.itemSize,p=e.layout,b=e.width,m=s==="horizontal"||p==="horizontal",S=m?b:u,l=Math.max(0,c*d-S),f=Math.min(l,r*d),g=Math.max(0,r*d-S+d+a);switch(n==="smart"&&(i>=g-S&&i<=f+S?n="auto":n="center"),n){case"start":return f;case"end":return g;case"center":{var v=Math.round(g+(f-g)/2);return v<Math.ceil(S/2)?0:v>l+Math.floor(S/2)?l:v}case"auto":default:return i>=g&&i<=f?i:i<g?g:f}},getStartIndexForOffset:function(e,r){var n=e.itemCount,i=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/i)))},getStopIndexForStartIndex:function(e,r,n){var i=e.direction,o=e.height,a=e.itemCount,s=e.itemSize,u=e.layout,c=e.width,d=i==="horizontal"||u==="horizontal",p=r*s,b=d?c:o,m=Math.ceil((b+n-p)/s);return Math.max(0,Math.min(a-1,r+m-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function ei(){var t,e;const r=A(),i=bn().cursor;if(!i||i.type!=="line")return null;const o=r.indent,a=r.rowHeight*i.index+((e=(t=r.props.padding)!==null&&t!==void 0?t:r.props.paddingTop)!==null&&e!==void 0?e:0),s=o*i.level,u=r.renderCursor;return y.jsx(u,{top:a,left:s,indent:o})}var ti=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const ri=h.forwardRef(function(e,r){const{children:n}=e,i=ti(e,["children"]),o=A();return y.jsxs("div",Object.assign({ref:r},i,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[y.jsx(ni,{}),n]}))}),ni=()=>{const t=A();return y.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:y.jsx(ei,{})})};var ii=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const oi=h.forwardRef(function(e,r){var n,i,o,a,{style:s}=e,u=ii(e,["style"]);const c=A(),d=(i=(n=c.props.padding)!==null&&n!==void 0?n:c.props.paddingTop)!==null&&i!==void 0?i:0,p=(a=(o=c.props.padding)!==null&&o!==void 0?o:c.props.paddingBottom)!==null&&a!==void 0?a:0;return y.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+d+p}px`})},u))});var wr=h.createContext({dragDropManager:void 0}),L;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(L||(L={}));function I(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];if(!t){var o;if(e===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;o=new Error(e.replace(/%s/g,function(){return n[a++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var Ze="dnd-core/INIT_COORDS",Se="dnd-core/BEGIN_DRAG",et="dnd-core/PUBLISH_DRAG_SOURCE",Ie="dnd-core/HOVER",De="dnd-core/DROP",Te="dnd-core/END_DRAG";function mt(t,e){return{type:Ze,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function fe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(r){return typeof r}:fe=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},fe(t)}function ai(t,e,r){return e.split(".").reduce(function(n,i){return n&&n[i]?n[i]:r||null},t)}function si(t,e){return t.filter(function(r){return r!==e})}function Cr(t){return fe(t)==="object"}function ui(t,e){var r=new Map,n=function(a){r.set(a,r.has(a)?r.get(a)+1:1)};t.forEach(n),e.forEach(n);var i=[];return r.forEach(function(o,a){o===1&&i.push(a)}),i}function li(t,e){return t.filter(function(r){return e.indexOf(r)>-1})}var ci={type:Ze,payload:{clientOffset:null,sourceClientOffset:null}};function di(t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},i=n.publishSource,o=i===void 0?!0:i,a=n.clientOffset,s=n.getSourceClientOffset,u=t.getMonitor(),c=t.getRegistry();t.dispatch(mt(a)),fi(r,u,c);var d=pi(r,u);if(d===null){t.dispatch(ci);return}var p=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");hi(s),p=s(d)}t.dispatch(mt(a,p));var b=c.getSource(d),m=b.beginDrag(u,d);if(m!=null){gi(m),c.pinSource(d);var S=c.getSourceType(d);return{type:Se,payload:{itemType:S,item:m,sourceId:d,clientOffset:a||null,sourceClientOffset:p||null,isSourcePublic:!!o}}}}}function fi(t,e,r){I(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(n){I(r.getSource(n),"Expected sourceIds to be registered.")})}function hi(t){I(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function gi(t){I(Cr(t),"Item must be an object.")}function pi(t,e){for(var r=null,n=t.length-1;n>=0;n--)if(e.canDragSource(t[n])){r=t[n];break}return r}function vi(t){return function(){var r=t.getMonitor();if(r.isDragging())return{type:et}}}function Ve(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(r){return r===e}):t===e}function yi(t){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.clientOffset;mi(r);var o=r.slice(0),a=t.getMonitor(),s=t.getRegistry();bi(o,a,s);var u=a.getItemType();return Oi(o,s,u),Si(o,a,s),{type:Ie,payload:{targetIds:o,clientOffset:i||null}}}}function mi(t){I(Array.isArray(t),"Expected targetIds to be an array.")}function bi(t,e,r){I(e.isDragging(),"Cannot call hover while not dragging."),I(!e.didDrop(),"Cannot call hover after drop.");for(var n=0;n<t.length;n++){var i=t[n];I(t.lastIndexOf(i)===n,"Expected targetIds to be unique in the passed array.");var o=r.getTarget(i);I(o,"Expected targetIds to be registered.")}}function Oi(t,e,r){for(var n=t.length-1;n>=0;n--){var i=t[n],o=e.getTargetType(i);Ve(o,r)||t.splice(n,1)}}function Si(t,e,r){t.forEach(function(n){var i=r.getTarget(n);i.hover(e,n)})}function bt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ot(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bt(Object(r),!0).forEach(function(n){Ii(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ii(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Di(t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),i=t.getRegistry();Ti(n);var o=Ei(n);o.forEach(function(a,s){var u=wi(a,s,i,n),c={type:De,payload:{dropResult:Ot(Ot({},r),u)}};t.dispatch(c)})}}function Ti(t){I(t.isDragging(),"Cannot call drop while not dragging."),I(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function wi(t,e,r,n){var i=r.getTarget(t),o=i?i.drop(n,t):void 0;return Ci(o),typeof o>"u"&&(o=e===0?{}:n.getDropResult()),o}function Ci(t){I(typeof t>"u"||Cr(t),"Drop result must either be an object or undefined.")}function Ei(t){var e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function _i(t){return function(){var r=t.getMonitor(),n=t.getRegistry();xi(r);var i=r.getSourceId();if(i!=null){var o=n.getSource(i,!0);o.endDrag(r,i),n.unpinSource()}return{type:Te}}}function xi(t){I(t.isDragging(),"Cannot call endDrag while not dragging.")}function Ni(t){return{beginDrag:di(t),publishDragSource:vi(t),hover:yi(t),drop:Di(t),endDrag:_i(t)}}function Pi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ri(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ki(t,e,r){return e&&Ri(t.prototype,e),t}function re(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ai=(function(){function t(e,r){var n=this;Pi(this,t),re(this,"store",void 0),re(this,"monitor",void 0),re(this,"backend",void 0),re(this,"isSetUp",!1),re(this,"handleRefCountChange",function(){var i=n.store.getState().refCount>0;n.backend&&(i&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!i&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=e,this.monitor=r,e.subscribe(this.handleRefCountChange)}return ki(t,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function i(a){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var d=a.apply(r,u);typeof d<"u"&&n(d)}}var o=Ni(this);return Object.keys(o).reduce(function(a,s){var u=o[s];return a[s]=i(u),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),t})();function M(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var St=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),It=function(){return Math.random().toString(36).substring(7).split("").join(".")},Dt={INIT:"@@redux/INIT"+It(),REPLACE:"@@redux/REPLACE"+It()};function Mi(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Er(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(M(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(M(1));return r(Er)(t,e)}if(typeof t!="function")throw new Error(M(2));var i=t,o=e,a=[],s=a,u=!1;function c(){s===a&&(s=a.slice())}function d(){if(u)throw new Error(M(3));return o}function p(l){if(typeof l!="function")throw new Error(M(4));if(u)throw new Error(M(5));var f=!0;return c(),s.push(l),function(){if(f){if(u)throw new Error(M(6));f=!1,c();var v=s.indexOf(l);s.splice(v,1),a=null}}}function b(l){if(!Mi(l))throw new Error(M(7));if(typeof l.type>"u")throw new Error(M(8));if(u)throw new Error(M(9));try{u=!0,o=i(o,l)}finally{u=!1}for(var f=a=s,g=0;g<f.length;g++){var v=f[g];v()}return l}function m(l){if(typeof l!="function")throw new Error(M(10));i=l,b({type:Dt.REPLACE})}function S(){var l,f=p;return l={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(M(11));function O(){v.next&&v.next(d())}O();var w=f(O);return{unsubscribe:w}}},l[St]=function(){return this},l}return b({type:Dt.INIT}),n={dispatch:b,subscribe:p,getState:d,replaceReducer:m},n[St]=S,n}var ji=function(e,r){return e===r};function Li(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function $i(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ji;if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!r(t[n],e[n]))return!1;return!0}function Tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function wt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(r),!0).forEach(function(n){Fi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ct={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Hi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ct,e=arguments.length>1?arguments[1]:void 0,r=e.payload;switch(e.type){case Ze:case Se:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Ie:return Li(t.clientOffset,r.clientOffset)?t:wt(wt({},t),{},{clientOffset:r.clientOffset});case Te:case De:return Ct;default:return t}}var tt="dnd-core/ADD_SOURCE",rt="dnd-core/ADD_TARGET",nt="dnd-core/REMOVE_SOURCE",we="dnd-core/REMOVE_TARGET";function Ui(t){return{type:tt,payload:{sourceId:t}}}function zi(t){return{type:rt,payload:{targetId:t}}}function Bi(t){return{type:nt,payload:{sourceId:t}}}function Wi(t){return{type:we,payload:{targetId:t}}}function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function j(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Et(Object(r),!0).forEach(function(n){qi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Vi={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Gi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vi,e=arguments.length>1?arguments[1]:void 0,r=e.payload;switch(e.type){case Se:return j(j({},t),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case et:return j(j({},t),{},{isSourcePublic:!0});case Ie:return j(j({},t),{},{targetIds:r.targetIds});case we:return t.targetIds.indexOf(r.targetId)===-1?t:j(j({},t),{},{targetIds:si(t.targetIds,r.targetId)});case De:return j(j({},t),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Te:return j(j({},t),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Ki(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case tt:case rt:return t+1;case nt:case we:return t-1;default:return t}}var be=[],it=[];be.__IS_NONE__=!0;it.__IS_ALL__=!0;function Yi(t,e){if(t===be)return!1;if(t===it||typeof e>"u")return!0;var r=li(e,t);return r.length>0}function Xi(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ie:break;case tt:case rt:case we:case nt:return be;case Se:case et:case Te:case De:default:return it}var e=t.payload,r=e.targetIds,n=r===void 0?[]:r,i=e.prevTargetIds,o=i===void 0?[]:i,a=ui(n,o),s=a.length>0||!$i(n,o);if(!s)return be;var u=o[o.length-1],c=n[n.length-1];return u!==c&&(u&&a.push(u),c&&a.push(c)),a}function Qi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return t+1}function _t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function xt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_t(Object(r),!0).forEach(function(n){Ji(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ji(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Xi(t.dirtyHandlerIds,{type:e.type,payload:xt(xt({},e.payload),{},{prevTargetIds:ai(t,"dragOperation.targetIds",[])})}),dragOffset:Hi(t.dragOffset,e),refCount:Ki(t.refCount,e),dragOperation:Gi(t.dragOperation,e),stateId:Qi(t.stateId)}}function eo(t,e){return{x:t.x+e.x,y:t.y+e.y}}function _r(t,e){return{x:t.x-e.x,y:t.y-e.y}}function to(t){var e=t.clientOffset,r=t.initialClientOffset,n=t.initialSourceClientOffset;return!e||!r||!n?null:_r(eo(e,n),r)}function ro(t){var e=t.clientOffset,r=t.initialClientOffset;return!e||!r?null:_r(e,r)}function no(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function io(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function oo(t,e,r){return e&&io(t.prototype,e),t}function Nt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ao=(function(){function t(e,r){no(this,t),Nt(this,"store",void 0),Nt(this,"registry",void 0),this.store=e,this.registry=r}return oo(t,[{key:"subscribeToStateChange",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=i.handlerIds;I(typeof r=="function","listener must be a function."),I(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,s=function(){var c=n.store.getState(),d=c.stateId;try{var p=d===a||d===a+1&&!Yi(c.dirtyHandlerIds,o);p||r()}finally{a=d}};return this.store.subscribe(s)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;I(typeof r=="function","listener must be a function.");var i=this.store.getState().dragOffset,o=function(){var s=n.store.getState().dragOffset;s!==i&&(i=s,r())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return I(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(I(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var i=this.registry.getTargetType(r),o=this.getItemType();return Ve(i,o)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(I(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var i=this.registry.getSourceType(r),o=this.getItemType();return i!==o?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var i=n.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(r),a=this.getItemType();if(a&&!Ve(o,a))return!1;var s=this.getTargetIds();if(!s.length)return!1;var u=s.indexOf(r);return i?u===s.length-1:u>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return to(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return ro(this.store.getState().dragOffset)}}]),t})(),so=0;function uo(){return so++}function he(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?he=function(r){return typeof r}:he=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},he(t)}function lo(t){I(typeof t.canDrag=="function","Expected canDrag to be a function."),I(typeof t.beginDrag=="function","Expected beginDrag to be a function."),I(typeof t.endDrag=="function","Expected endDrag to be a function.")}function co(t){I(typeof t.canDrop=="function","Expected canDrop to be a function."),I(typeof t.hover=="function","Expected hover to be a function."),I(typeof t.drop=="function","Expected beginDrag to be a function.")}function Ge(t,e){if(e&&Array.isArray(t)){t.forEach(function(r){return Ge(r,!1)});return}I(typeof t=="string"||he(t)==="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Pt=typeof global<"u"?global:self,xr=Pt.MutationObserver||Pt.WebKitMutationObserver;function Nr(t){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),t()}}}function fo(t){let e=1;const r=new xr(t),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){e=-e,n.data=e}}const ho=typeof xr=="function"?fo:Nr;class go{enqueueTask(e){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const r=this.index;if(this.index++,e[r].call(),this.index>this.capacity){for(let n=0,i=e.length-this.index;n<i;n++)e[n]=e[n+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=ho(this.flush),this.requestErrorThrow=Nr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class po{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,r){this.onError=e,this.release=r,this.task=null}}class vo{create(e){const r=this.freeTasks,n=r.length?r.pop():new po(this.onError,i=>r[r.length]=i);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}const Pr=new go,yo=new vo(Pr.registerPendingError);function mo(t){Pr.enqueueTask(yo.create(t))}function bo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function So(t,e,r){return e&&Oo(t.prototype,e),t}function Y(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Io(t,e){return Co(t)||wo(t,e)||To(t,e)||Do()}function Do(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function To(t,e){if(t){if(typeof t=="string")return Rt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rt(t,e)}}function Rt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wo(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Co(t){if(Array.isArray(t))return t}function Eo(t){var e=uo().toString();switch(t){case L.SOURCE:return"S".concat(e);case L.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function kt(t){switch(t[0]){case"S":return L.SOURCE;case"T":return L.TARGET;default:I(!1,"Cannot parse handler ID: ".concat(t))}}function At(t,e){var r=t.entries(),n=!1;do{var i=r.next(),o=i.done,a=Io(i.value,2),s=a[1];if(s===e)return!0;n=!!o}while(!n);return!1}var _o=(function(){function t(e){bo(this,t),Y(this,"types",new Map),Y(this,"dragSources",new Map),Y(this,"dropTargets",new Map),Y(this,"pinnedSourceId",null),Y(this,"pinnedSource",null),Y(this,"store",void 0),this.store=e}return So(t,[{key:"addSource",value:function(r,n){Ge(r),lo(n);var i=this.addHandler(L.SOURCE,r,n);return this.store.dispatch(Ui(i)),i}},{key:"addTarget",value:function(r,n){Ge(r,!0),co(n);var i=this.addHandler(L.TARGET,r,n);return this.store.dispatch(zi(i)),i}},{key:"containsHandler",value:function(r){return At(this.dragSources,r)||At(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;I(this.isSourceId(r),"Expected a valid source ID.");var i=n&&r===this.pinnedSourceId,o=i?this.pinnedSource:this.dragSources.get(r);return o}},{key:"getTarget",value:function(r){return I(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return I(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return I(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=kt(r);return n===L.SOURCE}},{key:"isTargetId",value:function(r){var n=kt(r);return n===L.TARGET}},{key:"removeSource",value:function(r){var n=this;I(this.getSource(r),"Expected an existing source."),this.store.dispatch(Bi(r)),mo(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){I(this.getTarget(r),"Expected an existing target."),this.store.dispatch(Wi(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);I(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){I(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,i){var o=Eo(r);return this.types.set(o,n),r===L.SOURCE?this.dragSources.set(o,i):r===L.TARGET&&this.dropTargets.set(o,i),o}}]),t})();function Rr(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=xo(n),o=new ao(i,new _o(i)),a=new Ai(i,o),s=t(a,e,r);return a.receiveBackend(s),a}function xo(t){var e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Er(Zi,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}var No=["children"];function Po(t,e){return Mo(t)||Ao(t,e)||ko(t,e)||Ro()}function Ro(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
13
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ko(t,e){if(t){if(typeof t=="string")return Mt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mt(t,e)}}function Mt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ao(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Mo(t){if(Array.isArray(t))return t}function jo(t,e){if(t==null)return{};var r=Lo(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Lo(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var jt=0,ge=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),$o=h.memo(function(e){var r=e.children,n=jo(e,No),i=Fo(n),o=Po(i,2),a=o[0],s=o[1];return h.useEffect(function(){if(s){var u=kr();return++jt,function(){--jt===0&&(u[ge]=null)}}},[]),y.jsx(wr.Provider,Object.assign({value:a},{children:r}),void 0)});function Fo(t){if("manager"in t){var e={dragDropManager:t.manager};return[e,!1]}var r=Ho(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[r,n]}function Ho(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kr(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=e;return i[ge]||(i[ge]={dragDropManager:Rr(t,e,r,n)}),i[ge]}function kr(){return typeof global<"u"?global:window}function Uo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Bo(t,e,r){return e&&zo(t.prototype,e),t}function Lt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ne=!1,Pe=!1,Wo=(function(){function t(e){Uo(this,t),Lt(this,"internalMonitor",void 0),Lt(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return Bo(t,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){I(!Ne,"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 Ne=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Ne=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;I(!Pe,"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 Pe=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pe=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t})();function qo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Go(t,e,r){return e&&Vo(t.prototype,e),t}function $t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Re=!1,Ko=(function(){function t(e){qo(this,t),$t(this,"internalMonitor",void 0),$t(this,"targetId",null),this.internalMonitor=e.getMonitor()}return Go(t,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;I(!Re,"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 Re=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Re=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t})();function Yo(t){if(typeof t.type!="string"){var e=t.type.displayName||t.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(e," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function Xo(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!h.isValidElement(e)){var n=e;return t(n,r),n}var i=e;Yo(i);var o=r?function(a){return t(a,r)}:t;return Qo(i,o)}}function Ar(t){var e={};return Object.keys(t).forEach(function(r){var n=t[r];if(r.endsWith("Ref"))e[r]=t[r];else{var i=Xo(n);e[r]=function(){return i}}}),e}function Ft(t,e){typeof t=="function"?t(e):t.current=e}function Qo(t,e){var r=t.ref;return I(typeof r!="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"),r?h.cloneElement(t,{ref:function(i){Ft(r,i),Ft(e,i)}}):h.cloneElement(t,{ref:e})}function pe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pe=function(r){return typeof r}:pe=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pe(t)}function Ke(t){return t!==null&&pe(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ye(t,e,r,n){var i=void 0;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),u=0;u<o.length;u++){var c=o[u];if(!s(c))return!1;var d=t[c],p=e[c];if(i=void 0,i===!1||i===void 0&&d!==p)return!1}return!0}function Jo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ea(t,e,r){return e&&Zo(t.prototype,e),t}function R(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ta=(function(){function t(e){var r=this;Jo(this,t),R(this,"hooks",Ar({dragSource:function(i,o){r.clearDragSource(),r.dragSourceOptions=o||null,Ke(i)?r.dragSourceRef=i:r.dragSourceNode=i,r.reconnectDragSource()},dragPreview:function(i,o){r.clearDragPreview(),r.dragPreviewOptions=o||null,Ke(i)?r.dragPreviewRef=i:r.dragPreviewNode=i,r.reconnectDragPreview()}})),R(this,"handlerId",null),R(this,"dragSourceRef",null),R(this,"dragSourceNode",void 0),R(this,"dragSourceOptionsInternal",null),R(this,"dragSourceUnsubscribe",void 0),R(this,"dragPreviewRef",null),R(this,"dragPreviewNode",void 0),R(this,"dragPreviewOptionsInternal",null),R(this,"dragPreviewUnsubscribe",void 0),R(this,"lastConnectedHandlerId",null),R(this,"lastConnectedDragSource",null),R(this,"lastConnectedDragSourceOptions",null),R(this,"lastConnectedDragPreview",null),R(this,"lastConnectedDragPreviewOptions",null),R(this,"backend",void 0),this.backend=e}return ea(t,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Ye(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Ye(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),t})();function ra(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ia(t,e,r){return e&&na(t.prototype,e),t}function U(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var oa=(function(){function t(e){var r=this;ra(this,t),U(this,"hooks",Ar({dropTarget:function(i,o){r.clearDropTarget(),r.dropTargetOptions=o,Ke(i)?r.dropTargetRef=i:r.dropTargetNode=i,r.reconnect()}})),U(this,"handlerId",null),U(this,"dropTargetRef",null),U(this,"dropTargetNode",void 0),U(this,"dropTargetOptionsInternal",null),U(this,"unsubscribeDropTarget",void 0),U(this,"lastConnectedHandlerId",null),U(this,"lastConnectedDropTarget",null),U(this,"lastConnectedDropTargetOptions",null),U(this,"backend",void 0),this.backend=e}return ia(t,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Ye(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),t})();function aa(t,e,r){var n=r.getRegistry(),i=n.addTarget(t,e);return[i,function(){return n.removeTarget(i)}]}function sa(t,e,r){var n=r.getRegistry(),i=n.addSource(t,e);return[i,function(){return n.removeSource(i)}]}var q=typeof window<"u"?h.useLayoutEffect:h.useEffect;function ve(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ve=function(r){return typeof r}:ve=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ve(t)}function ua(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function la(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ca(t,e,r){return e&&la(t.prototype,e),t}function ke(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var da=(function(){function t(e,r,n){ua(this,t),ke(this,"spec",void 0),ke(this,"monitor",void 0),ke(this,"connector",void 0),this.spec=e,this.monitor=r,this.connector=n}return ca(t,[{key:"beginDrag",value:function(){var r,n=this.spec,i=this.monitor,o=null;return ve(n.item)==="object"?o=n.item:typeof n.item=="function"?o=n.item(i):o={},(r=o)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var i=this.spec,o=this.monitor,a=i.isDragging;return a?a(o):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,i=this.connector,o=r.end;o&&o(n.getItem(),n),i.reconnect()}}]),t})();function fa(t,e,r){var n=h.useMemo(function(){return new da(t,e,r)},[e,r]);return h.useEffect(function(){n.spec=t},[t]),n}function V(){var t=h.useContext(wr),e=t.dragDropManager;return I(e!=null,"Expected drag drop context"),e}function ha(t){return h.useMemo(function(){var e=t.type;return I(e!=null,"spec.type must be defined"),e},[t])}function ga(t,e){return ma(t)||ya(t,e)||va(t,e)||pa()}function pa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
14
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function va(t,e){if(t){if(typeof t=="string")return Ht(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ht(t,e)}}function Ht(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ya(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function ma(t){if(Array.isArray(t))return t}function ba(t,e,r){var n=V(),i=fa(t,e,r),o=ha(t);q(function(){if(o!=null){var s=sa(o,i,n),u=ga(s,2),c=u[0],d=u[1];return e.receiveHandlerId(c),r.receiveHandlerId(c),d}},[n,e,r,i,o])}function Oa(t){return Ta(t)||Da(t)||Ia(t)||Sa()}function Sa(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
15
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ia(t,e){if(t){if(typeof t=="string")return Xe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xe(t,e)}}function Da(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ta(t){if(Array.isArray(t))return Xe(t)}function Xe(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Mr(t,e){var r=Oa(e||[]);return e==null&&typeof t!="function"&&r.push(t),h.useMemo(function(){return typeof t=="function"?t():t},r)}function wa(){var t=V();return h.useMemo(function(){return new Wo(t)},[t])}function Ca(t,e){var r=V(),n=h.useMemo(function(){return new ta(r.getBackend())},[r]);return q(function(){return n.dragSourceOptions=t||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,t]),q(function(){return n.dragPreviewOptions=e||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,e]),n}var Ae,Ut;function Ea(){return Ut||(Ut=1,Ae=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}),Ae}var _a=Ea();const xa=un(_a);function Na(t,e){return Aa(t)||ka(t,e)||Ra(t,e)||Pa()}function Pa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
16
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ra(t,e){if(t){if(typeof t=="string")return zt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zt(t,e)}}function zt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ka(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Aa(t){if(Array.isArray(t))return t}function jr(t,e,r){var n=h.useState(function(){return e(t)}),i=Na(n,2),o=i[0],a=i[1],s=h.useCallback(function(){var u=e(t);xa(o,u)||(a(u),r&&r())},[o,t,r]);return q(s),[o,s]}function Ma(t,e){return Fa(t)||$a(t,e)||La(t,e)||ja()}function ja(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
17
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function La(t,e){if(t){if(typeof t=="string")return Bt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bt(t,e)}}function Bt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $a(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Fa(t){if(Array.isArray(t))return t}function Ha(t,e,r){var n=jr(t,e,r),i=Ma(n,2),o=i[0],a=i[1];return q(function(){var u=t.getHandlerId();if(u!=null)return t.subscribeToStateChange(a,{handlerIds:[u]})},[t,a]),o}function Lr(t,e,r){return Ha(e,t||function(){return{}},function(){return r.reconnect()})}function Ua(t){return h.useMemo(function(){return t.hooks.dragSource()},[t])}function za(t){return h.useMemo(function(){return t.hooks.dragPreview()},[t])}function Ba(t,e){var r=Mr(t,e);I(!r.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)");var n=wa(),i=Ca(r.options,r.previewOptions);return ba(r,n,i),[Lr(r.collect,n,i),Ua(i),za(i)]}function Wa(t){var e=t.accept;return h.useMemo(function(){return I(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]},[e])}function qa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Va(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ga(t,e,r){return e&&Va(t.prototype,e),t}function Wt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ka=(function(){function t(e,r){qa(this,t),Wt(this,"spec",void 0),Wt(this,"monitor",void 0),this.spec=e,this.monitor=r}return Ga(t,[{key:"canDrop",value:function(){var r=this.spec,n=this.monitor;return r.canDrop?r.canDrop(n.getItem(),n):!0}},{key:"hover",value:function(){var r=this.spec,n=this.monitor;r.hover&&r.hover(n.getItem(),n)}},{key:"drop",value:function(){var r=this.spec,n=this.monitor;if(r.drop)return r.drop(n.getItem(),n)}}]),t})();function Ya(t,e){var r=h.useMemo(function(){return new Ka(t,e)},[e]);return h.useEffect(function(){r.spec=t},[t]),r}function Xa(t,e){return es(t)||Za(t,e)||Ja(t,e)||Qa()}function Qa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ja(t,e){if(t){if(typeof t=="string")return qt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qt(t,e)}}function qt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Za(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function es(t){if(Array.isArray(t))return t}function ts(t,e,r){var n=V(),i=Ya(t,e),o=Wa(t);q(function(){var s=aa(o,i,n),u=Xa(s,2),c=u[0],d=u[1];return e.receiveHandlerId(c),r.receiveHandlerId(c),d},[n,e,i,r,o.map(function(a){return a.toString()}).join("|")])}function rs(){var t=V();return h.useMemo(function(){return new Ko(t)},[t])}function ns(t){var e=V(),r=h.useMemo(function(){return new oa(e.getBackend())},[e]);return q(function(){return r.dropTargetOptions=t||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[t]),r}function is(t){return h.useMemo(function(){return t.hooks.dropTarget()},[t])}function $r(t,e){var r=Mr(t,e),n=rs(),i=ns(r.options);return ts(r,n,i),[Lr(r.collect,n,i),is(i)]}function os(t,e){return ls(t)||us(t,e)||ss(t,e)||as()}function as(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
19
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ss(t,e){if(t){if(typeof t=="string")return Vt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vt(t,e)}}function Vt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function us(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function ls(t){if(Array.isArray(t))return t}function cs(t){var e=V(),r=e.getMonitor(),n=jr(r,t),i=os(n,2),o=i[0],a=i[1];return h.useEffect(function(){return r.subscribeToOffsetChange(a)}),h.useEffect(function(){return r.subscribeToStateChange(a)}),o}function Fr(t){var e=null,r=function(){return e==null&&(e=t()),e};return r}function ds(t,e){return t.filter(function(r){return r!==e})}function fs(t,e){var r=new Set,n=function(a){return r.add(a)};t.forEach(n),e.forEach(n);var i=[];return r.forEach(function(o){return i.push(o)}),i}function hs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ps(t,e,r){return e&&gs(t.prototype,e),t}function Gt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var vs=(function(){function t(e){hs(this,t),Gt(this,"entered",[]),Gt(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return ps(t,[{key:"enter",value:function(r){var n=this,i=this.entered.length,o=function(s){return n.isNodeInDocument(s)&&(!s.contains||s.contains(r))};return this.entered=fs(this.entered.filter(o),[r]),i===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=ds(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t})(),ys=Fr(function(){return/firefox/i.test(navigator.userAgent)}),Hr=Fr(function(){return!!window.safari});function ms(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Os(t,e,r){return e&&bs(t.prototype,e),t}function ne(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Kt=(function(){function t(e,r){ms(this,t),ne(this,"xs",void 0),ne(this,"ys",void 0),ne(this,"c1s",void 0),ne(this,"c2s",void 0),ne(this,"c3s",void 0);for(var n=e.length,i=[],o=0;o<n;o++)i.push(o);i.sort(function(T,x){return e[T]<e[x]?-1:1});for(var a=[],s=[],u,c,d=0;d<n-1;d++)u=e[d+1]-e[d],c=r[d+1]-r[d],a.push(u),s.push(c/u);for(var p=[s[0]],b=0;b<a.length-1;b++){var m=s[b],S=s[b+1];if(m*S<=0)p.push(0);else{u=a[b];var l=a[b+1],f=u+l;p.push(3*f/((f+l)/m+(f+u)/S))}}p.push(s[s.length-1]);for(var g=[],v=[],O,w=0;w<p.length-1;w++){O=s[w];var D=p[w],E=1/a[w],_=D+p[w+1]-O-O;g.push((O-D-_)*E),v.push(_*E*E)}this.xs=e,this.ys=r,this.c1s=p,this.c2s=g,this.c3s=v}return Os(t,[{key:"interpolate",value:function(r){var n=this.xs,i=this.ys,o=this.c1s,a=this.c2s,s=this.c3s,u=n.length-1;if(r===n[u])return i[u];for(var c=0,d=s.length-1,p;c<=d;){p=Math.floor(.5*(c+d));var b=n[p];if(b<r)c=p+1;else if(b>r)d=p-1;else return i[p]}u=Math.max(0,d);var m=r-n[u],S=m*m;return i[u]+o[u]*m+a[u]*S+s[u]*m*S}}]),t})(),Ss=1;function Ur(t){var e=t.nodeType===Ss?t:t.parentElement;if(!e)return null;var r=e.getBoundingClientRect(),n=r.top,i=r.left;return{x:i,y:n}}function se(t){return{x:t.clientX,y:t.clientY}}function Is(t){var e;return t.nodeName==="IMG"&&(ys()||!((e=document.documentElement)!==null&&e!==void 0&&e.contains(t)))}function Ds(t,e,r,n){var i=t?e.width:r,o=t?e.height:n;return Hr()&&t&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}function Ts(t,e,r,n,i){var o=Is(e),a=o?t:e,s=Ur(a),u={x:r.x-s.x,y:r.y-s.y},c=t.offsetWidth,d=t.offsetHeight,p=n.anchorX,b=n.anchorY,m=Ds(o,e,c,d),S=m.dragPreviewWidth,l=m.dragPreviewHeight,f=function(){var _=new Kt([0,.5,1],[u.y,u.y/d*l,u.y+l-d]),T=_.interpolate(b);return Hr()&&o&&(T+=(window.devicePixelRatio-1)*l),T},g=function(){var _=new Kt([0,.5,1],[u.x,u.x/c*S,u.x+S-c]);return _.interpolate(p)},v=i.offsetX,O=i.offsetY,w=v===0||v,D=O===0||O;return{x:w?v:g(),y:D?O:f()}}var zr="__NATIVE_FILE__",Br="__NATIVE_URL__",Wr="__NATIVE_TEXT__",qr="__NATIVE_HTML__";const Yt=Object.freeze(Object.defineProperty({__proto__:null,FILE:zr,HTML:qr,TEXT:Wr,URL:Br},Symbol.toStringTag,{value:"Module"}));function Me(t,e,r){var n=e.reduce(function(i,o){return i||t.getData(o)},"");return n??r}var X;function ue(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Qe=(X={},ue(X,zr,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),ue(X,qr,{exposeProperties:{html:function(e,r){return Me(e,r,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),ue(X,Br,{exposeProperties:{urls:function(e,r){return Me(e,r,"").split(`
|
|
20
|
-
`)},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),ue(X,Wr,{exposeProperties:{text:function(e,r){return Me(e,r,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),X);function ws(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Es(t,e,r){return e&&Cs(t.prototype,e),t}function Xt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var _s=(function(){function t(e){ws(this,t),Xt(this,"item",void 0),Xt(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return Es(t,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var i={};Object.keys(this.config.exposeProperties).forEach(function(o){i[o]={value:n.config.exposeProperties[o](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,i)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),t})();function xs(t,e){var r=new _s(Qe[t]);return r.loadDataTransfer(e),r}function je(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(Qe).filter(function(r){var n=Qe[r].matchesTypes;return n.some(function(i){return e.indexOf(i)>-1})})[0]||null}function Ns(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ps(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Rs(t,e,r){return e&&Ps(t.prototype,e),t}function Le(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ks=(function(){function t(e,r){Ns(this,t),Le(this,"ownerDocument",null),Le(this,"globalContext",void 0),Le(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=r}return Rs(t,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),t})();function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Jt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qt(Object(r),!0).forEach(function(n){C(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function As(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ms(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function js(t,e,r){return e&&Ms(t.prototype,e),t}function C(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ls=(function(){function t(e,r,n){var i=this;As(this,t),C(this,"options",void 0),C(this,"actions",void 0),C(this,"monitor",void 0),C(this,"registry",void 0),C(this,"enterLeaveCounter",void 0),C(this,"sourcePreviewNodes",new Map),C(this,"sourcePreviewNodeOptions",new Map),C(this,"sourceNodes",new Map),C(this,"sourceNodeOptions",new Map),C(this,"dragStartSourceIds",null),C(this,"dropTargetIds",[]),C(this,"dragEnterTargetIds",[]),C(this,"currentNativeSource",null),C(this,"currentNativeHandle",null),C(this,"currentDragSourceNode",null),C(this,"altKeyPressed",!1),C(this,"mouseMoveTimeoutTimer",null),C(this,"asyncEndDragFrameId",null),C(this,"dragOverTargetIds",null),C(this,"lastClientOffset",null),C(this,"hoverRafId",null),C(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&Ur(a)||null}),C(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),C(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),C(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),C(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var s=se(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:s});var u=o.dataTransfer,c=je(u);if(i.monitor.isDragging()){if(u&&typeof u.setDragImage=="function"){var d=i.monitor.getSourceId(),p=i.sourceNodes.get(d),b=i.sourcePreviewNodes.get(d)||p;if(b){var m=i.getCurrentSourcePreviewNodeOptions(),S=m.anchorX,l=m.anchorY,f=m.offsetX,g=m.offsetY,v={anchorX:S,anchorY:l},O={offsetX:f,offsetY:g},w=Ts(p,b,s,v,O);u.setDragImage(b,w.x,w.y)}}try{u==null||u.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target);var D=i.getCurrentSourcePreviewNodeOptions(),E=D.captureDraggingState;E?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(c)i.beginDragNativeItem(c);else{if(u&&!u.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),C(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleTopDragEnterCapture",function(o){i.dragEnterTargetIds=[];var a=i.enterLeaveCounter.enter(o.target);if(!(!a||i.monitor.isDragging())){var s=o.dataTransfer,u=je(s);u&&i.beginDragNativeItem(u,s)}}),C(this,"handleTopDragEnter",function(o){var a=i.dragEnterTargetIds;if(i.dragEnterTargetIds=[],!!i.monitor.isDragging()){i.altKeyPressed=o.altKey,a.length>0&&i.actions.hover(a,{clientOffset:se(o)});var s=a.some(function(u){return i.monitor.canDropOnTarget(u)});s&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect()))}}),C(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),C(this,"handleTopDragOver",function(o){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}i.altKeyPressed=o.altKey,i.lastClientOffset=se(o),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(a||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null}));var s=(a||[]).some(function(u){return i.monitor.canDropOnTarget(u)});s?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),C(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault();var a=i.enterLeaveCounter.leave(o.target);a&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),C(this,"handleTopDropCapture",function(o){if(i.dropTargetIds=[],i.isDraggingNativeItem()){var a;o.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else je(o.dataTransfer)&&o.preventDefault();i.enterLeaveCounter.reset()}),C(this,"handleTopDrop",function(o){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:se(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new ks(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new vs(this.isNodeInDocument)}return js(t,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,i){var o=this;return this.sourcePreviewNodeOptions.set(r,i),this.sourcePreviewNodes.set(r,n),function(){o.sourcePreviewNodes.delete(r),o.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,i){var o=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,i);var a=function(c){return o.handleDragStart(c,r)},s=function(c){return o.handleSelectStart(c)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",s),function(){o.sourceNodes.delete(r),o.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var i=this,o=function(c){return i.handleDragEnter(c,r)},a=function(c){return i.handleDragOver(c,r)},s=function(c){return i.handleDrop(c,r)};return n.addEventListener("dragenter",o),n.addEventListener("dragover",a),n.addEventListener("drop",s),function(){n.removeEventListener("dragenter",o),n.removeEventListener("dragover",a),n.removeEventListener("drop",s)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return Jt({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return Jt({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Yt).some(function(n){return Yt[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=xs(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var i=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=n.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},i)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),t})(),le;function $s(){return le||(le=new Image,le.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),le}var Vr=function(e,r,n){return new Ls(e,r,n)};function Fs(t){const e=A(),r=e.selectedIds,[n,i,o]=Ba(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(r):[t.id];return e.dispatch(ee.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(ee.dragEnd())}}),[r,t]);return h.useEffect(()=>{o($s())},[o]),i}function Hs(t,e){const r=t.getBoundingClientRect(),n=e.x-Math.round(r.x),i=e.y-Math.round(r.y),o=r.height,a=i<o/2,s=!a,u=o/4,c=i>u&&i<o-u;return{x:n,inTopHalf:a,inBottomHalf:s,inMiddle:c,atTop:!c&&a,atBottom:!c&&s}}function Us(t,e,r,n){return t?t.isInternal?n.atTop?[e,t]:n.inMiddle?[t,t]:[t,r]:n.inTopHalf?[e,t]:[t,r]:[e,null]}function ce(t,e){return{parentId:t||null,index:e}}function Q(t,e){return{type:"line",index:t,level:e}}function zs(t){return{type:"highlight",id:t}}function $e(t,e){var r;let n=t;for(;n.parent&&n.level>e;)n=n.parent;const i=((r=n.parent)===null||r===void 0?void 0:r.id)||null,o=pr(n)+1;return{parentId:i,index:o}}function Gr(t){var e;const r=Hs(t.element,t.offset),n=t.indent,i=Math.round(Math.max(0,r.x-n)/n),{node:o,nextNode:a,prevNode:s}=t,[u,c]=Us(o,s,a,r);if(o&&o.isInternal&&r.inMiddle)return{drop:ce(o.id,null),cursor:zs(o.id)};if(!u)return{drop:ce((e=c==null?void 0:c.parent)===null||e===void 0?void 0:e.id,0),cursor:Q(0,0)};if(dr(u)){const d=de(i,(c==null?void 0:c.level)||0,u.level);return{drop:$e(u,d),cursor:Q(u.rowIndex+1,d)}}if(fr(u)){const d=de(i,(c==null?void 0:c.level)||0,u.level);return{drop:$e(u,d),cursor:Q(u.rowIndex+1,d)}}if(hr(u)){const d=de(i,0,u.level+1);return d>u.level?{drop:ce(u.id,0),cursor:Q(u.rowIndex+1,d)}:{drop:$e(u,d),cursor:Q(u.rowIndex+1,d)}}return{drop:ce(u==null?void 0:u.id,0),cursor:Q(u.rowIndex+1,u.level+1)}}function Bs(t,e){const r=A(),[n,i]=$r(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(o,a)=>{const s=a.getClientOffset();if(!t.current||!s)return;const{cursor:u,drop:c}=Gr({element:t.current,offset:s,indent:r.indent,node:e,prevNode:e.prev,nextNode:e.next});c&&r.dispatch(ee.hovering(c.parentId,c.index)),a.canDrop()?u&&r.showCursor(u):r.hideCursor()},drop:(o,a)=>{if(!a.canDrop())return null;let{parentId:s,index:u,dragIds:c}=r.state.dnd;Or(r.props.onMove,{dragIds:c,parentId:s===ae?null:s,index:u===null?0:u,dragNodes:r.dragNodes,parentNode:r.get(s)}),r.open(s)}}),[e,t.current,r.props]);return i}function Ws(t){const e=A(),r=e.at(t);if(!r)throw new Error(`Could not find node for index: ${t}`);return h.useMemo(()=>{const n=r.clone();return e.visibleNodes[t]=n,n},[...Object.values(r.state),r])}const qs=or.memo(function({index:e,style:r}){cr(),mn();const n=A(),i=Ws(e),o=h.useRef(null),a=Fs(i),s=Bs(o,i),u=h.useCallback(l=>{o.current=l,s(l)},[s]),c=n.indent*i.level,d=h.useMemo(()=>({paddingLeft:c}),[c]),p=h.useMemo(()=>{var l,f;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((f=(l=n.props.padding)!==null&&l!==void 0?l:n.props.paddingTop)!==null&&f!==void 0?f:0)})},[r,n.props.padding,n.props.paddingTop]),b={role:"treeitem","aria-level":i.level+1,"aria-selected":i.isSelected,"aria-expanded":i.isOpen,style:p,tabIndex:-1,className:n.props.rowClassName};h.useEffect(()=>{var l;!i.isEditing&&i.isFocused&&((l=o.current)===null||l===void 0||l.focus({preventScroll:!0}))},[i.isEditing,i.isFocused,o.current]);const m=n.renderNode,S=n.renderRow;return y.jsx(S,{node:i,innerRef:u,attrs:b,children:y.jsx(m,{node:i,tree:n,style:d,dragHandle:a})})});let Fe="",Zt=null;function Kr(){cr();const t=A();return y.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var r;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const i=Array.from(t.selectedIds);if(i.length>1){let o=t.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=t.lastNode),t.focus(o,{scroll:!1}),t.delete(Array.from(i))}else{const o=t.focusedNode;if(o){const a=o.nextSibling,s=o.parent;t.focus(a||s,{scroll:!1}),t.delete(o)}}return}if(e.key==="Tab"&&!e.shiftKey){e.preventDefault(),vr(e.currentTarget);return}if(e.key==="Tab"&&e.shiftKey){e.preventDefault(),yr(e.currentTarget);return}if(e.key==="ArrowDown"){e.preventDefault();const i=t.nextNode;if(e.metaKey){t.select(t.focusedNode),t.activate(t.focusedNode);return}else if(!e.shiftKey||t.props.disableMultiSelection){t.focus(i);return}else{if(!i)return;const o=t.focusedNode;o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.firstNode);return}}if(e.key==="ArrowUp"){e.preventDefault();const i=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection){t.focus(i);return}else{if(!i)return;const o=t.focusedNode;o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.lastNode);return}}if(e.key==="ArrowRight"){const i=t.focusedNode;if(!i)return;i.isInternal&&i.isOpen?t.focus(t.nextNode):i.isInternal&&t.open(i.id);return}if(e.key==="ArrowLeft"){const i=t.focusedNode;if(!i||i.isRoot)return;i.isInternal&&i.isOpen?t.close(i.id):!((r=i.parent)===null||r===void 0)&&r.isRoot||t.focus(i.parent);return}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection){e.preventDefault(),t.selectAll();return}if(e.key==="a"&&!e.metaKey&&t.props.onCreate){t.createLeaf();return}if(e.key==="A"&&!e.metaKey){if(!t.props.onCreate)return;t.createInternal();return}if(e.key==="Home"){e.preventDefault(),t.focus(t.firstNode);return}if(e.key==="End"){e.preventDefault(),t.focus(t.lastNode);return}if(e.key==="Enter"){const i=t.focusedNode;if(!i||!i.isEditable||!t.props.onRename)return;setTimeout(()=>{i&&t.edit(i)});return}if(e.key===" "){e.preventDefault();const i=t.focusedNode;if(!i)return;i.isLeaf?(i.select(),i.activate()):i.toggle();return}if(e.key==="*"){const i=t.focusedNode;if(!i)return;t.openSiblings(i);return}if(e.key==="PageUp"){e.preventDefault(),t.pageUp();return}e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(Zt),Fe+=e.key,Zt=setTimeout(()=>{Fe=""},600);const n=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"?o.toLowerCase().startsWith(Fe):!1});n&&t.focus(n.id)},children:y.jsx(Zn,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var r;return((r=t.visibleNodes[e])===null||r===void 0?void 0:r.id)||e},outerElementType:ri,innerElementType:oi,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:qs})})}function er(t){return t.isFiltered?Gs(t.root,t.isMatch.bind(t)):Vs(t.root)}function Vs(t){const e=[];function r(n){var i;n.level>=0&&e.push(n),n.isOpen&&((i=n.children)===null||i===void 0||i.forEach(r))}return r(t),e.forEach(Yr),e}function Gs(t,e){const r={},n=[];function i(a){if(!a.isRoot&&e(a)){r[a.id]=!0;let u=a.parent;for(;u;)r[u.id]=!0,u=u.parent}if(a.children)for(let u of a.children)i(u)}function o(a){var s;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((s=a.children)===null||s===void 0||s.forEach(o))}return i(t),o(t),n.forEach(Yr),n}function Yr(t,e){t.rowIndex=e}const tr=t=>t.reduce((e,r,n)=>(e[r.id]=n,e),{});var He=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(p){a(p)}}function u(d){try{c(n.throw(d))}catch(p){a(p)}}function c(d){d.done?o(d.value):i(d.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};const{safeRun:P,identify:z,identifyNull:F}=In;class oe{constructor(e,r,n,i){this.store=e,this.props=r,this.list=n,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=ct(this),this.visibleNodes=er(this),this.idToIndex=tr(this.visibleNodes)}update(e){this.props=e,this.root=ct(this),this.visibleNodes=er(this),this.idToIndex=tr(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const r=(e=this.props.searchMatch)!==null&&e!==void 0?e:((n,i)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(i.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(e){var r;const n=this.props.childrenAccessor||"children";return(r=ie(e,n))!==null&&r!==void 0?r:null}accessId(e){const r=this.props.idAccessor||"id",n=ie(e,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,r){var n;if(e===null||r===null)return[];const i=(n=this.indexOf(e))!==null&&n!==void 0?n:0,o=this.indexOf(r);if(o===null)return[];const a=Math.min(i,o),s=Math.max(i,o);return this.visibleNodes.slice(a,s+1)}indexOf(e){const r=br(e);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return He(this,arguments,void 0,function*(e={}){var r,n;const i=e.parentId===void 0?Dr(this):e.parentId,o=(r=e.index)!==null&&r!==void 0?r:Ir(this),a=(n=e.type)!==null&&n!==void 0?n:"leaf",s=yield P(this.props.onCreate,{type:a,parentId:i,index:o,parentNode:this.get(i)});s&&(this.focus(s),setTimeout(()=>{this.edit(s).then(()=>{this.select(s),this.activate(s)})}))})}delete(e){return He(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(z),i=n.map(o=>this.get(o)).filter(o=>!!o);yield P(this.props.onDelete,{nodes:i,ids:n})})}edit(e){const r=z(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(r),this.dispatch(Ee(r)),new Promise(n=>{oe.editPromise=n})}submit(e,r){return He(this,void 0,void 0,function*(){if(!e)return;const n=z(e);yield P(this.props.onRename,{id:n,name:r,node:this.get(n)}),this.dispatch(Ee(null)),this.resolveEdit({cancelled:!1,value:r}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Ee(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const r=this.get(F(e));r&&P(this.props.onActivate,r)}resolveEdit(e){const r=oe.editPromise;r&&r(e),oe.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&e.push(n)}return e}focus(e,r={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(G(z(e))),r.scroll!==!1&&this.scrollTo(e),this.focusedNode&&P(this.props.onFocus,this.focusedNode)))}pageUp(){var e,r;const n=this.visibleStartIndex,o=this.visibleStopIndex-n;let a=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;a>n?a=n:a=Math.max(n-o,0),this.focus(this.at(a))}pageDown(){var e,r;const n=this.visibleStartIndex,i=this.visibleStopIndex,o=i-n;let a=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;a<i?a=i:a=Math.min(a+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,r={}){if(!e)return;const n=r.focus!==!1,i=z(e);n&&this.dispatch(G(i)),this.dispatch($.only(i)),this.dispatch($.anchor(i)),this.dispatch($.mostRecent(i)),this.scrollTo(i,r.align),this.focusedNode&&n&&P(this.props.onFocus,this.focusedNode),P(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const r=z(e);this.dispatch($.remove(r)),P(this.props.onSelect,this.selectedNodes)}selectMulti(e,r={}){const n=this.get(F(e));if(!n)return;const i=r.focus!==!1;i&&this.dispatch(G(n.id)),this.dispatch($.add(n.id)),this.dispatch($.anchor(n.id)),this.dispatch($.mostRecent(n.id)),this.scrollTo(n,r.align),this.focusedNode&&i&&P(this.props.onFocus,this.focusedNode),P(this.props.onSelect,this.selectedNodes)}selectContiguous(e){if(!e)return;const r=z(e),{anchor:n,mostRecent:i}=this.state.nodes.selection;this.dispatch(G(r)),this.dispatch($.remove(this.nodesBetween(n,i))),this.dispatch($.add(this.nodesBetween(n,F(r)))),this.dispatch($.mostRecent(r)),this.scrollTo(r),this.focusedNode&&P(this.props.onFocus,this.focusedNode),P(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),P(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(G((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&P(this.props.onFocus,this.focusedNode),P(this.props.onSelect,this.selectedNodes)}setSelection(e){var r;const n=new Set((r=e.ids)===null||r===void 0?void 0:r.map(z)),i=F(e.anchor),o=F(e.mostRecent);this.dispatch($.set({ids:n,anchor:i,mostRecent:o})),P(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;switch(e.type){case"highlight":return e.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var e;if(this.isFiltered)return!1;const r=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,n=this.dragNodes,i=this.props.disableDrop;for(const o of n)if(!o||!r||o.isInternal&&gr(r,o))return!1;return typeof i=="function"?!i({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof i=="string"?!r.data[i]:typeof i=="boolean"?!i:!0}hideCursor(){this.dispatch(ee.cursor({type:"none"}))}showCursor(e){this.dispatch(ee.cursor(e))}open(e){const r=F(e);r&&(this.isOpen(r)||(this.dispatch(Be.open(r,this.isFiltered)),P(this.props.onToggle,r)))}close(e){const r=F(e);r&&this.isOpen(r)&&(this.dispatch(Be.close(r,this.isFiltered)),P(this.props.onToggle,r))}toggle(e){const r=F(e);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(e){const r=F(e);if(!r)return;const n=Je(this.root,r);let i=n==null?void 0:n.parent;for(;i;)this.open(i.id),i=i.parent}openSiblings(e){const r=e.parent;if(!r)this.toggle(e.id);else if(r.children){const n=e.isOpen;for(let i of r.children)i.isInternal&&(n?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}openAll(){ye(this.root,e=>{e.isInternal&&e.open()})}closeAll(){ye(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,r="smart"){if(!e)return;const n=z(e);return this.openParents(n),Sr(()=>n in this.idToIndex).then(()=>{var i;const o=this.idToIndex[n];o!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(o,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return e?this.state.nodes.selection.ids.has(e):!1}isOpen(e){var r,n,i;if(!e)return!1;if(e===ae)return!0;const o=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[e])!==null&&n!==void 0?n:!0:(i=this.state.nodes.open.unfiltered[e])!==null&&i!==void 0?i:o}isEditable(e){const r=this.props.disableEdit||(()=>!1);return!ie(e,r)}isDraggable(e){const r=this.props.disableDrag||(()=>!1);return!ie(e,r)}isDragging(e){const r=F(e);return r?this.state.nodes.drag.id===r:!1}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const r=F(e);if(!r)return!1;const{destinationParentId:n,destinationIndex:i}=this.state.nodes.drag;return r===n&&i===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(G(e.id))}onBlur(){this.dispatch(Rn())}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Kr}get renderRow(){return this.props.renderRow||En}get renderNode(){return this.props.children||_n}get renderDragPreview(){return this.props.renderDragPreview||Tr}get renderCursor(){return this.props.renderCursor||Cn}}function k(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Ks=typeof Symbol=="function"&&Symbol.observable||"@@observable",rr=Ks,Ue=()=>Math.random().toString(36).substring(7).split("").join("."),Ys={INIT:`@@redux/INIT${Ue()}`,REPLACE:`@@redux/REPLACE${Ue()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ue()}`},Oe=Ys;function Xs(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function Xr(t,e,r){if(typeof t!="function")throw new Error(k(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(k(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(k(1));return r(Xr)(t,e)}let n=t,i=e,o=new Map,a=o,s=0,u=!1;function c(){a===o&&(a=new Map,o.forEach((f,g)=>{a.set(g,f)}))}function d(){if(u)throw new Error(k(3));return i}function p(f){if(typeof f!="function")throw new Error(k(4));if(u)throw new Error(k(5));let g=!0;c();const v=s++;return a.set(v,f),function(){if(g){if(u)throw new Error(k(6));g=!1,c(),a.delete(v),o=null}}}function b(f){if(!Xs(f))throw new Error(k(7));if(typeof f.type>"u")throw new Error(k(8));if(typeof f.type!="string")throw new Error(k(17));if(u)throw new Error(k(9));try{u=!0,i=n(i,f)}finally{u=!1}return(o=a).forEach(v=>{v()}),f}function m(f){if(typeof f!="function")throw new Error(k(10));n=f,b({type:Oe.REPLACE})}function S(){const f=p;return{subscribe(g){if(typeof g!="object"||g===null)throw new Error(k(11));function v(){const w=g;w.next&&w.next(d())}return v(),{unsubscribe:f(v)}},[rr](){return this}}}return b({type:Oe.INIT}),{dispatch:b,subscribe:p,getState:d,replaceReducer:m,[rr]:S}}function Qs(t){Object.keys(t).forEach(e=>{const r=t[e];if(typeof r(void 0,{type:Oe.INIT})>"u")throw new Error(k(12));if(typeof r(void 0,{type:Oe.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(k(13))})}function nr(t){const e=Object.keys(t),r={};for(let o=0;o<e.length;o++){const a=e[o];typeof t[a]=="function"&&(r[a]=t[a])}const n=Object.keys(r);let i;try{Qs(r)}catch(o){i=o}return function(a={},s){if(i)throw i;let u=!1;const c={};for(let d=0;d<n.length;d++){const p=n[d],b=r[p],m=a[p],S=b(m,s);if(typeof S>"u")throw s&&s.type,new Error(k(14));c[p]=S,u=u||S!==m}return u=u||n.length!==Object.keys(a).length,u?c:a}}function Js(t=Z().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}const Zs=nr({nodes:nr({focus:kn,edit:Pn,open:An,selection:Mn,drag:Js}),dnd:jn}),eu=Z();function tu({treeProps:t,imperativeHandle:e,children:r}){const n=h.useRef(null),i=h.useRef(null),o=h.useRef(Xr(Zs,Z(t))),a=hn.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>eu),s=h.useMemo(()=>new oe(o.current,t,n,i),[]),u=h.useRef(0);return h.useMemo(()=>{u.current+=1,s.update(t)},[...Object.values(t),a.nodes.open]),h.useImperativeHandle(e,()=>s),h.useEffect(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),h.useEffect(()=>{s.props.searchTerm||o.current.dispatch(Be.clear(!0))},[s.props.searchTerm]),y.jsx(ar.Provider,{value:s,children:y.jsx(lr.Provider,{value:u.current,children:y.jsx(sr.Provider,{value:a.nodes,children:y.jsx(ur.Provider,{value:a.dnd,children:y.jsx($o,Object.assign({},t.dndManager?{manager:t.dndManager}:{backend:t.dndBackend||Vr,options:{rootElement:s.props.dndRootElement||void 0}},{children:r}))})})})})}function ru(){const t=A(),[,e]=$r(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?t.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const i=n.getClientOffset();if(!t.listEl.current||!i)return;const{cursor:o,drop:a}=Gr({element:t.listEl.current,offset:i,indent:t.indent,node:null,prevNode:t.visibleNodes[t.visibleNodes.length-1],nextNode:null});a&&t.dispatch(ee.hovering(a.parentId,a.index)),n.canDrop()?o&&t.showCursor(o):t.hideCursor()}}),[t]);e(t.listEl)}function nu(t){return ru(),t.children}function iu(){const e=A().props.renderContainer||Kr;return y.jsx(y.Fragment,{children:y.jsx(e,{})})}function ou(){const t=A(),{offset:e,mouse:r,item:n,isDragging:i}=cs(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=t.props.renderDragPreview||Tr;return y.jsx(o,{offset:e,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:i})}class au{constructor(e){this.root=su(e)}get data(){var e,r;return(r=(e=this.root.children)===null||e===void 0?void 0:e.map(n=>n.data))!==null&&r!==void 0?r:[]}create(e){const r=e.parentId?this.find(e.parentId):this.root;if(!r)return null;r.addChild(e.data,e.index)}move(e){const r=this.find(e.id),n=e.parentId?this.find(e.parentId):this.root;!r||!n||(n.addChild(r.data,e.index),r.drop())}update(e){const r=this.find(e.id);r&&r.update(e.changes)}drop(e){const r=this.find(e.id);r&&r.drop()}find(e,r=this.root){if(!r)return null;if(r.id===e)return r;if(r.children){for(let n of r.children){const i=this.find(e,n);if(i)return i}return null}return null}}function su(t){const e=new Qr({id:"ROOT"},null);return e.children=t.map(r=>ot(r,e)),e}function ot(t,e){const r=new Qr(t,e);return t.children&&(r.children=t.children.map(n=>ot(n,r))),r}class Qr{constructor(e,r){this.data=e,this.parent=r,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,r){var n,i;const o=ot(e,this);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,o),this.data.children=(i=this.data.children)!==null&&i!==void 0?i:[],this.data.children.splice(r,0,e)}removeChild(e){var r,n;(r=this.children)===null||r===void 0||r.splice(e,1),(n=this.data.children)===null||n===void 0||n.splice(e,1)}update(e){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let uu=0;function lu(t){const[e,r]=h.useState(t),n=h.useMemo(()=>new au(e),[e]);return[e,{onMove:c=>{for(const d of c.dragIds)n.move({id:d,parentId:c.parentId,index:c.index});r(n.data)},onRename:({name:c,id:d})=>{n.update({id:d,changes:{name:c}}),r(n.data)},onCreate:({parentId:c,index:d,type:p})=>{const b={id:`simple-tree-id-${uu++}`,name:""};return p==="internal"&&(b.children=[]),n.create({parentId:c,index:d,data:b}),r(n.data),b},onDelete:c=>{c.ids.forEach(d=>n.drop({id:d})),r(n.data)}}]}function cu(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
|
|
21
|
-
Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,r]=lu(t.initialData);return Object.assign(Object.assign(Object.assign({},t),r),{data:e})}else return t}function du(t,e){const r=cu(t);return y.jsxs(tu,{treeProps:r,imperativeHandle:e,children:[y.jsx(nu,{children:y.jsx(iu,{})}),y.jsx(ou,{})]})}const fu=h.forwardRef(du),ze=Symbol.for("@hachej/boring-workspace/file-tree-dnd-manager");function hu(){const t=globalThis;return t[ze]??(t[ze]=Rr(Vr,typeof window>"u"?void 0:window)),t[ze]}const Jr=new Set,Zr=h.createContext({onContextMenu:void 0,editing:null,pendingPaths:Jr,onSubmitEdit:void 0,onCancelEdit:void 0});function gu({initialValue:t,onSubmit:e,onCancel:r,isDraft:n}){const i=h.useRef(null),o=h.useRef(!1);h.useEffect(()=>{const s=i.current;if(s)if(s.focus(),!n&&t.includes(".")){const u=t.lastIndexOf(".");s.setSelectionRange(0,u)}else s.select()},[t,n]);const a=()=>{var s;if(o.current)return;o.current=!0;const u=((s=i.current)==null?void 0:s.value.trim())??"";!u||u===t?r():e(u)};return y.jsx(fn,{ref:i,type:"text",defaultValue:t,"data-testid":"file-tree-edit-input","aria-label":n?"Name":"Rename",onPointerDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"?(s.preventDefault(),a()):s.key==="Escape"&&(s.preventDefault(),o.current=!0,r())},onBlur:a,className:"h-5 min-w-0 flex-1 rounded-sm border-[color:var(--accent)]/60 px-1 text-[13px] leading-[1.2] focus-visible:ring-[color:var(--accent)]"})}function pu({node:t,style:e,dragHandle:r}){const{onContextMenu:n,editing:i,pendingPaths:o,onSubmitEdit:a,onCancelEdit:s}=h.useContext(Zr),u=t.data,c=u.kind==="dir",d=(i==null?void 0:i.path)===u.path,p=o.has(u.path),b=c?t.isOpen?pn:yn:ln(u.name||"untitled");return y.jsxs("div",{ref:r,style:e,className:J("group relative mx-1 flex items-center gap-1.5 rounded-md px-2 py-0.5 text-[13px] leading-[1.4] cursor-pointer select-none text-foreground","transition-colors duration-150 ease-[cubic-bezier(0.22,1,0.36,1)]",!d&&"hover:bg-foreground/[0.04]",t.isSelected&&!d&&"bg-[oklch(from_var(--accent)_l_c_h/0.10)] text-foreground font-medium",t.willReceiveDrop&&"bg-foreground/5 outline outline-1 outline-border"),onClick:m=>{d||(m.stopPropagation(),c?t.toggle():(t.select(),t.activate()))},onContextMenu:m=>{d||u.isDraft||(m.preventDefault(),m.stopPropagation(),n==null||n(m,u))},children:[c?y.jsx(cn,{className:J("h-3 w-3 shrink-0 text-muted-foreground/70 transition-transform duration-150 ease-[cubic-bezier(0.22,1,0.36,1)]",t.isOpen&&"rotate-90"),strokeWidth:2}):y.jsx("span",{className:"w-3 shrink-0"}),y.jsx(b,{className:J("h-4 w-4 shrink-0",t.isSelected?"text-[color:var(--accent)]":"text-muted-foreground/80"),strokeWidth:1.5}),d?y.jsx(gu,{initialValue:(i==null?void 0:i.initialValue)??u.name??"",isDraft:!!(i!=null&&i.isDraft),onSubmit:m=>a==null?void 0:a(u.path,m),onCancel:()=>s==null?void 0:s()}):y.jsx("span",{className:J("truncate",p&&"text-muted-foreground italic"),children:u.name}),p&&!d&&y.jsx(dn,{"data-testid":"file-tree-pending-spinner","aria-label":"Pending",className:"ml-auto h-3 w-3 shrink-0 animate-spin text-muted-foreground/70",strokeWidth:2})]})}function mu({files:t,selectedPath:e,searchQuery:r,height:n=400,editing:i,revealPath:o,pendingPaths:a,onSelect:s,onExpand:u,onCollapse:c,onContextMenu:d,onSubmitEdit:p,onCancelEdit:b,onRevealHandled:m,onDragDrop:S,className:l}){const f=h.useRef(null);h.useEffect(()=>{if(!(i!=null&&i.isDraft))return;const T=requestAnimationFrame(()=>{var x;(x=f.current)==null||x.scrollTo(i.path)});return()=>cancelAnimationFrame(T)},[i==null?void 0:i.isDraft,i==null?void 0:i.path]),h.useEffect(()=>{if(!o)return;let T=0;const x=requestAnimationFrame(()=>{const N=f.current;if(!N)return;N.openParents(o);const H=N.get(o);H&&(H.isInternal&&H.open(),T=requestAnimationFrame(()=>{var B;(B=f.current)==null||B.scrollTo(o),m==null||m(o)}))});return()=>{cancelAnimationFrame(x),cancelAnimationFrame(T)}},[t,m,o]);const g=h.useMemo(()=>e||void 0,[e]),v=h.useCallback(T=>{T.data.kind==="file"&&(s==null||s(T.data.path))},[s]),O=h.useCallback(T=>{var x;const N=(x=f.current)==null?void 0:x.get(T);N&&(N.isOpen?u==null||u(N.data.path):c==null||c(N.data.path))},[u,c]),w=h.useCallback(T=>{if(!S)return;const x=!T.parentNode||T.parentNode.isRoot,N=x?".":T.parentNode.data.path;if(!(!x&&T.parentNode.data.kind!=="dir"))for(const H of T.dragNodes){const B=H.data.path;if(N===B||N!=="."&&N.startsWith(B+"/"))return;S(B,N)}},[S]),D=h.useCallback(T=>{if(!T.parentNode||T.parentNode.isRoot)return!1;if(T.parentNode.data.kind!=="dir")return!0;for(const x of T.dragNodes)if(T.parentNode.data.path===x.data.path||T.parentNode.data.path.startsWith(x.data.path+"/"))return!0;return!1},[]),E=h.useCallback((T,x)=>T.data.name.toLowerCase().includes(x.toLowerCase()),[]),_=h.useMemo(()=>({onContextMenu:d,editing:i??null,pendingPaths:a??Jr,onSubmitEdit:p,onCancelEdit:b}),[d,i,a,p,b]);return t.length===0?y.jsx("div",{className:J("flex h-full items-center justify-center text-sm text-muted-foreground",l),children:"No files"}):y.jsx(Zr.Provider,{value:_,children:y.jsx("div",{"data-boring-workspace-part":"file-tree",className:J("file-tree",l),children:y.jsx(fu,{ref:f,data:t,idAccessor:"path",childrenAccessor:"children",openByDefault:!1,width:"100%",height:n,rowHeight:26,indent:14,selection:g,searchTerm:r??"",searchMatch:E,onActivate:v,onToggle:O,onMove:w,disableDrop:D,disableEdit:!0,dndManager:hu(),children:pu})})})}export{mu as FileTree};
|