@yoopta/ui 6.0.0-beta.9 → 6.0.1
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/action-menu-list/action-menu-list.d.ts.map +1 -1
- package/dist/action-menu-list/context.d.ts +3 -1
- package/dist/action-menu-list/context.d.ts.map +1 -1
- package/dist/action-menu-list.js +1 -1
- package/dist/action-menu-list.js.map +1 -0
- package/dist/block-dnd/block-dnd-context.d.ts.map +1 -1
- package/dist/block-dnd/sortable-block.d.ts.map +1 -1
- package/dist/block-dnd.js +7 -1
- package/dist/block-dnd.js.map +1 -0
- package/dist/block-options/block-options.d.ts +0 -7
- package/dist/block-options/block-options.d.ts.map +1 -1
- package/dist/block-options.js +1 -1
- package/dist/block-options.js.map +1 -0
- package/dist/chunks/_tslib-29461875.js +1 -0
- package/dist/chunks/_tslib-8c24563b.js +57 -0
- package/dist/chunks/_tslib-8c24563b.js.map +1 -0
- package/dist/chunks/createLucideIcon-6ba35914.js +56 -0
- package/dist/chunks/createLucideIcon-6ba35914.js.map +1 -0
- package/dist/chunks/createLucideIcon-8605f860.js +13 -0
- package/dist/chunks/debounce-1e7f29bf.js +40 -0
- package/dist/chunks/debounce-1e7f29bf.js.map +1 -0
- package/dist/chunks/{index-e0185864.js → debounce-c595d128.js} +1 -1
- package/dist/chunks/floating-ui.react-0f8b5c36.js +5 -0
- package/dist/chunks/floating-ui.react-77cadca5.js +2469 -0
- package/dist/chunks/floating-ui.react-77cadca5.js.map +1 -0
- package/dist/chunks/floating-ui.react-dom-3fffb30c.js +2356 -0
- package/dist/chunks/floating-ui.react-dom-3fffb30c.js.map +1 -0
- package/dist/chunks/floating-ui.react-dom-dc823237.js +1 -0
- package/dist/chunks/style-inject.es-746bb8ed.js +29 -0
- package/dist/chunks/style-inject.es-746bb8ed.js.map +1 -0
- package/dist/chunks/throttle-278836f4.js +45 -0
- package/dist/chunks/throttle-278836f4.js.map +1 -0
- package/dist/element-options/components/element-options-color-picker.d.ts.map +1 -1
- package/dist/element-options/components/element-options-content.d.ts.map +1 -1
- package/dist/element-options/components/element-options-root.d.ts +1 -1
- package/dist/element-options/components/element-options-root.d.ts.map +1 -1
- package/dist/element-options/components/element-options-select.d.ts.map +1 -1
- package/dist/element-options/components/element-options-slider.d.ts.map +1 -1
- package/dist/element-options/components/element-options-toggle.d.ts.map +1 -1
- package/dist/element-options/components/element-options-trigger.d.ts +1 -1
- package/dist/element-options/components/element-options-trigger.d.ts.map +1 -1
- package/dist/element-options/context/element-options-context.d.ts +1 -1
- package/dist/element-options/index.d.ts +3 -3
- package/dist/element-options/types.d.ts +1 -14
- package/dist/element-options/types.d.ts.map +1 -1
- package/dist/element-options.js +3 -3
- package/dist/element-options.js.map +1 -0
- package/dist/floating-block-actions/floating-block-actions.d.ts +4 -3
- package/dist/floating-block-actions/floating-block-actions.d.ts.map +1 -1
- package/dist/floating-block-actions.js +1 -1
- package/dist/floating-block-actions.js.map +1 -0
- package/dist/floating-toolbar/floating-toolbar.d.ts +4 -4
- package/dist/floating-toolbar/floating-toolbar.d.ts.map +1 -1
- package/dist/floating-toolbar.js +1 -1
- package/dist/floating-toolbar.js.map +1 -0
- package/dist/highlight-color-picker/highlight-color-picker.d.ts +1 -0
- package/dist/highlight-color-picker/highlight-color-picker.d.ts.map +1 -1
- package/dist/highlight-color-picker/index.d.ts +0 -1
- package/dist/highlight-color-picker/index.d.ts.map +1 -1
- package/dist/highlight-color-picker.js +1 -1
- package/dist/highlight-color-picker.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -0
- package/dist/overlay.js +1 -1
- package/dist/overlay.js.map +1 -0
- package/dist/portal/Portal.d.ts +1 -1
- package/dist/portal/Portal.d.ts.map +1 -1
- package/dist/portal.js +1 -1
- package/dist/portal.js.map +1 -0
- package/dist/selection-box/SelectionBox.d.ts.map +1 -1
- package/dist/selection-box/hooks.d.ts.map +1 -1
- package/dist/selection-box.js +1 -1
- package/dist/selection-box.js.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandContent.d.ts → slash-command-content.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-content.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandEmpty.d.ts → slash-command-empty.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-empty.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandFooter.d.ts → slash-command-footer.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-footer.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandGroup.d.ts → slash-command-group.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-group.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandInput.d.ts → slash-command-input.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-input.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandItem.d.ts → slash-command-item.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-item.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandList.d.ts → slash-command-list.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-list.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandLoading.d.ts → slash-command-loading.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-loading.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandRoot.d.ts → slash-command-root.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-root.d.ts.map +1 -0
- package/dist/slash-command-menu/components/{SlashCommandSeparator.d.ts → slash-command-separator.d.ts} +1 -1
- package/dist/slash-command-menu/components/slash-command-separator.d.ts.map +1 -0
- package/dist/slash-command-menu/constants.d.ts.map +1 -1
- package/dist/slash-command-menu/context/{SlashCommandContext.d.ts → slash-command-context.d.ts} +1 -1
- package/dist/slash-command-menu/context/slash-command-context.d.ts.map +1 -0
- package/dist/slash-command-menu/index.d.ts +32 -32
- package/dist/slash-command-menu/index.d.ts.map +1 -1
- package/dist/slash-command-menu.js +1 -1
- package/dist/slash-command-menu.js.map +1 -0
- package/dist/utils/debounce.d.ts +5 -0
- package/dist/utils/debounce.d.ts.map +1 -0
- package/package.json +8 -6
- package/LICENSE +0 -21
- package/dist/chunks/_tslib-5e145dfd.js +0 -1
- package/dist/chunks/floating-ui.react-727e4287.js +0 -5
- package/dist/chunks/highlight-color-picker-ce0b19ac.js +0 -1
- package/dist/slash-command-menu/components/SlashCommandContent.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandEmpty.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandFooter.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandGroup.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandInput.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandItem.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandList.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandLoading.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandRoot.d.ts.map +0 -1
- package/dist/slash-command-menu/components/SlashCommandSeparator.d.ts.map +0 -1
- package/dist/slash-command-menu/context/SlashCommandContext.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-menu-list.d.ts","sourceRoot":"","sources":["../../src/action-menu-list/action-menu-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"action-menu-list.d.ts","sourceRoot":"","sources":["../../src/action-menu-list/action-menu-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAepD,OAAO,KAA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,SAAS,CAAC;CAC3B,CAAC;AAgDF,KAAK,wBAAwB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAY/D,eAAO,MAAM,cAAc;iIAtSxB,uBAAuB;;;;qIAAvB,uBAAuB;;;;mBAkIb,SAAS;;;;;;;eAuGb,MAAM,GAAG,SAAS;;;CAmEzB,CAAC;AAEH,YAAY,EACV,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,GAClB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
1
|
+
import type { CSSProperties, HTMLProps } from 'react';
|
|
2
2
|
import type { ActionMenuItem } from './types';
|
|
3
3
|
export type ActionMenuListContextValue = {
|
|
4
4
|
/** Whether menu is open */
|
|
@@ -19,6 +19,8 @@ export type ActionMenuListContextValue = {
|
|
|
19
19
|
floatingStyles: CSSProperties;
|
|
20
20
|
/** Ref setter for floating element */
|
|
21
21
|
setFloatingRef: (node: HTMLElement | null) => void;
|
|
22
|
+
/** Props from useInteractions for dismiss handling */
|
|
23
|
+
getFloatingProps: (userProps?: HTMLProps<HTMLElement>) => Record<string, unknown>;
|
|
22
24
|
};
|
|
23
25
|
export declare const ActionMenuListContext: import("react").Context<ActionMenuListContextValue | null>;
|
|
24
26
|
export declare const useActionMenuListContext: () => ActionMenuListContextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/action-menu-list/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/action-menu-list/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,0BAA0B,GAAG;IACvC,2BAA2B;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,wBAAwB;IACxB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,4CAA4C;IAC5C,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,wCAAwC;IACxC,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,+BAA+B;IAC/B,iBAAiB,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,oCAAoC;IACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,qBAAqB;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,sCAAsC;IACtC,cAAc,EAAE,aAAa,CAAC;IAC9B,sCAAsC;IACtC,cAAc,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,sDAAsD;IACtD,gBAAgB,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnF,CAAC;AAEF,eAAO,MAAM,qBAAqB,4DAAyD,CAAC;AAE5F,eAAO,MAAM,wBAAwB,kCAQpC,CAAC"}
|
package/dist/action-menu-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t}from"./chunks/_tslib-5e145dfd.js";import{jsx as i,jsxs as o,Fragment as e}from"react/jsx-runtime";import{createContext as n,useContext as a,forwardRef as l,useState as s,useMemo as r,useCallback as c,isValidElement as u,cloneElement as p}from"react";import{d,u as m,f as y,s as g,o as v,a as h,c as f}from"./chunks/floating-ui.react-727e4287.js";import{Blocks as b,getAllowedPluginsFromElement as x,getRootBlockElement as w,useYooptaEditor as k}from"@yoopta/editor";import{s as j}from"./chunks/style-inject.es-e87a8d02.js";import{Portal as N}from"./portal.js";import{Overlay as O}from"./overlay.js";import"react-dom";const A=n(null),z=()=>{const t=a(A);if(!t)throw new Error("ActionMenuList components must be used within <ActionMenuList>");return t};function M(t){const i=Object.keys(t.plugins);let o=null;if("number"==typeof t.path.current){const i=b.getBlockSlate(t,{at:t.path.current});i&&(o=x(t,i))}let e=i;return o&&o.length>0&&(e="string"==typeof i[0]?i.filter(t=>o.includes(t)):i.filter(t=>o.includes(t.type))),e.map(i=>{var o,e,n,a,l,s;if("string"==typeof i){return{type:i,title:(null===(e=null===(o=t.plugins[i].options)||void 0===o?void 0:o.display)||void 0===e?void 0:e.title)||i,description:null===(a=null===(n=t.plugins[i].options)||void 0===n?void 0:n.display)||void 0===a?void 0:a.description,icon:null===(s=null===(l=t.plugins[i].options)||void 0===l?void 0:l.display)||void 0===s?void 0:s.icon}}return i})}function S(t,i){var o;const e=t.plugins[i];if(!e)return!1;const n=w(e.elements);return"void"!==(null===(o=null==n?void 0:n.props)||void 0===o?void 0:o.nodeType)}j(".yoopta-ui-action-menu-list-overlay{background:transparent;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list{bottom:auto;left:0;margin:0;position:absolute;right:auto;top:0;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list-content{background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-radius,.5rem);box-shadow:var(\n --yoopta-ui-action-menu-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)\n );max-height:var(--yoopta-ui-action-menu-max-height,330px);overflow-x:hidden;overflow-y:auto;padding:var(--yoopta-ui-action-menu-padding,.5rem);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-ui-action-menu-list-group{color:hsl(var(--yoopta-ui-foreground));overflow:hidden;padding:0}.yoopta-ui-action-menu-list-item{align-items:center;background:transparent;border:none;border-radius:var(--yoopta-ui-action-menu-item-radius,.375rem);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-action-menu-item-font-size,.875rem);gap:var(--yoopta-ui-action-menu-item-gap,.5rem);margin-bottom:.125rem;outline:none;padding:var(--yoopta-ui-action-menu-item-padding,.5rem);text-align:left;transition:background-color .15s ease-out;width:100%}.yoopta-ui-action-menu-list-item:last-child{margin-bottom:0}.yoopta-ui-action-menu-list-item:hover,.yoopta-ui-action-menu-list-item[data-selected=true]{background:hsl(var(--yoopta-ui-accent))}.yoopta-ui-action-menu-list-item:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-action-menu-list-item-icon{align-items:center;background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-icon-radius,.375rem);display:flex;flex-shrink:0;justify-content:center}.yoopta-ui-action-menu-list-item-icon img,.yoopta-ui-action-menu-list-item-icon svg{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.yoopta-ui-action-menu-list-item-content{flex:1;min-width:0}.yoopta-ui-action-menu-list-item-title{font-weight:500;line-height:1.25}.yoopta-ui-action-menu-list-item-description{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-item-description-font-size,.75rem);line-height:1.25;margin-top:.125rem;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoopta-ui-action-menu-list-empty{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-empty-font-size,.75rem);padding:var(--yoopta-ui-action-menu-empty-padding,.5rem);text-align:left}.yoopta-ui-action-menu-list-small{max-height:280px;min-width:180px;padding:.375rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item{font-size:.8125rem;gap:.375rem;padding:.375rem .5rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-icon{height:20px;padding:2px;width:20px}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-title{font-size:.8125rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-description{display:none}.yoopta-ui-action-menu-list-default{min-width:244px}.yoopta-ui-action-menu-list-default .yoopta-ui-action-menu-list-item-icon{height:40px;padding:6px;width:40px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar{width:8px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-track{background:transparent}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb{background:hsl(var(--yoopta-ui-border));border-radius:4px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb:hover{background:hsl(var(--yoopta-ui-muted-foreground))}");const C=({children:t,open:o,onOpenChange:e,defaultOpen:n=!1,anchor:a=null,view:l="default",placement:u="bottom-start",className:p=""})=>{var d;const b=k(),[x,j]=s(n),N=void 0!==o,O=N?o:x,z=r(()=>M(b).filter(t=>S(b,t.type)).filter(t=>{var i,o,e;const n=b.plugins[t.type],a=w(n.elements);return"inline"!==(null===(i=null==a?void 0:a.props)||void 0===i?void 0:i.nodeType)&&"inlineVoid"!==(null===(o=null==a?void 0:a.props)||void 0===o?void 0:o.nodeType)&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType)}),[b]),[C,L]=s(null!==(d=z[0])&&void 0!==d?d:null),{refs:E,floatingStyles:$,context:F}=m({elements:{reference:a},placement:u,open:O,middleware:[y(),g(),v(10)],whileElementsMounted:h}),{isMounted:T,styles:B}=f(F,{duration:100}),I=r(()=>Object.assign(Object.assign(Object.assign({},$),B),{minWidth:"small"===l?200:244}),[$,B,l]),P=c(()=>{var t;N||j(!1),null==e||e(!1),L(null!==(t=z[0])&&void 0!==t?t:null)},[N,e,z]),R=c(t=>{Array.isArray(b.path.selected)&&b.path.selected.length>0?b.batchOperations(()=>{b.path.selected.forEach(i=>{b.toggleBlock(t,{preserveContent:!0,focus:!0,at:i})})}):b.toggleBlock(t,{preserveContent:!0,focus:!0,at:b.path.current}),P()},[b,P]),G=r(()=>({isOpen:T,view:l,actions:z,selectedAction:C,setSelectedAction:L,onSelect:R,close:P,floatingStyles:I,setFloatingRef:E.setFloating}),[T,l,z,C,R,P,I,E.setFloating]),_={actions:z,selectedAction:C,onSelect:R,empty:0===z.length},D="function"==typeof t?t(_):t;return i(A.Provider,Object.assign({value:G},{children:i("div",Object.assign({className:p},{children:D}))}))};C.displayName="ActionMenuList";const L=l((o,e)=>{var{children:n,className:a=""}=o,l=t(o,["children","className"]);const{isOpen:s,floatingStyles:r,setFloatingRef:c,actions:u,selectedAction:p,setSelectedAction:m,onSelect:y,view:g,close:v}=z(),h=d([e,c]);if(!s)return null;const f=null!=n?n:0===u.length?i(F,{}):i(E,{children:u.map(t=>i($,{action:t,selected:t.type===(null==p?void 0:p.type),onMouseEnter:()=>m(t),onClick:()=>y(t.type)},t.type))});return i(N,Object.assign({id:"yoopta-ui-action-menu-list-portal"},{children:i(O,Object.assign({lockScroll:!1,onClick:v,className:"yoopta-ui-action-menu-list-overlay"},{children:i("div",Object.assign({ref:h,role:"listbox",tabIndex:0,className:`yoopta-ui-action-menu-list-content yoopta-ui-action-menu-list-${g} ${a}`,style:r,onMouseDown:t=>t.stopPropagation(),onClick:t=>t.stopPropagation()},l,{children:f}))}))}))});L.displayName="ActionMenuList.Content";const E=l((o,e)=>{var{children:n,className:a=""}=o,l=t(o,["children","className"]);return i("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-group ${a}`},l,{children:n}))});E.displayName="ActionMenuList.Group";const $=l((n,a)=>{var{action:l,selected:s,icon:r,className:c="",children:d}=n,m=t(n,["action","selected","icon","className","children"]);const y=null!=r?r:null==l?void 0:l.icon;return o("button",Object.assign({ref:a,type:"button",className:`yoopta-ui-action-menu-list-item ${s?"selected":""} ${c}`,"data-action-menu-item-type":null==l?void 0:l.type,"data-selected":s,"aria-pressed":s},m,{children:[l&&o(e,{children:[y&&i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-icon"},{children:(t=>{if(!t)return null;if("string"==typeof t)return i("img",{src:t,alt:"icon"});if(u(t))return p(t);return i(t,{})})(y)})),o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-content"},{children:[i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-title"},{children:null==l?void 0:l.title})),(null==l?void 0:l.description)&&i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-description"},{children:null==l?void 0:l.description}))]}))]}),d]}))});$.displayName="ActionMenuList.Item";const F=l((o,e)=>{var{children:n,className:a=""}=o,l=t(o,["children","className"]);return i("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-empty ${a}`},l,{children:null!=n?n:"No actions available"}))});F.displayName="ActionMenuList.Empty";const T=Object.assign(C,{Root:C,Content:L,Group:E,Item:$,Empty:F});export{T as ActionMenuList,S as filterToggleActions,M as mapActionMenuItems,z as useActionMenuListContext};
|
|
1
|
+
import{a as t}from"./chunks/_tslib-29461875.js";import{jsx as o,jsxs as i,Fragment as e}from"react/jsx-runtime";import{createContext as n,useContext as a,forwardRef as r,useRef as s,useEffect as l,useState as u,useMemo as p,useCallback as c,isValidElement as d,cloneElement as m}from"react";import{b as y,F as g,u as h,c as v,d as f}from"./chunks/floating-ui.react-0f8b5c36.js";import{Blocks as b,getAllowedPluginsFromElement as x,getRootBlockElement as w,useYooptaEditor as k}from"@yoopta/editor";import{s as j}from"./chunks/style-inject.es-e87a8d02.js";import{Overlay as N}from"./overlay.js";import{l as O,s as z,o as A,j as F}from"./chunks/floating-ui.react-dom-dc823237.js";import"react-dom";const M=n(null),S=()=>{const t=a(M);if(!t)throw new Error("ActionMenuList components must be used within <ActionMenuList>");return t};function C(t){const o=Object.keys(t.plugins);let i=null;if("number"==typeof t.path.current){const o=b.getBlockSlate(t,{at:t.path.current});o&&(i=x(t,o))}let e=o;return i&&i.length>0&&(e="string"==typeof o[0]?o.filter(t=>i.includes(t)):o.filter(t=>i.includes(t.type))),e.map(o=>{var i,e,n,a,r,s;if("string"==typeof o){return{type:o,title:(null===(e=null===(i=t.plugins[o].options)||void 0===i?void 0:i.display)||void 0===e?void 0:e.title)||o,description:null===(a=null===(n=t.plugins[o].options)||void 0===n?void 0:n.display)||void 0===a?void 0:a.description,icon:null===(s=null===(r=t.plugins[o].options)||void 0===r?void 0:r.display)||void 0===s?void 0:s.icon}}return o})}function E(t,o){var i;const e=t.plugins[o];if(!e)return!1;const n=w(e.elements);return"void"!==(null===(i=null==n?void 0:n.props)||void 0===i?void 0:i.nodeType)}j(":root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}.yoopta-ui-action-menu-list-overlay{background:transparent;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list{bottom:auto;left:0;margin:0;position:absolute;right:auto;top:0;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list-content{background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-radius,.5rem);box-shadow:var(--yoopta-ui-action-menu-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1));max-height:var(--yoopta-ui-action-menu-max-height,330px);overflow-x:hidden;overflow-y:auto;padding:var(--yoopta-ui-action-menu-padding,.5rem);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-ui-action-menu-list-group{color:hsl(var(--yoopta-ui-foreground));overflow:hidden;padding:0}.yoopta-ui-action-menu-list-item{align-items:center;background:transparent;border:none;border-radius:var(--yoopta-ui-action-menu-item-radius,.375rem);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-action-menu-item-font-size,.875rem);gap:var(--yoopta-ui-action-menu-item-gap,.5rem);margin-bottom:.125rem;outline:none;padding:var(--yoopta-ui-action-menu-item-padding,.5rem);text-align:left;transition:background-color .15s ease-out;width:100%}.yoopta-ui-action-menu-list-item:last-child{margin-bottom:0}.yoopta-ui-action-menu-list-item:hover,.yoopta-ui-action-menu-list-item[data-selected=true]{background:hsl(var(--yoopta-ui-accent))}.yoopta-ui-action-menu-list-item:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-action-menu-list-item-icon{align-items:center;background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-icon-radius,.375rem);display:flex;flex-shrink:0;justify-content:center}.yoopta-ui-action-menu-list-item-icon img,.yoopta-ui-action-menu-list-item-icon svg{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.yoopta-ui-action-menu-list-item-content{flex:1;min-width:0}.yoopta-ui-action-menu-list-item-title{font-weight:500;line-height:1.25}.yoopta-ui-action-menu-list-item-description{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-item-description-font-size,.75rem);line-height:1.25;margin-top:.125rem;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoopta-ui-action-menu-list-empty{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-empty-font-size,.75rem);padding:var(--yoopta-ui-action-menu-empty-padding,.5rem);text-align:left}.yoopta-ui-action-menu-list-small{max-height:280px;min-width:180px;padding:.375rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item{font-size:.8125rem;gap:.375rem;padding:.375rem .5rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-icon{height:20px;padding:2px;width:20px}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-title{font-size:.8125rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-description{display:none}.yoopta-ui-action-menu-list-default{min-width:244px}.yoopta-ui-action-menu-list-default .yoopta-ui-action-menu-list-item-icon{height:40px;padding:6px;width:40px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar{width:8px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-track{background:transparent}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb{background:hsl(var(--yoopta-ui-border));border-radius:4px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb:hover{background:hsl(var(--yoopta-ui-muted-foreground))}");const L=({children:t,open:i,onOpenChange:e,defaultOpen:n=!1,anchor:a=null,view:r="default",placement:s="bottom-start",className:d=""})=>{const m=k(),[y,g]=u(n),b=void 0!==i,x=b?i:y,j=p(()=>{if(!x)return[];return C(m).filter(t=>E(m,t.type)).filter(t=>{var o,i,e;const n=m.plugins[t.type],a=w(n.elements);return"inline"!==(null===(o=null==a?void 0:a.props)||void 0===o?void 0:o.nodeType)&&"inlineVoid"!==(null===(i=null==a?void 0:a.props)||void 0===i?void 0:i.nodeType)&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType)})},[m,x]),[N,S]=u(null);l(()=>{j.length>0&&S(j[0])},[j]);const L=c(t=>{b||g(t),null==e||e(t)},[b,e]),{refs:P,floatingStyles:$,context:T}=h({elements:{reference:a},placement:s,open:x,onOpenChange:L,middleware:[O(),z(),A(10)],whileElementsMounted:F}),B=v(T,{escapeKey:!0,outsidePress:!1}),{getFloatingProps:I}=f([B]),R=p(()=>Object.assign(Object.assign({},$),{minWidth:"small"===r?200:244}),[$,r]),D=c(()=>{var t;L(!1),S(null!==(t=j[0])&&void 0!==t?t:null)},[L,j]),G=c(t=>{Array.isArray(m.path.selected)&&m.path.selected.length>0?m.batchOperations(()=>{m.path.selected.forEach(o=>{m.toggleBlock(t,{preserveContent:!0,focus:!0,at:o})})}):m.toggleBlock(t,{preserveContent:!0,focus:!0,at:m.path.current}),D()},[m,D]),q=p(()=>({isOpen:x,view:r,actions:j,selectedAction:N,setSelectedAction:S,onSelect:G,close:D,floatingStyles:R,setFloatingRef:P.setFloating,getFloatingProps:I}),[x,r,j,N,G,D,R,P.setFloating,I]),K={actions:j,selectedAction:N,onSelect:G,empty:0===j.length},V="function"==typeof t?t(K):t;return o(M.Provider,Object.assign({value:q},{children:o("div",Object.assign({className:d},{children:V}))}))};L.displayName="ActionMenuList";const P=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);const{isOpen:u,floatingStyles:p,setFloatingRef:c,actions:d,selectedAction:m,setSelectedAction:h,onSelect:v,view:f,close:b,getFloatingProps:x}=S(),w=s(null),j=y([e,c,w]),O=k();if(l(()=>{let t;return u&&w.current&&(t=requestAnimationFrame(()=>{var t;null===(t=w.current)||void 0===t||t.focus()})),()=>cancelAnimationFrame(t)},[u]),!u)return null;const z=null!=n?n:0===d.length?o(B,{}):o($,{children:d.map(t=>o(T,{action:t,selected:t.type===(null==m?void 0:m.type),onMouseEnter:()=>h(t),onClick:()=>v(t.type)},t.type))});return o(g,Object.assign({root:O.refElement,id:`yoopta-ui-action-menu-list-portal-${O.id}`},{children:o(N,Object.assign({lockScroll:!1,onClick:b,className:"yoopta-ui-action-menu-list-overlay"},{children:o("div",Object.assign({ref:j,role:"listbox",tabIndex:0,className:`yoopta-ui-action-menu-list-content yoopta-ui-action-menu-list-${f} ${a}`,style:p},x({onMouseDown:t=>{t.preventDefault(),t.stopPropagation()},onClick:t=>t.stopPropagation()}),r,{children:z}))}))}))});P.displayName="ActionMenuList.Content";const $=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);return o("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-group ${a}`},r,{children:n}))});$.displayName="ActionMenuList.Group";const T=r((n,a)=>{var{action:r,selected:s,icon:l,className:u="",children:p}=n,c=t(n,["action","selected","icon","className","children"]);const y=null!=l?l:null==r?void 0:r.icon;return i("button",Object.assign({ref:a,type:"button",className:`yoopta-ui-action-menu-list-item ${s?"selected":""} ${u}`,"data-action-menu-item-type":null==r?void 0:r.type,"data-selected":s,"aria-pressed":s},c,{children:[r&&i(e,{children:[y&&o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-icon"},{children:(t=>{if(!t)return null;if("string"==typeof t)return o("img",{src:t,alt:"icon"});if(d(t))return m(t);return o(t,{})})(y)})),i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-content"},{children:[o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-title"},{children:null==r?void 0:r.title})),(null==r?void 0:r.description)&&o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-description"},{children:null==r?void 0:r.description}))]}))]}),p]}))});T.displayName="ActionMenuList.Item";const B=r((i,e)=>{var{children:n,className:a=""}=i,r=t(i,["children","className"]);return o("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-empty ${a}`},r,{children:null!=n?n:"No actions available"}))});B.displayName="ActionMenuList.Empty";const I=Object.assign(L,{Root:L,Content:P,Group:$,Item:T,Empty:B});export{I as ActionMenuList,E as filterToggleActions,C as mapActionMenuItems,S as useActionMenuListContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-menu-list.js","sources":["../src/action-menu-list/context.tsx","../src/action-menu-list/utils.ts","../src/action-menu-list/action-menu-list.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { CSSProperties, HTMLProps } from 'react';\n\nimport type { ActionMenuItem } from './types';\n\nexport type ActionMenuListContextValue = {\n /** Whether menu is open */\n isOpen: boolean;\n /** Current view mode */\n view: 'small' | 'default';\n /** Available actions from editor plugins */\n actions: ActionMenuItem[];\n /** Currently selected/hovered action */\n selectedAction: ActionMenuItem | null;\n /** Select an action (hover) */\n setSelectedAction: (action: ActionMenuItem) => void;\n /** Execute action (toggle block) */\n onSelect: (type: string) => void;\n /** Close the menu */\n close: () => void;\n /** Floating styles for positioning */\n floatingStyles: CSSProperties;\n /** Ref setter for floating element */\n setFloatingRef: (node: HTMLElement | null) => void;\n /** Props from useInteractions for dismiss handling */\n getFloatingProps: (userProps?: HTMLProps<HTMLElement>) => Record<string, unknown>;\n};\n\nexport const ActionMenuListContext = createContext<ActionMenuListContextValue | null>(null);\n\nexport const useActionMenuListContext = () => {\n const context = useContext(ActionMenuListContext);\n\n if (!context) {\n throw new Error('ActionMenuList components must be used within <ActionMenuList>');\n }\n\n return context;\n};\n","import { Blocks, getAllowedPluginsFromElement, getRootBlockElement } from '@yoopta/editor';\nimport type { Plugin, SlateElement, YooEditor, YooptaBlock, YooptaBlockData } from '@yoopta/editor';\n\nimport type { ActionMenuItem } from './types';\n\nconst filterBy = (\n item: YooptaBlockData | YooptaBlock['options'],\n text: string,\n field: string,\n): boolean => {\n if (!item || typeof item[field] === 'undefined') return false;\n\n const value = item[field];\n const searchText = text.toLowerCase().trim();\n\n if (Array.isArray(value)) {\n return value\n .filter(Boolean)\n .map((v) => String(v).toLowerCase())\n .some((v) => v.includes(searchText));\n }\n\n return String(value).toLowerCase().includes(searchText);\n};\n\nexport const filterActionMenuItems = (\n blockPlugin: Plugin<Record<string, SlateElement>, unknown>,\n searchText: string,\n): boolean => {\n if (!searchText.trim()) return true;\n if (!blockPlugin) return false;\n\n const searchTerms = searchText.toLowerCase().split(/\\s+/);\n\n return searchTerms.every((term) => {\n const typeMatch = filterBy(blockPlugin, term, 'type');\n if (typeMatch) return true;\n\n const titleMatch =\n blockPlugin.options?.display && filterBy(blockPlugin.options.display, term, 'title');\n if (titleMatch) return true;\n\n const shortcutMatch = blockPlugin.options && filterBy(blockPlugin.options, term, 'shortcuts');\n if (shortcutMatch) return true;\n\n const descriptionMatch =\n blockPlugin.options?.display && filterBy(blockPlugin.options.display, term, 'description');\n if (descriptionMatch) return true;\n\n return false;\n });\n};\n\nexport function mapActionMenuItems(editor: YooEditor): ActionMenuItem[] {\n const items: string[] | ActionMenuItem[] = Object.keys(editor.plugins);\n // Check if we're inside an element with injectElementsFromPlugins\n let injectElementsFromPlugins: string[] | null = null;\n\n if (typeof editor.path.current === 'number') {\n const slate = Blocks.getBlockSlate(editor, { at: editor.path.current });\n if (slate) {\n injectElementsFromPlugins = getAllowedPluginsFromElement(editor, slate);\n }\n }\n\n // Filter items based on injectElementsFromPlugins\n let filteredItems = items;\n\n if (injectElementsFromPlugins && injectElementsFromPlugins.length > 0) {\n if (typeof items[0] === 'string') {\n filteredItems = (items as string[]).filter((item) =>\n injectElementsFromPlugins!.includes(item),\n );\n } else {\n filteredItems = items.filter((item) => injectElementsFromPlugins!.includes(item.type));\n }\n }\n\n return filteredItems.map((item: string | ActionMenuItem) => {\n if (typeof item === 'string') {\n const title = editor.plugins[item].options?.display?.title || item;\n const description = editor.plugins[item].options?.display?.description;\n const icon = editor.plugins[item].options?.display?.icon;\n return { type: item, title, description, icon };\n }\n return item;\n });\n}\n\nexport function filterToggleActions(editor: YooEditor, type: string) {\n const block = editor.plugins[type];\n if (!block) return false;\n\n const rootBlock = getRootBlockElement(block.elements);\n if (rootBlock?.props?.nodeType === 'void') return false;\n return true;\n}\n\nexport function isSlashPressed(event: KeyboardEvent): boolean {\n return (\n event.key === '/' ||\n event.keyCode === 191 ||\n event.which === 191 ||\n event.code === 'Slash' ||\n event.key === '/' ||\n (event.key === '.' && event.shiftKey)\n );\n}\n","import type { CSSProperties, HTMLAttributes, ReactNode } from 'react';\nimport { cloneElement, forwardRef, isValidElement, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { Placement } from '@floating-ui/react';\nimport {\n FloatingPortal,\n autoUpdate,\n flip,\n offset,\n shift,\n useDismiss,\n useFloating,\n useInteractions,\n useMergeRefs,\n} from '@floating-ui/react';\nimport { getRootBlockElement, useYooptaEditor } from '@yoopta/editor';\n\nimport { ActionMenuListContext, useActionMenuListContext } from './context';\nimport type { ActionMenuItem } from './types';\nimport { filterToggleActions, mapActionMenuItems } from './utils';\nimport { Overlay } from '../overlay';\nimport './action-menu-list.css';\n\ntype ActionMenuListApi = {\n /** Available actions from editor plugins */\n actions: ActionMenuItem[];\n /** Currently selected action */\n selectedAction: ActionMenuItem | null;\n /** Execute action (toggle block type) */\n onSelect: (type: string) => void;\n /** Whether actions list is empty */\n empty: boolean;\n};\n\ntype ActionMenuListRootProps = {\n children: ReactNode | ((api: ActionMenuListApi) => ReactNode);\n /** Controlled open state */\n open?: boolean;\n /** Callback when open state changes */\n onOpenChange?: (open: boolean) => void;\n /** Default open state for uncontrolled usage */\n defaultOpen?: boolean;\n /** Anchor element for positioning */\n anchor?: HTMLElement | null;\n /** View mode - 'small' for compact, 'default' for full */\n view?: 'small' | 'default';\n /** Placement relative to anchor */\n placement?: Placement;\n className?: string;\n};\n\nconst ActionMenuListRoot = ({\n children,\n open: controlledOpen,\n onOpenChange: controlledOnOpenChange,\n defaultOpen = false,\n anchor = null,\n view = 'default',\n placement = 'bottom-start',\n className = '',\n}: ActionMenuListRootProps) => {\n const editor = useYooptaEditor();\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n\n const isControlled = controlledOpen !== undefined;\n const isOpen = isControlled ? controlledOpen : uncontrolledOpen;\n\n const actions = useMemo(() => {\n // Skip computation when menu is closed\n if (!isOpen) return [];\n\n const baseActions = mapActionMenuItems(editor)\n .filter((item) => filterToggleActions(editor, item.type))\n .filter((item) => {\n const plugin = editor.plugins[item.type];\n const rootElement = getRootBlockElement(plugin.elements);\n return (\n rootElement?.props?.nodeType !== 'inline' &&\n rootElement?.props?.nodeType !== 'inlineVoid' &&\n rootElement?.props?.nodeType !== 'void'\n );\n });\n\n return baseActions;\n }, [editor, isOpen]);\n\n const [selectedAction, setSelectedAction] = useState<ActionMenuItem | null>(null);\n\n // Sync selectedAction when actions list changes (e.g. menu opens with new context)\n useEffect(() => {\n if (actions.length > 0) {\n setSelectedAction(actions[0]);\n }\n }, [actions]);\n\n const onOpenChange = useCallback(\n (newOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(newOpen);\n }\n controlledOnOpenChange?.(newOpen);\n },\n [isControlled, controlledOnOpenChange],\n );\n\n const { refs, floatingStyles, context } = useFloating({\n elements: { reference: anchor },\n placement,\n open: isOpen,\n onOpenChange,\n middleware: [flip(), shift(), offset(10)],\n whileElementsMounted: autoUpdate,\n });\n\n // Handle dismiss (escape key, outside press handled by Overlay)\n const dismiss = useDismiss(context, {\n escapeKey: true,\n outsidePress: false, // Overlay handles this\n });\n\n const { getFloatingProps } = useInteractions([dismiss]);\n\n const combinedStyles: CSSProperties = useMemo(\n () => ({\n ...floatingStyles,\n minWidth: view === 'small' ? 200 : 244,\n }),\n [floatingStyles, view],\n );\n\n const close = useCallback(() => {\n onOpenChange(false);\n setSelectedAction(actions[0] ?? null);\n }, [onOpenChange, actions]);\n\n const onSelect = useCallback(\n (type: string) => {\n if (Array.isArray(editor.path.selected) && editor.path.selected.length > 0) {\n editor.batchOperations(() => {\n editor.path.selected!.forEach((selected) => {\n editor.toggleBlock(type, { preserveContent: true, focus: true, at: selected });\n });\n });\n } else {\n editor.toggleBlock(type, { preserveContent: true, focus: true, at: editor.path.current });\n }\n\n close();\n },\n [editor, close],\n );\n\n // Context value\n const contextValue = useMemo(\n () => ({\n isOpen,\n view,\n actions,\n selectedAction,\n setSelectedAction,\n onSelect,\n close,\n floatingStyles: combinedStyles,\n setFloatingRef: refs.setFloating,\n getFloatingProps,\n }),\n [isOpen, view, actions, selectedAction, onSelect, close, combinedStyles, refs.setFloating, getFloatingProps],\n );\n\n // API for render props\n const api: ActionMenuListApi = {\n actions,\n selectedAction,\n onSelect,\n empty: actions.length === 0,\n };\n\n // Render props or regular children\n const content = typeof children === 'function' ? children(api) : children;\n\n return (\n <ActionMenuListContext.Provider value={contextValue}>\n <div className={className}>{content}</div>\n </ActionMenuListContext.Provider>\n );\n};\n\nActionMenuListRoot.displayName = 'ActionMenuList';\n\ntype ActionMenuListContentProps = {\n children?: ReactNode;\n className?: string;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst ActionMenuListContent = forwardRef<HTMLDivElement, ActionMenuListContentProps>(\n ({ children, className = '', ...props }, forwardedRef) => {\n const {\n isOpen,\n floatingStyles,\n setFloatingRef,\n actions,\n selectedAction,\n setSelectedAction,\n onSelect,\n view,\n close,\n getFloatingProps,\n } = useActionMenuListContext();\n const internalRef = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs([forwardedRef, setFloatingRef, internalRef]);\n const editor = useYooptaEditor();\n\n // Auto-focus content when it opens for proper escape key handling\n useEffect(() => {\n let raf;\n\n if (isOpen && internalRef.current) {\n // Use requestAnimationFrame to ensure DOM is ready\n raf = requestAnimationFrame(() => {\n internalRef.current?.focus();\n });\n }\n\n return () => cancelAnimationFrame(raf);\n }, [isOpen]);\n\n if (!isOpen) return null;\n\n // Auto-generate items if no children provided\n const content =\n children ??\n (actions.length === 0 ? (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n <ActionMenuListEmpty />\n ) : (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n <ActionMenuListGroup>\n {actions.map((action) => (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n <ActionMenuListItem\n key={action.type}\n action={action}\n selected={action.type === selectedAction?.type}\n onMouseEnter={() => setSelectedAction(action)}\n onClick={() => onSelect(action.type)}\n />\n ))}\n </ActionMenuListGroup>\n ));\n\n return (\n <FloatingPortal root={editor.refElement} id={`yoopta-ui-action-menu-list-portal-${editor.id}`}>\n <Overlay lockScroll={false} onClick={close} className=\"yoopta-ui-action-menu-list-overlay\">\n <div\n ref={mergedRef}\n role=\"listbox\"\n tabIndex={0}\n className={`yoopta-ui-action-menu-list-content yoopta-ui-action-menu-list-${view} ${className}`}\n style={floatingStyles}\n {...getFloatingProps({\n onMouseDown: (e) => {\n e.preventDefault();\n e.stopPropagation();\n },\n onClick: (e) => e.stopPropagation(),\n })}\n {...props}\n >\n {content}\n </div>\n </Overlay>\n </FloatingPortal>\n );\n },\n);\n\nActionMenuListContent.displayName = 'ActionMenuList.Content';\n\ntype ActionMenuListGroupProps = HTMLAttributes<HTMLDivElement>;\n\nconst ActionMenuListGroup = forwardRef<HTMLDivElement, ActionMenuListGroupProps>(\n ({ children, className = '', ...props }, ref) => (\n <div ref={ref} className={`yoopta-ui-action-menu-list-group ${className}`} {...props}>\n {children}\n </div>\n ),\n);\n\nActionMenuListGroup.displayName = 'ActionMenuList.Group';\n\ntype ActionMenuListItemProps = HTMLAttributes<HTMLButtonElement> & {\n action?: ActionMenuItem;\n selected?: boolean;\n icon?: string | ReactNode;\n};\n\nconst ActionMenuListItem = forwardRef<HTMLButtonElement, ActionMenuListItemProps>(\n ({ action, selected, icon: iconProp, className = '', children, ...props }, ref) => {\n const renderIcon = (icon: unknown) => {\n if (!icon) return null;\n\n if (typeof icon === 'string') {\n return <img src={icon} alt=\"icon\" />;\n }\n\n if (isValidElement(icon)) {\n return cloneElement(icon as React.ReactElement);\n }\n\n const IconComponent = icon as React.ComponentType;\n return <IconComponent />;\n };\n\n const iconToRender = iconProp ?? action?.icon;\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={`yoopta-ui-action-menu-list-item ${selected ? 'selected' : ''} ${className}`}\n data-action-menu-item-type={action?.type}\n data-selected={selected}\n aria-pressed={selected}\n {...props}\n >\n {action && (\n <>\n {iconToRender && <div className=\"yoopta-ui-action-menu-list-item-icon\">{renderIcon(iconToRender)}</div>}\n <div className=\"yoopta-ui-action-menu-list-item-content\">\n <div className=\"yoopta-ui-action-menu-list-item-title\">{action?.title}</div>\n {action?.description && <div className=\"yoopta-ui-action-menu-list-item-description\">{action?.description}</div>}\n </div>\n </>\n )}\n {children}\n </button>\n );\n },\n);\n\nActionMenuListItem.displayName = 'ActionMenuList.Item';\n\ntype ActionMenuListEmptyProps = HTMLAttributes<HTMLDivElement>;\n\nconst ActionMenuListEmpty = forwardRef<HTMLDivElement, ActionMenuListEmptyProps>(\n ({ children, className = '', ...props }, ref) => (\n <div ref={ref} className={`yoopta-ui-action-menu-list-empty ${className}`} {...props}>\n {children ?? 'No actions available'}\n </div>\n ),\n);\n\nActionMenuListEmpty.displayName = 'ActionMenuList.Empty';\n\nexport const ActionMenuList = Object.assign(ActionMenuListRoot, {\n Root: ActionMenuListRoot,\n Content: ActionMenuListContent,\n Group: ActionMenuListGroup,\n Item: ActionMenuListItem,\n Empty: ActionMenuListEmpty,\n});\n\nexport type {\n ActionMenuListRootProps,\n ActionMenuListContentProps,\n ActionMenuListGroupProps,\n ActionMenuListItemProps,\n ActionMenuListEmptyProps,\n ActionMenuListApi,\n};\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;AA4BO,MAAM,qBAAqB,GAAG,aAAa,CAAoC,IAAI,CAAC,CAAC;AAErF,MAAM,wBAAwB,GAAG,MAAK;AAC3C,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAElD,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;AACnF,KAAA;AAED,IAAA,OAAO,OAAO,CAAC;AACjB;;ACeM,SAAU,kBAAkB,CAAC,MAAiB,EAAA;IAClD,MAAM,KAAK,GAAgC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;;IAEvE,IAAI,yBAAyB,GAAoB,IAAI,CAAC;IAEtD,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE;AAC3C,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AACxE,QAAA,IAAI,KAAK,EAAE;AACT,YAAA,yBAAyB,GAAG,4BAA4B,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzE,SAAA;AACF,KAAA;;IAGD,IAAI,aAAa,GAAG,KAAK,CAAC;AAE1B,IAAA,IAAI,yBAAyB,IAAI,yBAAyB,CAAC,MAAM,GAAG,CAAC,EAAE;AACrE,QAAA,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,YAAA,aAAa,GAAI,KAAkB,CAAC,MAAM,CAAC,CAAC,IAAI,KAC9C,yBAA0B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAC1C,CAA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AACJ,CAAC,CACF,CAAC;AAEF,kBAAkB,CAAC,WAAW,GAAG,qBAAqB,CAAC;AAIvD,MAAM,mBAAmB,GAAG,UAAU,CACpC,CAAC,EAAsC,EAAE,GAAG,KAAI;QAA/C,EAAE,QAAQ,EAAE,SAAS,GAAG,EAAE,OAAY,EAAP,KAAK,GAApC,MAAA,CAAA,EAAA,EAAA,CAAA,UAAA,EAAA,WAAA,CAAsC,CAAF,CAAA;IAAY,QAC/CA,2BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,CAAA,iCAAA,EAAoC,SAAS,CAAA,CAAE,IAAM,KAAK,EAAA,EAAA,QAAA,EACjF,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,KAAA,CAAA,GAAR,QAAQ,GAAI,sBAAsB,EAC/B,CAAA,CAAA,EACP;AAAA,CAAA,CACF,CAAC;AAEF,mBAAmB,CAAC,WAAW,GAAG,sBAAsB,CAAC;MAE5C,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;AAC9D,IAAA,IAAI,EAAE,kBAAkB;AACxB,IAAA,OAAO,EAAE,qBAAqB;AAC9B,IAAA,KAAK,EAAE,mBAAmB;AAC1B,IAAA,IAAI,EAAE,kBAAkB;AACxB,IAAA,KAAK,EAAE,mBAAmB;AAC3B,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-dnd-context.d.ts","sourceRoot":"","sources":["../../src/block-dnd/block-dnd-context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"block-dnd-context.d.ts","sourceRoot":"","sources":["../../src/block-dnd/block-dnd-context.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAqB,MAAM,SAAS,CAAC;AAC7F,OAAO,iBAAiB,CAAC;AAIzB,eAAO,MAAM,kBAAkB,QAAO,oBAMrC,CAAC;AAQF,eAAO,MAAM,eAAe,sFAOzB,oBAAoB,4CAkMtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortable-block.d.ts","sourceRoot":"","sources":["../../src/block-dnd/sortable-block.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sortable-block.d.ts","sourceRoot":"","sources":["../../src/block-dnd/sortable-block.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,aAAa,yDAAyE,kBAAkB,4CAkEpH,CAAC"}
|
package/dist/block-dnd.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useMemo as o,useLayoutEffect as i,useEffect as a,useRef as l,useCallback as c,useState as s,createContext as d,memo as u,useReducer as g,useContext as v,cloneElement as f,forwardRef as h,isValidElement as p}from"react";import{unstable_batchedUpdates as b,createPortal as y}from"react-dom";import{Blocks as m}from"@yoopta/editor";import{s as w}from"./chunks/style-inject.es-e87a8d02.js";const x="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function D(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function k(e){return"nodeType"in e}function C(e){var t,n;return e?D(e)?e:k(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function R(e){const{Document:t}=C(e);return e instanceof t}function E(e){return!D(e)&&e instanceof C(e).HTMLElement}function N(e){return e instanceof C(e).SVGElement}function O(e){return e?D(e)?e.document:k(e)?R(e)?e:E(e)||N(e)?e.ownerDocument:document:document:document}const S=x?i:a;function I(e){const t=l(e);return S(()=>{t.current=e}),c(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function A(e,t){void 0===t&&(t=[e]);const n=l(e);return S(()=>{n.current!==e&&(n.current=e)},t),n}function T(e,t){const n=l();return o(()=>{const t=e(n.current);return n.current=t,t},[...t])}function M(e){const t=I(e),n=l(null),r=c(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function j(e){const t=l();return a(()=>{t.current=e},[e]),t.current}let L={};function B(e,t){return o(()=>{if(t)return t;const n=null==L[e]?0:L[e]+1;return L[e]=n,e+"-"+n},[e,t])}function P(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const z=P(1),Y=P(-1);function F(e){if(!e)return!1;const{KeyboardEvent:t}=C(e.target);return t&&e instanceof t}function X(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=C(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const K=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[K.Translate.toString(e),K.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),W="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function U(e){return e.matches(W)?e:e.querySelector(W)}const H={display:"none"};function J(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:H},n)}function V(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},n)}const q=d(null);const G={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Q={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Z(e){let{announcements:t=Q,container:n,hiddenTextDescribedById:i,screenReaderInstructions:l=G}=e;const{announce:d,announcement:u}=function(){const[e,t]=s("");return{announce:c(e=>{null!=e&&t(e)},[]),announcement:e}}(),g=B("DndLiveRegion"),[f,h]=s(!1);if(a(()=>{h(!0)},[]),function(e){const t=v(q);a(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(o(()=>({onDragStart(e){let{active:n}=e;d(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&d(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;d(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;d(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;d(t.onDragCancel({active:n,over:r}))}}),[d,t])),!f)return null;const p=r.createElement(r.Fragment,null,r.createElement(J,{id:i,value:l.draggable}),r.createElement(V,{id:g,announcement:u}));return n?y(p,n):p}var $;function _(){}function ee(e,t){return o(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}($||($={}));const te=Object.freeze({x:0,y:0});function ne(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function re(e,t){const n=X(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function oe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ie(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ae(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function le(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function ce(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const se=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=ce(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=ne(ce(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(oe)};function de(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const ue=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=de(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(ie)};function ge(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:te}function ve(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const fe=ve(1);function he(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const pe={ignoreTransform:!1};function be(e,t){void 0===t&&(t=pe);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=C(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=he(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,c=e.left-a-(1-o)*parseFloat(n),s=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:c+d,bottom:s+u,left:c}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:c}}function ye(e){return be(e,{ignoreTransform:!0})}function me(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(R(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!E(o)||N(o))return n;if(n.includes(o))return n;const i=C(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=C(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=C(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function we(e){const[t]=me(e,1);return null!=t?t:null}function xe(e){return x&&e?D(e)?e:k(e)?R(e)||e===O(e).scrollingElement?window:E(e)?e:null:null:null}function De(e){return D(e)?e.scrollX:e.scrollLeft}function ke(e){return D(e)?e.scrollY:e.scrollTop}function Ce(e){return{x:De(e),y:ke(e)}}var Re;function Ee(e){return!(!x||!e)&&e===document.scrollingElement}function Ne(e){const t={x:0,y:0},n=Ee(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Re||(Re={}));const Oe={x:.2,y:.2};function Se(e,t,n,r,o){let{top:i,left:a,right:l,bottom:c}=n;void 0===r&&(r=10),void 0===o&&(o=Oe);const{isTop:s,isBottom:d,isLeft:u,isRight:g}=Ne(e),v={x:0,y:0},f={x:0,y:0},h=t.height*o.y,p=t.width*o.x;return!s&&i<=t.top+h?(v.y=Re.Backward,f.y=r*Math.abs((t.top+h-i)/h)):!d&&c>=t.bottom-h&&(v.y=Re.Forward,f.y=r*Math.abs((t.bottom-h-c)/h)),!g&&l>=t.right-p?(v.x=Re.Forward,f.x=r*Math.abs((t.right-p-l)/p)):!u&&a<=t.left+p&&(v.x=Re.Backward,f.x=r*Math.abs((t.left+p-a)/p)),{direction:v,speed:f}}function Ie(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Ae(e){return e.reduce((e,t)=>z(e,Ce(t)),te)}function Te(e,t){if(void 0===t&&(t=be),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);we(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Me=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+De(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+ke(t),0)}]];class je{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=me(t),r=Ae(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Me)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Le{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Be(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Pe,ze;function Ye(e){e.preventDefault()}function Fe(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Pe||(Pe={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(ze||(ze={}));const Xe={start:[ze.Space,ze.Enter],cancel:[ze.Esc],end:[ze.Space,ze.Enter,ze.Tab]},Ke=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ze.Right:return{...n,x:n.x+25};case ze.Left:return{...n,x:n.x-25};case ze.Down:return{...n,y:n.y+25};case ze.Up:return{...n,y:n.y-25}}};class We{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Le(O(t)),this.windowListeners=new Le(C(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Pe.Resize,this.handleCancel),this.windowListeners.add(Pe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Pe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Te(n),t(te)}handleKeyDown(e){if(F(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Xe,coordinateGetter:i=Ke,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=n.current,s=c?{x:c.left,y:c.top}:te;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:n.current,currentCoordinates:s});if(d){const t=Y(d,s),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:u,minScroll:g}=Ne(n),v=Ie(n),f={x:Math.min(o===ze.Right?v.right-v.width/2:v.right,Math.max(o===ze.Right?v.left:v.left+v.width/2,d.x)),y:Math.min(o===ze.Down?v.bottom-v.height/2:v.bottom,Math.max(o===ze.Down?v.top:v.top+v.height/2,d.y))},h=o===ze.Right&&!l||o===ze.Left&&!c,p=o===ze.Down&&!s||o===ze.Up&&!i;if(h&&f.x!==d.x){const e=n.scrollLeft+t.x,i=o===ze.Right&&e<=u.x||o===ze.Left&&e>=g.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===ze.Right?n.scrollLeft-u.x:n.scrollLeft-g.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(p&&f.y!==d.y){const e=n.scrollTop+t.y,i=o===ze.Down&&e<=u.y||o===ze.Up&&e>=g.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===ze.Down?n.scrollTop-u.y:n.scrollTop-g.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,z(Y(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Ue(e){return Boolean(e&&"distance"in e)}function He(e){return Boolean(e&&"delay"in e)}We.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Xe,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class Je{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=C(e);return e instanceof t?e:O(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=O(i),this.documentListeners=new Le(this.document),this.listeners=new Le(n),this.windowListeners=new Le(C(i)),this.initialCoordinates=null!=(r=X(o))?r:te,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Pe.Resize,this.handleCancel),this.windowListeners.add(Pe.DragStart,Ye),this.windowListeners.add(Pe.VisibilityChange,this.handleCancel),this.windowListeners.add(Pe.ContextMenu,Ye),this.documentListeners.add(Pe.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(He(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Ue(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Pe.Click,Fe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Pe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=X(e))?t:te,c=Y(r,l);if(!n&&a){if(Ue(a)){if(null!=a.tolerance&&Be(c,a.tolerance))return this.handleCancel();if(Be(c,a.distance))return this.handleStart()}return He(a)&&Be(c,a.tolerance)?this.handleCancel():void this.handlePending(a,c)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===ze.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Ve={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class qe extends Je{constructor(e){const{event:t}=e,n=O(t.target);super(e,Ve,n)}}qe.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const Ge={move:{name:"mousemove"},end:{name:"mouseup"}};var Qe;!function(e){e[e.RightClick=2]="RightClick"}(Qe||(Qe={}));(class extends Je{constructor(e){super(e,Ge,O(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Qe.RightClick&&(null==r||r({event:n}),!0)}}];const Ze={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var $e,_e;function et(e){let{acceleration:t,activator:n=$e.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:d=5,order:u=_e.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:f,delta:h,threshold:p}=e;const b=function(e){let{delta:t,disabled:n}=e;const r=j(t);return T(e=>{if(n||!r||!e)return tt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Re.Backward]:e.x[Re.Backward]||-1===o.x,[Re.Forward]:e.x[Re.Forward]||1===o.x},y:{[Re.Backward]:e.y[Re.Backward]||-1===o.y,[Re.Forward]:e.y[Re.Forward]||1===o.y}}},[n,t,r])}({delta:h,disabled:!s}),[y,m]=function(){const e=l(null);return[c((t,n)=>{e.current=setInterval(t,n)},[]),c(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),w=l({x:0,y:0}),x=l({x:0,y:0}),D=o(()=>{switch(n){case $e.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case $e.DraggableRect:return i}},[n,i,g]),k=l(null),C=c(()=>{const e=k.current;if(!e)return;const t=w.current.x*x.current.x,n=w.current.y*x.current.y;e.scrollBy(t,n)},[]),R=o(()=>u===_e.TreeOrder?[...v].reverse():v,[u,v]);a(()=>{if(s&&v.length&&D){for(const e of R){if(!1===(null==r?void 0:r(e)))continue;const n=v.indexOf(e),o=f[n];if(!o)continue;const{direction:i,speed:a}=Se(e,o,D,t,p);for(const e of["x","y"])b[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return m(),k.current=e,y(C,d),w.current=a,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},m()}else m()},[t,C,r,m,s,d,JSON.stringify(D),JSON.stringify(b),y,v,R,f,JSON.stringify(p)])}(class extends Je{constructor(e){super(e,Ze)}static setup(){return window.addEventListener(Ze.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ze.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}($e||($e={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(_e||(_e={}));const tt={x:{[Re.Backward]:!1,[Re.Forward]:!1},y:{[Re.Backward]:!1,[Re.Forward]:!1}};var nt,rt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(nt||(nt={})),function(e){e.Optimized="optimized"}(rt||(rt={}));const ot=new Map;function it(e,t){return T(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function at(e){let{callback:t,disabled:n}=e;const r=I(t),i=o(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return a(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function lt(e){return new je(be(e),e)}function ct(e,t,n){void 0===t&&(t=lt);const[r,i]=s(null);function l(){i(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const c=function(e){let{callback:t,disabled:n}=e;const r=I(t),i=o(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return a(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),d=at({callback:l});return S(()=>{l(),e?(null==d||d.observe(e),null==c||c.observe(document.body,{childList:!0,subtree:!0})):(null==d||d.disconnect(),null==c||c.disconnect())},[e]),r}const st=[];function dt(e,t){void 0===t&&(t=[]);const n=l(null);return a(()=>{n.current=null},t),a(()=>{const t=e!==te;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Y(e,n.current):te}function ut(e){return o(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const gt=[];function vt(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return E(t)?t:e}const ft=[{sensor:qe,options:{}},{sensor:We,options:{}}],ht={current:{}},pt={draggable:{measure:ye},droppable:{measure:ye,strategy:nt.WhileDragging,frequency:rt.Optimized},dragOverlay:{measure:be}};class bt extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const yt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new bt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:_},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pt,measureDroppableContainers:_,windowRect:null,measuringScheduled:!1},mt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:_,draggableNodes:new Map,over:null,measureDroppableContainers:_},wt=d(mt),xt=d(yt);function Dt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new bt}}}function kt(e,t){switch(t.type){case $.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case $.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case $.DragEnd:case $.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new bt(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case $.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new bt(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case $.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new bt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Ct(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=v(wt),i=j(r),l=j(null==n?void 0:n.id);return a(()=>{if(!t&&!r&&i&&null!=l){if(!F(i))return;if(document.activeElement===i.target)return;const e=o.get(l);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=U(e);if(t){t.focus();break}}})}},[r,t,o,l,i]),null}function Rt(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Et=d({...te,scaleX:1,scaleY:1});var Nt;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Nt||(Nt={}));const Ot=u(function(e){var t,n,i,d;let{id:u,accessibility:v,autoScroll:f=!0,children:h,sensors:p=ft,collisionDetection:y=ue,measuring:m,modifiers:w,...D}=e;const k=g(kt,void 0,Dt),[R,N]=k,[O,I]=function(){const[e]=s(()=>new Set),t=c(t=>(e.add(t),()=>e.delete(t)),[e]);return[c(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[j,L]=s(Nt.Uninitialized),P=j===Nt.Initialized,{draggable:{active:Y,nodes:F,translate:K},droppable:{containers:W}}=R,U=null!=Y?F.get(Y):null,H=l({initial:null,translated:null}),J=o(()=>{var e;return null!=Y?{id:Y,data:null!=(e=null==U?void 0:U.data)?e:ht,rect:H}:null},[Y,U]),V=l(null),[G,Q]=s(null),[_,ee]=s(null),ne=A(D,Object.values(D)),re=B("DndDescribedBy",u),oe=o(()=>W.getEnabled(),[W]),ie=o(()=>({draggable:{...pt.draggable,...null==ae?void 0:ae.draggable},droppable:{...pt.droppable,...null==ae?void 0:ae.droppable},dragOverlay:{...pt.dragOverlay,...null==ae?void 0:ae.dragOverlay}}),[null==(ae=m)?void 0:ae.draggable,null==ae?void 0:ae.droppable,null==ae?void 0:ae.dragOverlay]);var ae;const{droppableRects:ce,measureDroppableContainers:se,measuringScheduled:de}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,d]=s(null),{frequency:u,measure:g,strategy:v}=o,f=l(e),h=function(){switch(v){case nt.Always:return!1;case nt.BeforeDragging:return n;default:return!n}}(),p=A(h),b=c(function(e){void 0===e&&(e=[]),p.current||d(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),y=l(null),m=T(t=>{if(h&&!n)return ot;if(!t||t===ot||f.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new je(g(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,h,g]);return a(()=>{f.current=e},[e]),a(()=>{h||b()},[n,h]),a(()=>{i&&i.length>0&&d(null)},[JSON.stringify(i)]),a(()=>{h||"number"!=typeof u||null!==y.current||(y.current=setTimeout(()=>{b(),y.current=null},u))},[u,h,b,...r]),{droppableRects:m,measureDroppableContainers:b,measuringScheduled:null!=i}}(oe,{dragging:P,dependencies:[K.x,K.y],config:ie.droppable}),ve=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return T(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(F,Y),he=o(()=>_?X(_):null,[_]),pe=function(){const e=!1===(null==G?void 0:G.autoScrollEnabled),t="object"==typeof f?!1===f.enabled:!1===f,n=P&&!e&&!t;if("object"==typeof f)return{...f,enabled:n};return{enabled:n}}(),ye=function(e,t){return it(e,t)}(ve,ie.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=l(!1),{x:a,y:c}="boolean"==typeof o?{x:o,y:o}:o;S(()=>{if(!a&&!c||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=ge(n(e),r);if(a||(o.x=0),c||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=we(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,c,r,n])}({activeNode:null!=Y?F.get(Y):null,config:pe.layoutShiftCompensation,initialRect:ye,measure:ie.draggable.measure});const De=ct(ve,ie.draggable.measure,ye),ke=ct(ve?ve.parentElement:null),Re=l({activatorEvent:null,active:null,activeNode:ve,collisionRect:null,collisions:null,droppableRects:ce,draggableNodes:F,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ne=W.getNodeFor(null==(t=Re.current.over)?void 0:t.id),Oe=function(e){let{measure:t}=e;const[n,r]=s(null),i=at({callback:c(e=>{for(const{target:n}of e)if(E(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),a=c(e=>{const n=vt(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]),[l,d]=M(a);return o(()=>({nodeRef:l,rect:n,setRef:d}),[n,l,d])}({measure:ie.dragOverlay.measure}),Se=null!=(n=Oe.nodeRef.current)?n:ve,Ie=P?null!=(i=Oe.rect)?i:De:null,Te=Boolean(Oe.nodeRef.current&&Oe.rect),Me=ge(Le=Te?null:De,it(Le));var Le;const Be=ut(Se?C(Se):null),Pe=function(e){const t=l(e),n=T(n=>e?n&&n!==st&&e&&t.current&&e.parentNode===t.current.parentNode?n:me(e):st,[e]);return a(()=>{t.current=e},[e]),n}(P?null!=Ne?Ne:ve:null),ze=function(e,t){void 0===t&&(t=be);const[n]=e,r=ut(n?C(n):null),[o,i]=s(gt);function a(){i(()=>e.length?e.map(e=>Ee(e)?r:new je(t(e),e)):gt)}const l=at({callback:a});return S(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),o}(Pe),Ye=Rt(w,{transform:{x:K.x-Me.x,y:K.y-Me.y,scaleX:1,scaleY:1},activatorEvent:_,active:J,activeNodeRect:De,containerNodeRect:ke,draggingNodeRect:Ie,over:Re.current.over,overlayNodeRect:Oe.rect,scrollableAncestors:Pe,scrollableAncestorRects:ze,windowRect:Be}),Fe=he?z(he,K):null,Xe=function(e){const[t,n]=s(null),r=l(e),i=c(e=>{const t=xe(e.target);t&&n(e=>e?(e.set(t,Ce(t)),new Map(e)):null)},[]);return a(()=>{const t=r.current;if(e!==t){o(t);const a=e.map(e=>{const t=xe(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,Ce(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{const t=xe(e);null==t||t.removeEventListener("scroll",i)})}},[i,e]),o(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>z(e,t),te):Ae(e):te,[e,t])}(Pe),Ke=dt(Xe),We=dt(Xe,[De]),Ue=z(Ye,Ke),He=Ie?fe(Ie,Ye):null,Je=J&&He?y({active:J,collisionRect:He,droppableRects:ce,droppableContainers:oe,pointerCoordinates:Fe}):null,Ve=le(Je,"id"),[qe,Ge]=s(null),Qe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Te?Ye:z(Ye,We),null!=(d=null==qe?void 0:qe.rect)?d:null,De),Ze=l(null),$e=c((e,t)=>{let{sensor:n,options:r}=t;if(null==V.current)return;const o=F.get(V.current);if(!o)return;const i=e.nativeEvent,a=new n({active:V.current,activeNode:o,event:i,options:r,context:Re,onAbort(e){if(!F.get(e))return;const{onDragAbort:t}=ne.current,n={id:e};null==t||t(n),O({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!F.get(e))return;const{onDragPending:o}=ne.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),O({type:"onDragPending",event:i})},onStart(e){const t=V.current;if(null==t)return;const n=F.get(t);if(!n)return;const{onDragStart:r}=ne.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:H}};b(()=>{null==r||r(o),L(Nt.Initializing),N({type:$.DragStart,initialCoordinates:e,active:t}),O({type:"onDragStart",event:o}),Q(Ze.current),ee(i)})},onMove(e){N({type:$.DragMove,coordinates:e})},onEnd:l($.DragEnd),onCancel:l($.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Re.current;let a=null;if(t&&o){const{cancelDrop:l}=ne.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===$.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=$.DragCancel)}}V.current=null,b(()=>{N({type:e}),L(Nt.Uninitialized),Ge(null),Q(null),ee(null),Ze.current=null;const t=e===$.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=ne.current[t];null==e||e(a),O({type:t,event:a})}})}}Ze.current=a},[F]),_e=c((e,t)=>(n,r)=>{const o=n.nativeEvent,i=F.get(r);if(null!==V.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},V.current=r,$e(n,t))},[F,$e]),tt=function(e,t){return o(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(p,_e);!function(e){a(()=>{if(!x)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(p),S(()=>{De&&j===Nt.Initializing&&L(Nt.Initialized)},[De,j]),a(()=>{const{onDragMove:e}=ne.current,{active:t,activatorEvent:n,collisions:r,over:o}=Re.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Ue.x,y:Ue.y},over:o};b(()=>{null==e||e(i),O({type:"onDragMove",event:i})})},[Ue.x,Ue.y]),a(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Re.current;if(!e||null==V.current||!t||!o)return;const{onDragOver:i}=ne.current,a=r.get(Ve),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};b(()=>{Ge(l),null==i||i(c),O({type:"onDragOver",event:c})})},[Ve]),S(()=>{Re.current={activatorEvent:_,active:J,activeNode:ve,collisionRect:He,collisions:Je,droppableRects:ce,draggableNodes:F,draggingNode:Se,draggingNodeRect:Ie,droppableContainers:W,over:qe,scrollableAncestors:Pe,scrollAdjustedTranslate:Ue},H.current={initial:Ie,translated:He}},[J,ve,Je,He,F,Se,Ie,ce,W,qe,Pe,Ue]),et({...pe,delta:K,draggingRect:He,pointerCoordinates:Fe,scrollableAncestors:Pe,scrollableAncestorRects:ze});const rt=o(()=>({active:J,activeNode:ve,activeNodeRect:De,activatorEvent:_,collisions:Je,containerNodeRect:ke,dragOverlay:Oe,draggableNodes:F,droppableContainers:W,droppableRects:ce,over:qe,measureDroppableContainers:se,scrollableAncestors:Pe,scrollableAncestorRects:ze,measuringConfiguration:ie,measuringScheduled:de,windowRect:Be}),[J,ve,De,_,Je,ke,Oe,F,W,ce,qe,se,Pe,ze,ie,de,Be]),lt=o(()=>({activatorEvent:_,activators:tt,active:J,activeNodeRect:De,ariaDescribedById:{draggable:re},dispatch:N,draggableNodes:F,over:qe,measureDroppableContainers:se}),[_,tt,J,De,N,re,F,qe,se]);return r.createElement(q.Provider,{value:I},r.createElement(wt.Provider,{value:lt},r.createElement(xt.Provider,{value:rt},r.createElement(Et.Provider,{value:Qe},h)),r.createElement(Ct,{disabled:!1===(null==v?void 0:v.restoreFocus)})),r.createElement(Z,{...v,hiddenTextDescribedById:re}))}),St=d(null),It="button";function At(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const a=B("Draggable"),{activators:l,activatorEvent:c,active:s,activeNodeRect:d,ariaDescribedById:u,draggableNodes:g,over:f}=v(wt),{role:h=It,roleDescription:p="draggable",tabIndex:b=0}=null!=i?i:{},y=(null==s?void 0:s.id)===t,m=v(y?Et:St),[w,x]=M(),[D,k]=M(),C=function(e,t){return o(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(l,t),R=A(n);S(()=>(g.set(t,{id:t,key:a,node:w,activatorNode:D,data:R}),()=>{const e=g.get(t);e&&e.key===a&&g.delete(t)}),[g,t]);return{active:s,activatorEvent:c,activeNodeRect:d,attributes:o(()=>({role:h,tabIndex:b,"aria-disabled":r,"aria-pressed":!(!y||h!==It)||void 0,"aria-roledescription":p,"aria-describedby":u.draggable}),[r,h,b,y,p,u.draggable]),isDragging:y,listeners:r?void 0:C,node:w,over:f,setNodeRef:x,setActivatorNodeRef:k,transform:m}}function Tt(){return v(xt)}const Mt={timeout:25};function jt(e){let{animation:t,children:n}=e;const[o,i]=s(null),[a,l]=s(null),c=j(n);return n||o||!c||i(c),S(()=>{if(!a)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,a)).then(()=>{i(null)}):i(null)},[t,o,a]),r.createElement(r.Fragment,null,n,o?f(o,{ref:l}):null)}const Lt={x:0,y:0,scaleX:1,scaleY:1};function Bt(e){let{children:t}=e;return r.createElement(wt.Provider,{value:mt},r.createElement(Et.Provider,{value:Lt},t))}const Pt={position:"fixed",touchAction:"none"},zt=e=>F(e)?"transform 250ms ease":void 0,Yt=h((e,t)=>{let{as:n,activatorEvent:o,adjustScale:i,children:a,className:l,rect:c,style:s,transform:d,transition:u=zt}=e;if(!c)return null;const g=i?d:{...d,scaleX:1,scaleY:1},v={...Pt,width:c.width,height:c.height,top:c.top,left:c.left,transform:K.Transform.toString(g),transformOrigin:i&&o?re(o,c):void 0,transition:"function"==typeof u?u(o):u,...s};return r.createElement(n,{className:l,style:v,ref:t},a)}),Ft=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},Xt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:K.Transform.toString(t)},{transform:K.Transform.toString(n)}]},sideEffects:Ft({styles:{active:{opacity:"0"}}})};function Kt(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return I((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const l=a.node.current;if(!l)return;const c=vt(i);if(!c)return;const{transform:s}=C(i).getComputedStyle(i),d=he(s);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Xt,...e};return e=>{let{active:i,dragOverlay:a,transform:l,...c}=e;if(!t)return;const s={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:1!==l.scaleX?i.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?i.rect.height*l.scaleY/a.rect.height:1},u={x:l.x-s.x,y:l.y-s.y,...d},g=o({...c,active:i,dragOverlay:a,transform:{initial:l,final:u}}),[v]=g,f=g[g.length-1];if(JSON.stringify(v)===JSON.stringify(f))return;const h=null==r?void 0:r({active:i,dragOverlay:a,...c}),p=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{p.onfinish=()=>{null==h||h(),e()}})}}(t);return Te(l,o.draggable.measure),u({active:{id:e,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:o,transform:d})})}let Wt=0;function Ut(e){return o(()=>{if(null!=e)return Wt++,Wt},[e])}const Ht=r.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:i,transition:a,modifiers:l,wrapperElement:c="div",className:s,zIndex:d=999}=e;const{activatorEvent:u,active:g,activeNodeRect:f,containerNodeRect:h,draggableNodes:p,droppableContainers:b,dragOverlay:y,over:m,measuringConfiguration:w,scrollableAncestors:x,scrollableAncestorRects:D,windowRect:k}=Tt(),C=v(Et),R=Ut(null==g?void 0:g.id),E=Rt(l,{activatorEvent:u,active:g,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:y.rect,over:m,overlayNodeRect:y.rect,scrollableAncestors:x,scrollableAncestorRects:D,transform:C,windowRect:k}),N=it(f),O=Kt({config:o,draggableNodes:p,droppableContainers:b,measuringConfiguration:w}),S=N?y.setRef:void 0;return r.createElement(Bt,null,r.createElement(jt,{animation:O},g&&R?r.createElement(Yt,{key:R,id:g.id,ref:S,as:c,activatorEvent:u,adjustScale:t,className:s,transition:a,rect:N,style:{zIndex:d,...i},transform:E},n):null))});function Jt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Vt(e,t){return e.reduce((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e},Array(e.length))}function qt(e){return null!==e&&e>=0}const Gt=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Jt(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},Qt={scaleX:1,scaleY:1},Zt=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[n])?t:r;if(!l)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(l.top+l.height):e.top-l.top,...Qt}:null}const c=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=a?{x:0,y:-l.height-c,...Qt}:o<n&&o>=a?{x:0,y:l.height+c,...Qt}:{x:0,y:0,...Qt}};const $t="Sortable",_t=r.createContext({activeIndex:-1,containerId:$t,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Gt,disabled:{draggable:!1,droppable:!1}});function en(e){let{children:t,id:n,items:i,strategy:c=Gt,disabled:s=!1}=e;const{active:d,dragOverlay:u,droppableRects:g,over:v,measureDroppableContainers:f}=Tt(),h=B($t,n),p=Boolean(null!==u.rect),b=o(()=>i.map(e=>"object"==typeof e&&"id"in e?e.id:e),[i]),y=null!=d,m=d?b.indexOf(d.id):-1,w=v?b.indexOf(v.id):-1,x=l(b),D=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(b,x.current),k=-1!==w&&-1===m||D,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(s);S(()=>{D&&y&&f(b)},[D,b,y,f]),a(()=>{x.current=b},[b]);const R=o(()=>({activeIndex:m,containerId:h,disabled:C,disableTransforms:k,items:b,overIndex:w,useDragOverlay:p,sortedRects:Vt(b,g),strategy:c}),[m,h,C.draggable,C.droppable,k,b,w,g,p,c]);return r.createElement(_t.Provider,{value:R},t)}const tn=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Jt(n,r,o).indexOf(t)},nn=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:s}=e;return!(!s||!r)&&((l===i||o!==a)&&(!!n||a!==o&&t===c))},rn={duration:200,easing:"ease"},on="transform",an=K.Transition.toString({property:on,duration:0,easing:"linear"}),ln={roleDescription:"sortable"};function cn(e){let{animateLayoutChanges:t=nn,attributes:n,disabled:r,data:i,getNewIndex:d=tn,id:u,strategy:g,resizeObserverConfig:f,transition:h=rn}=e;const{items:p,containerId:b,activeIndex:y,disabled:m,disableTransforms:w,sortedRects:x,overIndex:D,useDragOverlay:k,strategy:C}=v(_t),R=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,m),E=p.indexOf(u),N=o(()=>({sortable:{containerId:b,index:E,items:p},...i}),[b,i,E,p]),O=o(()=>p.slice(p.indexOf(u)),[p,u]),{rect:I,node:T,isOver:j,setNodeRef:L}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=B("Droppable"),{active:s,dispatch:d,over:u,measureDroppableContainers:g}=v(wt),f=l({disabled:n}),h=l(!1),p=l(null),b=l(null),{disabled:y,updateMeasurementsFor:m,timeout:w}={...Mt,...o},x=A(null!=m?m:r),D=at({callback:c(()=>{h.current?(null!=b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{g(Array.isArray(x.current)?x.current:[x.current]),b.current=null},w)):h.current=!0},[w]),disabled:y||!s}),k=c((e,t)=>{D&&(t&&(D.unobserve(t),h.current=!1),e&&D.observe(e))},[D]),[C,R]=M(k),E=A(t);return a(()=>{D&&C.current&&(D.disconnect(),h.current=!1,D.observe(C.current))},[C,D]),a(()=>(d({type:$.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:p,data:E}}),()=>d({type:$.UnregisterDroppable,key:i,id:r})),[r]),a(()=>{n!==f.current.disabled&&(d({type:$.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,d]),{active:s,rect:p,isOver:(null==u?void 0:u.id)===r,node:C,over:u,setNodeRef:R}}({id:u,data:N,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...f}}),{active:P,activatorEvent:z,activeNodeRect:Y,attributes:X,setNodeRef:W,listeners:U,isDragging:H,over:J,setActivatorNodeRef:V,transform:q}=At({id:u,data:N,attributes:{...ln,...n},disabled:R.draggable}),G=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o(()=>e=>{t.forEach(t=>t(e))},t)}(L,W),Q=Boolean(P),Z=Q&&!w&&qt(y)&&qt(D),_=!k&&H,ee=_&&Z?q:null,te=Z?null!=ee?ee:(null!=g?g:C)({rects:x,activeNodeRect:Y,activeIndex:y,overIndex:D,index:E}):null,ne=qt(y)&&qt(D)?d({id:u,items:p,activeIndex:y,overIndex:D}):E,re=null==P?void 0:P.id,oe=l({activeId:re,items:p,newIndex:ne,containerId:b}),ie=p!==oe.current.items,ae=t({active:P,containerId:b,isDragging:H,isSorting:Q,id:u,index:E,items:p,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:h,wasDragging:null!=oe.current.activeId}),le=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,c]=s(null),d=l(n);return S(()=>{if(!t&&n!==d.current&&r.current){const e=o.current;if(e){const t=be(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&c(n)}}n!==d.current&&(d.current=n)},[t,n,r,o]),a(()=>{i&&c(null)},[i]),i}({disabled:!ae,index:E,node:T,rect:I});return a(()=>{Q&&oe.current.newIndex!==ne&&(oe.current.newIndex=ne),b!==oe.current.containerId&&(oe.current.containerId=b),p!==oe.current.items&&(oe.current.items=p)},[Q,ne,b,p]),a(()=>{if(re===oe.current.activeId)return;if(re&&!oe.current.activeId)return void(oe.current.activeId=re);const e=setTimeout(()=>{oe.current.activeId=re},50);return()=>clearTimeout(e)},[re]),{active:P,activeIndex:y,attributes:X,data:N,rect:I,index:E,newIndex:ne,items:p,isOver:j,isSorting:Q,isDragging:H,listeners:U,node:T,overIndex:D,over:J,setNodeRef:G,setActivatorNodeRef:V,setDroppableNodeRef:L,setDraggableNodeRef:W,transform:null!=le?le:te,transition:function(){if(le||ie&&oe.current.newIndex===E)return an;if(_&&!F(z)||!h)return;if(Q||ae)return K.Transition.toString({...h,property:on});return}()}}function sn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const dn=[ze.Down,ze.Right,ze.Up,ze.Left],un=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(dn.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case ze.Down:r.top<i.top&&t.push(n);break;case ze.Up:r.top>i.top&&t.push(n);break;case ze.Left:r.left>i.left&&t.push(n);break;case ze.Right:r.left<i.left&&t.push(n)}});const c=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=ae(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=ae(r),a=o.reduce((e,t,r)=>e+ne(n[r],t),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(oe)})({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let s=le(c,"id");if(s===(null==a?void 0:a.id)&&c.length>1&&(s=c[1].id),null!=s){const e=i.get(n.id),t=i.get(s),a=t?o.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&a&&e&&t){const n=me(c).some((e,t)=>l[t]!==e),o=gn(e,t),i=function(e,t){if(!sn(e)||!sn(t))return!1;if(!gn(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=n||!o?{x:0,y:0}:{x:i?r.width-a.width:0,y:i?r.height-a.height:0},d={x:a.left,y:a.top};return s.x&&s.y?d:Y(d,s)}}}};function gn(e,t){return!(!sn(e)||!sn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}w('.yoopta-block-dnd-sortable{position:relative;transition:transform .2s ease,opacity .2s ease}.yoopta-block-dnd-sortable--dragging{cursor:grabbing;z-index:1000}.yoopta-block-dnd-drop-indicator{background-color:var(--yoopta-block-dnd-indicator-color,#3b82f6);border-radius:1px;height:2px;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:100}.yoopta-block-dnd-drop-indicator:after,.yoopta-block-dnd-drop-indicator:before{background-color:var(--yoopta-block-dnd-indicator-color,#3b82f6);border-radius:50%;content:"";height:6px;position:absolute;top:50%;transform:translateY(-50%);width:6px}.yoopta-block-dnd-drop-indicator:before{left:-3px}.yoopta-block-dnd-drop-indicator:after{right:-3px}.yoopta-block-dnd-handle{cursor:grab;transition:opacity .15s ease}.yoopta-block-dnd-handle:hover{opacity:.8}.yoopta-block-dnd-handle:focus{outline:none}.yoopta-block-dnd-handle:focus-visible{border-radius:4px;outline:2px solid var(--yoopta-block-dnd-focus-ring,#3b82f6);outline-offset:2px}.yoopta-block-dnd-handle--holding{cursor:grabbing;opacity:.7}.yoopta-block-dnd-handle--dragging{cursor:grabbing;opacity:.5}.yoopta-block-dnd-handle:disabled{cursor:not-allowed;opacity:.3}.yoopta-block-dnd-overlay{align-items:center;animation:yoopta-block-dnd-overlay-fade-in .15s ease;background-color:var(--yoopta-block-dnd-overlay-bg,#fff);border:1px solid var(--yoopta-block-dnd-overlay-border,#e5e7eb);border-radius:8px;box-shadow:0 10px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);display:flex;gap:10px;min-width:140px;padding:10px 14px;pointer-events:none}.yoopta-block-dnd-overlay-icon{align-items:center;color:var(--yoopta-block-dnd-overlay-icon-color,#6b7280);display:flex;flex-shrink:0;height:20px;justify-content:center;width:20px}.yoopta-block-dnd-overlay-content{align-items:center;display:flex;flex:1;min-width:0}.yoopta-block-dnd-overlay-text{color:var(--yoopta-block-dnd-overlay-text,#374151);font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoopta-block-dnd-overlay-text strong{color:var(--yoopta-block-dnd-overlay-text-accent,#1f2937);font-weight:600}[data-block-dnd-dragging=true]{opacity:.5;pointer-events:none}.yoopta-block-dnd-sortable:focus{outline:none}.yoopta-block-dnd-sortable:focus-visible{border-radius:4px;outline:2px solid var(--yoopta-block-dnd-focus-ring,#3b82f6);outline-offset:2px}@media (prefers-color-scheme:dark){.yoopta-block-dnd-handle:hover{opacity:.9}.yoopta-block-dnd-overlay{background-color:var(--yoopta-block-dnd-overlay-bg,#1f2937);border-color:var(--yoopta-block-dnd-overlay-border,#374151)}.yoopta-block-dnd-overlay-icon{color:var(--yoopta-block-dnd-overlay-icon-color,#9ca3af)}.yoopta-block-dnd-overlay-text{color:var(--yoopta-block-dnd-overlay-text,#f3f4f6)}.yoopta-block-dnd-overlay-text strong{color:var(--yoopta-block-dnd-overlay-text-accent,#fff)}}@keyframes yoopta-block-dnd-overlay-fade-in{0%{opacity:0;transform:scale(.95) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}');const vn=d(null),fn=()=>{const e=v(vn);if(!e)throw new Error("useBlockDndContext must be used within a BlockDndContext");return e},hn=({transform:e})=>Object.assign(Object.assign({},e),{x:0}),pn=({editor:r,children:i,onDragStart:a,onDragEnd:d,renderDragOverlay:u,enableMultiDrag:g=!0})=>{var v;const[f,h]=s(null),[p,b]=s([]),y=l(new Map),w=o(()=>Object.keys(r.children).sort((e,t)=>r.children[e].meta.order-r.children[t].meta.order),[r.children]),x=f&&null!==(v=r.children[f])&&void 0!==v?v:null,D=o(()=>p.map(e=>r.children[e]).filter(Boolean),[p,r.children]),k=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o(()=>[...t].filter(e=>null!=e),[...t])}(ee(qe,{activationConstraint:{distance:5}}),ee(We,{coordinateGetter:un})),C=c(e=>{const{active:t}=e;h(t.id);const n=r.path.selected;let o=[t.id];if(g&&Array.isArray(n)&&n.length>1){const e=n.map(e=>{const t=m.getBlock(r,{at:e});return null==t?void 0:t.id}).filter(e=>void 0!==e);e.includes(t.id)&&(o=e)}b(o);const i=o.map(e=>r.children[e]).filter(Boolean);null==a||a(e,i)},[r,g,a]),R=c(e=>{const{active:t,over:n}=e;if(h(null),b([]),!n||t.id===n.id)return void(null==d||d(e,!1));const o=r.children[t.id],i=r.children[n.id];if(!o||!i)return void(null==d||d(e,!1));const a=o.meta.order,l=i.meta.order;a!==l?(r.batchOperations(()=>{if(p.length>1){const e=[...p].sort((e,t)=>{var n,o,i,a;return(null!==(o=null===(n=r.children[e])||void 0===n?void 0:n.meta.order)&&void 0!==o?o:0)-(null!==(a=null===(i=r.children[t])||void 0===i?void 0:i.meta.order)&&void 0!==a?a:0)}),t=l;e.forEach((e,n)=>{r.moveBlock(e,t+n)})}else r.moveBlock(t.id,l)}),r.setPath({current:l,selected:null}),null==d||d(e,!0)):null==d||d(e,!1)},[r,p,d]),E=c((e,t)=>{y.current.set(e,t)},[]),N=c(e=>{y.current.delete(e)},[]),O=c(e=>y.current.get(e)||null,[]),S=o(()=>({activeId:f,activeBlock:x,isDragging:null!==f,draggedIds:p,editor:r,registerSortable:E,unregisterSortable:N,getSortable:O}),[f,x,p,r,E,N,O]),I=D.length>0&&e("div",Object.assign({className:"yoopta-block-dnd-overlay"},{children:[t("div",Object.assign({className:"yoopta-block-dnd-overlay-icon"},{children:t("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:t("path",{d:"M6 2h4M6 8h4M6 14h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))})),t("div",Object.assign({className:"yoopta-block-dnd-overlay-content"},{children:t("span",Object.assign({className:"yoopta-block-dnd-overlay-text"},{children:1===D.length?t(n,{children:"Moving block"}):e(n,{children:["Moving ",t("strong",{children:D.length})," blocks"]})}))}))]}));return t(vn.Provider,Object.assign({value:S},{children:e(Ot,Object.assign({sensors:k,collisionDetection:se,onDragStart:C,onDragEnd:R,modifiers:[hn]},{children:[t(en,Object.assign({items:w,strategy:Zt},{children:i})),t(Ht,Object.assign({dropAnimation:null},{children:f?u?u(D):I:null}))]}))}))},bn=({id:n,children:r,className:o,disabled:i=!1,useDragHandle:l=!1})=>{const{draggedIds:c,isDragging:s,registerSortable:d,unregisterSortable:u}=fn(),{attributes:g,listeners:v,setNodeRef:f,setActivatorNodeRef:h,transform:p,transition:b,isDragging:y,isOver:m}=cn({id:n,disabled:i});a(()=>{if(l)return d(n,{setActivatorNodeRef:h,listeners:v,attributes:g}),()=>{u(n)}},[n,l,h,v,g,d,u]);const w=c.includes(n)&&c.length>1,x=y||s&&c.includes(n),D={transform:K.Transform.toString(p),transition:b,opacity:x?.5:1,position:"relative"},k=["yoopta-block-dnd-sortable",y&&"yoopta-block-dnd-sortable--dragging",m&&"yoopta-block-dnd-sortable--over",w&&"yoopta-block-dnd-sortable--multi",o].filter(Boolean).join(" ");return e("div",Object.assign({ref:f,style:D,className:k},l?{}:g,l?{}:v,{"data-block-dnd-id":n,"data-block-dnd-dragging":x||void 0,"data-block-dnd-over":m||void 0},{children:[r,m&&!y&&t("div",{className:"yoopta-block-dnd-drop-indicator"})]}))},yn=h(({blockId:e,children:n,className:r,onClick:o,asChild:i=!1},d)=>{const{isDragging:u,getSortable:g}=fn(),[v,h]=s(!1),b=l(!1),y=e?g(e):null,m=l(d);m.current=d;const w=c(e=>{y&&y.setActivatorNodeRef(e);const t=m.current;"function"==typeof t?t(e):t&&(t.current=e)},[y]);a(()=>{if(!u){const e=setTimeout(()=>{b.current=!1,h(!1)},100);return()=>clearTimeout(e)}b.current=!0,h(!0)},[u]);const x=c(e=>{b.current||u||null==o||o(e)},[u,o]),D=["yoopta-block-dnd-handle",v&&"yoopta-block-dnd-handle--holding",u&&"yoopta-block-dnd-handle--dragging",r].filter(Boolean).join(" ");if(!y||!e){if(i&&p(n)){const e=n.props,t=e.ref,o=e=>{"function"==typeof d?d(e):d&&(d.current=e),t&&("function"==typeof t?t(e):t&&"current"in t&&(t.current=e))};return f(n,Object.assign(Object.assign({},e),{ref:o,className:r,disabled:!0}))}return t("button",Object.assign({type:"button",ref:d,className:r,disabled:!0},{children:n}))}if(i&&p(n)){const t=n.props,r=t.ref,o=e=>{y&&y.setActivatorNodeRef(e);const t=m.current;"function"==typeof t?t(e):t&&(t.current=e),r&&("function"==typeof r?r(e):r&&"current"in r&&(r.current=e))};return f(n,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),{ref:o,className:[D,t.className].filter(Boolean).join(" "),onClick:e=>{var n;x(e),null===(n=t.onClick)||void 0===n||n.call(t,e)}}),y.attributes),y.listeners),{"data-block-dnd-handle":!0,"data-block-id":e,"aria-label":t["aria-label"]||"Drag to reorder block",title:t.title||"Drag to reorder"}))}return t("button",Object.assign({type:"button",ref:w,className:D,onClick:x},y.attributes,y.listeners,{"data-block-dnd-handle":!0,"data-block-id":e,"aria-label":"Drag to reorder block",title:"Drag to reorder"},{children:n}))});yn.displayName="DragHandle";const mn=(e={})=>{const{blockId:t}=e,n=fn(),{isDragging:r,draggedIds:i,editor:a}=n,l=o(()=>!!t&&i.includes(t),[t,i]),s=o(()=>!!t&&(i.includes(t)&&i.length>1),[t,i]),d=c((e,t)=>{a.moveBlock(e,t)},[a]),u=c((e,t)=>{a.batchOperations(()=>{[...e].sort((e,t)=>{var n,r,o,i;return(null!==(r=null===(n=a.children[e])||void 0===n?void 0:n.meta.order)&&void 0!==r?r:0)-(null!==(i=null===(o=a.children[t])||void 0===o?void 0:o.meta.order)&&void 0!==i?i:0)}).forEach((e,n)=>{a.moveBlock(e,t+n)})})},[a]);return{isDragging:r,isBlockDragging:l,isPartOfMultiDrag:s,dragCount:i.length,draggedIds:i,moveBlock:d,moveBlocks:u}},wn=e=>Object.keys(e.children).sort((t,n)=>e.children[t].meta.order-e.children[n].meta.order);export{pn as BlockDndContext,yn as DragHandle,bn as SortableBlock,wn as getOrderedBlockIds,mn as useBlockDnd,fn as useBlockDndContext};
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r,{useMemo as o,useLayoutEffect as i,useEffect as a,useRef as l,useCallback as c,useState as s,createContext as d,memo as u,useReducer as g,useContext as p,cloneElement as v,forwardRef as h,isValidElement as f}from"react";import{unstable_batchedUpdates as b,createPortal as y}from"react-dom";import{Blocks as m,useYooptaEditor as x}from"@yoopta/editor";import{s as w}from"./chunks/style-inject.es-e87a8d02.js";import{c as D}from"./chunks/createLucideIcon-8605f860.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.294.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const k=D("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function R(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function E(e){return"nodeType"in e}function N(e){var t,n;return e?R(e)?e:E(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function O(e){const{Document:t}=N(e);return e instanceof t}function S(e){return!R(e)&&e instanceof N(e).HTMLElement}function I(e){return e instanceof N(e).SVGElement}function A(e){return e?R(e)?e.document:E(e)?O(e)?e:S(e)||I(e)?e.ownerDocument:document:document:document}const T=C?i:a;function M(e){const t=l(e);return T(()=>{t.current=e}),c(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function j(e,t){void 0===t&&(t=[e]);const n=l(e);return T(()=>{n.current!==e&&(n.current=e)},t),n}function L(e,t){const n=l();return o(()=>{const t=e(n.current);return n.current=t,t},[...t])}function B(e){const t=M(e),n=l(null),r=c(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function P(e){const t=l();return a(()=>{t.current=e},[e]),t.current}let z={};function Y(e,t){return o(()=>{if(t)return t;const n=null==z[e]?0:z[e]+1;return z[e]=n,e+"-"+n},[e,t])}function F(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const X=F(1),K=F(-1);function U(e){if(!e)return!1;const{KeyboardEvent:t}=N(e.target);return t&&e instanceof t}function W(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=N(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const H=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[H.Translate.toString(e),H.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),J="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function V(e){return e.matches(J)?e:e.querySelector(J)}const q={display:"none"};function G(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:q},n)}function Q(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},n)}const Z=d(null);const $={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},_={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ee(e){let{announcements:t=_,container:n,hiddenTextDescribedById:i,screenReaderInstructions:l=$}=e;const{announce:d,announcement:u}=function(){const[e,t]=s("");return{announce:c(e=>{null!=e&&t(e)},[]),announcement:e}}(),g=Y("DndLiveRegion"),[v,h]=s(!1);if(a(()=>{h(!0)},[]),function(e){const t=p(Z);a(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(o(()=>({onDragStart(e){let{active:n}=e;d(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&d(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;d(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;d(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;d(t.onDragCancel({active:n,over:r}))}}),[d,t])),!v)return null;const f=r.createElement(r.Fragment,null,r.createElement(G,{id:i,value:l.draggable}),r.createElement(Q,{id:g,announcement:u}));return n?y(f,n):f}var te;function ne(){}function re(e,t){return o(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(te||(te={}));const oe=Object.freeze({x:0,y:0});function ie(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ae(e,t){const n=W(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function le(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ce(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function se(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function de(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function ue(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const ge=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=ue(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=ie(ue(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(le)};function pe(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const ve=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=pe(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(ce)};function he(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:oe}function fe(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const be=fe(1);function ye(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const me={ignoreTransform:!1};function xe(e,t){void 0===t&&(t=me);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=N(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=ye(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,c=e.left-a-(1-o)*parseFloat(n),s=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:c+d,bottom:s+u,left:c}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:c}}function we(e){return xe(e,{ignoreTransform:!0})}function De(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(O(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!S(o)||I(o))return n;if(n.includes(o))return n;const i=N(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=N(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=N(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function ke(e){const[t]=De(e,1);return null!=t?t:null}function Ce(e){return C&&e?R(e)?e:E(e)?O(e)||e===A(e).scrollingElement?window:S(e)?e:null:null:null}function Re(e){return R(e)?e.scrollX:e.scrollLeft}function Ee(e){return R(e)?e.scrollY:e.scrollTop}function Ne(e){return{x:Re(e),y:Ee(e)}}var Oe;function Se(e){return!(!C||!e)&&e===document.scrollingElement}function Ie(e){const t={x:0,y:0},n=Se(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Oe||(Oe={}));const Ae={x:.2,y:.2};function Te(e,t,n,r,o){let{top:i,left:a,right:l,bottom:c}=n;void 0===r&&(r=10),void 0===o&&(o=Ae);const{isTop:s,isBottom:d,isLeft:u,isRight:g}=Ie(e),p={x:0,y:0},v={x:0,y:0},h=t.height*o.y,f=t.width*o.x;return!s&&i<=t.top+h?(p.y=Oe.Backward,v.y=r*Math.abs((t.top+h-i)/h)):!d&&c>=t.bottom-h&&(p.y=Oe.Forward,v.y=r*Math.abs((t.bottom-h-c)/h)),!g&&l>=t.right-f?(p.x=Oe.Forward,v.x=r*Math.abs((t.right-f-l)/f)):!u&&a<=t.left+f&&(p.x=Oe.Backward,v.x=r*Math.abs((t.left+f-a)/f)),{direction:p,speed:v}}function Me(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function je(e){return e.reduce((e,t)=>X(e,Ne(t)),oe)}function Le(e,t){if(void 0===t&&(t=xe),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);ke(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Be=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Re(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Ee(t),0)}]];class Pe{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=De(t),r=je(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Be)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ze{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Ye(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Fe,Xe;function Ke(e){e.preventDefault()}function Ue(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Fe||(Fe={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Xe||(Xe={}));const We={start:[Xe.Space,Xe.Enter],cancel:[Xe.Esc],end:[Xe.Space,Xe.Enter,Xe.Tab]},He=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Xe.Right:return{...n,x:n.x+25};case Xe.Left:return{...n,x:n.x-25};case Xe.Down:return{...n,y:n.y+25};case Xe.Up:return{...n,y:n.y-25}}};class Je{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ze(A(t)),this.windowListeners=new ze(N(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fe.Resize,this.handleCancel),this.windowListeners.add(Fe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Le(n),t(oe)}handleKeyDown(e){if(U(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=We,coordinateGetter:i=He,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=n.current,s=c?{x:c.left,y:c.top}:oe;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:n.current,currentCoordinates:s});if(d){const t=K(d,s),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:u,minScroll:g}=Ie(n),p=Me(n),v={x:Math.min(o===Xe.Right?p.right-p.width/2:p.right,Math.max(o===Xe.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(o===Xe.Down?p.bottom-p.height/2:p.bottom,Math.max(o===Xe.Down?p.top:p.top+p.height/2,d.y))},h=o===Xe.Right&&!l||o===Xe.Left&&!c,f=o===Xe.Down&&!s||o===Xe.Up&&!i;if(h&&v.x!==d.x){const e=n.scrollLeft+t.x,i=o===Xe.Right&&e<=u.x||o===Xe.Left&&e>=g.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Xe.Right?n.scrollLeft-u.x:n.scrollLeft-g.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(f&&v.y!==d.y){const e=n.scrollTop+t.y,i=o===Xe.Down&&e<=u.y||o===Xe.Up&&e>=g.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Xe.Down?n.scrollTop-u.y:n.scrollTop-g.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,X(K(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Ve(e){return Boolean(e&&"distance"in e)}function qe(e){return Boolean(e&&"delay"in e)}Je.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=We,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class Ge{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=N(e);return e instanceof t?e:A(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=A(i),this.documentListeners=new ze(this.document),this.listeners=new ze(n),this.windowListeners=new ze(N(i)),this.initialCoordinates=null!=(r=W(o))?r:oe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Fe.Resize,this.handleCancel),this.windowListeners.add(Fe.DragStart,Ke),this.windowListeners.add(Fe.VisibilityChange,this.handleCancel),this.windowListeners.add(Fe.ContextMenu,Ke),this.documentListeners.add(Fe.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(qe(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Ve(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Fe.Click,Ue,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=W(e))?t:oe,c=K(r,l);if(!n&&a){if(Ve(a)){if(null!=a.tolerance&&Ye(c,a.tolerance))return this.handleCancel();if(Ye(c,a.distance))return this.handleStart()}return qe(a)&&Ye(c,a.tolerance)?this.handleCancel():void this.handlePending(a,c)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Xe.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Qe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ze extends Ge{constructor(e){const{event:t}=e,n=A(t.target);super(e,Qe,n)}}Ze.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const $e={move:{name:"mousemove"},end:{name:"mouseup"}};var _e;!function(e){e[e.RightClick=2]="RightClick"}(_e||(_e={}));(class extends Ge{constructor(e){super(e,$e,A(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==_e.RightClick&&(null==r||r({event:n}),!0)}}];const et={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var tt,nt;function rt(e){let{acceleration:t,activator:n=tt.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:d=5,order:u=nt.TreeOrder,pointerCoordinates:g,scrollableAncestors:p,scrollableAncestorRects:v,delta:h,threshold:f}=e;const b=function(e){let{delta:t,disabled:n}=e;const r=P(t);return L(e=>{if(n||!r||!e)return ot;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Oe.Backward]:e.x[Oe.Backward]||-1===o.x,[Oe.Forward]:e.x[Oe.Forward]||1===o.x},y:{[Oe.Backward]:e.y[Oe.Backward]||-1===o.y,[Oe.Forward]:e.y[Oe.Forward]||1===o.y}}},[n,t,r])}({delta:h,disabled:!s}),[y,m]=function(){const e=l(null);return[c((t,n)=>{e.current=setInterval(t,n)},[]),c(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),x=l({x:0,y:0}),w=l({x:0,y:0}),D=o(()=>{switch(n){case tt.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case tt.DraggableRect:return i}},[n,i,g]),k=l(null),C=c(()=>{const e=k.current;if(!e)return;const t=x.current.x*w.current.x,n=x.current.y*w.current.y;e.scrollBy(t,n)},[]),R=o(()=>u===nt.TreeOrder?[...p].reverse():p,[u,p]);a(()=>{if(s&&p.length&&D){for(const e of R){if(!1===(null==r?void 0:r(e)))continue;const n=p.indexOf(e),o=v[n];if(!o)continue;const{direction:i,speed:a}=Te(e,o,D,t,f);for(const e of["x","y"])b[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return m(),k.current=e,y(C,d),x.current=a,void(w.current=i)}x.current={x:0,y:0},w.current={x:0,y:0},m()}else m()},[t,C,r,m,s,d,JSON.stringify(D),JSON.stringify(b),y,p,R,v,JSON.stringify(f)])}(class extends Ge{constructor(e){super(e,et)}static setup(){return window.addEventListener(et.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(et.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(tt||(tt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(nt||(nt={}));const ot={x:{[Oe.Backward]:!1,[Oe.Forward]:!1},y:{[Oe.Backward]:!1,[Oe.Forward]:!1}};var it,at;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(it||(it={})),function(e){e.Optimized="optimized"}(at||(at={}));const lt=new Map;function ct(e,t){return L(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function st(e){let{callback:t,disabled:n}=e;const r=M(t),i=o(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return a(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function dt(e){return new Pe(xe(e),e)}function ut(e,t,n){void 0===t&&(t=dt);const[r,i]=s(null);function l(){i(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const c=function(e){let{callback:t,disabled:n}=e;const r=M(t),i=o(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return a(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),d=st({callback:l});return T(()=>{l(),e?(null==d||d.observe(e),null==c||c.observe(document.body,{childList:!0,subtree:!0})):(null==d||d.disconnect(),null==c||c.disconnect())},[e]),r}const gt=[];function pt(e,t){void 0===t&&(t=[]);const n=l(null);return a(()=>{n.current=null},t),a(()=>{const t=e!==oe;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?K(e,n.current):oe}function vt(e){return o(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const ht=[];function ft(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return S(t)?t:e}const bt=[{sensor:Ze,options:{}},{sensor:Je,options:{}}],yt={current:{}},mt={draggable:{measure:we},droppable:{measure:we,strategy:it.WhileDragging,frequency:at.Optimized},dragOverlay:{measure:xe}};class xt extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const wt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ne},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mt,measureDroppableContainers:ne,windowRect:null,measuringScheduled:!1},Dt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ne,draggableNodes:new Map,over:null,measureDroppableContainers:ne},kt=d(Dt),Ct=d(wt);function Rt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xt}}}function Et(e,t){switch(t.type){case te.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case te.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case te.DragEnd:case te.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case te.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new xt(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case te.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new xt(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case te.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new xt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Nt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=p(kt),i=P(r),l=P(null==n?void 0:n.id);return a(()=>{if(!t&&!r&&i&&null!=l){if(!U(i))return;if(document.activeElement===i.target)return;const e=o.get(l);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=V(e);if(t){t.focus();break}}})}},[r,t,o,l,i]),null}function Ot(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const St=d({...oe,scaleX:1,scaleY:1});var It;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(It||(It={}));const At=u(function(e){var t,n,i,d;let{id:u,accessibility:p,autoScroll:v=!0,children:h,sensors:f=bt,collisionDetection:y=ve,measuring:m,modifiers:x,...w}=e;const D=g(Et,void 0,Rt),[k,R]=D,[E,O]=function(){const[e]=s(()=>new Set),t=c(t=>(e.add(t),()=>e.delete(t)),[e]);return[c(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[I,A]=s(It.Uninitialized),M=I===It.Initialized,{draggable:{active:P,nodes:z,translate:F},droppable:{containers:K}}=k,U=null!=P?z.get(P):null,H=l({initial:null,translated:null}),J=o(()=>{var e;return null!=P?{id:P,data:null!=(e=null==U?void 0:U.data)?e:yt,rect:H}:null},[P,U]),V=l(null),[q,G]=s(null),[Q,$]=s(null),_=j(w,Object.values(w)),ne=Y("DndDescribedBy",u),re=o(()=>K.getEnabled(),[K]),ie=o(()=>({draggable:{...mt.draggable,...null==ae?void 0:ae.draggable},droppable:{...mt.droppable,...null==ae?void 0:ae.droppable},dragOverlay:{...mt.dragOverlay,...null==ae?void 0:ae.dragOverlay}}),[null==(ae=m)?void 0:ae.draggable,null==ae?void 0:ae.droppable,null==ae?void 0:ae.dragOverlay]);var ae;const{droppableRects:le,measureDroppableContainers:ce,measuringScheduled:se}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,d]=s(null),{frequency:u,measure:g,strategy:p}=o,v=l(e),h=function(){switch(p){case it.Always:return!1;case it.BeforeDragging:return n;default:return!n}}(),f=j(h),b=c(function(e){void 0===e&&(e=[]),f.current||d(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),y=l(null),m=L(t=>{if(h&&!n)return lt;if(!t||t===lt||v.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Pe(g(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,h,g]);return a(()=>{v.current=e},[e]),a(()=>{h||b()},[n,h]),a(()=>{i&&i.length>0&&d(null)},[JSON.stringify(i)]),a(()=>{h||"number"!=typeof u||null!==y.current||(y.current=setTimeout(()=>{b(),y.current=null},u))},[u,h,b,...r]),{droppableRects:m,measureDroppableContainers:b,measuringScheduled:null!=i}}(re,{dragging:M,dependencies:[F.x,F.y],config:ie.droppable}),ue=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return L(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(z,P),ge=o(()=>Q?W(Q):null,[Q]),pe=function(){const e=!1===(null==q?void 0:q.autoScrollEnabled),t="object"==typeof v?!1===v.enabled:!1===v,n=M&&!e&&!t;if("object"==typeof v)return{...v,enabled:n};return{enabled:n}}(),fe=function(e,t){return ct(e,t)}(ue,ie.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=l(!1),{x:a,y:c}="boolean"==typeof o?{x:o,y:o}:o;T(()=>{if(!a&&!c||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=he(n(e),r);if(a||(o.x=0),c||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=ke(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,c,r,n])}({activeNode:null!=P?z.get(P):null,config:pe.layoutShiftCompensation,initialRect:fe,measure:ie.draggable.measure});const ye=ut(ue,ie.draggable.measure,fe),me=ut(ue?ue.parentElement:null),we=l({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:le,draggableNodes:z,draggingNode:null,draggingNodeRect:null,droppableContainers:K,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Re=K.getNodeFor(null==(t=we.current.over)?void 0:t.id),Ee=function(e){let{measure:t}=e;const[n,r]=s(null),i=st({callback:c(e=>{for(const{target:n}of e)if(S(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),a=c(e=>{const n=ft(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]),[l,d]=B(a);return o(()=>({nodeRef:l,rect:n,setRef:d}),[n,l,d])}({measure:ie.dragOverlay.measure}),Oe=null!=(n=Ee.nodeRef.current)?n:ue,Ie=M?null!=(i=Ee.rect)?i:ye:null,Ae=Boolean(Ee.nodeRef.current&&Ee.rect),Te=he(Me=Ae?null:ye,ct(Me));var Me;const Le=vt(Oe?N(Oe):null),Be=function(e){const t=l(e),n=L(n=>e?n&&n!==gt&&e&&t.current&&e.parentNode===t.current.parentNode?n:De(e):gt,[e]);return a(()=>{t.current=e},[e]),n}(M?null!=Re?Re:ue:null),ze=function(e,t){void 0===t&&(t=xe);const[n]=e,r=vt(n?N(n):null),[o,i]=s(ht);function a(){i(()=>e.length?e.map(e=>Se(e)?r:new Pe(t(e),e)):ht)}const l=st({callback:a});return T(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),o}(Be),Ye=Ot(x,{transform:{x:F.x-Te.x,y:F.y-Te.y,scaleX:1,scaleY:1},activatorEvent:Q,active:J,activeNodeRect:ye,containerNodeRect:me,draggingNodeRect:Ie,over:we.current.over,overlayNodeRect:Ee.rect,scrollableAncestors:Be,scrollableAncestorRects:ze,windowRect:Le}),Fe=ge?X(ge,F):null,Xe=function(e){const[t,n]=s(null),r=l(e),i=c(e=>{const t=Ce(e.target);t&&n(e=>e?(e.set(t,Ne(t)),new Map(e)):null)},[]);return a(()=>{const t=r.current;if(e!==t){o(t);const a=e.map(e=>{const t=Ce(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,Ne(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{const t=Ce(e);null==t||t.removeEventListener("scroll",i)})}},[i,e]),o(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>X(e,t),oe):je(e):oe,[e,t])}(Be),Ke=pt(Xe),Ue=pt(Xe,[ye]),We=X(Ye,Ke),He=Ie?be(Ie,Ye):null,Je=J&&He?y({active:J,collisionRect:He,droppableRects:le,droppableContainers:re,pointerCoordinates:Fe}):null,Ve=de(Je,"id"),[qe,Ge]=s(null),Qe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Ae?Ye:X(Ye,Ue),null!=(d=null==qe?void 0:qe.rect)?d:null,ye),Ze=l(null),$e=c((e,t)=>{let{sensor:n,options:r}=t;if(null==V.current)return;const o=z.get(V.current);if(!o)return;const i=e.nativeEvent,a=new n({active:V.current,activeNode:o,event:i,options:r,context:we,onAbort(e){if(!z.get(e))return;const{onDragAbort:t}=_.current,n={id:e};null==t||t(n),E({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!z.get(e))return;const{onDragPending:o}=_.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),E({type:"onDragPending",event:i})},onStart(e){const t=V.current;if(null==t)return;const n=z.get(t);if(!n)return;const{onDragStart:r}=_.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:H}};b(()=>{null==r||r(o),A(It.Initializing),R({type:te.DragStart,initialCoordinates:e,active:t}),E({type:"onDragStart",event:o}),G(Ze.current),$(i)})},onMove(e){R({type:te.DragMove,coordinates:e})},onEnd:l(te.DragEnd),onCancel:l(te.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=we.current;let a=null;if(t&&o){const{cancelDrop:l}=_.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===te.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=te.DragCancel)}}V.current=null,b(()=>{R({type:e}),A(It.Uninitialized),Ge(null),G(null),$(null),Ze.current=null;const t=e===te.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=_.current[t];null==e||e(a),E({type:t,event:a})}})}}Ze.current=a},[z]),_e=c((e,t)=>(n,r)=>{const o=n.nativeEvent,i=z.get(r);if(null!==V.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},V.current=r,$e(n,t))},[z,$e]),et=function(e,t){return o(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(f,_e);!function(e){a(()=>{if(!C)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(f),T(()=>{ye&&I===It.Initializing&&A(It.Initialized)},[ye,I]),a(()=>{const{onDragMove:e}=_.current,{active:t,activatorEvent:n,collisions:r,over:o}=we.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:We.x,y:We.y},over:o};b(()=>{null==e||e(i),E({type:"onDragMove",event:i})})},[We.x,We.y]),a(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=we.current;if(!e||null==V.current||!t||!o)return;const{onDragOver:i}=_.current,a=r.get(Ve),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};b(()=>{Ge(l),null==i||i(c),E({type:"onDragOver",event:c})})},[Ve]),T(()=>{we.current={activatorEvent:Q,active:J,activeNode:ue,collisionRect:He,collisions:Je,droppableRects:le,draggableNodes:z,draggingNode:Oe,draggingNodeRect:Ie,droppableContainers:K,over:qe,scrollableAncestors:Be,scrollAdjustedTranslate:We},H.current={initial:Ie,translated:He}},[J,ue,Je,He,z,Oe,Ie,le,K,qe,Be,We]),rt({...pe,delta:F,draggingRect:He,pointerCoordinates:Fe,scrollableAncestors:Be,scrollableAncestorRects:ze});const tt=o(()=>({active:J,activeNode:ue,activeNodeRect:ye,activatorEvent:Q,collisions:Je,containerNodeRect:me,dragOverlay:Ee,draggableNodes:z,droppableContainers:K,droppableRects:le,over:qe,measureDroppableContainers:ce,scrollableAncestors:Be,scrollableAncestorRects:ze,measuringConfiguration:ie,measuringScheduled:se,windowRect:Le}),[J,ue,ye,Q,Je,me,Ee,z,K,le,qe,ce,Be,ze,ie,se,Le]),nt=o(()=>({activatorEvent:Q,activators:et,active:J,activeNodeRect:ye,ariaDescribedById:{draggable:ne},dispatch:R,draggableNodes:z,over:qe,measureDroppableContainers:ce}),[Q,et,J,ye,R,ne,z,qe,ce]);return r.createElement(Z.Provider,{value:O},r.createElement(kt.Provider,{value:nt},r.createElement(Ct.Provider,{value:tt},r.createElement(St.Provider,{value:Qe},h)),r.createElement(Nt,{disabled:!1===(null==p?void 0:p.restoreFocus)})),r.createElement(ee,{...p,hiddenTextDescribedById:ne}))}),Tt=d(null),Mt="button";function jt(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const a=Y("Draggable"),{activators:l,activatorEvent:c,active:s,activeNodeRect:d,ariaDescribedById:u,draggableNodes:g,over:v}=p(kt),{role:h=Mt,roleDescription:f="draggable",tabIndex:b=0}=null!=i?i:{},y=(null==s?void 0:s.id)===t,m=p(y?St:Tt),[x,w]=B(),[D,k]=B(),C=function(e,t){return o(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(l,t),R=j(n);T(()=>(g.set(t,{id:t,key:a,node:x,activatorNode:D,data:R}),()=>{const e=g.get(t);e&&e.key===a&&g.delete(t)}),[g,t]);return{active:s,activatorEvent:c,activeNodeRect:d,attributes:o(()=>({role:h,tabIndex:b,"aria-disabled":r,"aria-pressed":!(!y||h!==Mt)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[r,h,b,y,f,u.draggable]),isDragging:y,listeners:r?void 0:C,node:x,over:v,setNodeRef:w,setActivatorNodeRef:k,transform:m}}function Lt(){return p(Ct)}const Bt={timeout:25};function Pt(e){let{animation:t,children:n}=e;const[o,i]=s(null),[a,l]=s(null),c=P(n);return n||o||!c||i(c),T(()=>{if(!a)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,a)).then(()=>{i(null)}):i(null)},[t,o,a]),r.createElement(r.Fragment,null,n,o?v(o,{ref:l}):null)}const zt={x:0,y:0,scaleX:1,scaleY:1};function Yt(e){let{children:t}=e;return r.createElement(kt.Provider,{value:Dt},r.createElement(St.Provider,{value:zt},t))}const Ft={position:"fixed",touchAction:"none"},Xt=e=>U(e)?"transform 250ms ease":void 0,Kt=h((e,t)=>{let{as:n,activatorEvent:o,adjustScale:i,children:a,className:l,rect:c,style:s,transform:d,transition:u=Xt}=e;if(!c)return null;const g=i?d:{...d,scaleX:1,scaleY:1},p={...Ft,width:c.width,height:c.height,top:c.top,left:c.left,transform:H.Transform.toString(g),transformOrigin:i&&o?ae(o,c):void 0,transition:"function"==typeof u?u(o):u,...s};return r.createElement(n,{className:l,style:p,ref:t},a)}),Ut=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},Wt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:H.Transform.toString(t)},{transform:H.Transform.toString(n)}]},sideEffects:Ut({styles:{active:{opacity:"0"}}})};function Ht(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return M((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const l=a.node.current;if(!l)return;const c=ft(i);if(!c)return;const{transform:s}=N(i).getComputedStyle(i),d=ye(s);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Wt,...e};return e=>{let{active:i,dragOverlay:a,transform:l,...c}=e;if(!t)return;const s={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:1!==l.scaleX?i.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?i.rect.height*l.scaleY/a.rect.height:1},u={x:l.x-s.x,y:l.y-s.y,...d},g=o({...c,active:i,dragOverlay:a,transform:{initial:l,final:u}}),[p]=g,v=g[g.length-1];if(JSON.stringify(p)===JSON.stringify(v))return;const h=null==r?void 0:r({active:i,dragOverlay:a,...c}),f=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{f.onfinish=()=>{null==h||h(),e()}})}}(t);return Le(l,o.draggable.measure),u({active:{id:e,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:o,transform:d})})}let Jt=0;function Vt(e){return o(()=>{if(null!=e)return Jt++,Jt},[e])}const qt=r.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:i,transition:a,modifiers:l,wrapperElement:c="div",className:s,zIndex:d=999}=e;const{activatorEvent:u,active:g,activeNodeRect:v,containerNodeRect:h,draggableNodes:f,droppableContainers:b,dragOverlay:y,over:m,measuringConfiguration:x,scrollableAncestors:w,scrollableAncestorRects:D,windowRect:k}=Lt(),C=p(St),R=Vt(null==g?void 0:g.id),E=Ot(l,{activatorEvent:u,active:g,activeNodeRect:v,containerNodeRect:h,draggingNodeRect:y.rect,over:m,overlayNodeRect:y.rect,scrollableAncestors:w,scrollableAncestorRects:D,transform:C,windowRect:k}),N=ct(v),O=Ht({config:o,draggableNodes:f,droppableContainers:b,measuringConfiguration:x}),S=N?y.setRef:void 0;return r.createElement(Yt,null,r.createElement(Pt,{animation:O},g&&R?r.createElement(Kt,{key:R,id:g.id,ref:S,as:c,activatorEvent:u,adjustScale:t,className:s,transition:a,rect:N,style:{zIndex:d,...i},transform:E},n):null))});function Gt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Qt(e,t){return e.reduce((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e},Array(e.length))}function Zt(e){return null!==e&&e>=0}const $t=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Gt(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},_t={scaleX:1,scaleY:1},en=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[n])?t:r;if(!l)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(l.top+l.height):e.top-l.top,..._t}:null}const c=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=a?{x:0,y:-l.height-c,..._t}:o<n&&o>=a?{x:0,y:l.height+c,..._t}:{x:0,y:0,..._t}};const tn="Sortable",nn=r.createContext({activeIndex:-1,containerId:tn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$t,disabled:{draggable:!1,droppable:!1}});function rn(e){let{children:t,id:n,items:i,strategy:c=$t,disabled:s=!1}=e;const{active:d,dragOverlay:u,droppableRects:g,over:p,measureDroppableContainers:v}=Lt(),h=Y(tn,n),f=Boolean(null!==u.rect),b=o(()=>i.map(e=>"object"==typeof e&&"id"in e?e.id:e),[i]),y=null!=d,m=d?b.indexOf(d.id):-1,x=p?b.indexOf(p.id):-1,w=l(b),D=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(b,w.current),k=-1!==x&&-1===m||D,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(s);T(()=>{D&&y&&v(b)},[D,b,y,v]),a(()=>{w.current=b},[b]);const R=o(()=>({activeIndex:m,containerId:h,disabled:C,disableTransforms:k,items:b,overIndex:x,useDragOverlay:f,sortedRects:Qt(b,g),strategy:c}),[m,h,C.draggable,C.droppable,k,b,x,g,f,c]);return r.createElement(nn.Provider,{value:R},t)}const on=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Gt(n,r,o).indexOf(t)},an=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:s}=e;return!(!s||!r)&&((l===i||o!==a)&&(!!n||a!==o&&t===c))},ln={duration:200,easing:"ease"},cn="transform",sn=H.Transition.toString({property:cn,duration:0,easing:"linear"}),dn={roleDescription:"sortable"};function un(e){let{animateLayoutChanges:t=an,attributes:n,disabled:r,data:i,getNewIndex:d=on,id:u,strategy:g,resizeObserverConfig:v,transition:h=ln}=e;const{items:f,containerId:b,activeIndex:y,disabled:m,disableTransforms:x,sortedRects:w,overIndex:D,useDragOverlay:k,strategy:C}=p(nn),R=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,m),E=f.indexOf(u),N=o(()=>({sortable:{containerId:b,index:E,items:f},...i}),[b,i,E,f]),O=o(()=>f.slice(f.indexOf(u)),[f,u]),{rect:S,node:I,isOver:A,setNodeRef:M}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Y("Droppable"),{active:s,dispatch:d,over:u,measureDroppableContainers:g}=p(kt),v=l({disabled:n}),h=l(!1),f=l(null),b=l(null),{disabled:y,updateMeasurementsFor:m,timeout:x}={...Bt,...o},w=j(null!=m?m:r),D=st({callback:c(()=>{h.current?(null!=b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{g(Array.isArray(w.current)?w.current:[w.current]),b.current=null},x)):h.current=!0},[x]),disabled:y||!s}),k=c((e,t)=>{D&&(t&&(D.unobserve(t),h.current=!1),e&&D.observe(e))},[D]),[C,R]=B(k),E=j(t);return a(()=>{D&&C.current&&(D.disconnect(),h.current=!1,D.observe(C.current))},[C,D]),a(()=>(d({type:te.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:f,data:E}}),()=>d({type:te.UnregisterDroppable,key:i,id:r})),[r]),a(()=>{n!==v.current.disabled&&(d({type:te.SetDroppableDisabled,id:r,key:i,disabled:n}),v.current.disabled=n)},[r,i,n,d]),{active:s,rect:f,isOver:(null==u?void 0:u.id)===r,node:C,over:u,setNodeRef:R}}({id:u,data:N,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...v}}),{active:L,activatorEvent:P,activeNodeRect:z,attributes:F,setNodeRef:X,listeners:K,isDragging:W,over:J,setActivatorNodeRef:V,transform:q}=jt({id:u,data:N,attributes:{...dn,...n},disabled:R.draggable}),G=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o(()=>e=>{t.forEach(t=>t(e))},t)}(M,X),Q=Boolean(L),Z=Q&&!x&&Zt(y)&&Zt(D),$=!k&&W,_=$&&Z?q:null,ee=Z?null!=_?_:(null!=g?g:C)({rects:w,activeNodeRect:z,activeIndex:y,overIndex:D,index:E}):null,ne=Zt(y)&&Zt(D)?d({id:u,items:f,activeIndex:y,overIndex:D}):E,re=null==L?void 0:L.id,oe=l({activeId:re,items:f,newIndex:ne,containerId:b}),ie=f!==oe.current.items,ae=t({active:L,containerId:b,isDragging:W,isSorting:Q,id:u,index:E,items:f,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:h,wasDragging:null!=oe.current.activeId}),le=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,c]=s(null),d=l(n);return T(()=>{if(!t&&n!==d.current&&r.current){const e=o.current;if(e){const t=xe(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&c(n)}}n!==d.current&&(d.current=n)},[t,n,r,o]),a(()=>{i&&c(null)},[i]),i}({disabled:!ae,index:E,node:I,rect:S});return a(()=>{Q&&oe.current.newIndex!==ne&&(oe.current.newIndex=ne),b!==oe.current.containerId&&(oe.current.containerId=b),f!==oe.current.items&&(oe.current.items=f)},[Q,ne,b,f]),a(()=>{if(re===oe.current.activeId)return;if(re&&!oe.current.activeId)return void(oe.current.activeId=re);const e=setTimeout(()=>{oe.current.activeId=re},50);return()=>clearTimeout(e)},[re]),{active:L,activeIndex:y,attributes:F,data:N,rect:S,index:E,newIndex:ne,items:f,isOver:A,isSorting:Q,isDragging:W,listeners:K,node:I,overIndex:D,over:J,setNodeRef:G,setActivatorNodeRef:V,setDroppableNodeRef:M,setDraggableNodeRef:X,transform:null!=le?le:ee,transition:function(){if(le||ie&&oe.current.newIndex===E)return sn;if($&&!U(P)||!h)return;if(Q||ae)return H.Transition.toString({...h,property:cn});return}()}}function gn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const pn=[Xe.Down,Xe.Right,Xe.Up,Xe.Left],vn=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(pn.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case Xe.Down:r.top<i.top&&t.push(n);break;case Xe.Up:r.top>i.top&&t.push(n);break;case Xe.Left:r.left>i.left&&t.push(n);break;case Xe.Right:r.left<i.left&&t.push(n)}});const c=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=se(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=se(r),a=o.reduce((e,t,r)=>e+ie(n[r],t),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(le)})({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let s=de(c,"id");if(s===(null==a?void 0:a.id)&&c.length>1&&(s=c[1].id),null!=s){const e=i.get(n.id),t=i.get(s),a=t?o.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&a&&e&&t){const n=De(c).some((e,t)=>l[t]!==e),o=hn(e,t),i=function(e,t){if(!gn(e)||!gn(t))return!1;if(!hn(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=n||!o?{x:0,y:0}:{x:i?r.width-a.width:0,y:i?r.height-a.height:0},d={x:a.left,y:a.top};return s.x&&s.y?d:K(d,s)}}}};function hn(e,t){return!(!gn(e)||!gn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}w(':root{--yoopta-ui-background:0 0% 100%;--yoopta-ui-foreground:222.2 84% 4.9%;--yoopta-ui-muted:210 40% 96.1%;--yoopta-ui-muted-foreground:215.4 16.3% 46.9%;--yoopta-ui-border:214.3 31.8% 91.4%;--yoopta-ui-ring:222.2 84% 4.9%;--yoopta-ui-accent:210 40% 96.1%;--yoopta-ui-accent-foreground:222.2 47.4% 11.2%;--yoopta-ui-primary:221.2 83.2% 53.3%;--yoopta-ui-primary-foreground:210 40% 98%;--yoopta-ui-destructive:0 84.2% 60.2%;--yoopta-ui-destructive-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.18),0 4px 16px -4px rgba(0,0,0,.1);--yoopta-ui-radius-sm:0.375rem;--yoopta-ui-radius:0.5rem;--yoopta-ui-radius-lg:0.625rem;--yoopta-ui-z-dropdown:50;--yoopta-ui-z-sticky:100;--yoopta-ui-z-overlay:200;--yoopta-ui-z-modal:9999;--yoopta-ui-transition-fast:100ms ease;--yoopta-ui-transition:150ms ease;--yoopta-ui-transition-slow:200ms ease}.dark,[data-theme=dark],[data-yoopta-theme=dark]{--yoopta-ui-background:222.2 84% 4.9%;--yoopta-ui-foreground:210 40% 98%;--yoopta-ui-muted:217.2 32.6% 17.5%;--yoopta-ui-muted-foreground:215 20.2% 65.1%;--yoopta-ui-border:217.2 32.6% 17.5%;--yoopta-ui-ring:212.7 26.8% 83.9%;--yoopta-ui-accent:217.2 32.6% 17.5%;--yoopta-ui-accent-foreground:210 40% 98%;--yoopta-ui-shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--yoopta-ui-shadow:0 4px 6px -1px rgba(0,0,0,.4),0 2px 4px -2px rgba(0,0,0,.3);--yoopta-ui-shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.3);--yoopta-ui-shadow-xl:0 16px 48px -12px rgba(0,0,0,.5),0 4px 16px -4px rgba(0,0,0,.3)}:root{--yoopta-ui-block-dnd-overlay-shadow:0 10px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--yoopta-ui-block-dnd-overlay-radius:0.5rem;--yoopta-ui-block-dnd-overlay-padding-y:10px;--yoopta-ui-block-dnd-overlay-padding-x:14px;--yoopta-ui-block-dnd-overlay-min-width:140px;--yoopta-ui-block-dnd-transition:transform 200ms ease,opacity 200ms ease}.yoopta-ui-block-dnd-sortable{position:relative;transition:var(--yoopta-ui-block-dnd-transition)}.yoopta-ui-block-dnd-sortable--dragging{cursor:grabbing;z-index:1000}.yoopta-ui-block-dnd-drop-indicator{background-color:hsl(var(--yoopta-ui-primary));border-radius:1px;height:2px;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:100}.yoopta-ui-block-dnd-drop-indicator:after,.yoopta-ui-block-dnd-drop-indicator:before{background-color:hsl(var(--yoopta-ui-primary));border-radius:50%;content:"";height:6px;position:absolute;top:50%;transform:translateY(-50%);width:6px}.yoopta-ui-block-dnd-drop-indicator:before{left:-3px}.yoopta-ui-block-dnd-drop-indicator:after{right:-3px}.yoopta-ui-block-dnd-handle{cursor:grab;transition:opacity .15s ease}.yoopta-ui-block-dnd-handle:hover{opacity:.8}.yoopta-ui-block-dnd-handle:focus{outline:none}.yoopta-ui-block-dnd-handle:focus-visible{border-radius:4px;outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-block-dnd-handle--holding{cursor:grabbing;opacity:.7}.yoopta-ui-block-dnd-handle--dragging{cursor:grabbing;opacity:.5}.yoopta-ui-block-dnd-handle:disabled{cursor:not-allowed;opacity:.3}.yoopta-ui-block-dnd-overlay{align-items:center;animation:yoopta-ui-block-dnd-overlay-fade-in .15s ease;background-color:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-block-dnd-overlay-radius);box-shadow:var(--yoopta-ui-block-dnd-overlay-shadow);display:flex;gap:10px;min-width:var(--yoopta-ui-block-dnd-overlay-min-width);padding:var(--yoopta-ui-block-dnd-overlay-padding-y) var(--yoopta-ui-block-dnd-overlay-padding-x);pointer-events:none}.yoopta-ui-block-dnd-overlay-icon{align-items:center;color:hsl(var(--yoopta-ui-muted-foreground));display:flex;flex-shrink:0;height:20px;justify-content:center;width:20px}.yoopta-ui-block-dnd-overlay-content{align-items:center;display:flex;flex:1;min-width:0}.yoopta-ui-block-dnd-overlay-text{color:hsl(var(--yoopta-ui-foreground));font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoopta-ui-block-dnd-overlay-text strong{color:hsl(var(--yoopta-ui-foreground));font-weight:600}[data-block-dnd-dragging=true]{opacity:.5;pointer-events:none}.yoopta-ui-block-dnd-sortable:focus{outline:none}.yoopta-ui-block-dnd-sortable:focus-visible{border-radius:4px;outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}@keyframes yoopta-ui-block-dnd-overlay-fade-in{0%{opacity:0;transform:scale(.95) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}');const fn=d(null),bn=()=>{const e=p(fn);if(!e)throw new Error("useBlockDndContext must be used within a BlockDndContext");return e},yn=({transform:e})=>Object.assign(Object.assign({},e),{x:0}),mn=({editor:r,children:i,onDragStart:a,onDragEnd:d,renderDragOverlay:u,enableMultiDrag:g=!0})=>{var p;const[v,h]=s(null),[f,b]=s([]),y=l(new Map),x=o(()=>Object.keys(r.children).sort((e,t)=>r.children[e].meta.order-r.children[t].meta.order),[r.children]),w=v&&null!==(p=r.children[v])&&void 0!==p?p:null,D=o(()=>f.map(e=>r.children[e]).filter(Boolean),[f,r.children]),C=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o(()=>[...t].filter(e=>null!=e),[...t])}(re(Ze,{activationConstraint:{distance:5}}),re(Je,{coordinateGetter:vn})),R=c(e=>{const{active:t}=e;h(t.id);const n=r.path.selected;let o=[t.id];if(g&&Array.isArray(n)&&n.length>1){const e=n.map(e=>{const t=m.getBlock(r,{at:e});return null==t?void 0:t.id}).filter(e=>void 0!==e);e.includes(t.id)&&(o=e)}b(o);const i=o.map(e=>r.children[e]).filter(Boolean);null==a||a(e,i)},[r,g,a]),E=c(e=>{const{active:t,over:n}=e;if(h(null),b([]),!n||t.id===n.id)return void(null==d||d(e,!1));const o=r.children[t.id],i=r.children[n.id];if(!o||!i)return void(null==d||d(e,!1));const a=o.meta.order,l=i.meta.order;a!==l?(r.batchOperations(()=>{if(f.length>1){const e=[...f].sort((e,t)=>{var n,o,i,a;return(null!==(o=null===(n=r.children[e])||void 0===n?void 0:n.meta.order)&&void 0!==o?o:0)-(null!==(a=null===(i=r.children[t])||void 0===i?void 0:i.meta.order)&&void 0!==a?a:0)}),t=l;e.forEach((e,n)=>{r.moveBlock(e,t+n)})}else r.moveBlock(t.id,l)}),r.setPath({current:l,selected:null}),null==d||d(e,!0)):null==d||d(e,!1)},[r,f,d]),N=c((e,t)=>{y.current.set(e,t)},[]),O=c(e=>{y.current.delete(e)},[]),S=c(e=>y.current.get(e)||null,[]),I=o(()=>({activeId:v,activeBlock:w,isDragging:null!==v,draggedIds:f,editor:r,registerSortable:N,unregisterSortable:O,getSortable:S}),[v,w,f,r,N,O,S]),A=D.length>0&&e("div",Object.assign({className:"yoopta-ui-block-dnd-overlay"},{children:[t("div",Object.assign({className:"yoopta-ui-block-dnd-overlay-icon"},{children:t(k,{size:16})})),t("div",Object.assign({className:"yoopta-ui-block-dnd-overlay-content"},{children:t("span",Object.assign({className:"yoopta-ui-block-dnd-overlay-text"},{children:1===D.length?t(n,{children:"Moving block"}):e(n,{children:["Moving ",t("strong",{children:D.length})," blocks"]})}))}))]}));return t(fn.Provider,Object.assign({value:I},{children:e(At,Object.assign({sensors:C,collisionDetection:ge,onDragStart:R,onDragEnd:E,modifiers:[yn]},{children:[t(rn,Object.assign({items:x,strategy:en},{children:i})),t(qt,Object.assign({dropAnimation:null},{children:v?u?u(D):A:null}))]}))}))},xn=({id:n,children:r,className:o,disabled:i=!1,useDragHandle:l=!0})=>{const{draggedIds:c,isDragging:s,registerSortable:d,unregisterSortable:u}=bn(),g=x(),{attributes:p,listeners:v,setNodeRef:h,setActivatorNodeRef:f,transform:b,transition:y,isDragging:m,isOver:w}=un({id:n,disabled:i||g.readOnly});a(()=>{if(l)return d(n,{setActivatorNodeRef:f,listeners:v,attributes:p}),()=>{u(n)}},[n,l,f,v,p,d,u]);const D=c.includes(n)&&c.length>1,k=m||s&&c.includes(n),C={transform:H.Transform.toString(b),transition:y,opacity:k?.5:1,position:"relative"},R=["yoopta-ui-block-dnd-sortable",m&&"yoopta-ui-block-dnd-sortable--dragging",w&&"yoopta-ui-block-dnd-sortable--over",D&&"yoopta-ui-block-dnd-sortable--multi",o].filter(Boolean).join(" ");return e("div",Object.assign({ref:h,style:C,className:R},l?{}:p,l?{}:v,{"data-block-dnd-id":n,"data-block-dnd-dragging":k||void 0,"data-block-dnd-over":w||void 0},{children:[r,w&&!m&&t("div",{className:"yoopta-ui-block-dnd-drop-indicator"})]}))},wn=h(({blockId:e,children:n,className:r,onClick:o,asChild:i=!1},d)=>{const{isDragging:u,getSortable:g}=bn(),[p,h]=s(!1),b=l(!1),y=e?g(e):null,m=l(d);m.current=d;const x=c(e=>{y&&y.setActivatorNodeRef(e);const t=m.current;"function"==typeof t?t(e):t&&(t.current=e)},[y]);a(()=>{if(!u){const e=setTimeout(()=>{b.current=!1,h(!1)},100);return()=>clearTimeout(e)}b.current=!0,h(!0)},[u]);const w=c(e=>{b.current||u||null==o||o(e)},[u,o]),D=["yoopta-ui-block-dnd-handle",p&&"yoopta-ui-block-dnd-handle--holding",u&&"yoopta-ui-block-dnd-handle--dragging",r].filter(Boolean).join(" ");if(!y||!e){if(i&&f(n)){const e=n.props,t=e.ref,o=e=>{"function"==typeof d?d(e):d&&(d.current=e),t&&("function"==typeof t?t(e):t&&"current"in t&&(t.current=e))};return v(n,Object.assign(Object.assign({},e),{ref:o,className:r,disabled:!0}))}return t("button",Object.assign({type:"button",ref:d,className:r,disabled:!0},{children:n}))}if(i&&f(n)){const t=n.props,r=t.ref,o=e=>{y&&y.setActivatorNodeRef(e);const t=m.current;"function"==typeof t?t(e):t&&(t.current=e),r&&("function"==typeof r?r(e):r&&"current"in r&&(r.current=e))};return v(n,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),{ref:o,className:[D,t.className].filter(Boolean).join(" "),onClick:e=>{var n;w(e),null===(n=t.onClick)||void 0===n||n.call(t,e)}}),y.attributes),y.listeners),{"data-block-dnd-handle":!0,"data-block-id":e,"aria-label":t["aria-label"]||"Drag to reorder block",title:t.title||"Drag to reorder"}))}return t("button",Object.assign({type:"button",ref:x,className:D,onClick:w},y.attributes,y.listeners,{"data-block-dnd-handle":!0,"data-block-id":e,"aria-label":"Drag to reorder block",title:"Drag to reorder"},{children:n}))});wn.displayName="DragHandle";const Dn=(e={})=>{const{blockId:t}=e,n=bn(),{isDragging:r,draggedIds:i,editor:a}=n,l=o(()=>!!t&&i.includes(t),[t,i]),s=o(()=>!!t&&(i.includes(t)&&i.length>1),[t,i]),d=c((e,t)=>{a.moveBlock(e,t)},[a]),u=c((e,t)=>{a.batchOperations(()=>{[...e].sort((e,t)=>{var n,r,o,i;return(null!==(r=null===(n=a.children[e])||void 0===n?void 0:n.meta.order)&&void 0!==r?r:0)-(null!==(i=null===(o=a.children[t])||void 0===o?void 0:o.meta.order)&&void 0!==i?i:0)}).forEach((e,n)=>{a.moveBlock(e,t+n)})})},[a]);return{isDragging:r,isBlockDragging:l,isPartOfMultiDrag:s,dragCount:i.length,draggedIds:i,moveBlock:d,moveBlocks:u}},kn=e=>Object.keys(e.children).sort((t,n)=>e.children[t].meta.order-e.children[n].meta.order);export{mn as BlockDndContext,wn as DragHandle,xn as SortableBlock,kn as getOrderedBlockIds,Dn as useBlockDnd,bn as useBlockDndContext};
|