@yoopta/editor 4.6.8-rc.2 → 4.6.9-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ declare const useYooptaEditor: () => YooEditor;
16
16
  declare const useBlockData: (blockId: string) => import("../../editor/types").YooptaBlockData<import("slate").Descendant>;
17
17
  declare const useYooptaFocused: () => boolean;
18
18
  declare const useYooptaReadOnly: () => boolean;
19
- declare const useYooptaPluginOptions: <TOptions>(blockType: string) => PluginOptions<TOptions>;
19
+ declare const useYooptaPluginOptions: <TOptions>(pluginType: string) => PluginOptions<TOptions>;
20
20
  type UseBlockSelectedProps = {
21
21
  blockId: string;
22
22
  path?: YooptaBlockPath;
@@ -1 +1 @@
1
- {"version":3,"file":"YooptaContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/YooptaContext/YooptaContext.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAsDF,eAAO,MAAM,aAAa,8CAAuD,CAAC;AAElF;;GAEG;AACH,QAAA,MAAM,qBAAqB;;;6CAQ1B,CAAC;AAEF,QAAA,MAAM,eAAe,QAAO,SAQ3B,CAAC;AAEF,QAAA,MAAM,YAAY,YAAa,MAAM,6EAAwC,CAAC;AAC9E,QAAA,MAAM,gBAAgB,eAAsC,CAAC;AAC7D,QAAA,MAAM,iBAAiB,eAAmC,CAAC;AAC3D,QAAA,MAAM,sBAAsB,wBAA0B,MAAM,4BACc,CAAC;AAE3E,KAAK,qBAAqB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACvH,QAAA,MAAM,gBAAgB,sBAAuB,qBAAqB,YAkBjE,CAAC;AAEF,OAAO,EACL,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GACtB,CAAC"}
1
+ {"version":3,"file":"YooptaContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/YooptaContext/YooptaContext.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAsDF,eAAO,MAAM,aAAa,8CAAuD,CAAC;AAElF;;GAEG;AACH,QAAA,MAAM,qBAAqB;;;6CAQ1B,CAAC;AAEF,QAAA,MAAM,eAAe,QAAO,SAQ3B,CAAC;AAEF,QAAA,MAAM,YAAY,YAAa,MAAM,6EAAwC,CAAC;AAC9E,QAAA,MAAM,gBAAgB,eAAsC,CAAC;AAC7D,QAAA,MAAM,iBAAiB,eAAmC,CAAC;AAC3D,QAAA,MAAM,sBAAsB,yBAA2B,MAAM,4BACc,CAAC;AAE5E,KAAK,qBAAqB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACvH,QAAA,MAAM,gBAAgB,sBAAuB,qBAAqB,YAkBjE,CAAC;AAEF,OAAO,EACL,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GACtB,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import r,{createContext as i,useContext as l,useRef as c,useLayoutEffect as a,useEffect as s,useMemo as d,useCallback as u,useState as f,memo as p,useReducer as h,forwardRef as g,createElement as v}from"react";import*as y from"react-dom";import{unstable_batchedUpdates as m,createPortal as b}from"react-dom";import{ReactEditor as w,useSelected as x,Slate as k,Editable as E,DefaultElement as O,withReact as C}from"slate-react";import{Editor as S,Transforms as D,Path as j,Range as B,Text as _,Element as R,Node as A,Operation as M,createEditor as T,Point as N}from"slate";class L{constructor(e){this.plugin=e}get getPlugin(){return this.plugin}extend(e){const{renders:t,options:n}=e,o=Object.assign(Object.assign({},this.plugin.options),n),r=Object.assign({},this.plugin.elements);return t&&Object.keys(t).forEach((e=>{const n=r[e];if(n&&n.render){const o=t[e];let r=n.render;n.render=e=>r(Object.assign(Object.assign({},e),{extendRender:o}))}})),new L(Object.assign(Object.assign({},this.plugin),{elements:r,options:o}))}}function P(e,t={}){const n=Object.keys(e.children),{at:o=e.selection}=t,r=n.find((t=>e.children[t].meta.order===(null==o?void 0:o[0])));return r?e.children[r]:null}const I={editor:{id:"",getBlock:()=>null,insertBlock:()=>{},insertBlocks:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},deleteBlocks:()=>{},toggleBlock:()=>{},focusBlock:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},duplicateBlock:()=>{},setBlockSelected:()=>{},selectedBlocks:[],setSelection:()=>{},applyChanges:()=>{},getEditorValue:()=>{},setEditorValue:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,readOnly:!1,blockEditorsMap:{},children:{},emit:()=>{},on:()=>{},off:()=>{},once:()=>{},blur:()=>{},isFocused:()=>!1,focus:()=>{},getHTML:()=>"",getMarkdown:()=>"",getPlainText:()=>"",refElement:null}},z=i(I),F=({children:t,editorState:n})=>{const o=c(I);return o.current={editor:n.editor},e(z.Provider,Object.assign({value:o.current},{children:t}))},H=()=>{const e=l(z);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},U=e=>H().children[e],V=()=>H().isFocused(),$=()=>H().readOnly,W=e=>{var t;return null===(t=H().plugins[e])||void 0===t?void 0:t.options},K=({blockId:e,path:t})=>{var n;const o=H();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let r;return e&&(r=o.children[e]),t&&(r=P(o,{at:t})),(null===(n=o.selection)||void 0===n?void 0:n[0])===(null==r?void 0:r.meta.order)};var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},X={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,o,i,l){if("function"!=typeof o)throw new TypeError("The listener must be a function");var c=new r(o,i||e,l),a=n?n+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],c]:e._events[a].push(c):(e._events[a]=c,e._eventsCount++),e}function l(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,o,r=[];if(0===this._eventsCount)return r;for(o in e=this._events)t.call(e,o)&&r.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},c.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var r=0,i=o.length,l=new Array(i);r<i;r++)l[r]=o[r].fn;return l},c.prototype.listenerCount=function(e){var t=n?n+e:e,o=this._events[t];return o?o.fn?1:o.length:0},c.prototype.emit=function(e,t,o,r,i,l){var c=n?n+e:e;if(!this._events[c])return!1;var a,s,d=this._events[c],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,o),!0;case 4:return d.fn.call(d.context,t,o,r),!0;case 5:return d.fn.call(d.context,t,o,r,i),!0;case 6:return d.fn.call(d.context,t,o,r,i,l),!0}for(s=1,a=new Array(u-1);s<u;s++)a[s-1]=arguments[s];d.fn.apply(d.context,a)}else{var f,p=d.length;for(s=0;s<p;s++)switch(d[s].once&&this.removeListener(e,d[s].fn,void 0,!0),u){case 1:d[s].fn.call(d[s].context);break;case 2:d[s].fn.call(d[s].context,t);break;case 3:d[s].fn.call(d[s].context,t,o);break;case 4:d[s].fn.call(d[s].context,t,o,r);break;default:if(!a)for(f=1,a=new Array(u-1);f<u;f++)a[f-1]=arguments[f];d[s].fn.apply(d[s].context,a)}}return!0},c.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,o,r){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return l(this,i),this;var c=this._events[i];if(c.fn)c.fn!==t||r&&!c.once||o&&c.context!==o||l(this,i);else{for(var a=0,s=[],d=c.length;a<d;a++)(c[a].fn!==t||r&&!c[a].once||o&&c[a].context!==o)&&s.push(c[a]);s.length?this._events[i]=1===s.length?s[0]:s:l(this,i)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&l(this,t)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c}({get exports(){return X},set exports(e){X=e}});var q=X;function Z(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}const G=()=>{var e,t;return"undefined"==typeof window||"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?Z():null===(t=window.crypto)||void 0===t?void 0:t.randomUUID()},J=e=>({id:G(),type:(null==e?void 0:e.type)||"paragraph",children:(null==e?void 0:e.children)||[{text:""}],props:Object.assign({nodeType:"block"},null==e?void 0:e.props)}),Q=e=>({id:(null==e?void 0:e.id)||G(),value:(null==e?void 0:e.value)||[J()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const ee="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function te(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function ne(e){return"nodeType"in e}function oe(e){var t,n;return e?te(e)?e:ne(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function re(e){const{Document:t}=oe(e);return e instanceof t}function ie(e){return!te(e)&&e instanceof oe(e).HTMLElement}function le(e){return e instanceof oe(e).SVGElement}function ce(e){return e?te(e)?e.document:ne(e)?re(e)?e:ie(e)||le(e)?e.ownerDocument:document:document:document}const ae=ee?a:s;function se(e){const t=c(e);return ae((()=>{t.current=e})),u((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)}),[])}function de(e,t){void 0===t&&(t=[e]);const n=c(e);return ae((()=>{n.current!==e&&(n.current=e)}),t),n}function ue(e,t){const n=c();return d((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function fe(e){const t=se(e),n=c(null),o=u((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function pe(e){const t=c();return s((()=>{t.current=e}),[e]),t.current}let he={};function ge(e,t){return d((()=>{if(t)return t;const n=null==he[e]?0:he[e]+1;return he[e]=n,e+"-"+n}),[e,t])}function ve(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce(((t,n)=>{const o=Object.entries(n);for(const[n,r]of o){const o=t[n];null!=o&&(t[n]=o+e*r)}return t}),{...t})}}const ye=ve(1),me=ve(-1);function be(e){if(!e)return!1;const{KeyboardEvent:t}=oe(e.target);return t&&e instanceof t}function we(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=oe(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 xe=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[xe.Translate.toString(e),xe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),ke="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ee(e){return e.matches(ke)?e:e.querySelector(ke)}const Oe={display:"none"};function Ce(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:Oe},n)}function Se(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",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 De=i(null);const je={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 "},Be={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 _e(e){let{announcements:t=Be,container:n,hiddenTextDescribedById:o,screenReaderInstructions:i=je}=e;const{announce:c,announcement:a}=function(){const[e,t]=f("");return{announce:u((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=ge("DndLiveRegion"),[h,g]=f(!1);if(s((()=>{g(!0)}),[]),function(e){const t=l(De);s((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(d((()=>({onDragStart(e){let{active:n}=e;c(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:o}=e;t.onDragMove&&c(t.onDragMove({active:n,over:o}))},onDragOver(e){let{active:n,over:o}=e;c(t.onDragOver({active:n,over:o}))},onDragEnd(e){let{active:n,over:o}=e;c(t.onDragEnd({active:n,over:o}))},onDragCancel(e){let{active:n,over:o}=e;c(t.onDragCancel({active:n,over:o}))}})),[c,t])),!h)return null;const v=r.createElement(r.Fragment,null,r.createElement(Ce,{id:o,value:i.draggable}),r.createElement(Se,{id:p,announcement:a}));return n?b(v,n):v}var Re;function Ae(){}function Me(e,t){return d((()=>({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"}(Re||(Re={}));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 Le(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function Pe(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function Ie(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function ze(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function Fe(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 He=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Fe(t,t.left,t.top),i=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=Ne(Fe(o),r);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(Le)};function Ue(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),l=r-o,c=i-n;if(o<r&&n<i){const n=t.width*t.height,o=e.width*e.height,r=l*c;return Number((r/(n+o-r)).toFixed(4))}return 0}const Ve=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const e of o){const{id:o}=e,i=n.get(o);if(i){const n=Ue(i,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(Pe)};function $e(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Te}function We(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.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 Ke=We(1);const Ye={ignoreTransform:!1};function Xe(e,t){void 0===t&&(t=Ye);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=oe(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!o)return e;const{scaleX:r,scaleY:i,x:l,y:c}=o,a=e.left-l-(1-r)*parseFloat(n),s=e.top-c-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:a+d,bottom:s+u,left:a}}(n,t,o))}const{top:o,left:r,width:i,height:l,bottom:c,right:a}=n;return{top:o,left:r,width:i,height:l,bottom:c,right:a}}function qe(e){return Xe(e,{ignoreTransform:!0})}function Ze(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t)return n;if(!r)return n;if(re(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!ie(r)||le(r))return n;if(n.includes(r))return n;const i=oe(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=oe(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const o=t[e];return"string"==typeof o&&n.test(o)}))}(r,i)&&n.push(r),function(e,t){return void 0===t&&(t=oe(e).getComputedStyle(e)),"fixed"===t.position}(r,i)?n:o(r.parentNode)}(e):n}function Ge(e){const[t]=Ze(e,1);return null!=t?t:null}function Je(e){return ee&&e?te(e)?e:ne(e)?re(e)||e===ce(e).scrollingElement?window:ie(e)?e:null:null:null}function Qe(e){return te(e)?e.scrollX:e.scrollLeft}function et(e){return te(e)?e.scrollY:e.scrollTop}function tt(e){return{x:Qe(e),y:et(e)}}var nt;function ot(e){return!(!ee||!e)&&e===document.scrollingElement}function rt(e){const t={x:0,y:0},n=ot(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(nt||(nt={}));const it={x:.2,y:.2};function lt(e,t,n,o,r){let{top:i,left:l,right:c,bottom:a}=n;void 0===o&&(o=10),void 0===r&&(r=it);const{isTop:s,isBottom:d,isLeft:u,isRight:f}=rt(e),p={x:0,y:0},h={x:0,y:0},g=t.height*r.y,v=t.width*r.x;return!s&&i<=t.top+g?(p.y=nt.Backward,h.y=o*Math.abs((t.top+g-i)/g)):!d&&a>=t.bottom-g&&(p.y=nt.Forward,h.y=o*Math.abs((t.bottom-g-a)/g)),!f&&c>=t.right-v?(p.x=nt.Forward,h.x=o*Math.abs((t.right-v-c)/v)):!u&&l<=t.left+v&&(p.x=nt.Backward,h.x=o*Math.abs((t.left+v-l)/v)),{direction:p,speed:h}}function ct(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:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function at(e){return e.reduce(((e,t)=>ye(e,tt(t))),Te)}const st=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Qe(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+et(t)),0)}]];class dt{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=Ze(t),o=at(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of st)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=r(n),l=o[e]-t;return this.rect[i]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ut{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 o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ft(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var pt,ht;function gt(e){e.preventDefault()}function vt(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"}(pt||(pt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ht||(ht={}));const yt={start:[ht.Space,ht.Enter],cancel:[ht.Esc],end:[ht.Space,ht.Enter]},mt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ht.Right:return{...n,x:n.x+25};case ht.Left:return{...n,x:n.x-25};case ht.Down:return{...n,y:n.y+25};case ht.Up:return{...n,y:n.y-25}}};class bt{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 ut(ce(t)),this.windowListeners=new ut(oe(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(pt.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Xe),!e)return;const{top:n,left:o,bottom:r,right:i}=t(e);Ge(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(Te)}handleKeyDown(e){if(be(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=yt,coordinateGetter:i=mt,scrollBehavior:l="smooth"}=o,{code:c}=e;if(r.end.includes(c))return void this.handleEnd(e);if(r.cancel.includes(c))return void this.handleCancel(e);const{collisionRect:a}=n.current,s=a?{x:a.left,y:a.top}:Te;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:n.current,currentCoordinates:s});if(d){const t=me(d,s),o={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:i,isRight:c,isLeft:a,isBottom:s,maxScroll:u,minScroll:f}=rt(n),p=ct(n),h={x:Math.min(r===ht.Right?p.right-p.width/2:p.right,Math.max(r===ht.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===ht.Down?p.bottom-p.height/2:p.bottom,Math.max(r===ht.Down?p.top:p.top+p.height/2,d.y))},g=r===ht.Right&&!c||r===ht.Left&&!a,v=r===ht.Down&&!s||r===ht.Up&&!i;if(g&&h.x!==d.x){const e=n.scrollLeft+t.x,i=r===ht.Right&&e<=u.x||r===ht.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:l});o.x=i?n.scrollLeft-e:r===ht.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,o.x&&n.scrollBy({left:-o.x,behavior:l});break}if(v&&h.y!==d.y){const e=n.scrollTop+t.y,i=r===ht.Down&&e<=u.y||r===ht.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:l});o.y=i?n.scrollTop-e:r===ht.Down?n.scrollTop-u.y:n.scrollTop-f.y,o.y&&n.scrollBy({top:-o.y,behavior:l});break}}this.handleMove(e,ye(me(d,this.referenceCoordinates),o))}}}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 wt(e){return Boolean(e&&"distance"in e)}function xt(e){return Boolean(e&&"delay"in e)}bt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=yt,onActivation:r}=t,{active:i}=n;const{code:l}=e.nativeEvent;if(o.start.includes(l)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class kt{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=oe(e);return e instanceof t?e:ce(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:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=ce(i),this.documentListeners=new ut(this.document),this.listeners=new ut(n),this.windowListeners=new ut(oe(i)),this.initialCoordinates=null!=(o=we(r))?o: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),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.DragStart,gt),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),this.windowListeners.add(pt.ContextMenu,gt),this.documentListeners.add(pt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(wt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(pt.Click,vt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:r}=this,{onMove:i,options:{activationConstraint:l}}=r;if(!o)return;const c=null!=(t=we(e))?t:Te,a=me(o,c);if(!n&&l){if(wt(l)){if(null!=l.tolerance&&ft(a,l.tolerance))return this.handleCancel();if(ft(a,l.distance))return this.handleStart()}return xt(l)&&ft(a,l.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(c)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ht.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Et={move:{name:"pointermove"},end:{name:"pointerup"}};class Ot extends kt{constructor(e){const{event:t}=e,n=ce(t.target);super(e,Et,n)}}Ot.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button)&&(null==o||o({event:n}),!0)}}];const Ct={move:{name:"mousemove"},end:{name:"mouseup"}};var St;!function(e){e[e.RightClick=2]="RightClick"}(St||(St={}));(class extends kt{constructor(e){super(e,Ct,ce(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==St.RightClick&&(null==o||o({event:n}),!0)}}];const Dt={move:{name:"touchmove"},end:{name:"touchend"}};var jt,Bt;function _t(e){let{acceleration:t,activator:n=jt.Pointer,canScroll:o,draggingRect:r,enabled:i,interval:l=5,order:a=Bt.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:h,delta:g,threshold:v}=e;const y=function(e){let{delta:t,disabled:n}=e;const o=pe(t);return ue((e=>{if(n||!o||!e)return Rt;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[nt.Backward]:e.x[nt.Backward]||-1===r.x,[nt.Forward]:e.x[nt.Forward]||1===r.x},y:{[nt.Backward]:e.y[nt.Backward]||-1===r.y,[nt.Forward]:e.y[nt.Forward]||1===r.y}}}),[n,t,o])}({delta:g,disabled:!i}),[m,b]=function(){const e=c(null);return[u(((t,n)=>{e.current=setInterval(t,n)}),[]),u((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),w=c({x:0,y:0}),x=c({x:0,y:0}),k=d((()=>{switch(n){case jt.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case jt.DraggableRect:return r}}),[n,r,f]),E=c(null),O=u((()=>{const e=E.current;if(!e)return;const t=w.current.x*x.current.x,n=w.current.y*x.current.y;e.scrollBy(t,n)}),[]),C=d((()=>a===Bt.TreeOrder?[...p].reverse():p),[a,p]);s((()=>{if(i&&p.length&&k){for(const e of C){if(!1===(null==o?void 0:o(e)))continue;const n=p.indexOf(e),r=h[n];if(!r)continue;const{direction:i,speed:c}=lt(e,r,k,t,v);for(const e of["x","y"])y[e][i[e]]||(c[e]=0,i[e]=0);if(c.x>0||c.y>0)return b(),E.current=e,m(O,l),w.current=c,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},b()}else b()}),[t,O,o,b,i,l,JSON.stringify(k),JSON.stringify(y),m,p,C,h,JSON.stringify(v)])}(class extends kt{constructor(e){super(e,Dt)}static setup(){return window.addEventListener(Dt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Dt.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1)&&(null==o||o({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(jt||(jt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Bt||(Bt={}));const Rt={x:{[nt.Backward]:!1,[nt.Forward]:!1},y:{[nt.Backward]:!1,[nt.Forward]:!1}};var At,Mt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(At||(At={})),function(e){e.Optimized="optimized"}(Mt||(Mt={}));const Tt=new Map;function Nt(e,t){return ue((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Lt(e){let{callback:t,disabled:n}=e;const o=se(t),r=d((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[n]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}function Pt(e){return new dt(Xe(e),e)}function It(e,t,n){void 0===t&&(t=Pt);const[o,r]=h((function(o){if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=o?o:n)?r:null;const i=t(e);if(JSON.stringify(o)===JSON.stringify(i))return o;return i}),null),i=function(e){let{callback:t,disabled:n}=e;const o=se(t),r=d((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,n]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){r();break}}}}),l=Lt({callback:r});return ae((()=>{r(),e?(null==l||l.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==i||i.disconnect())}),[e]),o}const zt=[];function Ft(e,t){void 0===t&&(t=[]);const n=c(null);return s((()=>{n.current=null}),t),s((()=>{const t=e!==Te;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?me(e,n.current):Te}function Ht(e){return d((()=>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 Ut=[];function Vt(e){let{measure:t}=e;const[n,o]=f(null),r=u((e=>{for(const{target:n}of e)if(ie(n)){o((e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o}));break}}),[t]),i=Lt({callback:r}),l=u((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ie(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),o(n?t(n):null)}),[t,i]),[c,a]=fe(l);return d((()=>({nodeRef:c,rect:n,setRef:a})),[n,c,a])}const $t=[{sensor:Ot,options:{}},{sensor:bt,options:{}}],Wt={current:{}},Kt={draggable:{measure:qe},droppable:{measure:qe,strategy:At.WhileDragging,frequency:Mt.Optimized},dragOverlay:{measure:Xe}};class Yt 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 Xt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Yt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ae},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Kt,measureDroppableContainers:Ae,windowRect:null,measuringScheduled:!1},qt=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ae,draggableNodes:new Map,over:null,measureDroppableContainers:Ae}),Zt=i(Xt);function Gt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Yt}}}function Jt(e,t){switch(t.type){case Re.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Re.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Re.DragEnd:case Re.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Re.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new Yt(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case Re.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const l=new Yt(e.droppable.containers);return l.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:l}}}case Re.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const i=new Yt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Qt(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=l(qt),i=pe(o),c=pe(null==n?void 0:n.id);return s((()=>{if(!t&&!o&&i&&null!=c){if(!be(i))return;if(document.activeElement===i.target)return;const e=r.get(c);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=Ee(e);if(t){t.focus();break}}}))}}),[o,t,r,c,i]),null}const en=i({...Te,scaleX:1,scaleY:1});var tn;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(tn||(tn={}));const nn=p((function(e){var t,n,o,i;let{id:l,accessibility:a,autoScroll:p=!0,children:g,sensors:v=$t,collisionDetection:y=Ve,measuring:b,modifiers:w,...x}=e;const k=h(Jt,void 0,Gt),[E,O]=k,[C,S]=function(){const[e]=f((()=>new Set)),t=u((t=>(e.add(t),()=>e.delete(t))),[e]);return[u((t=>{let{type:n,event:o}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)}))}),[e]),t]}(),[D,j]=f(tn.Uninitialized),B=D===tn.Initialized,{draggable:{active:_,nodes:R,translate:A},droppable:{containers:M}}=E,T=_?R.get(_):null,N=c({initial:null,translated:null}),L=d((()=>{var e;return null!=_?{id:_,data:null!=(e=null==T?void 0:T.data)?e:Wt,rect:N}:null}),[_,T]),P=c(null),[I,z]=f(null),[F,H]=f(null),U=de(x,Object.values(x)),V=ge("DndDescribedBy",l),$=d((()=>M.getEnabled()),[M]),W=d((()=>({draggable:{...Kt.draggable,...null==K?void 0:K.draggable},droppable:{...Kt.droppable,...null==K?void 0:K.droppable},dragOverlay:{...Kt.dragOverlay,...null==K?void 0:K.dragOverlay}})),[null==(K=b)?void 0:K.draggable,null==K?void 0:K.droppable,null==K?void 0:K.dragOverlay]);var K;const{droppableRects:Y,measureDroppableContainers:X,measuringScheduled:q}=function(e,t){let{dragging:n,dependencies:o,config:r}=t;const[i,l]=f(null),{frequency:a,measure:d,strategy:p}=r,h=c(e),g=function(){switch(p){case At.Always:return!1;case At.BeforeDragging:return n;default:return!n}}(),v=de(g),y=u((function(e){void 0===e&&(e=[]),v.current||l((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[v]),m=c(null),b=ue((t=>{if(g&&!n)return Tt;if(!t||t===Tt||h.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,o=e?new dt(d(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t}),[e,i,n,g,d]);return s((()=>{h.current=e}),[e]),s((()=>{g||y()}),[n,g]),s((()=>{i&&i.length>0&&l(null)}),[JSON.stringify(i)]),s((()=>{g||"number"!=typeof a||null!==m.current||(m.current=setTimeout((()=>{y(),m.current=null}),a))}),[a,g,y,...o]),{droppableRects:b,measureDroppableContainers:y,measuringScheduled:null!=i}}($,{dragging:B,dependencies:[A.x,A.y],config:W.droppable}),Z=function(e,t){const n=null!==t?e.get(t):void 0,o=n?n.node.current:null;return ue((e=>{var n;return null===t?null:null!=(n=null!=o?o:e)?n:null}),[o,t])}(R,_),G=d((()=>F?we(F):null),[F]),J=function(){const e=!1===(null==I?void 0:I.autoScrollEnabled),t="object"==typeof p?!1===p.enabled:!1===p,n=B&&!e&&!t;if("object"==typeof p)return{...p,enabled:n};return{enabled:n}}(),Q=function(e,t){return Nt(e,t)}(Z,W.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const i=c(!1),{x:l,y:a}="boolean"==typeof r?{x:r,y:r}:r;ae((()=>{if(!l&&!a||!t)return void(i.current=!1);if(i.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=$e(n(e),o);if(l||(r.x=0),a||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=Ge(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,l,a,o,n])}({activeNode:_?R.get(_):null,config:J.layoutShiftCompensation,initialRect:Q,measure:W.draggable.measure});const te=It(Z,W.draggable.measure,Q),ne=It(Z?Z.parentElement:null),re=c({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=M.getNodeFor(null==(t=re.current.over)?void 0:t.id),le=Vt({measure:W.dragOverlay.measure}),ce=null!=(n=le.nodeRef.current)?n:Z,se=B?null!=(o=le.rect)?o:te:null,fe=Boolean(le.nodeRef.current&&le.rect),pe=$e(he=fe?null:te,Nt(he));var he;const ve=Ht(ce?oe(ce):null),me=function(e){const t=c(e),n=ue((n=>e?n&&n!==zt&&e&&t.current&&e.parentNode===t.current.parentNode?n:Ze(e):zt),[e]);return s((()=>{t.current=e}),[e]),n}(B?null!=ie?ie:Z:null),be=function(e,t){void 0===t&&(t=Xe);const[n]=e,o=Ht(n?oe(n):null),[r,i]=h((function(){return e.length?e.map((e=>ot(e)?o:new dt(t(e),e))):Ut}),Ut),l=Lt({callback:i});return e.length>0&&r===Ut&&i(),ae((()=>{e.length?e.forEach((e=>null==l?void 0:l.observe(e))):(null==l||l.disconnect(),i())}),[e]),r}(me),xe=function(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...o})),n):n}(w,{transform:{x:A.x-pe.x,y:A.y-pe.y,scaleX:1,scaleY:1},activatorEvent:F,active:L,activeNodeRect:te,containerNodeRect:ne,draggingNodeRect:se,over:re.current.over,overlayNodeRect:le.rect,scrollableAncestors:me,scrollableAncestorRects:be,windowRect:ve}),ke=G?ye(G,A):null,Ee=function(e){const[t,n]=f(null),o=c(e),r=u((e=>{const t=Je(e.target);t&&n((e=>e?(e.set(t,tt(t)),new Map(e)):null))}),[]);return s((()=>{const t=o.current;if(e!==t){i(t);const l=e.map((e=>{const t=Je(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,tt(t)]):null})).filter((e=>null!=e));n(l.length?new Map(l):null),o.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=Je(e);null==t||t.removeEventListener("scroll",r)}))}}),[r,e]),d((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ye(e,t)),Te):at(e):Te),[e,t])}(me),Oe=Ft(Ee),Ce=Ft(Ee,[te]),Se=ye(xe,Oe),je=se?Ke(se,xe):null,Be=L&&je?y({active:L,collisionRect:je,droppableRects:Y,droppableContainers:$,pointerCoordinates:ke}):null,Ae=ze(Be,"id"),[Me,Ne]=f(null),Le=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(fe?xe:ye(xe,Ce),null!=(i=null==Me?void 0:Me.rect)?i:null,te),Pe=u(((e,t)=>{let{sensor:n,options:o}=t;if(null==P.current)return;const r=R.get(P.current);if(!r)return;const i=e.nativeEvent,l=new n({active:P.current,activeNode:r,event:i,options:o,context:re,onStart(e){const t=P.current;if(null==t)return;const n=R.get(t);if(!n)return;const{onDragStart:o}=U.current,r={active:{id:t,data:n.data,rect:N}};m((()=>{null==o||o(r),j(tn.Initializing),O({type:Re.DragStart,initialCoordinates:e,active:t}),C({type:"onDragStart",event:r})}))},onMove(e){O({type:Re.DragMove,coordinates:e})},onEnd:c(Re.DragEnd),onCancel:c(Re.DragCancel)});function c(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:r}=re.current;let l=null;if(t&&r){const{cancelDrop:c}=U.current;if(l={activatorEvent:i,active:t,collisions:n,delta:r,over:o},e===Re.DragEnd&&"function"==typeof c){await Promise.resolve(c(l))&&(e=Re.DragCancel)}}P.current=null,m((()=>{O({type:e}),j(tn.Uninitialized),Ne(null),z(null),H(null);const t=e===Re.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=U.current[t];null==e||e(l),C({type:t,event:l})}}))}}m((()=>{z(l),H(e.nativeEvent)}))}),[R]),Ie=u(((e,t)=>(n,o)=>{const r=n.nativeEvent,i=R.get(o);if(null!==P.current||!i||r.dndKit||r.defaultPrevented)return;const l={active:i};!0===e(n,t.options,l)&&(r.dndKit={capturedBy:t.sensor},P.current=o,Pe(n,t))}),[R,Pe]),Fe=function(e,t){return d((()=>e.reduce(((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(v,Ie);!function(e){s((()=>{if(!ee)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})))}(v),ae((()=>{te&&D===tn.Initializing&&j(tn.Initialized)}),[te,D]),s((()=>{const{onDragMove:e}=U.current,{active:t,activatorEvent:n,collisions:o,over:r}=re.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:o,delta:{x:Se.x,y:Se.y},over:r};m((()=>{null==e||e(i),C({type:"onDragMove",event:i})}))}),[Se.x,Se.y]),s((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:r}=re.current;if(!e||null==P.current||!t||!r)return;const{onDragOver:i}=U.current,l=o.get(Ae),c=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,a={active:e,activatorEvent:t,collisions:n,delta:{x:r.x,y:r.y},over:c};m((()=>{Ne(c),null==i||i(a),C({type:"onDragOver",event:a})}))}),[Ae]),ae((()=>{re.current={activatorEvent:F,active:L,activeNode:Z,collisionRect:je,collisions:Be,droppableRects:Y,draggableNodes:R,draggingNode:ce,draggingNodeRect:se,droppableContainers:M,over:Me,scrollableAncestors:me,scrollAdjustedTranslate:Se},N.current={initial:se,translated:je}}),[L,Z,Be,je,R,ce,se,Y,M,Me,me,Se]),_t({...J,delta:A,draggingRect:je,pointerCoordinates:ke,scrollableAncestors:me,scrollableAncestorRects:be});const He=d((()=>({active:L,activeNode:Z,activeNodeRect:te,activatorEvent:F,collisions:Be,containerNodeRect:ne,dragOverlay:le,draggableNodes:R,droppableContainers:M,droppableRects:Y,over:Me,measureDroppableContainers:X,scrollableAncestors:me,scrollableAncestorRects:be,measuringConfiguration:W,measuringScheduled:q,windowRect:ve})),[L,Z,te,F,Be,ne,le,R,M,Y,Me,X,me,be,W,q,ve]),Ue=d((()=>({activatorEvent:F,activators:Fe,active:L,activeNodeRect:te,ariaDescribedById:{draggable:V},dispatch:O,draggableNodes:R,over:Me,measureDroppableContainers:X})),[F,Fe,L,te,O,V,R,Me,X]);return r.createElement(De.Provider,{value:S},r.createElement(qt.Provider,{value:Ue},r.createElement(Zt.Provider,{value:He},r.createElement(en.Provider,{value:Le},g)),r.createElement(Qt,{disabled:!1===(null==a?void 0:a.restoreFocus)})),r.createElement(_e,{...a,hiddenTextDescribedById:V}))})),on=i(null),rn="button",ln="Droppable";function cn(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e;const i=ge(ln),{activators:c,activatorEvent:a,active:s,activeNodeRect:u,ariaDescribedById:f,draggableNodes:p,over:h}=l(qt),{role:g=rn,roleDescription:v="draggable",tabIndex:y=0}=null!=r?r:{},m=(null==s?void 0:s.id)===t,b=l(m?en:on),[w,x]=fe(),[k,E]=fe(),O=function(e,t){return d((()=>e.reduce(((e,n)=>{let{eventName:o,handler:r}=n;return e[o]=e=>{r(e,t)},e}),{})),[e,t])}(c,t),C=de(n);ae((()=>(p.set(t,{id:t,key:i,node:w,activatorNode:k,data:C}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:s,activatorEvent:a,activeNodeRect:u,attributes:d((()=>({role:g,tabIndex:y,"aria-disabled":o,"aria-pressed":!(!m||g!==rn)||void 0,"aria-roledescription":v,"aria-describedby":f.draggable})),[o,g,y,m,v,f.draggable]),isDragging:m,listeners:o?void 0:O,node:w,over:h,setNodeRef:x,setActivatorNodeRef:E,transform:b}}const an="Droppable",sn={timeout:25};function dn(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function un(e,t){return e.reduce(((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e}),Array(e.length))}function fn(e){return null!==e&&e>=0}const pn=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const i=dn(t,o,n),l=t[r],c=i[r];return c&&l?{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}:null},hn={scaleX:1,scaleY:1},gn=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:r,rects:i,overIndex:l}=e;const c=null!=(t=i[n])?t:o;if(!c)return null;if(r===n){const e=i[l];return e?{x:0,y:n<l?e.top+e.height-(c.top+c.height):e.top-c.top,...hn}:null}const a=function(e,t,n){const o=e[t],r=e[t-1],i=e[t+1];if(!o)return 0;if(n<t)return r?o.top-(r.top+r.height):i?i.top-(o.top+o.height):0;return i?i.top-(o.top+o.height):r?o.top-(r.top+r.height):0}(i,r,n);return r>n&&r<=l?{x:0,y:-c.height-a,...hn}:r<n&&r>=l?{x:0,y:c.height+a,...hn}:{x:0,y:0,...hn}};const vn="Sortable",yn=r.createContext({activeIndex:-1,containerId:vn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pn,disabled:{draggable:!1,droppable:!1}});function mn(e){let{children:t,id:n,items:o,strategy:i=pn,disabled:a=!1}=e;const{active:u,dragOverlay:f,droppableRects:p,over:h,measureDroppableContainers:g}=l(Zt),v=ge(vn,n),y=Boolean(null!==f.rect),m=d((()=>o.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[o]),b=null!=u,w=u?m.indexOf(u.id):-1,x=h?m.indexOf(h.id):-1,k=c(m),E=!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}(m,k.current),O=-1!==x&&-1===w||E,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(a);ae((()=>{E&&b&&g(m)}),[E,m,b,g]),s((()=>{k.current=m}),[m]);const S=d((()=>({activeIndex:w,containerId:v,disabled:C,disableTransforms:O,items:m,overIndex:x,useDragOverlay:y,sortedRects:un(m,p),strategy:i})),[w,v,C.draggable,C.droppable,O,m,x,p,y,i]);return r.createElement(yn.Provider,{value:S},t)}const bn=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return dn(n,o,r).indexOf(t)},wn=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:l,previousItems:c,previousContainerId:a,transition:s}=e;return!(!s||!o)&&((c===i||r!==l)&&(!!n||l!==r&&t===a))},xn={duration:200,easing:"ease"},kn="transform",En=xe.Transition.toString({property:kn,duration:0,easing:"linear"}),On={roleDescription:"sortable"};function Cn(e){let{animateLayoutChanges:t=wn,attributes:n,disabled:o,data:r,getNewIndex:i=bn,id:a,strategy:p,resizeObserverConfig:h,transition:g=xn}=e;const{items:v,containerId:y,activeIndex:m,disabled:b,disableTransforms:w,sortedRects:x,overIndex:k,useDragOverlay:E,strategy:O}=l(yn),C=function(e,t){var n,o;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(o=null==e?void 0:e.droppable)?o:t.droppable}}(o,b),S=v.indexOf(a),D=d((()=>({sortable:{containerId:y,index:S,items:v},...r})),[y,r,S,v]),j=d((()=>v.slice(v.indexOf(a))),[v,a]),{rect:B,node:_,isOver:R,setNodeRef:A}=function(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e;const i=ge(an),{active:a,dispatch:d,over:f,measureDroppableContainers:p}=l(qt),h=c({disabled:n}),g=c(!1),v=c(null),y=c(null),{disabled:m,updateMeasurementsFor:b,timeout:w}={...sn,...r},x=de(null!=b?b:o),k=Lt({callback:u((()=>{g.current?(null!=y.current&&clearTimeout(y.current),y.current=setTimeout((()=>{p(Array.isArray(x.current)?x.current:[x.current]),y.current=null}),w)):g.current=!0}),[w]),disabled:m||!a}),E=u(((e,t)=>{k&&(t&&(k.unobserve(t),g.current=!1),e&&k.observe(e))}),[k]),[O,C]=fe(E),S=de(t);return s((()=>{k&&O.current&&(k.disconnect(),g.current=!1,k.observe(O.current))}),[O,k]),ae((()=>(d({type:Re.RegisterDroppable,element:{id:o,key:i,disabled:n,node:O,rect:v,data:S}}),()=>d({type:Re.UnregisterDroppable,key:i,id:o}))),[o]),s((()=>{n!==h.current.disabled&&(d({type:Re.SetDroppableDisabled,id:o,key:i,disabled:n}),h.current.disabled=n)}),[o,i,n,d]),{active:a,rect:v,isOver:(null==f?void 0:f.id)===o,node:O,over:f,setNodeRef:C}}({id:a,data:D,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...h}}),{active:M,activatorEvent:T,activeNodeRect:N,attributes:L,setNodeRef:P,listeners:I,isDragging:z,over:F,setActivatorNodeRef:H,transform:U}=cn({id:a,data:D,attributes:{...On,...n},disabled:C.draggable}),V=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>e=>{t.forEach((t=>t(e)))}),t)}(A,P),$=Boolean(M),W=$&&!w&&fn(m)&&fn(k),K=!E&&z,Y=K&&W?U:null,X=W?null!=Y?Y:(null!=p?p:O)({rects:x,activeNodeRect:N,activeIndex:m,overIndex:k,index:S}):null,q=fn(m)&&fn(k)?i({id:a,items:v,activeIndex:m,overIndex:k}):S,Z=null==M?void 0:M.id,G=c({activeId:Z,items:v,newIndex:q,containerId:y}),J=v!==G.current.items,Q=t({active:M,containerId:y,isDragging:z,isSorting:$,id:a,index:S,items:v,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:g,wasDragging:null!=G.current.activeId}),ee=function(e){let{disabled:t,index:n,node:o,rect:r}=e;const[i,l]=f(null),a=c(n);return ae((()=>{if(!t&&n!==a.current&&o.current){const e=r.current;if(e){const t=Xe(o.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)&&l(n)}}n!==a.current&&(a.current=n)}),[t,n,o,r]),s((()=>{i&&l(null)}),[i]),i}({disabled:!Q,index:S,node:_,rect:B});return s((()=>{$&&G.current.newIndex!==q&&(G.current.newIndex=q),y!==G.current.containerId&&(G.current.containerId=y),v!==G.current.items&&(G.current.items=v)}),[$,q,y,v]),s((()=>{if(Z===G.current.activeId)return;if(Z&&!G.current.activeId)return void(G.current.activeId=Z);const e=setTimeout((()=>{G.current.activeId=Z}),50);return()=>clearTimeout(e)}),[Z]),{active:M,activeIndex:m,attributes:L,data:D,rect:B,index:S,newIndex:q,items:v,isOver:R,isSorting:$,isDragging:z,listeners:I,node:_,overIndex:k,over:F,setNodeRef:V,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:P,transform:null!=ee?ee:X,transition:function(){if(ee||J&&G.current.newIndex===S)return En;if(K&&!be(T)||!g)return;if($||Q)return xe.Transition.toString({...g,property:kn});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=[ht.Down,ht.Right,ht.Up,ht.Left],jn=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:l,scrollableAncestors:c}}=t;if(Dn.includes(e.code)){if(e.preventDefault(),!n||!o)return;const t=[];i.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const i=r.get(n.id);if(i)switch(e.code){case ht.Down:o.top<i.top&&t.push(n);break;case ht.Up:o.top>i.top&&t.push(n);break;case ht.Left:o.left>i.left&&t.push(n);break;case ht.Right:o.left<i.left&&t.push(n)}}));const a=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Ie(t),i=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=Ie(o),l=r.reduce(((e,t,o)=>e+Ne(n[o],t)),0),c=Number((l/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:c}})}}return i.sort(Le)})({active:n,collisionRect:o,droppableRects:r,droppableContainers:t,pointerCoordinates:null});let s=ze(a,"id");if(s===(null==l?void 0:l.id)&&a.length>1&&(s=a[1].id),null!=s){const e=i.get(n.id),t=i.get(s),l=t?r.get(t.id):null,a=null==t?void 0:t.node.current;if(a&&l&&e&&t){const n=Ze(a).some(((e,t)=>c[t]!==e)),r=Bn(e,t),i=function(e,t){if(!Sn(e)||!Sn(t))return!1;if(!Bn(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=n||!r?{x:0,y:0}:{x:i?o.width-l.width:0,y:i?o.height-l.height:0},d={x:l.left,y:l.top};return s.x&&s.y?d:me(d,s)}}}};function Bn(e,t){return!(!Sn(e)||!Sn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var _n;function Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Rn.apply(this,arguments)}var An,Mn=function(e){return o.createElement("svg",Rn({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),_n||(_n=o.createElement("path",{d:"M3 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm4-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})))};function Tn(){return Tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Tn.apply(this,arguments)}var Nn=function(e){return o.createElement("svg",Tn({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),An||(An=o.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function Ln(e,t={}){const n=Object.keys(e.children),{at:o=e.selection}=t,r=n.find((t=>e.children[t].meta.order===(null==o?void 0:o[0])));if(r)return e.blockEditorsMap[r]}function Pn(e){return Fn(e)?(e.nodeName||"").toLowerCase():"#document"}function In(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function zn(e){var t;return null==(t=(Fn(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Fn(e){return e instanceof Node||e instanceof In(e).Node}function Hn(e){return e instanceof Element||e instanceof In(e).Element}function Un(e){return e instanceof HTMLElement||e instanceof In(e).HTMLElement}function Vn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof In(e).ShadowRoot)}function $n(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=qn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Wn(e){return["table","td","th"].includes(Pn(e))}function Kn(e){const t=Yn(),n=qn(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Yn(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Xn(e){return["html","body","#document"].includes(Pn(e))}function qn(e){return In(e).getComputedStyle(e)}function Zn(e){return Hn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Gn(e){if("html"===Pn(e))return e;const t=e.assignedSlot||e.parentNode||Vn(e)&&e.host||zn(e);return Vn(t)?t.host:t}function Jn(e){const t=Gn(e);return Xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Un(t)&&$n(t)?t:Jn(t)}function Qn(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Jn(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),l=In(r);return i?t.concat(l,l.visualViewport||[],$n(r)?r:[],l.frameElement&&n?Qn(l.frameElement):[]):t.concat(r,Qn(r,[],n))}const eo=Math.min,to=Math.max,no=Math.round,oo=Math.floor,ro=e=>({x:e,y:e}),io={left:"right",right:"left",bottom:"top",top:"bottom"},lo={start:"end",end:"start"};function co(e,t,n){return to(e,eo(t,n))}function ao(e,t){return"function"==typeof e?e(t):e}function so(e){return e.split("-")[0]}function uo(e){return e.split("-")[1]}function fo(e){return"x"===e?"y":"x"}function po(e){return"y"===e?"height":"width"}function ho(e){return["top","bottom"].includes(so(e))?"y":"x"}function go(e){return fo(ho(e))}function vo(e){return e.replace(/start|end/g,(e=>lo[e]))}function yo(e){return e.replace(/left|right|bottom|top/g,(e=>io[e]))}function mo(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function bo(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function wo(e,t,n){let{reference:o,floating:r}=e;const i=ho(t),l=go(t),c=po(l),a=so(t),s="y"===i,d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,f=o[c]/2-r[c]/2;let p;switch(a){case"top":p={x:d,y:o.y-r.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={x:o.x-r.width,y:u};break;default:p={x:o.x,y:o.y}}switch(uo(t)){case"start":p[l]-=f*(n&&s?-1:1);break;case"end":p[l]+=f*(n&&s?-1:1)}return p}async function xo(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:l,elements:c,strategy:a}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=ao(t,e),h=mo(p),g=c[f?"floating"===u?"reference":"floating":u],v=bo(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:s,rootBoundary:d,strategy:a})),y="floating"===u?{...l.floating,x:o,y:r}:l.reference,m=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),b=await(null==i.isElement?void 0:i.isElement(m))&&await(null==i.getScale?void 0:i.getScale(m))||{x:1,y:1},w=bo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:m,strategy:a}):y);return{top:(v.top-w.top+h.top)/b.y,bottom:(w.bottom-v.bottom+h.bottom)/b.y,left:(v.left-w.left+h.left)/b.x,right:(w.right-v.right+h.right)/b.x}}function ko(e){const t=eo(...e.map((e=>e.left))),n=eo(...e.map((e=>e.top)));return{x:t,y:n,width:to(...e.map((e=>e.right)))-t,height:to(...e.map((e=>e.bottom)))-n}}const Eo=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:l,middlewareData:c}=t,a=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=so(n),c=uo(n),a="y"===ho(n),s=["left","top"].includes(l)?-1:1,d=i&&a?-1:1,u=ao(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return c&&"number"==typeof h&&(p="end"===c?-1*h:h),a?{x:p*d,y:f*s}:{x:f*s,y:p*d}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:l}}}}};function Oo(e){const t=qn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Un(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,c=no(n)!==i||no(o)!==l;return c&&(n=i,o=l),{width:n,height:o,$:c}}function Co(e){return Hn(e)?e:e.contextElement}function So(e){const t=Co(e);if(!Un(t))return ro(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Oo(t);let l=(i?no(n.width):n.width)/o,c=(i?no(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Do=ro(0);function jo(e){const t=In(e);return Yn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Do}function Bo(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=Co(e);let l=ro(1);t&&(o?Hn(o)&&(l=So(o)):l=So(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==In(e))&&t}(i,n,o)?jo(i):ro(0);let a=(r.left+c.x)/l.x,s=(r.top+c.y)/l.y,d=r.width/l.x,u=r.height/l.y;if(i){const e=In(i),t=o&&Hn(o)?In(o):o;let n=e,r=n.frameElement;for(;r&&o&&t!==n;){const e=So(r),t=r.getBoundingClientRect(),o=qn(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,l=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;a*=e.x,s*=e.y,d*=e.x,u*=e.y,a+=i,s+=l,n=In(r),r=n.frameElement}}return bo({width:d,height:u,x:a,y:s})}const _o=[":popover-open",":modal"];function Ro(e){return _o.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Ao(e){return Bo(zn(e)).left+Zn(e).scrollLeft}function Mo(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=In(e),o=zn(e),r=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,c=0,a=0;if(r){i=r.width,l=r.height;const e=Yn();(!e||e&&"fixed"===t)&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:l,x:c,y:a}}(e,n);else if("document"===t)o=function(e){const t=zn(e),n=Zn(e),o=e.ownerDocument.body,r=to(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=to(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Ao(e);const c=-n.scrollTop;return"rtl"===qn(o).direction&&(l+=to(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:c}}(zn(e));else if(Hn(t))o=function(e,t){const n=Bo(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Un(e)?So(e):ro(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=jo(e);o={...t,x:t.x-n.x,y:t.y-n.y}}return bo(o)}function To(e,t){const n=Gn(e);return!(n===t||!Hn(n)||Xn(n))&&("fixed"===qn(n).position||To(n,t))}function No(e,t,n){const o=Un(t),r=zn(t),i="fixed"===n,l=Bo(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const a=ro(0);if(o||!o&&!i)if(("body"!==Pn(t)||$n(r))&&(c=Zn(t)),o){const e=Bo(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else r&&(a.x=Ao(r));return{x:l.left+c.scrollLeft-a.x,y:l.top+c.scrollTop-a.y,width:l.width,height:l.height}}function Lo(e,t){return Un(e)&&"fixed"!==qn(e).position?t?t(e):e.offsetParent:null}function Po(e,t){const n=In(e);if(!Un(e)||Ro(e))return n;let o=Lo(e,t);for(;o&&Wn(o)&&"static"===qn(o).position;)o=Lo(o,t);return o&&("html"===Pn(o)||"body"===Pn(o)&&"static"===qn(o).position&&!Kn(o))?n:o||function(e){let t=Gn(e);for(;Un(t)&&!Xn(t);){if(Kn(t))return t;t=Gn(t)}return null}(e)||n}const Io={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,l=zn(o),c=!!t&&Ro(t.floating);if(o===l||c&&i)return n;let a={scrollLeft:0,scrollTop:0},s=ro(1);const d=ro(0),u=Un(o);if((u||!u&&!i)&&(("body"!==Pn(o)||$n(l))&&(a=Zn(o)),Un(o))){const e=Bo(o);s=So(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-a.scrollLeft*s.x+d.x,y:n.y*s.y-a.scrollTop*s.y+d.y}},getDocumentElement:zn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let o=Qn(e,[],!1).filter((e=>Hn(e)&&"body"!==Pn(e))),r=null;const i="fixed"===qn(e).position;let l=i?Gn(e):e;for(;Hn(l)&&!Xn(l);){const t=qn(l),n=Kn(l);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||$n(l)&&!n&&To(e,l))?o=o.filter((e=>e!==l)):r=t,l=Gn(l)}return t.set(e,o),o}(t,this._c):[].concat(n),o],l=i[0],c=i.reduce(((e,n)=>{const o=Mo(t,n,r);return e.top=to(o.top,e.top),e.right=eo(o.right,e.right),e.bottom=eo(o.bottom,e.bottom),e.left=to(o.left,e.left),e}),Mo(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Po,getElementRects:async function(e){const t=this.getOffsetParent||Po,n=this.getDimensions;return{reference:No(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Oo(e);return{width:t,height:n}},getScale:So,isElement:Hn,isRTL:function(e){return"rtl"===qn(e).direction}};function zo(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,s=Co(e),d=r||i?[...s?Qn(s):[],...Qn(t)]:[];d.forEach((e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const u=s&&c?function(e,t){let n,o=null;const r=zn(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function l(c,a){void 0===c&&(c=!1),void 0===a&&(a=1),i();const{left:s,top:d,width:u,height:f}=e.getBoundingClientRect();if(c||t(),!u||!f)return;const p={rootMargin:-oo(d)+"px "+-oo(r.clientWidth-(s+u))+"px "+-oo(r.clientHeight-(d+f))+"px "+-oo(s)+"px",threshold:to(0,eo(1,a))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==a){if(!h)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),100)}h=!1}try{o=new IntersectionObserver(g,{...p,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,p)}o.observe(e)}(!0),i}(s,n):null;let f,p=-1,h=null;l&&(h=new ResizeObserver((e=>{let[o]=e;o&&o.target===s&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),s&&!a&&h.observe(s),h.observe(t));let g=a?Bo(e):null;return a&&function t(){const o=Bo(e);!g||o.x===g.x&&o.y===g.y&&o.width===g.width&&o.height===g.height||n();g=o,f=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach((e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,a&&cancelAnimationFrame(f)}}const Fo=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...a}=ao(e,t),s={x:n,y:o},d=await xo(t,a),u=ho(so(r)),f=fo(u);let p=s[f],h=s[u];if(i){const e="y"===f?"bottom":"right";p=co(p+d["y"===f?"top":"left"],p,p-d[e])}if(l){const e="y"===u?"bottom":"right";h=co(h+d["y"===u?"top":"left"],h,h-d[e])}const g=c.fn({...t,[f]:p,[u]:h});return{...g,data:{x:g.x-n,y:g.y-o}}}}},Ho=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:c,platform:a,elements:s}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...v}=ao(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=so(r),m=so(c)===c,b=await(null==a.isRTL?void 0:a.isRTL(s.floating)),w=f||(m||!g?[yo(c)]:function(e){const t=yo(e);return[vo(e),t,vo(t)]}(c));f||"none"===h||w.push(...function(e,t,n,o){const r=uo(e);let i=function(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:l;default:return[]}}(so(e),"start"===n,o);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(vo)))),i}(c,g,h,b));const x=[c,...w],k=await xo(t,v),E=[];let O=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&E.push(k[y]),u){const e=function(e,t,n){void 0===n&&(n=!1);const o=uo(e),r=go(e),i=po(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=yo(l)),[l,yo(l)]}(r,l,b);E.push(k[e[0]],k[e[1]])}if(O=[...O,{placement:r,overflows:E}],!E.every((e=>e<=0))){var C,S;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let n=null==(S=O.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!n)switch(p){case"bestFit":{var D;const e=null==(D=O.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:D[0];e&&(n=e);break}case"initialPlacement":n=c}if(r!==n)return{reset:{placement:n}}}return{}}}},Uo=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:r,platform:i,strategy:l}=t,{padding:c=2,x:a,y:s}=ao(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]),u=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),n=[];let o=null;for(let e=0;e<t.length;e++){const r=t[e];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map((e=>bo(ko(e))))}(d),f=bo(ko(d)),p=mo(c);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=a&&null!=s)return u.find((e=>a>e.left-p.left&&a<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||f;if(u.length>=2){if("y"===ho(n)){const e=u[0],t=u[u.length-1],o="top"===so(n),r=e.top,i=t.bottom,l=o?e.left:t.left,c=o?e.right:t.right;return{top:r,bottom:i,left:l,right:c,width:c-l,height:i-r,x:l,y:r}}const e="left"===so(n),t=to(...u.map((e=>e.right))),o=eo(...u.map((e=>e.left))),r=u.filter((n=>e?n.left===o:n.right===t)),i=r[0].top,l=r[r.length-1].bottom;return{top:i,bottom:l,left:o,right:t,width:t-o,height:l-i,x:o,y:i}}return f}},floating:o.floating,strategy:l});return r.reference.x!==h.reference.x||r.reference.y!==h.reference.y||r.reference.width!==h.reference.width||r.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Vo=(e,t,n)=>{const o=new Map,r={platform:Io,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),a=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=wo(s,o,a),f=o,p={},h=0;for(let n=0;n<c.length;n++){const{name:i,fn:g}=c[n],{x:v,y:y,data:m,reset:b}=await g({x:d,y:u,initialPlacement:o,placement:f,strategy:r,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=y?y:u,p={...p,[i]:{...p[i],...m}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:d,y:u}=wo(s,f,a))),n=-1)}return{x:d,y:u,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var $o="undefined"!=typeof document?a:s;function Wo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!=o--;)if(!Wo(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!=o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!Wo(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ko(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yo(e,t){const n=Ko(e);return Math.round(t*n)/n}function Xo(e){const t=o.useRef(e);return $o((()=>{t.current=e})),t}
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import r,{createContext as i,useContext as l,useRef as c,useLayoutEffect as a,useEffect as s,useMemo as d,useCallback as u,useState as f,memo as p,useReducer as h,forwardRef as g,createElement as v}from"react";import*as y from"react-dom";import{unstable_batchedUpdates as m,createPortal as b}from"react-dom";import{ReactEditor as w,useSelected as x,Slate as k,Editable as E,DefaultElement as O,withReact as C}from"slate-react";import{Editor as S,Transforms as D,Path as j,Range as B,Text as _,Element as R,Node as A,Operation as M,createEditor as T,Point as N}from"slate";class L{constructor(e){this.plugin=e}get getPlugin(){return this.plugin}extend(e){const{renders:t,options:n,defaultProps:o}=e,r=Object.assign(Object.assign({},this.plugin.options),n),i=Object.assign({},this.plugin.elements);return t&&Object.keys(t).forEach((e=>{const n=i[e];if(n&&n.render){const o=t[e];let r=n.render;n.render=e=>r(Object.assign(Object.assign({},e),{extendRender:o}))}})),o&&Object.keys(o).forEach((e=>{const t=i[e];if(t){const n=o[e],r=t.props;t.props=n(r)}})),new L(Object.assign(Object.assign({},this.plugin),{elements:i,options:r}))}}function P(e,t={}){const n=Object.keys(e.children),{at:o=e.selection}=t,r=n.find((t=>e.children[t].meta.order===(null==o?void 0:o[0])));return r?e.children[r]:null}const I={editor:{id:"",getBlock:()=>null,insertBlock:()=>{},insertBlocks:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},deleteBlocks:()=>{},toggleBlock:()=>{},focusBlock:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},duplicateBlock:()=>{},setBlockSelected:()=>{},selectedBlocks:[],setSelection:()=>{},applyChanges:()=>{},getEditorValue:()=>{},setEditorValue:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,readOnly:!1,blockEditorsMap:{},children:{},emit:()=>{},on:()=>{},off:()=>{},once:()=>{},blur:()=>{},isFocused:()=>!1,focus:()=>{},getHTML:()=>"",getMarkdown:()=>"",getPlainText:()=>"",refElement:null}},z=i(I),F=({children:t,editorState:n})=>{const o=c(I);return o.current={editor:n.editor},e(z.Provider,Object.assign({value:o.current},{children:t}))},H=()=>{const e=l(z);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},U=e=>H().children[e],V=()=>H().isFocused(),$=()=>H().readOnly,W=e=>{var t;return null===(t=H().plugins[e])||void 0===t?void 0:t.options},K=({blockId:e,path:t})=>{var n;const o=H();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let r;return e&&(r=o.children[e]),t&&(r=P(o,{at:t})),(null===(n=o.selection)||void 0===n?void 0:n[0])===(null==r?void 0:r.meta.order)};var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},X={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,o,i,l){if("function"!=typeof o)throw new TypeError("The listener must be a function");var c=new r(o,i||e,l),a=n?n+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],c]:e._events[a].push(c):(e._events[a]=c,e._eventsCount++),e}function l(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,o,r=[];if(0===this._eventsCount)return r;for(o in e=this._events)t.call(e,o)&&r.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},c.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var r=0,i=o.length,l=new Array(i);r<i;r++)l[r]=o[r].fn;return l},c.prototype.listenerCount=function(e){var t=n?n+e:e,o=this._events[t];return o?o.fn?1:o.length:0},c.prototype.emit=function(e,t,o,r,i,l){var c=n?n+e:e;if(!this._events[c])return!1;var a,s,d=this._events[c],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,o),!0;case 4:return d.fn.call(d.context,t,o,r),!0;case 5:return d.fn.call(d.context,t,o,r,i),!0;case 6:return d.fn.call(d.context,t,o,r,i,l),!0}for(s=1,a=new Array(u-1);s<u;s++)a[s-1]=arguments[s];d.fn.apply(d.context,a)}else{var f,p=d.length;for(s=0;s<p;s++)switch(d[s].once&&this.removeListener(e,d[s].fn,void 0,!0),u){case 1:d[s].fn.call(d[s].context);break;case 2:d[s].fn.call(d[s].context,t);break;case 3:d[s].fn.call(d[s].context,t,o);break;case 4:d[s].fn.call(d[s].context,t,o,r);break;default:if(!a)for(f=1,a=new Array(u-1);f<u;f++)a[f-1]=arguments[f];d[s].fn.apply(d[s].context,a)}}return!0},c.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,o,r){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return l(this,i),this;var c=this._events[i];if(c.fn)c.fn!==t||r&&!c.once||o&&c.context!==o||l(this,i);else{for(var a=0,s=[],d=c.length;a<d;a++)(c[a].fn!==t||r&&!c[a].once||o&&c[a].context!==o)&&s.push(c[a]);s.length?this._events[i]=1===s.length?s[0]:s:l(this,i)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&l(this,t)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c}({get exports(){return X},set exports(e){X=e}});var q=X;function Z(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}const G=()=>{var e,t;return"undefined"==typeof window||"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?Z():null===(t=window.crypto)||void 0===t?void 0:t.randomUUID()},J=e=>({id:G(),type:(null==e?void 0:e.type)||"paragraph",children:(null==e?void 0:e.children)||[{text:""}],props:Object.assign({nodeType:"block"},null==e?void 0:e.props)}),Q=e=>({id:(null==e?void 0:e.id)||G(),value:(null==e?void 0:e.value)||[J()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const ee="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function te(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function ne(e){return"nodeType"in e}function oe(e){var t,n;return e?te(e)?e:ne(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function re(e){const{Document:t}=oe(e);return e instanceof t}function ie(e){return!te(e)&&e instanceof oe(e).HTMLElement}function le(e){return e instanceof oe(e).SVGElement}function ce(e){return e?te(e)?e.document:ne(e)?re(e)?e:ie(e)||le(e)?e.ownerDocument:document:document:document}const ae=ee?a:s;function se(e){const t=c(e);return ae((()=>{t.current=e})),u((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)}),[])}function de(e,t){void 0===t&&(t=[e]);const n=c(e);return ae((()=>{n.current!==e&&(n.current=e)}),t),n}function ue(e,t){const n=c();return d((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function fe(e){const t=se(e),n=c(null),o=u((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function pe(e){const t=c();return s((()=>{t.current=e}),[e]),t.current}let he={};function ge(e,t){return d((()=>{if(t)return t;const n=null==he[e]?0:he[e]+1;return he[e]=n,e+"-"+n}),[e,t])}function ve(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce(((t,n)=>{const o=Object.entries(n);for(const[n,r]of o){const o=t[n];null!=o&&(t[n]=o+e*r)}return t}),{...t})}}const ye=ve(1),me=ve(-1);function be(e){if(!e)return!1;const{KeyboardEvent:t}=oe(e.target);return t&&e instanceof t}function we(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=oe(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 xe=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[xe.Translate.toString(e),xe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),ke="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ee(e){return e.matches(ke)?e:e.querySelector(ke)}const Oe={display:"none"};function Ce(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:Oe},n)}function Se(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",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 De=i(null);const je={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 "},Be={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 _e(e){let{announcements:t=Be,container:n,hiddenTextDescribedById:o,screenReaderInstructions:i=je}=e;const{announce:c,announcement:a}=function(){const[e,t]=f("");return{announce:u((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=ge("DndLiveRegion"),[h,g]=f(!1);if(s((()=>{g(!0)}),[]),function(e){const t=l(De);s((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(d((()=>({onDragStart(e){let{active:n}=e;c(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:o}=e;t.onDragMove&&c(t.onDragMove({active:n,over:o}))},onDragOver(e){let{active:n,over:o}=e;c(t.onDragOver({active:n,over:o}))},onDragEnd(e){let{active:n,over:o}=e;c(t.onDragEnd({active:n,over:o}))},onDragCancel(e){let{active:n,over:o}=e;c(t.onDragCancel({active:n,over:o}))}})),[c,t])),!h)return null;const v=r.createElement(r.Fragment,null,r.createElement(Ce,{id:o,value:i.draggable}),r.createElement(Se,{id:p,announcement:a}));return n?b(v,n):v}var Re;function Ae(){}function Me(e,t){return d((()=>({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"}(Re||(Re={}));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 Le(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function Pe(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function Ie(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function ze(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function Fe(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 He=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Fe(t,t.left,t.top),i=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=Ne(Fe(o),r);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(Le)};function Ue(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),l=r-o,c=i-n;if(o<r&&n<i){const n=t.width*t.height,o=e.width*e.height,r=l*c;return Number((r/(n+o-r)).toFixed(4))}return 0}const Ve=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const e of o){const{id:o}=e,i=n.get(o);if(i){const n=Ue(i,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(Pe)};function $e(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Te}function We(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.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 Ke=We(1);const Ye={ignoreTransform:!1};function Xe(e,t){void 0===t&&(t=Ye);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=oe(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!o)return e;const{scaleX:r,scaleY:i,x:l,y:c}=o,a=e.left-l-(1-r)*parseFloat(n),s=e.top-c-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:a+d,bottom:s+u,left:a}}(n,t,o))}const{top:o,left:r,width:i,height:l,bottom:c,right:a}=n;return{top:o,left:r,width:i,height:l,bottom:c,right:a}}function qe(e){return Xe(e,{ignoreTransform:!0})}function Ze(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t)return n;if(!r)return n;if(re(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!ie(r)||le(r))return n;if(n.includes(r))return n;const i=oe(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=oe(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const o=t[e];return"string"==typeof o&&n.test(o)}))}(r,i)&&n.push(r),function(e,t){return void 0===t&&(t=oe(e).getComputedStyle(e)),"fixed"===t.position}(r,i)?n:o(r.parentNode)}(e):n}function Ge(e){const[t]=Ze(e,1);return null!=t?t:null}function Je(e){return ee&&e?te(e)?e:ne(e)?re(e)||e===ce(e).scrollingElement?window:ie(e)?e:null:null:null}function Qe(e){return te(e)?e.scrollX:e.scrollLeft}function et(e){return te(e)?e.scrollY:e.scrollTop}function tt(e){return{x:Qe(e),y:et(e)}}var nt;function ot(e){return!(!ee||!e)&&e===document.scrollingElement}function rt(e){const t={x:0,y:0},n=ot(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(nt||(nt={}));const it={x:.2,y:.2};function lt(e,t,n,o,r){let{top:i,left:l,right:c,bottom:a}=n;void 0===o&&(o=10),void 0===r&&(r=it);const{isTop:s,isBottom:d,isLeft:u,isRight:f}=rt(e),p={x:0,y:0},h={x:0,y:0},g=t.height*r.y,v=t.width*r.x;return!s&&i<=t.top+g?(p.y=nt.Backward,h.y=o*Math.abs((t.top+g-i)/g)):!d&&a>=t.bottom-g&&(p.y=nt.Forward,h.y=o*Math.abs((t.bottom-g-a)/g)),!f&&c>=t.right-v?(p.x=nt.Forward,h.x=o*Math.abs((t.right-v-c)/v)):!u&&l<=t.left+v&&(p.x=nt.Backward,h.x=o*Math.abs((t.left+v-l)/v)),{direction:p,speed:h}}function ct(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:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function at(e){return e.reduce(((e,t)=>ye(e,tt(t))),Te)}const st=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Qe(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+et(t)),0)}]];class dt{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=Ze(t),o=at(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of st)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=r(n),l=o[e]-t;return this.rect[i]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ut{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 o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ft(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var pt,ht;function gt(e){e.preventDefault()}function vt(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"}(pt||(pt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ht||(ht={}));const yt={start:[ht.Space,ht.Enter],cancel:[ht.Esc],end:[ht.Space,ht.Enter]},mt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ht.Right:return{...n,x:n.x+25};case ht.Left:return{...n,x:n.x-25};case ht.Down:return{...n,y:n.y+25};case ht.Up:return{...n,y:n.y-25}}};class bt{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 ut(ce(t)),this.windowListeners=new ut(oe(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(pt.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Xe),!e)return;const{top:n,left:o,bottom:r,right:i}=t(e);Ge(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(Te)}handleKeyDown(e){if(be(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=yt,coordinateGetter:i=mt,scrollBehavior:l="smooth"}=o,{code:c}=e;if(r.end.includes(c))return void this.handleEnd(e);if(r.cancel.includes(c))return void this.handleCancel(e);const{collisionRect:a}=n.current,s=a?{x:a.left,y:a.top}:Te;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:n.current,currentCoordinates:s});if(d){const t=me(d,s),o={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:i,isRight:c,isLeft:a,isBottom:s,maxScroll:u,minScroll:f}=rt(n),p=ct(n),h={x:Math.min(r===ht.Right?p.right-p.width/2:p.right,Math.max(r===ht.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===ht.Down?p.bottom-p.height/2:p.bottom,Math.max(r===ht.Down?p.top:p.top+p.height/2,d.y))},g=r===ht.Right&&!c||r===ht.Left&&!a,v=r===ht.Down&&!s||r===ht.Up&&!i;if(g&&h.x!==d.x){const e=n.scrollLeft+t.x,i=r===ht.Right&&e<=u.x||r===ht.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:l});o.x=i?n.scrollLeft-e:r===ht.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,o.x&&n.scrollBy({left:-o.x,behavior:l});break}if(v&&h.y!==d.y){const e=n.scrollTop+t.y,i=r===ht.Down&&e<=u.y||r===ht.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:l});o.y=i?n.scrollTop-e:r===ht.Down?n.scrollTop-u.y:n.scrollTop-f.y,o.y&&n.scrollBy({top:-o.y,behavior:l});break}}this.handleMove(e,ye(me(d,this.referenceCoordinates),o))}}}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 wt(e){return Boolean(e&&"distance"in e)}function xt(e){return Boolean(e&&"delay"in e)}bt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=yt,onActivation:r}=t,{active:i}=n;const{code:l}=e.nativeEvent;if(o.start.includes(l)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class kt{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=oe(e);return e instanceof t?e:ce(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:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=ce(i),this.documentListeners=new ut(this.document),this.listeners=new ut(n),this.windowListeners=new ut(oe(i)),this.initialCoordinates=null!=(o=we(r))?o: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),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.DragStart,gt),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),this.windowListeners.add(pt.ContextMenu,gt),this.documentListeners.add(pt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(wt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(pt.Click,vt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:r}=this,{onMove:i,options:{activationConstraint:l}}=r;if(!o)return;const c=null!=(t=we(e))?t:Te,a=me(o,c);if(!n&&l){if(wt(l)){if(null!=l.tolerance&&ft(a,l.tolerance))return this.handleCancel();if(ft(a,l.distance))return this.handleStart()}return xt(l)&&ft(a,l.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(c)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ht.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Et={move:{name:"pointermove"},end:{name:"pointerup"}};class Ot extends kt{constructor(e){const{event:t}=e,n=ce(t.target);super(e,Et,n)}}Ot.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button)&&(null==o||o({event:n}),!0)}}];const Ct={move:{name:"mousemove"},end:{name:"mouseup"}};var St;!function(e){e[e.RightClick=2]="RightClick"}(St||(St={}));(class extends kt{constructor(e){super(e,Ct,ce(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==St.RightClick&&(null==o||o({event:n}),!0)}}];const Dt={move:{name:"touchmove"},end:{name:"touchend"}};var jt,Bt;function _t(e){let{acceleration:t,activator:n=jt.Pointer,canScroll:o,draggingRect:r,enabled:i,interval:l=5,order:a=Bt.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:h,delta:g,threshold:v}=e;const y=function(e){let{delta:t,disabled:n}=e;const o=pe(t);return ue((e=>{if(n||!o||!e)return Rt;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[nt.Backward]:e.x[nt.Backward]||-1===r.x,[nt.Forward]:e.x[nt.Forward]||1===r.x},y:{[nt.Backward]:e.y[nt.Backward]||-1===r.y,[nt.Forward]:e.y[nt.Forward]||1===r.y}}}),[n,t,o])}({delta:g,disabled:!i}),[m,b]=function(){const e=c(null);return[u(((t,n)=>{e.current=setInterval(t,n)}),[]),u((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),w=c({x:0,y:0}),x=c({x:0,y:0}),k=d((()=>{switch(n){case jt.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case jt.DraggableRect:return r}}),[n,r,f]),E=c(null),O=u((()=>{const e=E.current;if(!e)return;const t=w.current.x*x.current.x,n=w.current.y*x.current.y;e.scrollBy(t,n)}),[]),C=d((()=>a===Bt.TreeOrder?[...p].reverse():p),[a,p]);s((()=>{if(i&&p.length&&k){for(const e of C){if(!1===(null==o?void 0:o(e)))continue;const n=p.indexOf(e),r=h[n];if(!r)continue;const{direction:i,speed:c}=lt(e,r,k,t,v);for(const e of["x","y"])y[e][i[e]]||(c[e]=0,i[e]=0);if(c.x>0||c.y>0)return b(),E.current=e,m(O,l),w.current=c,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},b()}else b()}),[t,O,o,b,i,l,JSON.stringify(k),JSON.stringify(y),m,p,C,h,JSON.stringify(v)])}(class extends kt{constructor(e){super(e,Dt)}static setup(){return window.addEventListener(Dt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Dt.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1)&&(null==o||o({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(jt||(jt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Bt||(Bt={}));const Rt={x:{[nt.Backward]:!1,[nt.Forward]:!1},y:{[nt.Backward]:!1,[nt.Forward]:!1}};var At,Mt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(At||(At={})),function(e){e.Optimized="optimized"}(Mt||(Mt={}));const Tt=new Map;function Nt(e,t){return ue((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Lt(e){let{callback:t,disabled:n}=e;const o=se(t),r=d((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[n]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}function Pt(e){return new dt(Xe(e),e)}function It(e,t,n){void 0===t&&(t=Pt);const[o,r]=h((function(o){if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=o?o:n)?r:null;const i=t(e);if(JSON.stringify(o)===JSON.stringify(i))return o;return i}),null),i=function(e){let{callback:t,disabled:n}=e;const o=se(t),r=d((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,n]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){r();break}}}}),l=Lt({callback:r});return ae((()=>{r(),e?(null==l||l.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==i||i.disconnect())}),[e]),o}const zt=[];function Ft(e,t){void 0===t&&(t=[]);const n=c(null);return s((()=>{n.current=null}),t),s((()=>{const t=e!==Te;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?me(e,n.current):Te}function Ht(e){return d((()=>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 Ut=[];function Vt(e){let{measure:t}=e;const[n,o]=f(null),r=u((e=>{for(const{target:n}of e)if(ie(n)){o((e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o}));break}}),[t]),i=Lt({callback:r}),l=u((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ie(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),o(n?t(n):null)}),[t,i]),[c,a]=fe(l);return d((()=>({nodeRef:c,rect:n,setRef:a})),[n,c,a])}const $t=[{sensor:Ot,options:{}},{sensor:bt,options:{}}],Wt={current:{}},Kt={draggable:{measure:qe},droppable:{measure:qe,strategy:At.WhileDragging,frequency:Mt.Optimized},dragOverlay:{measure:Xe}};class Yt 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 Xt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Yt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ae},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Kt,measureDroppableContainers:Ae,windowRect:null,measuringScheduled:!1},qt=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ae,draggableNodes:new Map,over:null,measureDroppableContainers:Ae}),Zt=i(Xt);function Gt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Yt}}}function Jt(e,t){switch(t.type){case Re.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Re.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Re.DragEnd:case Re.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Re.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new Yt(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case Re.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const l=new Yt(e.droppable.containers);return l.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:l}}}case Re.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const i=new Yt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Qt(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=l(qt),i=pe(o),c=pe(null==n?void 0:n.id);return s((()=>{if(!t&&!o&&i&&null!=c){if(!be(i))return;if(document.activeElement===i.target)return;const e=r.get(c);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=Ee(e);if(t){t.focus();break}}}))}}),[o,t,r,c,i]),null}const en=i({...Te,scaleX:1,scaleY:1});var tn;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(tn||(tn={}));const nn=p((function(e){var t,n,o,i;let{id:l,accessibility:a,autoScroll:p=!0,children:g,sensors:v=$t,collisionDetection:y=Ve,measuring:b,modifiers:w,...x}=e;const k=h(Jt,void 0,Gt),[E,O]=k,[C,S]=function(){const[e]=f((()=>new Set)),t=u((t=>(e.add(t),()=>e.delete(t))),[e]);return[u((t=>{let{type:n,event:o}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)}))}),[e]),t]}(),[D,j]=f(tn.Uninitialized),B=D===tn.Initialized,{draggable:{active:_,nodes:R,translate:A},droppable:{containers:M}}=E,T=_?R.get(_):null,N=c({initial:null,translated:null}),L=d((()=>{var e;return null!=_?{id:_,data:null!=(e=null==T?void 0:T.data)?e:Wt,rect:N}:null}),[_,T]),P=c(null),[I,z]=f(null),[F,H]=f(null),U=de(x,Object.values(x)),V=ge("DndDescribedBy",l),$=d((()=>M.getEnabled()),[M]),W=d((()=>({draggable:{...Kt.draggable,...null==K?void 0:K.draggable},droppable:{...Kt.droppable,...null==K?void 0:K.droppable},dragOverlay:{...Kt.dragOverlay,...null==K?void 0:K.dragOverlay}})),[null==(K=b)?void 0:K.draggable,null==K?void 0:K.droppable,null==K?void 0:K.dragOverlay]);var K;const{droppableRects:Y,measureDroppableContainers:X,measuringScheduled:q}=function(e,t){let{dragging:n,dependencies:o,config:r}=t;const[i,l]=f(null),{frequency:a,measure:d,strategy:p}=r,h=c(e),g=function(){switch(p){case At.Always:return!1;case At.BeforeDragging:return n;default:return!n}}(),v=de(g),y=u((function(e){void 0===e&&(e=[]),v.current||l((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[v]),m=c(null),b=ue((t=>{if(g&&!n)return Tt;if(!t||t===Tt||h.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,o=e?new dt(d(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t}),[e,i,n,g,d]);return s((()=>{h.current=e}),[e]),s((()=>{g||y()}),[n,g]),s((()=>{i&&i.length>0&&l(null)}),[JSON.stringify(i)]),s((()=>{g||"number"!=typeof a||null!==m.current||(m.current=setTimeout((()=>{y(),m.current=null}),a))}),[a,g,y,...o]),{droppableRects:b,measureDroppableContainers:y,measuringScheduled:null!=i}}($,{dragging:B,dependencies:[A.x,A.y],config:W.droppable}),Z=function(e,t){const n=null!==t?e.get(t):void 0,o=n?n.node.current:null;return ue((e=>{var n;return null===t?null:null!=(n=null!=o?o:e)?n:null}),[o,t])}(R,_),G=d((()=>F?we(F):null),[F]),J=function(){const e=!1===(null==I?void 0:I.autoScrollEnabled),t="object"==typeof p?!1===p.enabled:!1===p,n=B&&!e&&!t;if("object"==typeof p)return{...p,enabled:n};return{enabled:n}}(),Q=function(e,t){return Nt(e,t)}(Z,W.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const i=c(!1),{x:l,y:a}="boolean"==typeof r?{x:r,y:r}:r;ae((()=>{if(!l&&!a||!t)return void(i.current=!1);if(i.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=$e(n(e),o);if(l||(r.x=0),a||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=Ge(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,l,a,o,n])}({activeNode:_?R.get(_):null,config:J.layoutShiftCompensation,initialRect:Q,measure:W.draggable.measure});const te=It(Z,W.draggable.measure,Q),ne=It(Z?Z.parentElement:null),re=c({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=M.getNodeFor(null==(t=re.current.over)?void 0:t.id),le=Vt({measure:W.dragOverlay.measure}),ce=null!=(n=le.nodeRef.current)?n:Z,se=B?null!=(o=le.rect)?o:te:null,fe=Boolean(le.nodeRef.current&&le.rect),pe=$e(he=fe?null:te,Nt(he));var he;const ve=Ht(ce?oe(ce):null),me=function(e){const t=c(e),n=ue((n=>e?n&&n!==zt&&e&&t.current&&e.parentNode===t.current.parentNode?n:Ze(e):zt),[e]);return s((()=>{t.current=e}),[e]),n}(B?null!=ie?ie:Z:null),be=function(e,t){void 0===t&&(t=Xe);const[n]=e,o=Ht(n?oe(n):null),[r,i]=h((function(){return e.length?e.map((e=>ot(e)?o:new dt(t(e),e))):Ut}),Ut),l=Lt({callback:i});return e.length>0&&r===Ut&&i(),ae((()=>{e.length?e.forEach((e=>null==l?void 0:l.observe(e))):(null==l||l.disconnect(),i())}),[e]),r}(me),xe=function(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...o})),n):n}(w,{transform:{x:A.x-pe.x,y:A.y-pe.y,scaleX:1,scaleY:1},activatorEvent:F,active:L,activeNodeRect:te,containerNodeRect:ne,draggingNodeRect:se,over:re.current.over,overlayNodeRect:le.rect,scrollableAncestors:me,scrollableAncestorRects:be,windowRect:ve}),ke=G?ye(G,A):null,Ee=function(e){const[t,n]=f(null),o=c(e),r=u((e=>{const t=Je(e.target);t&&n((e=>e?(e.set(t,tt(t)),new Map(e)):null))}),[]);return s((()=>{const t=o.current;if(e!==t){i(t);const l=e.map((e=>{const t=Je(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,tt(t)]):null})).filter((e=>null!=e));n(l.length?new Map(l):null),o.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=Je(e);null==t||t.removeEventListener("scroll",r)}))}}),[r,e]),d((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ye(e,t)),Te):at(e):Te),[e,t])}(me),Oe=Ft(Ee),Ce=Ft(Ee,[te]),Se=ye(xe,Oe),je=se?Ke(se,xe):null,Be=L&&je?y({active:L,collisionRect:je,droppableRects:Y,droppableContainers:$,pointerCoordinates:ke}):null,Ae=ze(Be,"id"),[Me,Ne]=f(null),Le=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(fe?xe:ye(xe,Ce),null!=(i=null==Me?void 0:Me.rect)?i:null,te),Pe=u(((e,t)=>{let{sensor:n,options:o}=t;if(null==P.current)return;const r=R.get(P.current);if(!r)return;const i=e.nativeEvent,l=new n({active:P.current,activeNode:r,event:i,options:o,context:re,onStart(e){const t=P.current;if(null==t)return;const n=R.get(t);if(!n)return;const{onDragStart:o}=U.current,r={active:{id:t,data:n.data,rect:N}};m((()=>{null==o||o(r),j(tn.Initializing),O({type:Re.DragStart,initialCoordinates:e,active:t}),C({type:"onDragStart",event:r})}))},onMove(e){O({type:Re.DragMove,coordinates:e})},onEnd:c(Re.DragEnd),onCancel:c(Re.DragCancel)});function c(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:r}=re.current;let l=null;if(t&&r){const{cancelDrop:c}=U.current;if(l={activatorEvent:i,active:t,collisions:n,delta:r,over:o},e===Re.DragEnd&&"function"==typeof c){await Promise.resolve(c(l))&&(e=Re.DragCancel)}}P.current=null,m((()=>{O({type:e}),j(tn.Uninitialized),Ne(null),z(null),H(null);const t=e===Re.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=U.current[t];null==e||e(l),C({type:t,event:l})}}))}}m((()=>{z(l),H(e.nativeEvent)}))}),[R]),Ie=u(((e,t)=>(n,o)=>{const r=n.nativeEvent,i=R.get(o);if(null!==P.current||!i||r.dndKit||r.defaultPrevented)return;const l={active:i};!0===e(n,t.options,l)&&(r.dndKit={capturedBy:t.sensor},P.current=o,Pe(n,t))}),[R,Pe]),Fe=function(e,t){return d((()=>e.reduce(((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(v,Ie);!function(e){s((()=>{if(!ee)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})))}(v),ae((()=>{te&&D===tn.Initializing&&j(tn.Initialized)}),[te,D]),s((()=>{const{onDragMove:e}=U.current,{active:t,activatorEvent:n,collisions:o,over:r}=re.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:o,delta:{x:Se.x,y:Se.y},over:r};m((()=>{null==e||e(i),C({type:"onDragMove",event:i})}))}),[Se.x,Se.y]),s((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:r}=re.current;if(!e||null==P.current||!t||!r)return;const{onDragOver:i}=U.current,l=o.get(Ae),c=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,a={active:e,activatorEvent:t,collisions:n,delta:{x:r.x,y:r.y},over:c};m((()=>{Ne(c),null==i||i(a),C({type:"onDragOver",event:a})}))}),[Ae]),ae((()=>{re.current={activatorEvent:F,active:L,activeNode:Z,collisionRect:je,collisions:Be,droppableRects:Y,draggableNodes:R,draggingNode:ce,draggingNodeRect:se,droppableContainers:M,over:Me,scrollableAncestors:me,scrollAdjustedTranslate:Se},N.current={initial:se,translated:je}}),[L,Z,Be,je,R,ce,se,Y,M,Me,me,Se]),_t({...J,delta:A,draggingRect:je,pointerCoordinates:ke,scrollableAncestors:me,scrollableAncestorRects:be});const He=d((()=>({active:L,activeNode:Z,activeNodeRect:te,activatorEvent:F,collisions:Be,containerNodeRect:ne,dragOverlay:le,draggableNodes:R,droppableContainers:M,droppableRects:Y,over:Me,measureDroppableContainers:X,scrollableAncestors:me,scrollableAncestorRects:be,measuringConfiguration:W,measuringScheduled:q,windowRect:ve})),[L,Z,te,F,Be,ne,le,R,M,Y,Me,X,me,be,W,q,ve]),Ue=d((()=>({activatorEvent:F,activators:Fe,active:L,activeNodeRect:te,ariaDescribedById:{draggable:V},dispatch:O,draggableNodes:R,over:Me,measureDroppableContainers:X})),[F,Fe,L,te,O,V,R,Me,X]);return r.createElement(De.Provider,{value:S},r.createElement(qt.Provider,{value:Ue},r.createElement(Zt.Provider,{value:He},r.createElement(en.Provider,{value:Le},g)),r.createElement(Qt,{disabled:!1===(null==a?void 0:a.restoreFocus)})),r.createElement(_e,{...a,hiddenTextDescribedById:V}))})),on=i(null),rn="button",ln="Droppable";function cn(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e;const i=ge(ln),{activators:c,activatorEvent:a,active:s,activeNodeRect:u,ariaDescribedById:f,draggableNodes:p,over:h}=l(qt),{role:g=rn,roleDescription:v="draggable",tabIndex:y=0}=null!=r?r:{},m=(null==s?void 0:s.id)===t,b=l(m?en:on),[w,x]=fe(),[k,E]=fe(),O=function(e,t){return d((()=>e.reduce(((e,n)=>{let{eventName:o,handler:r}=n;return e[o]=e=>{r(e,t)},e}),{})),[e,t])}(c,t),C=de(n);ae((()=>(p.set(t,{id:t,key:i,node:w,activatorNode:k,data:C}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:s,activatorEvent:a,activeNodeRect:u,attributes:d((()=>({role:g,tabIndex:y,"aria-disabled":o,"aria-pressed":!(!m||g!==rn)||void 0,"aria-roledescription":v,"aria-describedby":f.draggable})),[o,g,y,m,v,f.draggable]),isDragging:m,listeners:o?void 0:O,node:w,over:h,setNodeRef:x,setActivatorNodeRef:E,transform:b}}const an="Droppable",sn={timeout:25};function dn(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function un(e,t){return e.reduce(((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e}),Array(e.length))}function fn(e){return null!==e&&e>=0}const pn=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const i=dn(t,o,n),l=t[r],c=i[r];return c&&l?{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}:null},hn={scaleX:1,scaleY:1},gn=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:r,rects:i,overIndex:l}=e;const c=null!=(t=i[n])?t:o;if(!c)return null;if(r===n){const e=i[l];return e?{x:0,y:n<l?e.top+e.height-(c.top+c.height):e.top-c.top,...hn}:null}const a=function(e,t,n){const o=e[t],r=e[t-1],i=e[t+1];if(!o)return 0;if(n<t)return r?o.top-(r.top+r.height):i?i.top-(o.top+o.height):0;return i?i.top-(o.top+o.height):r?o.top-(r.top+r.height):0}(i,r,n);return r>n&&r<=l?{x:0,y:-c.height-a,...hn}:r<n&&r>=l?{x:0,y:c.height+a,...hn}:{x:0,y:0,...hn}};const vn="Sortable",yn=r.createContext({activeIndex:-1,containerId:vn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pn,disabled:{draggable:!1,droppable:!1}});function mn(e){let{children:t,id:n,items:o,strategy:i=pn,disabled:a=!1}=e;const{active:u,dragOverlay:f,droppableRects:p,over:h,measureDroppableContainers:g}=l(Zt),v=ge(vn,n),y=Boolean(null!==f.rect),m=d((()=>o.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[o]),b=null!=u,w=u?m.indexOf(u.id):-1,x=h?m.indexOf(h.id):-1,k=c(m),E=!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}(m,k.current),O=-1!==x&&-1===w||E,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(a);ae((()=>{E&&b&&g(m)}),[E,m,b,g]),s((()=>{k.current=m}),[m]);const S=d((()=>({activeIndex:w,containerId:v,disabled:C,disableTransforms:O,items:m,overIndex:x,useDragOverlay:y,sortedRects:un(m,p),strategy:i})),[w,v,C.draggable,C.droppable,O,m,x,p,y,i]);return r.createElement(yn.Provider,{value:S},t)}const bn=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return dn(n,o,r).indexOf(t)},wn=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:l,previousItems:c,previousContainerId:a,transition:s}=e;return!(!s||!o)&&((c===i||r!==l)&&(!!n||l!==r&&t===a))},xn={duration:200,easing:"ease"},kn="transform",En=xe.Transition.toString({property:kn,duration:0,easing:"linear"}),On={roleDescription:"sortable"};function Cn(e){let{animateLayoutChanges:t=wn,attributes:n,disabled:o,data:r,getNewIndex:i=bn,id:a,strategy:p,resizeObserverConfig:h,transition:g=xn}=e;const{items:v,containerId:y,activeIndex:m,disabled:b,disableTransforms:w,sortedRects:x,overIndex:k,useDragOverlay:E,strategy:O}=l(yn),C=function(e,t){var n,o;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(o=null==e?void 0:e.droppable)?o:t.droppable}}(o,b),S=v.indexOf(a),D=d((()=>({sortable:{containerId:y,index:S,items:v},...r})),[y,r,S,v]),j=d((()=>v.slice(v.indexOf(a))),[v,a]),{rect:B,node:_,isOver:R,setNodeRef:A}=function(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e;const i=ge(an),{active:a,dispatch:d,over:f,measureDroppableContainers:p}=l(qt),h=c({disabled:n}),g=c(!1),v=c(null),y=c(null),{disabled:m,updateMeasurementsFor:b,timeout:w}={...sn,...r},x=de(null!=b?b:o),k=Lt({callback:u((()=>{g.current?(null!=y.current&&clearTimeout(y.current),y.current=setTimeout((()=>{p(Array.isArray(x.current)?x.current:[x.current]),y.current=null}),w)):g.current=!0}),[w]),disabled:m||!a}),E=u(((e,t)=>{k&&(t&&(k.unobserve(t),g.current=!1),e&&k.observe(e))}),[k]),[O,C]=fe(E),S=de(t);return s((()=>{k&&O.current&&(k.disconnect(),g.current=!1,k.observe(O.current))}),[O,k]),ae((()=>(d({type:Re.RegisterDroppable,element:{id:o,key:i,disabled:n,node:O,rect:v,data:S}}),()=>d({type:Re.UnregisterDroppable,key:i,id:o}))),[o]),s((()=>{n!==h.current.disabled&&(d({type:Re.SetDroppableDisabled,id:o,key:i,disabled:n}),h.current.disabled=n)}),[o,i,n,d]),{active:a,rect:v,isOver:(null==f?void 0:f.id)===o,node:O,over:f,setNodeRef:C}}({id:a,data:D,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...h}}),{active:M,activatorEvent:T,activeNodeRect:N,attributes:L,setNodeRef:P,listeners:I,isDragging:z,over:F,setActivatorNodeRef:H,transform:U}=cn({id:a,data:D,attributes:{...On,...n},disabled:C.draggable}),V=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>e=>{t.forEach((t=>t(e)))}),t)}(A,P),$=Boolean(M),W=$&&!w&&fn(m)&&fn(k),K=!E&&z,Y=K&&W?U:null,X=W?null!=Y?Y:(null!=p?p:O)({rects:x,activeNodeRect:N,activeIndex:m,overIndex:k,index:S}):null,q=fn(m)&&fn(k)?i({id:a,items:v,activeIndex:m,overIndex:k}):S,Z=null==M?void 0:M.id,G=c({activeId:Z,items:v,newIndex:q,containerId:y}),J=v!==G.current.items,Q=t({active:M,containerId:y,isDragging:z,isSorting:$,id:a,index:S,items:v,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:g,wasDragging:null!=G.current.activeId}),ee=function(e){let{disabled:t,index:n,node:o,rect:r}=e;const[i,l]=f(null),a=c(n);return ae((()=>{if(!t&&n!==a.current&&o.current){const e=r.current;if(e){const t=Xe(o.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)&&l(n)}}n!==a.current&&(a.current=n)}),[t,n,o,r]),s((()=>{i&&l(null)}),[i]),i}({disabled:!Q,index:S,node:_,rect:B});return s((()=>{$&&G.current.newIndex!==q&&(G.current.newIndex=q),y!==G.current.containerId&&(G.current.containerId=y),v!==G.current.items&&(G.current.items=v)}),[$,q,y,v]),s((()=>{if(Z===G.current.activeId)return;if(Z&&!G.current.activeId)return void(G.current.activeId=Z);const e=setTimeout((()=>{G.current.activeId=Z}),50);return()=>clearTimeout(e)}),[Z]),{active:M,activeIndex:m,attributes:L,data:D,rect:B,index:S,newIndex:q,items:v,isOver:R,isSorting:$,isDragging:z,listeners:I,node:_,overIndex:k,over:F,setNodeRef:V,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:P,transform:null!=ee?ee:X,transition:function(){if(ee||J&&G.current.newIndex===S)return En;if(K&&!be(T)||!g)return;if($||Q)return xe.Transition.toString({...g,property:kn});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=[ht.Down,ht.Right,ht.Up,ht.Left],jn=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:l,scrollableAncestors:c}}=t;if(Dn.includes(e.code)){if(e.preventDefault(),!n||!o)return;const t=[];i.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const i=r.get(n.id);if(i)switch(e.code){case ht.Down:o.top<i.top&&t.push(n);break;case ht.Up:o.top>i.top&&t.push(n);break;case ht.Left:o.left>i.left&&t.push(n);break;case ht.Right:o.left<i.left&&t.push(n)}}));const a=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Ie(t),i=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=Ie(o),l=r.reduce(((e,t,o)=>e+Ne(n[o],t)),0),c=Number((l/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:c}})}}return i.sort(Le)})({active:n,collisionRect:o,droppableRects:r,droppableContainers:t,pointerCoordinates:null});let s=ze(a,"id");if(s===(null==l?void 0:l.id)&&a.length>1&&(s=a[1].id),null!=s){const e=i.get(n.id),t=i.get(s),l=t?r.get(t.id):null,a=null==t?void 0:t.node.current;if(a&&l&&e&&t){const n=Ze(a).some(((e,t)=>c[t]!==e)),r=Bn(e,t),i=function(e,t){if(!Sn(e)||!Sn(t))return!1;if(!Bn(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=n||!r?{x:0,y:0}:{x:i?o.width-l.width:0,y:i?o.height-l.height:0},d={x:l.left,y:l.top};return s.x&&s.y?d:me(d,s)}}}};function Bn(e,t){return!(!Sn(e)||!Sn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var _n;function Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Rn.apply(this,arguments)}var An,Mn=function(e){return o.createElement("svg",Rn({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),_n||(_n=o.createElement("path",{d:"M3 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm4-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})))};function Tn(){return Tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Tn.apply(this,arguments)}var Nn=function(e){return o.createElement("svg",Tn({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),An||(An=o.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function Ln(e,t={}){const n=Object.keys(e.children),{at:o=e.selection}=t,r=n.find((t=>e.children[t].meta.order===(null==o?void 0:o[0])));if(r)return e.blockEditorsMap[r]}function Pn(e){return Fn(e)?(e.nodeName||"").toLowerCase():"#document"}function In(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function zn(e){var t;return null==(t=(Fn(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Fn(e){return e instanceof Node||e instanceof In(e).Node}function Hn(e){return e instanceof Element||e instanceof In(e).Element}function Un(e){return e instanceof HTMLElement||e instanceof In(e).HTMLElement}function Vn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof In(e).ShadowRoot)}function $n(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=qn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Wn(e){return["table","td","th"].includes(Pn(e))}function Kn(e){const t=Yn(),n=qn(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Yn(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Xn(e){return["html","body","#document"].includes(Pn(e))}function qn(e){return In(e).getComputedStyle(e)}function Zn(e){return Hn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Gn(e){if("html"===Pn(e))return e;const t=e.assignedSlot||e.parentNode||Vn(e)&&e.host||zn(e);return Vn(t)?t.host:t}function Jn(e){const t=Gn(e);return Xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Un(t)&&$n(t)?t:Jn(t)}function Qn(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Jn(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),l=In(r);return i?t.concat(l,l.visualViewport||[],$n(r)?r:[],l.frameElement&&n?Qn(l.frameElement):[]):t.concat(r,Qn(r,[],n))}const eo=Math.min,to=Math.max,no=Math.round,oo=Math.floor,ro=e=>({x:e,y:e}),io={left:"right",right:"left",bottom:"top",top:"bottom"},lo={start:"end",end:"start"};function co(e,t,n){return to(e,eo(t,n))}function ao(e,t){return"function"==typeof e?e(t):e}function so(e){return e.split("-")[0]}function uo(e){return e.split("-")[1]}function fo(e){return"x"===e?"y":"x"}function po(e){return"y"===e?"height":"width"}function ho(e){return["top","bottom"].includes(so(e))?"y":"x"}function go(e){return fo(ho(e))}function vo(e){return e.replace(/start|end/g,(e=>lo[e]))}function yo(e){return e.replace(/left|right|bottom|top/g,(e=>io[e]))}function mo(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function bo(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function wo(e,t,n){let{reference:o,floating:r}=e;const i=ho(t),l=go(t),c=po(l),a=so(t),s="y"===i,d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,f=o[c]/2-r[c]/2;let p;switch(a){case"top":p={x:d,y:o.y-r.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={x:o.x-r.width,y:u};break;default:p={x:o.x,y:o.y}}switch(uo(t)){case"start":p[l]-=f*(n&&s?-1:1);break;case"end":p[l]+=f*(n&&s?-1:1)}return p}async function xo(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:l,elements:c,strategy:a}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=ao(t,e),h=mo(p),g=c[f?"floating"===u?"reference":"floating":u],v=bo(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:s,rootBoundary:d,strategy:a})),y="floating"===u?{...l.floating,x:o,y:r}:l.reference,m=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),b=await(null==i.isElement?void 0:i.isElement(m))&&await(null==i.getScale?void 0:i.getScale(m))||{x:1,y:1},w=bo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:m,strategy:a}):y);return{top:(v.top-w.top+h.top)/b.y,bottom:(w.bottom-v.bottom+h.bottom)/b.y,left:(v.left-w.left+h.left)/b.x,right:(w.right-v.right+h.right)/b.x}}function ko(e){const t=eo(...e.map((e=>e.left))),n=eo(...e.map((e=>e.top)));return{x:t,y:n,width:to(...e.map((e=>e.right)))-t,height:to(...e.map((e=>e.bottom)))-n}}const Eo=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:l,middlewareData:c}=t,a=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=so(n),c=uo(n),a="y"===ho(n),s=["left","top"].includes(l)?-1:1,d=i&&a?-1:1,u=ao(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return c&&"number"==typeof h&&(p="end"===c?-1*h:h),a?{x:p*d,y:f*s}:{x:f*s,y:p*d}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:l}}}}};function Oo(e){const t=qn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Un(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,c=no(n)!==i||no(o)!==l;return c&&(n=i,o=l),{width:n,height:o,$:c}}function Co(e){return Hn(e)?e:e.contextElement}function So(e){const t=Co(e);if(!Un(t))return ro(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Oo(t);let l=(i?no(n.width):n.width)/o,c=(i?no(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Do=ro(0);function jo(e){const t=In(e);return Yn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Do}function Bo(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=Co(e);let l=ro(1);t&&(o?Hn(o)&&(l=So(o)):l=So(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==In(e))&&t}(i,n,o)?jo(i):ro(0);let a=(r.left+c.x)/l.x,s=(r.top+c.y)/l.y,d=r.width/l.x,u=r.height/l.y;if(i){const e=In(i),t=o&&Hn(o)?In(o):o;let n=e,r=n.frameElement;for(;r&&o&&t!==n;){const e=So(r),t=r.getBoundingClientRect(),o=qn(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,l=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;a*=e.x,s*=e.y,d*=e.x,u*=e.y,a+=i,s+=l,n=In(r),r=n.frameElement}}return bo({width:d,height:u,x:a,y:s})}const _o=[":popover-open",":modal"];function Ro(e){return _o.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Ao(e){return Bo(zn(e)).left+Zn(e).scrollLeft}function Mo(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=In(e),o=zn(e),r=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,c=0,a=0;if(r){i=r.width,l=r.height;const e=Yn();(!e||e&&"fixed"===t)&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:l,x:c,y:a}}(e,n);else if("document"===t)o=function(e){const t=zn(e),n=Zn(e),o=e.ownerDocument.body,r=to(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=to(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Ao(e);const c=-n.scrollTop;return"rtl"===qn(o).direction&&(l+=to(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:c}}(zn(e));else if(Hn(t))o=function(e,t){const n=Bo(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Un(e)?So(e):ro(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=jo(e);o={...t,x:t.x-n.x,y:t.y-n.y}}return bo(o)}function To(e,t){const n=Gn(e);return!(n===t||!Hn(n)||Xn(n))&&("fixed"===qn(n).position||To(n,t))}function No(e,t,n){const o=Un(t),r=zn(t),i="fixed"===n,l=Bo(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const a=ro(0);if(o||!o&&!i)if(("body"!==Pn(t)||$n(r))&&(c=Zn(t)),o){const e=Bo(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else r&&(a.x=Ao(r));return{x:l.left+c.scrollLeft-a.x,y:l.top+c.scrollTop-a.y,width:l.width,height:l.height}}function Lo(e,t){return Un(e)&&"fixed"!==qn(e).position?t?t(e):e.offsetParent:null}function Po(e,t){const n=In(e);if(!Un(e)||Ro(e))return n;let o=Lo(e,t);for(;o&&Wn(o)&&"static"===qn(o).position;)o=Lo(o,t);return o&&("html"===Pn(o)||"body"===Pn(o)&&"static"===qn(o).position&&!Kn(o))?n:o||function(e){let t=Gn(e);for(;Un(t)&&!Xn(t);){if(Kn(t))return t;t=Gn(t)}return null}(e)||n}const Io={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,l=zn(o),c=!!t&&Ro(t.floating);if(o===l||c&&i)return n;let a={scrollLeft:0,scrollTop:0},s=ro(1);const d=ro(0),u=Un(o);if((u||!u&&!i)&&(("body"!==Pn(o)||$n(l))&&(a=Zn(o)),Un(o))){const e=Bo(o);s=So(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-a.scrollLeft*s.x+d.x,y:n.y*s.y-a.scrollTop*s.y+d.y}},getDocumentElement:zn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let o=Qn(e,[],!1).filter((e=>Hn(e)&&"body"!==Pn(e))),r=null;const i="fixed"===qn(e).position;let l=i?Gn(e):e;for(;Hn(l)&&!Xn(l);){const t=qn(l),n=Kn(l);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||$n(l)&&!n&&To(e,l))?o=o.filter((e=>e!==l)):r=t,l=Gn(l)}return t.set(e,o),o}(t,this._c):[].concat(n),o],l=i[0],c=i.reduce(((e,n)=>{const o=Mo(t,n,r);return e.top=to(o.top,e.top),e.right=eo(o.right,e.right),e.bottom=eo(o.bottom,e.bottom),e.left=to(o.left,e.left),e}),Mo(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Po,getElementRects:async function(e){const t=this.getOffsetParent||Po,n=this.getDimensions;return{reference:No(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Oo(e);return{width:t,height:n}},getScale:So,isElement:Hn,isRTL:function(e){return"rtl"===qn(e).direction}};function zo(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,s=Co(e),d=r||i?[...s?Qn(s):[],...Qn(t)]:[];d.forEach((e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const u=s&&c?function(e,t){let n,o=null;const r=zn(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function l(c,a){void 0===c&&(c=!1),void 0===a&&(a=1),i();const{left:s,top:d,width:u,height:f}=e.getBoundingClientRect();if(c||t(),!u||!f)return;const p={rootMargin:-oo(d)+"px "+-oo(r.clientWidth-(s+u))+"px "+-oo(r.clientHeight-(d+f))+"px "+-oo(s)+"px",threshold:to(0,eo(1,a))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==a){if(!h)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),100)}h=!1}try{o=new IntersectionObserver(g,{...p,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,p)}o.observe(e)}(!0),i}(s,n):null;let f,p=-1,h=null;l&&(h=new ResizeObserver((e=>{let[o]=e;o&&o.target===s&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),s&&!a&&h.observe(s),h.observe(t));let g=a?Bo(e):null;return a&&function t(){const o=Bo(e);!g||o.x===g.x&&o.y===g.y&&o.width===g.width&&o.height===g.height||n();g=o,f=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach((e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,a&&cancelAnimationFrame(f)}}const Fo=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...a}=ao(e,t),s={x:n,y:o},d=await xo(t,a),u=ho(so(r)),f=fo(u);let p=s[f],h=s[u];if(i){const e="y"===f?"bottom":"right";p=co(p+d["y"===f?"top":"left"],p,p-d[e])}if(l){const e="y"===u?"bottom":"right";h=co(h+d["y"===u?"top":"left"],h,h-d[e])}const g=c.fn({...t,[f]:p,[u]:h});return{...g,data:{x:g.x-n,y:g.y-o}}}}},Ho=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:c,platform:a,elements:s}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...v}=ao(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=so(r),m=so(c)===c,b=await(null==a.isRTL?void 0:a.isRTL(s.floating)),w=f||(m||!g?[yo(c)]:function(e){const t=yo(e);return[vo(e),t,vo(t)]}(c));f||"none"===h||w.push(...function(e,t,n,o){const r=uo(e);let i=function(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:l;default:return[]}}(so(e),"start"===n,o);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(vo)))),i}(c,g,h,b));const x=[c,...w],k=await xo(t,v),E=[];let O=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&E.push(k[y]),u){const e=function(e,t,n){void 0===n&&(n=!1);const o=uo(e),r=go(e),i=po(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=yo(l)),[l,yo(l)]}(r,l,b);E.push(k[e[0]],k[e[1]])}if(O=[...O,{placement:r,overflows:E}],!E.every((e=>e<=0))){var C,S;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let n=null==(S=O.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!n)switch(p){case"bestFit":{var D;const e=null==(D=O.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:D[0];e&&(n=e);break}case"initialPlacement":n=c}if(r!==n)return{reset:{placement:n}}}return{}}}},Uo=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:r,platform:i,strategy:l}=t,{padding:c=2,x:a,y:s}=ao(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]),u=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),n=[];let o=null;for(let e=0;e<t.length;e++){const r=t[e];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map((e=>bo(ko(e))))}(d),f=bo(ko(d)),p=mo(c);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=a&&null!=s)return u.find((e=>a>e.left-p.left&&a<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||f;if(u.length>=2){if("y"===ho(n)){const e=u[0],t=u[u.length-1],o="top"===so(n),r=e.top,i=t.bottom,l=o?e.left:t.left,c=o?e.right:t.right;return{top:r,bottom:i,left:l,right:c,width:c-l,height:i-r,x:l,y:r}}const e="left"===so(n),t=to(...u.map((e=>e.right))),o=eo(...u.map((e=>e.left))),r=u.filter((n=>e?n.left===o:n.right===t)),i=r[0].top,l=r[r.length-1].bottom;return{top:i,bottom:l,left:o,right:t,width:t-o,height:l-i,x:o,y:i}}return f}},floating:o.floating,strategy:l});return r.reference.x!==h.reference.x||r.reference.y!==h.reference.y||r.reference.width!==h.reference.width||r.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Vo=(e,t,n)=>{const o=new Map,r={platform:Io,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),a=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=wo(s,o,a),f=o,p={},h=0;for(let n=0;n<c.length;n++){const{name:i,fn:g}=c[n],{x:v,y:y,data:m,reset:b}=await g({x:d,y:u,initialPlacement:o,placement:f,strategy:r,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=y?y:u,p={...p,[i]:{...p[i],...m}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:d,y:u}=wo(s,f,a))),n=-1)}return{x:d,y:u,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var $o="undefined"!=typeof document?a:s;function Wo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!=o--;)if(!Wo(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!=o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!Wo(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ko(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yo(e,t){const n=Ko(e);return Math.round(t*n)/n}function Xo(e){const t=o.useRef(e);return $o((()=>{t.current=e})),t}
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
5
  */
6
- var qo=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Zo="undefined"==typeof Element,Go=Zo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Jo=!Zo&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Qo=function e(t,n){var o;void 0===n&&(n=!0);var r=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},er=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var l=i.shift();if(!Qo(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),a=e(c.length?c:l.children,!0,o);o.flatten?r.push.apply(r,a):r.push({scopeParent:l,candidates:a})}else{Go.call(l,qo)&&o.filter(l)&&(n||!t.includes(l))&&r.push(l);var s=l.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(l),d=!Qo(s,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(s&&d){var u=e(!0===s?l.children:s.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:l,candidates:u})}else i.unshift.apply(i,l.children)}}return r},tr=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},nr=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!tr(e)?0:e.tabIndex},or=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},rr=function(e){return"INPUT"===e.tagName},ir=function(e){return function(e){return rr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Jo(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!r||r===e}(e)},lr=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},cr=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=Go.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Go.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return lr(e)}else{if("function"==typeof o){for(var i=e;e;){var l=e.parentElement,c=Jo(e);if(l&&!l.shadowRoot&&!0===o(l))return lr(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,o,r,i=e&&Jo(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(l)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!c&&l;){var a,s,d;c=!(null===(s=l=null===(a=i=Jo(l))||void 0===a?void 0:a.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ar=function(e,t){return!(t.disabled||Qo(t)||function(e){return rr(e)&&"hidden"===e.type}(t)||cr(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var o=t.children.item(n);if("LEGEND"===o.tagName)return!!Go.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},sr=function(e,t){return!(ir(t)||nr(t)<0||!ar(e,t))},dr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ur=function e(t){var n=[],o=[];return t.forEach((function(t,r){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=nr(e);return n<0&&t&&!tr(e)?0:n}(l,i),a=i?e(t.candidates):l;0===c?i?n.push.apply(n,a):n.push(l):o.push({documentOrder:r,tabIndex:c,item:t,isScope:i,content:a})})),o.sort(or).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},fr=function(e,t){var n;return n=(t=t||{}).getShadowRoot?er([e],t.includeContainer,{filter:sr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dr}):function(e,t,n){if(Qo(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(qo));return t&&Go.call(e,qo)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,sr.bind(null,t)),ur(n)};const pr=o["useInsertionEffect".toString()]||(e=>e());var hr="undefined"!=typeof document?a:s;function gr(){return gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},gr.apply(this,arguments)}let vr=!1,yr=0;const mr=()=>"floating-ui-"+yr++;const br=o["useId".toString()]||function(){const[e,t]=o.useState((()=>vr?mr():void 0));return hr((()=>{null==e&&t(mr())}),[]),o.useEffect((()=>{vr||(vr=!0)}),[]),e};const wr=o.createContext(null),xr=o.createContext(null);function kr(e){return"data-floating-ui-"+e}function Er(e){const t=c(e);return hr((()=>{t.current=e})),t}const Or=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Cr(e,t){const n=fr(e,Or());"prev"===t&&n.reverse();const o=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}((null==(r=e)?void 0:r.ownerDocument)||document));var r;return n.slice(o+1)[0]}function Sr(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!function(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Vn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,o)}function Dr(e){fr(e,Or()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function jr(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Br={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function _r(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Rr=o.forwardRef((function(e,t){const[n,r]=o.useState();hr((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",_r),()=>{document.removeEventListener("keydown",_r)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[kr("focus-guard")]:"",style:Br};return o.createElement("span",gr({},e,i))})),Ar=o.createContext(null),Mr=kr("portal");function Tr(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const l=function(e){let{id:t,root:n}=void 0===e?{}:e;const[r,i]=o.useState(null),l=br(),c=Nr(),a=o.useRef(null);return hr((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{a.current=null}))}),[r]),hr((()=>{if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=l,n.setAttribute(Mr,""),e.appendChild(n),a.current=n,i(n)}),[t,l]),hr((()=>{if(a.current)return;let e=n||(null==c?void 0:c.portalNode);e&&!Hn(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const r=document.createElement("div");r.id=l,r.setAttribute(Mr,""),e=o||e,e.appendChild(r),a.current=r,i(r)}),[t,n,l,c]),r}({id:n,root:r}),[c,a]=o.useState(null),s=o.useRef(null),d=o.useRef(null),u=o.useRef(null),f=o.useRef(null),p=!!c&&!c.modal&&c.open&&i&&!(!r&&!l);return o.useEffect((()=>{if(l&&i&&(null==c||!c.modal))return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&Sr(e)){("focusin"===e.type?jr:Dr)(l)}}}),[l,i,null==c?void 0:c.modal]),o.createElement(Ar.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:l,setFocusManagerState:a})),[i,l])},p&&l&&o.createElement(Rr,{"data-type":"outside",ref:s,onFocus:e=>{if(Sr(e,l)){var t;null==(t=u.current)||t.focus()}else{const e=Cr(document.body,"prev")||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),p&&l&&o.createElement("span",{"aria-owns":l.id,style:Br}),l&&b(t,l),p&&l&&o.createElement(Rr,{"data-type":"outside",ref:d,onFocus:e=>{if(Sr(e,l)){var t;null==(t=f.current)||t.focus()}else{const t=Cr(document.body,"next")||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent))}}}))}const Nr=()=>o.useContext(Ar),Lr=new Set,Pr=o.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;const i=br();return hr((()=>{if(!n)return;Lr.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,c=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[o]=r+"px"),e){var a,s;const e=(null==(a=window.visualViewport)?void 0:a.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(c-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{Lr.delete(i),0===Lr.size&&(Object.assign(t,{overflow:"",[o]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,c)))}}),[i,n]),o.createElement("div",gr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Ir(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e,[l,c]=o.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||l,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:l,floating:c}={},transform:a=!0,whileElementsMounted:s,open:d}=e,[u,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=o.useState(r);Wo(p,r)||h(r);const[g,v]=o.useState(null),[m,b]=o.useState(null),w=o.useCallback((e=>{e!==O.current&&(O.current=e,v(e))}),[]),x=o.useCallback((e=>{e!==C.current&&(C.current=e,b(e))}),[]),k=l||g,E=c||m,O=o.useRef(null),C=o.useRef(null),S=o.useRef(u),D=null!=s,j=Xo(s),B=Xo(i),_=o.useCallback((()=>{if(!O.current||!C.current)return;const e={placement:t,strategy:n,middleware:p};B.current&&(e.platform=B.current),Vo(O.current,C.current,e).then((e=>{const t={...e,isPositioned:!0};R.current&&!Wo(S.current,t)&&(S.current=t,y.flushSync((()=>{f(t)})))}))}),[p,t,n,B]);$o((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const R=o.useRef(!1);$o((()=>(R.current=!0,()=>{R.current=!1})),[]),$o((()=>{if(k&&(O.current=k),E&&(C.current=E),k&&E){if(j.current)return j.current(k,E,_);_()}}),[k,E,_,j,D]);const A=o.useMemo((()=>({reference:O,floating:C,setReference:w,setFloating:x})),[w,x]),M=o.useMemo((()=>({reference:k,floating:E})),[k,E]),T=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!M.floating)return e;const t=Yo(M.floating,u.x),o=Yo(M.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+o+"px)",...Ko(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}}),[n,a,M.floating,u.x,u.y]);return o.useMemo((()=>({...u,update:_,refs:A,elements:M,floatingStyles:T})),[u,_,A,M,T])}(e),d=o.useContext(xr),u=null!=((null==(f=o.useContext(wr))?void 0:f.id)||null);var f;const p=function(e){const t=o.useRef((()=>{}));return pr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(g.current.openEvent=t),v.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),h=o.useRef(null),g=o.useRef({}),v=o.useState((()=>function(){const e=new Map;return{emit(t,n){var o;null==(o=e.get(t))||o.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,(null==(o=e.get(t))?void 0:o.filter((e=>e!==n)))||[])}}}()))[0],m=br(),b=o.useCallback((e=>{const t=Hn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=o.useCallback((e=>{(Hn(e)||null===e)&&(h.current=e,c(e)),(Hn(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Hn(e))&&s.refs.setReference(e)}),[s.refs]),x=o.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=o.useMemo((()=>({...s.elements,domReference:a})),[s.elements,a]),E=o.useMemo((()=>({...s,refs:x,elements:k,dataRef:g,nodeId:i,floatingId:m,events:v,open:n,onOpenChange:p})),[s,i,m,v,n,p,x,k]);return hr((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=E)})),o.useMemo((()=>({...s,context:E,refs:x,elements:k})),[s,x,k,E])}const zr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Fr(e,t){return"function"==typeof e?e(t):e}function Hr(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,l=("number"==typeof i?i:i.close)||0,[c,a]=o.useState(!1),[s,d]=o.useState("unmounted"),u=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,l);return hr((()=>{c&&!u&&d("unmounted")}),[c,u]),hr((()=>{if(r){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}a(!0),d("close")}}),[n,r]),{isMounted:u,status:s}}function Ur(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:l,duration:c=250}=t,a=e.placement,s=a.split("-")[0],d=o.useMemo((()=>({side:s,placement:a})),[s,a]),u="number"==typeof c,f=(u?c:c.open)||0,p=(u?c:c.close)||0,[h,g]=o.useState((()=>({...Fr(l,d),...Fr(n,d)}))),{isMounted:v,status:y}=Hr(e,{duration:c}),m=Er(n),b=Er(r),w=Er(i),x=Er(l);return hr((()=>{const e=Fr(m.current,d),t=Fr(w.current,d),n=Fr(x.current,d),o=Fr(b.current,d)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&g({transitionProperty:Object.keys(o).map(zr).join(","),transitionDuration:f+"ms",...n,...o}),"close"===y){const o=t||e;g({transitionProperty:Object.keys(o).map(zr).join(","),transitionDuration:p+"ms",...n,...o})}}),[p,w,m,b,x,f,y,d]),{isMounted:v,styles:h}}var Vr;function $r(){return $r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},$r.apply(this,arguments)}var Wr=function(e){return o.createElement("svg",$r({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Vr||(Vr=o.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Kr(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}var Yr=["color"],Xr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Kr(e,Yr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),v("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),qr=["color"],Zr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Kr(e,qr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),v("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Gr=["color"],Jr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Kr(e,Gr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),v("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Qr=["color"],ei=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Kr(e,Qr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),v("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),ti=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],o=0;o<e.rangeCount;o++)n.push(e.getRangeAt(o));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},ni={"text/plain":"Text","text/html":"Url",default:"Text"};var oi=function(e,t){var n,o,r,i,l,c,a=!1;t||(t={}),n=t.debug||!1;try{if(r=ti(),i=document.createRange(),l=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(o){if(o.stopPropagation(),t.format)if(o.preventDefault(),void 0===o.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=ni[t.format]||ni.default;window.clipboardData.setData(r,e)}else o.clipboardData.clearData(),o.clipboardData.setData(t.format,e);t.onCopy&&(o.preventDefault(),t.onCopy(o.clipboardData))})),document.body.appendChild(c),i.selectNodeContents(c),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");a=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),a=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),c&&document.body.removeChild(c),r()}return a};function ri(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ii(e){if(!e)return;const t=ri(e);return t?e[t]:void 0}function li(e,t,n){var o;return(null===(o=e.children)||void 0===o?void 0:o.map((e=>{const o=t[e];if(!o)throw new Error(`Element definition for ${e} not found`);return J({id:G(),type:e,props:o.props,children:o.children&&o.children.length>0?li(o,t,n):[{text:(null==n?void 0:n[e])||""}]})})))||[]}function ci(e,t,n){const o=e.blocks[t].elements,r=ri(o);if(!r)throw new Error(`Root element type not found for block type ${t}`);const i=o[r];return{id:G(),type:r,props:i.props,children:i.children&&i.children.length>0?li(i,o,n):[{text:""}]}}const ai=i(void 0),si=({children:o,tools:r})=>{const i=$(),l=d((()=>r?Object.keys(r).reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t]:null===(n=r[t])||void 0===n?void 0:n.render})}),{}):{}),[r]),c=d((()=>!r||i?null:Object.keys(r).map((t=>{var n,o,i;const l=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.tool,c=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.render,a=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return l?e(l,Object.assign({render:c},a),t):null}))),[r]);return e(ai.Provider,Object.assign({value:l},{children:t(n,{children:[c,o]})}))},di=()=>{const e=l(ai);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e};function ui({editor:e,view:t,onClose:n,mode:o="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===o&&(t=t.filter((t=>function(e,t){var n;const o=e.blocks[t];if(!o)return!1;const r=ii(o.elements);return"void"!==(null===(n=null==r?void 0:r.props)||void 0===n?void 0:n.nodeType)}(e,t)))),t.map((t=>{var n,o,r,i,l,c;return{type:t,title:(null===(o=null===(n=e.blocks[t].options)||void 0===n?void 0:n.display)||void 0===o?void 0:o.title)||t,description:null===(i=null===(r=e.blocks[t].options)||void 0===r?void 0:r.display)||void 0===i?void 0:i.description,icon:null===(c=null===(l=e.blocks[t].options)||void 0===l?void 0:l.display)||void 0===c?void 0:c.icon}}))})(),onClose:n,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===o&&e.blocks[t].toggle({focus:!0}),"create"===o&&e.blocks[t].create({deleteText:!0,focus:!0}),n()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}function fi(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;const pi=t=>{var{className:n,children:o,lockScroll:r=!0}=t,i=fi(t,["className","children","lockScroll"]);return e(Pr,Object.assign({lockScroll:r,className:n},i,{onClick:e=>{var t;e.stopPropagation(),null===(t=i.onClick)||void 0===t||t.call(i,e)},onMouseDown:e=>{var t;e.stopPropagation(),null===(t=i.onMouseDown)||void 0===t||t.call(i,e)}},{children:o}))},hi=t=>{const[n,o]=f(!1),r=c(null),i=H();return s((()=>{o(!0);const e=i.refElement;if(!e)return;return e.querySelector(".yoopta-overlays")||(r.current=document.createElement("div"),r.current.className="yoopta-overlays",e.appendChild(r.current)),()=>{r.current&&r.current.remove()}}),[]),n?e(Tr,Object.assign({id:`${t.id}-${i.id}`,root:r.current||i.refElement},{children:t.children})):null},gi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-group"},{children:t})),vi=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoopta-block-options-menu-content data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),yi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-item"},{children:t})),mi=({isOpen:n,onClose:o,refs:r,style:i,children:l})=>{var c,a,s;const d=H(),u=di(),[p,h]=f(!1),{refs:g,floatingStyles:v,context:y}=Ir({placement:"right",open:p,onOpenChange:h,middleware:[Uo(),Ho(),Fo(),Eo(10)],whileElementsMounted:zo}),{isMounted:m,styles:b}=Ur(y,{duration:100});if(!n)return null;const w=P(d,{at:d.selection}),x=ii(null===(c=d.blocks[(null==w?void 0:w.type)||""])||void 0===c?void 0:c.elements),k="void"===(null===(a=null==x?void 0:x.props)||void 0===a?void 0:a.nodeType),E=u.ActionMenu,O=Object.assign(Object.assign({},v),b),C=ui({editor:d,view:"small",onClose:()=>{h(!1),o()}});return e(hi,Object.assign({id:"yoo-block-options-portal"},{children:e(pi,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:o},{children:e("div",Object.assign({style:i,ref:r.setFloating},{children:t(vi,{children:[t(gi,{children:[e(yi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=d.selection;d.deleteBlock({at:e}),d.setBlockSelected(null),d.setSelection(null),o()}},{children:[e(ei,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(yi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{d.duplicateBlock({at:d.selection,focus:!0}),d.setBlockSelected(null),o()}},{children:[e(Xr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!E&&!k&&!(null===(s=d.blocks[(null==w?void 0:w.type)||""])||void 0===s?void 0:s.hasCustomEditor)&&t(yi,{children:[m&&e(hi,Object.assign({id:"yoo-block-options-portal"},{children:e(pi,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>h(!1)},{children:e("div",Object.assign({style:O,ref:g.setFloating},{children:e(E,Object.assign({},C))}))}))})),t("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:g.setReference,onClick:()=>h((e=>!e))},{children:[e(Wr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(yi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=P(d);e&&(oi(`${window.location.origin}${window.location.pathname}#${e.id}`),d.emit("block:copy",e)),o()}},{children:[e(Jr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),l]})}))}))}))};var bi=Object.freeze({__proto__:null,BlockOptions:mi,BlockOptionsMenuContent:vi,BlockOptionsMenuGroup:gi,BlockOptionsMenuItem:yi,BlockOptionsSeparator:({className:t=""})=>e("div",{className:`yoopta-block-options-separator ${t}`})});const wi=({block:n,editor:o,dragHandleProps:r,onChangeActiveBlock:i,showActions:l})=>{const[c,a]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:g,actionMenuRenderProps:v,ActionMenu:y}=(({editor:e})=>{const t=di().ActionMenu,[n,o]=f(!1),{refs:r,floatingStyles:i,context:l}=Ir({placement:"bottom-start",open:n,onOpenChange:o,middleware:[Uo(),Ho(),Fo(),Eo(10)],whileElementsMounted:zo}),{isMounted:c,styles:a}=Ur(l,{duration:100}),s=Object.assign(Object.assign({},i),a),d=e=>o(e),u=()=>d(!1),p=ui({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:c,actionMenuStyles:s,actionMenuRefs:r,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:o}),{refs:m,floatingStyles:b,context:x}=Ir({placement:"right-start",open:c,onOpenChange:a,middleware:[Uo(),Ho(),Fo(),Eo()]}),{isMounted:k,styles:E}=Ur(x,{duration:100}),{setActivatorNodeRef:O,attributes:C,listeners:j}=r,B=Object.assign(Object.assign({},b),E);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":l,className:"yoopta-block-actions"},{children:[s&&u&&e(hi,Object.assign({id:"yoo-block-options-portal"},{children:e(pi,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:g},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(y,Object.assign({},v))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=Ln(o,{at:[n.meta.order]}),r=o.blocks[n.type];if(!t)return;const i=document.querySelector(`[data-yoopta-block-id="${n.id}"]`),l=ii(r.elements);let c;r.hasCustomEditor||(c=S.string(t,[0]));const a="string"==typeof c&&0===c.trim().length;if(u&&a&&"void"!==(null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.nodeType))o.setSelection([n.meta.order]),o.focusBlock(n.id),d.setReference(i),h(!0);else{const e=Q({id:G()}),t=[n.meta.order+1];o.setSelection([n.meta.order]),o.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{i&&d.setReference(i.nextSibling),h(!0)}),0)}},className:"yoopta-block-actions-plus"},{children:e(Nn,{})})),e("button",Object.assign({type:"button",className:"yoopta-block-actions-drag",ref:e=>{O(e),m.setReference(e)}},C,j,{onClick:e=>{e.stopPropagation(),i(n.id);const t=Ln(o,{at:[n.meta.order]});o.focusBlock(n.id),t&&setTimeout((()=>{o.blocks[n.type].hasCustomEditor||(w.blur(t),w.deselect(t),D.deselect(t)),o.setBlockSelected([n.meta.order],{only:!0}),o.setSelection([n.meta.order]),a(!0)}),10)}},{children:e(Mn,{})})),e(mi,{isOpen:k,refs:m,style:B,onClose:()=>a(!1)})]}))},xi=({children:n,block:o,blockId:r})=>{var i;const l=H(),[c,a]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:g,isOver:v,isDragging:y}=Cn({id:r,disabled:l.readOnly}),m=`yoopta-block yoopta-align-${o.meta.align||"left"}`,b={marginLeft:20*o.meta.depth+"px",transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:y?.7:1},w=null===(i=l.selectedBlocks)||void 0===i?void 0:i.includes(o.meta.order),x=c===r,k={borderBottom:v&&!y?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:m,onMouseEnter:()=>{l.readOnly||a(r)},onMouseLeave:()=>{l.readOnly||a(null)},style:b,"data-hovered-block":x,"data-yoopta-block":!0,"data-yoopta-block-id":r,"data-yoopta-block-type":o.type},{children:[!l.readOnly&&e(wi,{block:o,editor:l,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:x,onChangeActiveBlock:e=>a(e)}),e("div",Object.assign({style:k},{children:n})),w&&!l.readOnly&&e("div",{className:"yoopta-selection-block"})]}))};var ki={};Object.defineProperty(ki,"__esModule",{value:!0});for(var Ei="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Oi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Ci={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Ei?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Si={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Di=1;Di<20;Di++)Si["f"+Di]=111+Di;function ji(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var o=e.map((function(e){return Bi(e,t)})),r=function(e){return o.some((function(t){return _i(t,e)}))};return null==n?r:r(n)}function Bi(e,t){var n=t&&t.byKey,o={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var l in Oi)o[Oi[l]]=!1;var c=!0,a=!1,s=void 0;try{for(var d,u=r[Symbol.iterator]();!(c=(d=u.next()).done);c=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Ai(f),g=Oi[h];if(f.length>1&&!g&&!Ci[f]&&!Si[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?o.key=h:o.which=Ri(f)),g&&(o[g]=!p||null)}}catch(e){a=!0,s=e}finally{try{!c&&u.return&&u.return()}finally{if(a)throw s}}return o}function _i(e,t){for(var n in e){var o=e[n],r=void 0;if(null!=o&&((null!=(r="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===o&&93===t.which?91:t.which:t[n])||!1!==o)&&r!==o))return!1}return!0}function Ri(e){return e=Ai(e),Si[e]||e.toUpperCase().charCodeAt(0)}function Ai(e){return e=e.toLowerCase(),e=Ci[e]||e}ki.default=ji,ki.isHotkey=ji,ki.isCodeHotkey=function(e,t){return ji(e,t)};var Mi=ki.isKeyHotkey=function(e,t){return ji(e,{byKey:!0},t)};ki.parseHotkey=Bi,ki.compareHotkey=_i,ki.toKeyCode=Ri,ki.toKeyName=Ai;const Ti={bold:"mod+b",italic:"mod+i",compose:["down","left","right","up","backspace","enter"],arrowLeft:"left",arrowUp:"up",arrowDown:"down",arrowRight:"right",ctrlLeft:"ctrl+left",escape:"esc",ctrlRight:"ctrl+right",deleteBackward:"shift?+backspace",backspace:"backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",shiftEnter:"shift+enter",enter:"enter",space:"space",undo:"mod+z",select:"mod+a",shiftTab:"shift+tab",shiftArrowUp:"shift+up",shiftArrowDown:"shift+down",tab:"tab",cmd:"mod",cmdEnter:"mod+enter",slashCommand:"/",copy:"mod+c",cut:"mod+x"},Ni={moveLineBackward:"opt+up",moveLineForward:"opt+down",ctrlLeft:"opt+left",ctrlRight:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Li={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Pi=e=>{const t=Ti[e],n=Ni[e],o=Li[e],r=t&&Mi(t),i=n&&Mi(n),l=o&&Mi(o);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!l||!l(e)))},Ii={isBold:Pi("bold"),isCompose:Pi("compose"),isArrowLeft:Pi("arrowLeft"),isArrowRight:Pi("arrowRight"),isArrowUp:Pi("arrowUp"),isArrowDown:Pi("arrowDown"),isDeleteBackward:Pi("deleteBackward"),isDeleteForward:Pi("deleteForward"),isDeleteLineBackward:Pi("deleteLineBackward"),isDeleteLineForward:Pi("deleteLineForward"),isDeleteWordBackward:Pi("deleteWordBackward"),isDeleteWordForward:Pi("deleteWordForward"),isExtendBackward:Pi("extendBackward"),isExtendForward:Pi("extendForward"),isExtendLineBackward:Pi("extendLineBackward"),isExtendLineForward:Pi("extendLineForward"),isItalic:Pi("italic"),isMoveLineBackward:Pi("moveLineBackward"),isMoveLineForward:Pi("moveLineForward"),isCtrlLeft:Pi("ctrlLeft"),isCtrlRight:Pi("ctrlRight"),isRedo:Pi("redo"),isShiftEnter:Pi("shiftEnter"),isEnter:Pi("enter"),isTransposeCharacter:Pi("transposeCharacter"),isUndo:Pi("undo"),isSpace:Pi("space"),isSelect:Pi("select"),isTab:Pi("tab"),isShiftTab:Pi("shiftTab"),isBackspace:Pi("backspace"),isCmdEnter:Pi("cmdEnter"),isCmd:Pi("cmd"),isEscape:Pi("escape"),isSlashCommand:Pi("slashCommand"),isShiftArrowUp:Pi("shiftArrowUp"),isShiftArrowDown:Pi("shiftArrowDown"),isCopy:Pi("copy"),isCut:Pi("cut")};const zi={onKeyDown:function(e){return t=>{const n=Ln(e,{at:e.selection});if(!n||!n.selection)return;const o=j.parent(n.selection.anchor.path);if(Ii.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(Ii.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=S.isStart(n,n.selection.anchor,o),i=S.isEnd(n,n.selection.anchor,o);if(!r&&!i)return void e.splitBlock({slate:n,focus:!0});const l=Q({id:G()}),c=e.selection?[e.selection[0]+1]:[0];e.insertBlock(l,{at:c,slate:n,focus:!0})}else if(Ii.isBackspace(t)){if(t.isDefaultPrevented())return;const o=j.parent(n.selection.anchor.path);if(S.isStart(n,n.selection.anchor,o)){t.preventDefault();const r=S.string(n,o),i=e.selection?e.selection[0]-1:0,l=Ln(e,{at:[i]}),c=P(e,{at:[i]}),a=e.blocks[(null==c?void 0:c.type)||""];let s;if(l&&!a.hasCustomEditor&&(s=function(e,t){try{const[,n]=S.last(e,t);return{path:n,offset:S.string(e,n).length}}catch(e){return{path:[0,0],offset:0}}}(l,o)),0===r.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:s});{if(B.isExpanded(n.selection))return D.delete(n,{at:n.selection});const t=e.selection?e.selection[0]-1:0,o=P(e,{at:[t]}),r=e.blocks[(null==o?void 0:o.type)||""];if(r&&r.hasCustomEditor)return;if(!l)return;if(0===S.string(l,[0,0]).length)return e.deleteBlock({at:[t],focus:!0,focusAt:s});const i=Array.from(S.nodes(n,{at:[0],match:e=>!S.isEditor(e)&&(_.isText(e)||S.isInline(n,e)),mode:"highest"})).map((([e])=>e));return D.insertNodes(l,i,{at:S.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:s})}}}else{if(Ii.isSelect(t)){if(t.isDefaultPrevented())return;const[,o]=S.first(n,[0]),[,r]=S.last(n,[n.children.length-1]),i=S.range(n,o,r),l=B.equals(n.selection,i),c=0===S.string(n,i).trim().length;if(B.isExpanded(n.selection)&&l||c)return t.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(Ii.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Ii.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Ii.isArrowUp(t)){if(t.isDefaultPrevented())return;if(1===new Set(n.selection.anchor.path).size){const n=e.selection?[e.selection[0]-1]:null,o=Ln(e,{at:n}),r=P(e,{at:n});if(o&&r){const[,n]=S.last(o,[0]),i={path:n,offset:S.string(o,n).length};return t.preventDefault(),void e.focusBlock(r.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Ii.isArrowDown(t)){if(t.isDefaultPrevented())return;const o=j.parent(n.selection.anchor.path);if(S.isEnd(n,n.selection.anchor,o)){const n=e.selection?[e.selection[0]+1]:null,r=Ln(e,{at:n}),i=P(e,{at:n});if(r&&i){const n=function(e,t){try{const[,n]=S.first(e,t);return{path:n,offset:0}}catch(e){return{path:[0,0],offset:0}}}(r,o);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(B.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Mi(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Fi=({children:t,attributes:n,placeholder:o})=>{const r=x(),i=Object.assign({},n);return r&&o&&(i["data-placeholder"]=o,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Hi(e){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)}const Ui=(e,t)=>{(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&R.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{D.unwrapNodes(e,{match:e=>!S.isEditor(e)&&R.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,o=n&&B.isCollapsed(n),r={type:"link",children:o?[{text:t}]:[],props:{url:t,target:"_self",rel:"noopener noreferrer"}};o?D.insertNodes(e,r):(D.wrapNodes(e,r,{split:!0}),D.collapse(e,{edge:"end"}))},Vi=new WeakMap;function $i(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Wi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"italic"}},Ki=["left","center","right",void 0];function Yi(e,t,n,o){var r,i;let l;if(t.parse){l=t.parse(n,e);if(R.isElement(l)&&"inline"===(null===(r=l.props)||void 0===r?void 0:r.nodeType))return l}const c=e.blocks[t.type],a=ri(c.elements)||"",s=c.elements[a],d="void"===(null===(i=s.props)||void 0===i?void 0:i.nodeType);let u={id:G(),type:a,children:d&&!c.hasCustomEditor?[{text:""}]:o.map(qi),props:Object.assign({nodeType:"block"},s.props)};if(l)if(R.isElement(l))u=l;else if(Array.isArray(l)){return l}if(0===u.children.length&&(u.children=[{text:""}]),!l&&t.parse)return;const f=n.getAttribute("data-meta-align"),p=parseInt(n.getAttribute("data-meta-depth")||"0",10);return Q({id:G(),type:t.type,value:[u],meta:{order:0,depth:p,align:Ki.includes(f)?f:void 0}})}function Xi(e,t,n){var o,r;if(3===n.nodeType){return null===(o=n.textContent)||void 0===o?void 0:o.replace(/[\t\n\r\f\v]+/g," ")}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return"\n";const i=n;let l=Array.from(i.childNodes).map((n=>Xi(e,t,n))).flat();if(Wi[n.nodeName]){return{[Wi[n.nodeName].type]:!0,text:null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}const c=t[n.nodeName];if(c){if(Array.isArray(c)){return c.map((t=>Yi(e,t,n,l))).filter(Boolean)}return Yi(e,c,n,l)}return l}function qi(e){if("string"==typeof e)return{text:e};if(R.isElement(e))return e;if(Array.isArray(e))return{text:e[0]};if(null==e?void 0:e.text)return e;if($i(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}function Zi(e,t){console.log("pasted html",t);const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const o=e.plugins[n],{parsers:r}=o;if(r){const{html:e}=r;if(e){const{deserialize:o}=e;if(o){const{nodeNames:e}=o;e&&e.forEach((e=>{const r=t[e];if(r){const i=Array.isArray(r)?r:[r];t[e]=[...i,{type:n,parse:o.parse}]}else t[e]={type:n,parse:o.parse}}))}}}})),t}(e);return Xi(e,n,t).filter($i)}const Gi=({id:t,customEditor:n,elements:o,marks:r,events:i,options:l,placeholder:a="Type '/' for commands"})=>{var s,f,p;const h=H(),g=U(t),v=c(g.value).current,y=d((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(o)),[o]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(r)),[r]),b=d((()=>{let e=h.blockEditorsMap[t];const{normalizeNode:n}=e,r=Object.keys(o);return r.forEach((t=>{var n;const r=null===(n=o[t].props)||void 0===n?void 0:n.nodeType,i="inline"===r,l="void"===r,c="inlineVoid"===r;c&&(e.markableVoid=e=>e.type===t),(l||c)&&(e.isVoid=e=>e.type===t),(i||c)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&Hi(t)?Ui(e,t):n(t)},e.insertData=n=>{const o=n.getData("text/plain");o&&Hi(o)?Ui(e,o):t(n)},e})(e))})),e.normalizeNode=t=>{const[o,i]=t,l=h.blocks[g.type].elements;if(Object.keys(l).length>1)return n(t);if(R.isElement(o)){const{type:t}=o,n=ri(l);if(!r.includes(t))return void D.setNodes(e,{type:n,props:Object.assign({},o.props)},{at:i});if(o.type===n)for(const[t,n]of A.children(e,i))if(R.isElement(t)&&!e.isInline(t))return void D.unwrapNodes(e,{at:n})}n(t)},e}),[o,t]),x=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Ii,currentBlock:g,defaultBlock:Q({id:G()})},t={};return Object.keys(i).forEach((n=>{t[n]=function(t){if(i[n]){i[n](h,b,e)(t)}}})),t}),[i,h,g]),k=u((e=>h.updateBlock(t,{value:e})),[t]),E=u((n=>{const o=y[n.element.type],{attributes:r}=n,i=fi(n,["attributes"]);let c;r["data-element-type"]=i.element.type;try{c=w.findPath(b,n.element)}catch(e){c=[]}return o?e(o,Object.assign({},i,{path:c,attributes:r,blockId:t,HTMLAttributes:null==l?void 0:l.HTMLAttributes})):e(O,Object.assign({},i,{attributes:r}))}),[o,b.children]),C=u((t=>{var n,o,r,i,l;let{children:c,leaf:s,attributes:d}=t;const u=fi(s,["text"]),f=(null===(n=h.selection)||void 0===n?void 0:n[0])===g.meta.order;u&&Object.keys(u).forEach((e=>{const t=m[e];t&&(c=t.render({children:c,leaf:s}))}));const p=!("void"===(null===(l=null===(i=null===(r=null===(o=t.children)||void 0===o?void 0:o.props)||void 0===r?void 0:r.parent)||void 0===i?void 0:i.props)||void 0===l?void 0:l.nodeType))&&f&&s.withPlaceholder;return e(Fi,Object.assign({attributes:d,placeholder:p?a:void 0},{children:c}))}),[r]),j=u((e=>{var t;h.readOnly||(null===(t=x.onKeyDown)||void 0===t||t.call(x,e),zi.onKeyDown(h)(e))}),[x.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],g.meta.order]),_=u((e=>{var t;h.readOnly||null===(t=null==x?void 0:x.onKeyUp)||void 0===t||t.call(x,e)}),[x.onKeyUp,h.readOnly]),M=u((e=>{var t,n;h.readOnly||((null===(t=h.selection)||void 0===t?void 0:t[0])!==g.meta.order&&h.setSelection([g.meta.order]),null===(n=null==x?void 0:x.onMouseDown)||void 0===n||n.call(x,e))}),[x.onMouseDown,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],g.meta.order]),T=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==x?void 0:x.onBlur)||void 0===t||t.call(x,e))}),[x.onBlur,h.readOnly]),N=u((e=>{var t;h.readOnly||(h.isFocused()||(Vi.set(h,!0),h.emit("focus",!0)),null===(t=null==x?void 0:x.onFocus)||void 0===t||t.call(x,e))}),[x.onFocus,h.readOnly]),L=u((e=>{var t;if(h.readOnly)return;null===(t=null==x?void 0:x.onPaste)||void 0===t||t.call(x,e);const n=e.clipboardData.getData("text/html"),o=(new DOMParser).parseFromString(n,"text/html");if(o.body.childNodes.length>0){const t=Zi(h,o.body);if(t.length>0)return e.preventDefault(),void h.insertBlocks(t,{at:h.selection,focus:!0})}}),[x.onPaste,h.readOnly]),P=u((e=>{var t;const n=[];if(h.readOnly)return n;const[o,r]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===g.meta.order;return b.selection&&i&&!S.isEditor(o)&&""===S.string(b,[r[0]])&&B.includes(b.selection,r)&&B.isCollapsed(b.selection)&&n.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),n}),[h.readOnly,null===(p=h.selection)||void 0===p?void 0:p[0],g.meta.order]);return e(Ji,{id:t,slate:b,initialValue:v,onChange:k,decorate:P,renderLeaf:C,renderElement:E,eventHandlers:x,onKeyDown:j,onKeyUp:_,onFocus:N,onMouseDown:M,onBlur:T,customEditor:n,readOnly:h.readOnly,onPaste:L})},Ji=p((({id:t,slate:n,initialValue:o,onChange:r,renderLeaf:i,renderElement:l,eventHandlers:c,onKeyDown:a,onKeyUp:s,onFocus:d,onMouseDown:u,onBlur:f,onPaste:p,customEditor:h,decorate:g,readOnly:v})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:n,initialValue:o,onChange:r},{children:e(E,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:l,renderLeaf:i,className:"yoopta-slate",spellCheck:!0},c,{onKeyDown:a,onKeyUp:s,onFocus:d,onMouseDown:u,decorate:g,onBlur:f,readOnly:v,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));Ji.displayName="SlateEditorInstance";const Qi=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Me(Ot,{activationConstraint:{distance:20}}),Me(bt,{coordinateGetter:jn})),handleDragEnd:u((t=>{const{active:n,over:o}=t;if(n&&o&&n.id!==o.id){const t=e.children[o.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),el=[],tl=({editor:t,marks:o,placeholder:r})=>{const i=$(),{sensors:l,handleDragEnd:c,handleDragStart:a}=Qi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?el:s.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[s]),f=[];for(let n=0;n<u.length;n++){const i=u[n],l=t.children[i],c=t.plugins[l.type];l&&c?f.push(e(xi,Object.assign({block:l,blockId:i},{children:e(Gi,{type:l.type,id:i,marks:o,customEditor:c.customEditor,events:c.events,elements:c.elements,options:c.options,placeholder:r},i)}),i)):console.error(`Plugin ${l.type} not found`)}return i?e(n,{children:f}):e(nn,Object.assign({sensors:l,collisionDetection:He,onDragStart:a,onDragEnd:c},{children:e(mn,Object.assign({disabled:i,items:u,strategy:gn},{children:f}))}))},nl=({editor:e,root:t})=>{const[n,o]=f({origin:[0,0],coords:[0,0],selection:!1}),r=r=>{var i;if(e.readOnly||!1===t)return;const l=null===(i=e.refElement)||void 0===i?void 0:i.contains(r.target);if(!l&&!n.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();l||o({origin:[r.pageX,r.pageY-window.pageYOffset],coords:[r.pageX,r.pageY-window.pageYOffset],selection:!0})},i=r=>{if(!n.selection||e.readOnly||!1===t)return;o((e=>Object.assign(Object.assign({},e),{coords:[r.pageX,r.pageY-window.pageYOffset]})));const i=((e,t,n)=>{var o;const r=[],i=null===(o=e.refElement)||void 0===o?void 0:o.querySelectorAll("[data-yoopta-block]");return i?(i.forEach(((e,o)=>{if(!e)return;const i=e.getBoundingClientRect(),l=Math.min(t[1],n[1]),c=Math.min(t[0],n[0]),a=Math.max(t[1],n[1]),s=Math.max(t[0],n[0]);l<i.bottom&&a>i.top&&c<i.right&&s>i.left&&r.push(o)})),r):r})(e,n.origin,[r.pageX,r.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},l=()=>{e.readOnly||c()};s((()=>{var n;if(e.readOnly||!1===t)return;const o=t&&"current"in t?t.current:t||document;if(!o)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in o))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(n=e.refElement)||void 0===n?void 0:n.contains(o))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return o.addEventListener("mousedown",r),o.addEventListener("mousemove",i),o.addEventListener("mouseup",l),()=>{o.removeEventListener("mousedown",r),o.removeEventListener("mousemove",i),o.removeEventListener("mouseup",l)}}),[e.selectedBlocks,n,t,e.readOnly]);const c=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},n),{onClose:c})},ol=({origin:t,coords:n,isOpen:o})=>{if(!o)return null;const r={zIndex:10,left:t[0],top:t[1],height:Math.abs(n[1]-t[1]-1),width:Math.abs(n[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>n[1]&&t[0]>n[0]?"scaleY(-1) scaleX(-1)":t[1]>n[1]?"scaleY(-1)":t[0]>n[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:r})};var rl=Symbol.for("immer-nothing"),il=Symbol.for("immer-draftable"),ll=Symbol.for("immer-state");function cl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var al=Object.getPrototypeOf;function sl(e){return!!e&&!!e[ll]}function dl(e){return!!e&&(fl(e)||Array.isArray(e)||!!e[il]||!!e.constructor?.[il]||yl(e)||ml(e))}var ul=Object.prototype.constructor.toString();function fl(e){if(!e||"object"!=typeof e)return!1;const t=al(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ul}function pl(e,t){0===hl(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,o)=>t(o,n,e)))}function hl(e){const t=e[ll];return t?t.type_:Array.isArray(e)?1:yl(e)?2:ml(e)?3:0}function gl(e,t){return 2===hl(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vl(e,t,n){const o=hl(e);2===o?e.set(t,n):3===o?e.add(n):e[t]=n}function yl(e){return e instanceof Map}function ml(e){return e instanceof Set}function bl(e){return e.copy_||e.base_}function wl(e,t){if(yl(e))return new Map(e);if(ml(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&fl(e)){if(!al(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[ll];let o=Reflect.ownKeys(n);for(let t=0;t<o.length;t++){const r=o[t],i=n[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(al(e),n)}function xl(e,t=!1){return El(e)||sl(e)||!dl(e)||(hl(e)>1&&(e.set=e.add=e.clear=e.delete=kl),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>xl(t,!0)))),e}function kl(){cl(2)}function El(e){return Object.isFrozen(e)}var Ol,Cl={};function Sl(e){const t=Cl[e];return t||cl(0),t}function Dl(){return Ol}function jl(e,t){t&&(Sl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bl(e){_l(e),e.drafts_.forEach(Al),e.drafts_=null}function _l(e){e===Ol&&(Ol=e.parent_)}function Rl(e){return Ol={drafts_:[],parent_:Ol,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Al(e){const t=e[ll];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ml(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[ll].modified_&&(Bl(t),cl(4)),dl(e)&&(e=Tl(t,e),t.parent_||Ll(t,e)),t.patches_&&Sl("Patches").generateReplacementPatches_(n[ll].base_,e,t.patches_,t.inversePatches_)):e=Tl(t,n,[]),Bl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==rl?e:void 0}function Tl(e,t,n){if(El(t))return t;const o=t[ll];if(!o)return pl(t,((r,i)=>Nl(e,o,t,r,i,n))),t;if(o.scope_!==e)return t;if(!o.modified_)return Ll(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let r=t,i=!1;3===o.type_&&(r=new Set(t),t.clear(),i=!0),pl(r,((r,l)=>Nl(e,o,t,r,l,n,i))),Ll(e,t,!1),n&&e.patches_&&Sl("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Nl(e,t,n,o,r,i,l){if(sl(r)){const l=Tl(e,r,i&&t&&3!==t.type_&&!gl(t.assigned_,o)?i.concat(o):void 0);if(vl(n,o,l),!sl(l))return;e.canAutoFreeze_=!1}else l&&n.add(r);if(dl(r)&&!El(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Tl(e,r),t&&t.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(n,o)||Ll(e,r)}}function Ll(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xl(t,n)}var Pl={get(e,t){if(t===ll)return e;const n=bl(e);if(!gl(n,t))return function(e,t,n){const o=Fl(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}(e,n,t);const o=n[t];return e.finalized_||!dl(o)?o:o===zl(e.base_,t)?(Ul(e),e.copy_[t]=Vl(o,e)):o},has:(e,t)=>t in bl(e),ownKeys:e=>Reflect.ownKeys(bl(e)),set(e,t,n){const o=Fl(bl(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const o=zl(bl(e),t),l=o?.[ll];if(l&&l.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((r=n)===(i=o)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==n||gl(e.base_,t)))return!0;Ul(e),Hl(e)}var r,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==zl(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Ul(e),Hl(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=bl(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:o.enumerable,value:n[t]}:o},defineProperty(){cl(11)},getPrototypeOf:e=>al(e.base_),setPrototypeOf(){cl(12)}},Il={};function zl(e,t){const n=e[ll];return(n?bl(n):e)[t]}function Fl(e,t){if(!(t in e))return;let n=al(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=al(n)}}function Hl(e){e.modified_||(e.modified_=!0,e.parent_&&Hl(e.parent_))}function Ul(e){e.copy_||(e.copy_=wl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}pl(Pl,((e,t)=>{Il[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Il.deleteProperty=function(e,t){return Il.set.call(this,e,t,void 0)},Il.set=function(e,t,n){return Pl.set.call(this,e[0],t,n,e[0])};function Vl(e,t){const n=yl(e)?Sl("MapSet").proxyMap_(e,t):ml(e)?Sl("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:Dl(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,i=Pl;n&&(r=[o],i=Il);const{revoke:l,proxy:c}=Proxy.revocable(r,i);return o.draft_=c,o.revoke_=l,c}(e,t);return(t?t.scope_:Dl()).drafts_.push(n),n}function $l(e){if(!dl(e)||El(e))return e;const t=e[ll];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=wl(e,t.scope_.immer_.useStrictShallowCopy_)}else n=wl(e,!0);return pl(n,((e,t)=>{vl(n,e,$l(t))})),t&&(t.finalized_=!1),n}var Wl=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const o=this;return function(e=n,...r){return o.produce(e,(e=>t.call(this,e,...r)))}}let o;if("function"!=typeof t&&cl(6),void 0!==n&&"function"!=typeof n&&cl(7),dl(e)){const r=Rl(this),i=Vl(e,void 0);let l=!0;try{o=t(i),l=!1}finally{l?Bl(r):_l(r)}return jl(r,n),Ml(o,r)}if(!e||"object"!=typeof e){if(o=t(e),void 0===o&&(o=e),o===rl&&(o=void 0),this.autoFreeze_&&xl(o,!0),n){const t=[],r=[];Sl("Patches").generateReplacementPatches_(e,o,t,r),n(t,r)}return o}cl(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,o;return[this.produce(e,t,((e,t)=>{n=e,o=t})),n,o]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){dl(e)||cl(8),sl(e)&&(e=function(e){sl(e)||cl(10);return $l(e)}(e));const t=Rl(this),n=Vl(e,void 0);return n[ll].isManual_=!0,_l(t),n}finishDraft(e,t){const n=e&&e[ll];n&&n.isManual_||cl(9);const{scope_:o}=n;return jl(o,t),Ml(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));const o=Sl("Patches").applyPatches_;return sl(e)?o(e,t):this.produce(e,(e=>o(e,t)))}};Wl.produce,Wl.produceWithPatches.bind(Wl),Wl.setAutoFreeze.bind(Wl),Wl.setUseStrictShallowCopy.bind(Wl),Wl.applyPatches.bind(Wl);var Kl=Wl.createDraft.bind(Wl),Yl=Wl.finishDraft.bind(Wl);
6
+ var qo=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Zo="undefined"==typeof Element,Go=Zo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Jo=!Zo&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Qo=function e(t,n){var o;void 0===n&&(n=!0);var r=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},er=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var l=i.shift();if(!Qo(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),a=e(c.length?c:l.children,!0,o);o.flatten?r.push.apply(r,a):r.push({scopeParent:l,candidates:a})}else{Go.call(l,qo)&&o.filter(l)&&(n||!t.includes(l))&&r.push(l);var s=l.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(l),d=!Qo(s,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(s&&d){var u=e(!0===s?l.children:s.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:l,candidates:u})}else i.unshift.apply(i,l.children)}}return r},tr=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},nr=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!tr(e)?0:e.tabIndex},or=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},rr=function(e){return"INPUT"===e.tagName},ir=function(e){return function(e){return rr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Jo(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!r||r===e}(e)},lr=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},cr=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=Go.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Go.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return lr(e)}else{if("function"==typeof o){for(var i=e;e;){var l=e.parentElement,c=Jo(e);if(l&&!l.shadowRoot&&!0===o(l))return lr(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,o,r,i=e&&Jo(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(l)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!c&&l;){var a,s,d;c=!(null===(s=l=null===(a=i=Jo(l))||void 0===a?void 0:a.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ar=function(e,t){return!(t.disabled||Qo(t)||function(e){return rr(e)&&"hidden"===e.type}(t)||cr(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var o=t.children.item(n);if("LEGEND"===o.tagName)return!!Go.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},sr=function(e,t){return!(ir(t)||nr(t)<0||!ar(e,t))},dr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ur=function e(t){var n=[],o=[];return t.forEach((function(t,r){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=nr(e);return n<0&&t&&!tr(e)?0:n}(l,i),a=i?e(t.candidates):l;0===c?i?n.push.apply(n,a):n.push(l):o.push({documentOrder:r,tabIndex:c,item:t,isScope:i,content:a})})),o.sort(or).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},fr=function(e,t){var n;return n=(t=t||{}).getShadowRoot?er([e],t.includeContainer,{filter:sr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dr}):function(e,t,n){if(Qo(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(qo));return t&&Go.call(e,qo)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,sr.bind(null,t)),ur(n)};const pr=o["useInsertionEffect".toString()]||(e=>e());var hr="undefined"!=typeof document?a:s;function gr(){return gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},gr.apply(this,arguments)}let vr=!1,yr=0;const mr=()=>"floating-ui-"+yr++;const br=o["useId".toString()]||function(){const[e,t]=o.useState((()=>vr?mr():void 0));return hr((()=>{null==e&&t(mr())}),[]),o.useEffect((()=>{vr||(vr=!0)}),[]),e};const wr=o.createContext(null),xr=o.createContext(null);function kr(e){return"data-floating-ui-"+e}function Er(e){const t=c(e);return hr((()=>{t.current=e})),t}const Or=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Cr(e,t){const n=fr(e,Or());"prev"===t&&n.reverse();const o=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}((null==(r=e)?void 0:r.ownerDocument)||document));var r;return n.slice(o+1)[0]}function Sr(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!function(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Vn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,o)}function Dr(e){fr(e,Or()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function jr(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Br={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function _r(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Rr=o.forwardRef((function(e,t){const[n,r]=o.useState();hr((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",_r),()=>{document.removeEventListener("keydown",_r)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[kr("focus-guard")]:"",style:Br};return o.createElement("span",gr({},e,i))})),Ar=o.createContext(null),Mr=kr("portal");function Tr(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const l=function(e){let{id:t,root:n}=void 0===e?{}:e;const[r,i]=o.useState(null),l=br(),c=Nr(),a=o.useRef(null);return hr((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{a.current=null}))}),[r]),hr((()=>{if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=l,n.setAttribute(Mr,""),e.appendChild(n),a.current=n,i(n)}),[t,l]),hr((()=>{if(a.current)return;let e=n||(null==c?void 0:c.portalNode);e&&!Hn(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const r=document.createElement("div");r.id=l,r.setAttribute(Mr,""),e=o||e,e.appendChild(r),a.current=r,i(r)}),[t,n,l,c]),r}({id:n,root:r}),[c,a]=o.useState(null),s=o.useRef(null),d=o.useRef(null),u=o.useRef(null),f=o.useRef(null),p=!!c&&!c.modal&&c.open&&i&&!(!r&&!l);return o.useEffect((()=>{if(l&&i&&(null==c||!c.modal))return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&Sr(e)){("focusin"===e.type?jr:Dr)(l)}}}),[l,i,null==c?void 0:c.modal]),o.createElement(Ar.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:l,setFocusManagerState:a})),[i,l])},p&&l&&o.createElement(Rr,{"data-type":"outside",ref:s,onFocus:e=>{if(Sr(e,l)){var t;null==(t=u.current)||t.focus()}else{const e=Cr(document.body,"prev")||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),p&&l&&o.createElement("span",{"aria-owns":l.id,style:Br}),l&&b(t,l),p&&l&&o.createElement(Rr,{"data-type":"outside",ref:d,onFocus:e=>{if(Sr(e,l)){var t;null==(t=f.current)||t.focus()}else{const t=Cr(document.body,"next")||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent))}}}))}const Nr=()=>o.useContext(Ar),Lr=new Set,Pr=o.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;const i=br();return hr((()=>{if(!n)return;Lr.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,c=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[o]=r+"px"),e){var a,s;const e=(null==(a=window.visualViewport)?void 0:a.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(c-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{Lr.delete(i),0===Lr.size&&(Object.assign(t,{overflow:"",[o]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,c)))}}),[i,n]),o.createElement("div",gr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Ir(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e,[l,c]=o.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||l,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:l,floating:c}={},transform:a=!0,whileElementsMounted:s,open:d}=e,[u,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=o.useState(r);Wo(p,r)||h(r);const[g,v]=o.useState(null),[m,b]=o.useState(null),w=o.useCallback((e=>{e!==O.current&&(O.current=e,v(e))}),[]),x=o.useCallback((e=>{e!==C.current&&(C.current=e,b(e))}),[]),k=l||g,E=c||m,O=o.useRef(null),C=o.useRef(null),S=o.useRef(u),D=null!=s,j=Xo(s),B=Xo(i),_=o.useCallback((()=>{if(!O.current||!C.current)return;const e={placement:t,strategy:n,middleware:p};B.current&&(e.platform=B.current),Vo(O.current,C.current,e).then((e=>{const t={...e,isPositioned:!0};R.current&&!Wo(S.current,t)&&(S.current=t,y.flushSync((()=>{f(t)})))}))}),[p,t,n,B]);$o((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const R=o.useRef(!1);$o((()=>(R.current=!0,()=>{R.current=!1})),[]),$o((()=>{if(k&&(O.current=k),E&&(C.current=E),k&&E){if(j.current)return j.current(k,E,_);_()}}),[k,E,_,j,D]);const A=o.useMemo((()=>({reference:O,floating:C,setReference:w,setFloating:x})),[w,x]),M=o.useMemo((()=>({reference:k,floating:E})),[k,E]),T=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!M.floating)return e;const t=Yo(M.floating,u.x),o=Yo(M.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+o+"px)",...Ko(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}}),[n,a,M.floating,u.x,u.y]);return o.useMemo((()=>({...u,update:_,refs:A,elements:M,floatingStyles:T})),[u,_,A,M,T])}(e),d=o.useContext(xr),u=null!=((null==(f=o.useContext(wr))?void 0:f.id)||null);var f;const p=function(e){const t=o.useRef((()=>{}));return pr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(g.current.openEvent=t),v.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),h=o.useRef(null),g=o.useRef({}),v=o.useState((()=>function(){const e=new Map;return{emit(t,n){var o;null==(o=e.get(t))||o.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,(null==(o=e.get(t))?void 0:o.filter((e=>e!==n)))||[])}}}()))[0],m=br(),b=o.useCallback((e=>{const t=Hn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=o.useCallback((e=>{(Hn(e)||null===e)&&(h.current=e,c(e)),(Hn(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Hn(e))&&s.refs.setReference(e)}),[s.refs]),x=o.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=o.useMemo((()=>({...s.elements,domReference:a})),[s.elements,a]),E=o.useMemo((()=>({...s,refs:x,elements:k,dataRef:g,nodeId:i,floatingId:m,events:v,open:n,onOpenChange:p})),[s,i,m,v,n,p,x,k]);return hr((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=E)})),o.useMemo((()=>({...s,context:E,refs:x,elements:k})),[s,x,k,E])}const zr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Fr(e,t){return"function"==typeof e?e(t):e}function Hr(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,l=("number"==typeof i?i:i.close)||0,[c,a]=o.useState(!1),[s,d]=o.useState("unmounted"),u=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,l);return hr((()=>{c&&!u&&d("unmounted")}),[c,u]),hr((()=>{if(r){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}a(!0),d("close")}}),[n,r]),{isMounted:u,status:s}}function Ur(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:l,duration:c=250}=t,a=e.placement,s=a.split("-")[0],d=o.useMemo((()=>({side:s,placement:a})),[s,a]),u="number"==typeof c,f=(u?c:c.open)||0,p=(u?c:c.close)||0,[h,g]=o.useState((()=>({...Fr(l,d),...Fr(n,d)}))),{isMounted:v,status:y}=Hr(e,{duration:c}),m=Er(n),b=Er(r),w=Er(i),x=Er(l);return hr((()=>{const e=Fr(m.current,d),t=Fr(w.current,d),n=Fr(x.current,d),o=Fr(b.current,d)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===y&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===y&&g({transitionProperty:Object.keys(o).map(zr).join(","),transitionDuration:f+"ms",...n,...o}),"close"===y){const o=t||e;g({transitionProperty:Object.keys(o).map(zr).join(","),transitionDuration:p+"ms",...n,...o})}}),[p,w,m,b,x,f,y,d]),{isMounted:v,styles:h}}var Vr;function $r(){return $r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},$r.apply(this,arguments)}var Wr=function(e){return o.createElement("svg",$r({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Vr||(Vr=o.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Kr(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}var Yr=["color"],Xr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Kr(e,Yr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),v("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),qr=["color"],Zr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Kr(e,qr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),v("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Gr=["color"],Jr=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Kr(e,Gr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),v("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),Qr=["color"],ei=g((function(e,t){var n=e.color,o=void 0===n?"currentColor":n,r=Kr(e,Qr);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),v("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))})),ti=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],o=0;o<e.rangeCount;o++)n.push(e.getRangeAt(o));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},ni={"text/plain":"Text","text/html":"Url",default:"Text"};var oi=function(e,t){var n,o,r,i,l,c,a=!1;t||(t={}),n=t.debug||!1;try{if(r=ti(),i=document.createRange(),l=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(o){if(o.stopPropagation(),t.format)if(o.preventDefault(),void 0===o.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=ni[t.format]||ni.default;window.clipboardData.setData(r,e)}else o.clipboardData.clearData(),o.clipboardData.setData(t.format,e);t.onCopy&&(o.preventDefault(),t.onCopy(o.clipboardData))})),document.body.appendChild(c),i.selectNodeContents(c),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");a=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),a=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),c&&document.body.removeChild(c),r()}return a};function ri(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ii(e){if(!e)return;const t=ri(e);return t?e[t]:void 0}function li(e,t,n){var o;return(null===(o=e.children)||void 0===o?void 0:o.map((e=>{const o=t[e];if(!o)throw new Error(`Element definition for ${e} not found`);return J({id:G(),type:e,props:o.props,children:o.children&&o.children.length>0?li(o,t,n):[{text:(null==n?void 0:n[e])||""}]})})))||[]}function ci(e,t,n){const o=e.blocks[t].elements,r=ri(o);if(!r)throw new Error(`Root element type not found for block type ${t}`);const i=o[r];return{id:G(),type:r,props:i.props,children:i.children&&i.children.length>0?li(i,o,n):[{text:""}]}}const ai=i(void 0),si=({children:o,tools:r})=>{const i=$(),l=d((()=>r?Object.keys(r).reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t]:null===(n=r[t])||void 0===n?void 0:n.render})}),{}):{}),[r]),c=d((()=>!r||i?null:Object.keys(r).map((t=>{var n,o,i;const l=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.tool,c=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.render,a=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return l?e(l,Object.assign({render:c},a),t):null}))),[r]);return e(ai.Provider,Object.assign({value:l},{children:t(n,{children:[c,o]})}))},di=()=>{const e=l(ai);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e};function ui({editor:e,view:t,onClose:n,mode:o="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===o&&(t=t.filter((t=>function(e,t){var n;const o=e.blocks[t];if(!o)return!1;const r=ii(o.elements);return"void"!==(null===(n=null==r?void 0:r.props)||void 0===n?void 0:n.nodeType)}(e,t)))),t.map((t=>{var n,o,r,i,l,c;return{type:t,title:(null===(o=null===(n=e.blocks[t].options)||void 0===n?void 0:n.display)||void 0===o?void 0:o.title)||t,description:null===(i=null===(r=e.blocks[t].options)||void 0===r?void 0:r.display)||void 0===i?void 0:i.description,icon:null===(c=null===(l=e.blocks[t].options)||void 0===l?void 0:l.display)||void 0===c?void 0:c.icon}}))})(),onClose:n,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===o&&e.blocks[t].toggle({focus:!0}),"create"===o&&e.blocks[t].create({deleteText:!0,focus:!0}),n()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}function fi(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;const pi=t=>{var{className:n,children:o,lockScroll:r=!0}=t,i=fi(t,["className","children","lockScroll"]);return e(Pr,Object.assign({lockScroll:r,className:n},i,{onClick:e=>{var t;e.stopPropagation(),null===(t=i.onClick)||void 0===t||t.call(i,e)},onMouseDown:e=>{var t;e.stopPropagation(),null===(t=i.onMouseDown)||void 0===t||t.call(i,e)}},{children:o}))},hi=t=>{const[n,o]=f(!1),r=c(null),i=H();return s((()=>{o(!0);const e=i.refElement;if(!e)return;return e.querySelector(".yoopta-overlays")||(r.current=document.createElement("div"),r.current.className="yoopta-overlays",e.appendChild(r.current)),()=>{r.current&&r.current.remove()}}),[]),n?e(Tr,Object.assign({id:`${t.id}-${i.id}`,root:r.current||i.refElement},{children:t.children})):null},gi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-group"},{children:t})),vi=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoopta-block-options-menu-content data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),yi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-item"},{children:t})),mi=({isOpen:n,onClose:o,refs:r,style:i,children:l})=>{var c,a,s;const d=H(),u=di(),[p,h]=f(!1),{refs:g,floatingStyles:v,context:y}=Ir({placement:"right",open:p,onOpenChange:h,middleware:[Uo(),Ho(),Fo(),Eo(10)],whileElementsMounted:zo}),{isMounted:m,styles:b}=Ur(y,{duration:100});if(!n)return null;const w=P(d,{at:d.selection}),x=ii(null===(c=d.blocks[(null==w?void 0:w.type)||""])||void 0===c?void 0:c.elements),k="void"===(null===(a=null==x?void 0:x.props)||void 0===a?void 0:a.nodeType),E=u.ActionMenu,O=Object.assign(Object.assign({},v),b),C=ui({editor:d,view:"small",onClose:()=>{h(!1),o()}});return e(hi,Object.assign({id:"yoo-block-options-portal"},{children:e(pi,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:o},{children:e("div",Object.assign({style:i,ref:r.setFloating},{children:t(vi,{children:[t(gi,{children:[e(yi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=d.selection;d.deleteBlock({at:e}),d.setBlockSelected(null),d.setSelection(null),o()}},{children:[e(ei,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(yi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{d.duplicateBlock({at:d.selection,focus:!0}),d.setBlockSelected(null),o()}},{children:[e(Xr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!E&&!k&&!(null===(s=d.blocks[(null==w?void 0:w.type)||""])||void 0===s?void 0:s.hasCustomEditor)&&t(yi,{children:[m&&e(hi,Object.assign({id:"yoo-block-options-portal"},{children:e(pi,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>h(!1)},{children:e("div",Object.assign({style:O,ref:g.setFloating},{children:e(E,Object.assign({},C))}))}))})),t("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:g.setReference,onClick:()=>h((e=>!e))},{children:[e(Wr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(yi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=P(d);e&&(oi(`${window.location.origin}${window.location.pathname}#${e.id}`),d.emit("block:copy",e)),o()}},{children:[e(Jr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),l]})}))}))}))};var bi=Object.freeze({__proto__:null,BlockOptions:mi,BlockOptionsMenuContent:vi,BlockOptionsMenuGroup:gi,BlockOptionsMenuItem:yi,BlockOptionsSeparator:({className:t=""})=>e("div",{className:`yoopta-block-options-separator ${t}`})});const wi=({block:n,editor:o,dragHandleProps:r,onChangeActiveBlock:i,showActions:l})=>{const[c,a]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:g,actionMenuRenderProps:v,ActionMenu:y}=(({editor:e})=>{const t=di().ActionMenu,[n,o]=f(!1),{refs:r,floatingStyles:i,context:l}=Ir({placement:"bottom-start",open:n,onOpenChange:o,middleware:[Uo(),Ho(),Fo(),Eo(10)],whileElementsMounted:zo}),{isMounted:c,styles:a}=Ur(l,{duration:100}),s=Object.assign(Object.assign({},i),a),d=e=>o(e),u=()=>d(!1),p=ui({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:c,actionMenuStyles:s,actionMenuRefs:r,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:o}),{refs:m,floatingStyles:b,context:x}=Ir({placement:"right-start",open:c,onOpenChange:a,middleware:[Uo(),Ho(),Fo(),Eo()]}),{isMounted:k,styles:E}=Ur(x,{duration:100}),{setActivatorNodeRef:O,attributes:C,listeners:j}=r,B=Object.assign(Object.assign({},b),E);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":l,className:"yoopta-block-actions"},{children:[s&&u&&e(hi,Object.assign({id:"yoo-block-options-portal"},{children:e(pi,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:g},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(y,Object.assign({},v))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=Ln(o,{at:[n.meta.order]}),r=o.blocks[n.type];if(!t)return;const i=document.querySelector(`[data-yoopta-block-id="${n.id}"]`),l=ii(r.elements);let c;r.hasCustomEditor||(c=S.string(t,[0]));const a="string"==typeof c&&0===c.trim().length;if(u&&a&&"void"!==(null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.nodeType))o.setSelection([n.meta.order]),o.focusBlock(n.id),d.setReference(i),h(!0);else{const e=Q({id:G()}),t=[n.meta.order+1];o.setSelection([n.meta.order]),o.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{i&&d.setReference(i.nextSibling),h(!0)}),0)}},className:"yoopta-block-actions-plus"},{children:e(Nn,{})})),e("button",Object.assign({type:"button",className:"yoopta-block-actions-drag",ref:e=>{O(e),m.setReference(e)}},C,j,{onClick:e=>{e.stopPropagation(),i(n.id);const t=Ln(o,{at:[n.meta.order]});o.focusBlock(n.id),t&&setTimeout((()=>{o.blocks[n.type].hasCustomEditor||(w.blur(t),w.deselect(t),D.deselect(t)),o.setBlockSelected([n.meta.order],{only:!0}),o.setSelection([n.meta.order]),a(!0)}),10)}},{children:e(Mn,{})})),e(mi,{isOpen:k,refs:m,style:B,onClose:()=>a(!1)})]}))},xi=({children:n,block:o,blockId:r})=>{var i;const l=H(),[c,a]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:g,isOver:v,isDragging:y}=Cn({id:r,disabled:l.readOnly}),m=`yoopta-block yoopta-align-${o.meta.align||"left"}`,b={marginLeft:20*o.meta.depth+"px",transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:y?.7:1},w=null===(i=l.selectedBlocks)||void 0===i?void 0:i.includes(o.meta.order),x=c===r,k={borderBottom:v&&!y?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:m,onMouseEnter:()=>{l.readOnly||a(r)},onMouseLeave:()=>{l.readOnly||a(null)},style:b,"data-hovered-block":x,"data-yoopta-block":!0,"data-yoopta-block-id":r,"data-yoopta-block-type":o.type},{children:[!l.readOnly&&e(wi,{block:o,editor:l,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:x,onChangeActiveBlock:e=>a(e)}),e("div",Object.assign({style:k},{children:n})),w&&!l.readOnly&&e("div",{className:"yoopta-selection-block"})]}))};var ki={};Object.defineProperty(ki,"__esModule",{value:!0});for(var Ei="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Oi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Ci={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Ei?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Si={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Di=1;Di<20;Di++)Si["f"+Di]=111+Di;function ji(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var o=e.map((function(e){return Bi(e,t)})),r=function(e){return o.some((function(t){return _i(t,e)}))};return null==n?r:r(n)}function Bi(e,t){var n=t&&t.byKey,o={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var l in Oi)o[Oi[l]]=!1;var c=!0,a=!1,s=void 0;try{for(var d,u=r[Symbol.iterator]();!(c=(d=u.next()).done);c=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Ai(f),g=Oi[h];if(f.length>1&&!g&&!Ci[f]&&!Si[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?o.key=h:o.which=Ri(f)),g&&(o[g]=!p||null)}}catch(e){a=!0,s=e}finally{try{!c&&u.return&&u.return()}finally{if(a)throw s}}return o}function _i(e,t){for(var n in e){var o=e[n],r=void 0;if(null!=o&&((null!=(r="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===o&&93===t.which?91:t.which:t[n])||!1!==o)&&r!==o))return!1}return!0}function Ri(e){return e=Ai(e),Si[e]||e.toUpperCase().charCodeAt(0)}function Ai(e){return e=e.toLowerCase(),e=Ci[e]||e}ki.default=ji,ki.isHotkey=ji,ki.isCodeHotkey=function(e,t){return ji(e,t)};var Mi=ki.isKeyHotkey=function(e,t){return ji(e,{byKey:!0},t)};ki.parseHotkey=Bi,ki.compareHotkey=_i,ki.toKeyCode=Ri,ki.toKeyName=Ai;const Ti={bold:"mod+b",italic:"mod+i",compose:["down","left","right","up","backspace","enter"],arrowLeft:"left",arrowUp:"up",arrowDown:"down",arrowRight:"right",ctrlLeft:"ctrl+left",escape:"esc",ctrlRight:"ctrl+right",deleteBackward:"shift?+backspace",backspace:"backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",shiftEnter:"shift+enter",enter:"enter",space:"space",undo:"mod+z",select:"mod+a",shiftTab:"shift+tab",shiftArrowUp:"shift+up",shiftArrowDown:"shift+down",tab:"tab",cmd:"mod",cmdEnter:"mod+enter",slashCommand:"/",copy:"mod+c",cut:"mod+x"},Ni={moveLineBackward:"opt+up",moveLineForward:"opt+down",ctrlLeft:"opt+left",ctrlRight:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Li={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Pi=e=>{const t=Ti[e],n=Ni[e],o=Li[e],r=t&&Mi(t),i=n&&Mi(n),l=o&&Mi(o);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!l||!l(e)))},Ii={isBold:Pi("bold"),isCompose:Pi("compose"),isArrowLeft:Pi("arrowLeft"),isArrowRight:Pi("arrowRight"),isArrowUp:Pi("arrowUp"),isArrowDown:Pi("arrowDown"),isDeleteBackward:Pi("deleteBackward"),isDeleteForward:Pi("deleteForward"),isDeleteLineBackward:Pi("deleteLineBackward"),isDeleteLineForward:Pi("deleteLineForward"),isDeleteWordBackward:Pi("deleteWordBackward"),isDeleteWordForward:Pi("deleteWordForward"),isExtendBackward:Pi("extendBackward"),isExtendForward:Pi("extendForward"),isExtendLineBackward:Pi("extendLineBackward"),isExtendLineForward:Pi("extendLineForward"),isItalic:Pi("italic"),isMoveLineBackward:Pi("moveLineBackward"),isMoveLineForward:Pi("moveLineForward"),isCtrlLeft:Pi("ctrlLeft"),isCtrlRight:Pi("ctrlRight"),isRedo:Pi("redo"),isShiftEnter:Pi("shiftEnter"),isEnter:Pi("enter"),isTransposeCharacter:Pi("transposeCharacter"),isUndo:Pi("undo"),isSpace:Pi("space"),isSelect:Pi("select"),isTab:Pi("tab"),isShiftTab:Pi("shiftTab"),isBackspace:Pi("backspace"),isCmdEnter:Pi("cmdEnter"),isCmd:Pi("cmd"),isEscape:Pi("escape"),isSlashCommand:Pi("slashCommand"),isShiftArrowUp:Pi("shiftArrowUp"),isShiftArrowDown:Pi("shiftArrowDown"),isCopy:Pi("copy"),isCut:Pi("cut")};const zi={onKeyDown:function(e){return t=>{const n=Ln(e,{at:e.selection});if(!n||!n.selection)return;const o=j.parent(n.selection.anchor.path);if(Ii.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(Ii.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=S.isStart(n,n.selection.anchor,o),i=S.isEnd(n,n.selection.anchor,o);if(!r&&!i)return void e.splitBlock({slate:n,focus:!0});const l=Q({id:G()}),c=e.selection?[e.selection[0]+1]:[0];e.insertBlock(l,{at:c,slate:n,focus:!0})}else if(Ii.isBackspace(t)){if(t.isDefaultPrevented())return;const o=j.parent(n.selection.anchor.path);if(S.isStart(n,n.selection.anchor,o)){t.preventDefault();const r=S.string(n,o),i=e.selection?e.selection[0]-1:0,l=Ln(e,{at:[i]}),c=P(e,{at:[i]}),a=e.blocks[(null==c?void 0:c.type)||""];let s;if(l&&!a.hasCustomEditor&&(s=function(e,t){try{const[,n]=S.last(e,t);return{path:n,offset:S.string(e,n).length}}catch(e){return{path:[0,0],offset:0}}}(l,o)),0===r.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:s});{if(B.isExpanded(n.selection))return D.delete(n,{at:n.selection});const t=e.selection?e.selection[0]-1:0,o=P(e,{at:[t]}),r=e.blocks[(null==o?void 0:o.type)||""];if(r&&r.hasCustomEditor)return;if(!l)return;if(0===S.string(l,[0,0]).length)return e.deleteBlock({at:[t],focus:!0,focusAt:s});const i=Array.from(S.nodes(n,{at:[0],match:e=>!S.isEditor(e)&&(_.isText(e)||S.isInline(n,e)),mode:"highest"})).map((([e])=>e));return D.insertNodes(l,i,{at:S.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:s})}}}else{if(Ii.isSelect(t)){if(t.isDefaultPrevented())return;const[,o]=S.first(n,[0]),[,r]=S.last(n,[n.children.length-1]),i=S.range(n,o,r),l=B.equals(n.selection,i),c=0===S.string(n,i).trim().length;if(B.isExpanded(n.selection)&&l||c)return t.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(Ii.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Ii.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Ii.isArrowUp(t)){if(t.isDefaultPrevented())return;if(1===new Set(n.selection.anchor.path).size){const n=e.selection?[e.selection[0]-1]:null,o=Ln(e,{at:n}),r=P(e,{at:n});if(o&&r){const[,n]=S.last(o,[0]),i={path:n,offset:S.string(o,n).length};return t.preventDefault(),void e.focusBlock(r.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Ii.isArrowDown(t)){if(t.isDefaultPrevented())return;const o=j.parent(n.selection.anchor.path);if(S.isEnd(n,n.selection.anchor,o)){const n=e.selection?[e.selection[0]+1]:null,r=Ln(e,{at:n}),i=P(e,{at:n});if(r&&i){const n=function(e,t){try{const[,n]=S.first(e,t);return{path:n,offset:0}}catch(e){return{path:[0,0],offset:0}}}(r,o);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(B.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Mi(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Fi=({children:t,attributes:n,placeholder:o})=>{const r=x(),i=Object.assign({},n);return r&&o&&(i["data-placeholder"]=o,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Hi(e){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)}const Ui=(e,t,n)=>{var o,r,i,l;(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&R.isElement(e)&&"link"===e.type});return!!t})(t)&&(e=>{D.unwrapNodes(e,{match:e=>!S.isEditor(e)&&R.isElement(e)&&"link"===e.type})})(t);const{selection:c}=t,a=c&&B.isCollapsed(c),s=null===(l=null===(i=null===(r=null===(o=e.plugins)||void 0===o?void 0:o.LinkPlugin)||void 0===r?void 0:r.elements)||void 0===i?void 0:i.link)||void 0===l?void 0:l.props,d={type:"link",children:a?[{text:n}]:[],props:{url:n,target:(null==s?void 0:s.target)||"_self",rel:(null==s?void 0:s.rel)||"noopener noreferrer"}};a?D.insertNodes(t,d):(D.wrapNodes(t,d,{split:!0}),D.collapse(t,{edge:"end"}))},Vi=new WeakMap;function $i(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Wi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"italic"}},Ki=["left","center","right",void 0];function Yi(e,t,n,o){var r,i;let l;if(t.parse){l=t.parse(n,e);if(R.isElement(l)&&"inline"===(null===(r=l.props)||void 0===r?void 0:r.nodeType))return l}const c=e.blocks[t.type],a=ri(c.elements)||"",s=c.elements[a],d="void"===(null===(i=s.props)||void 0===i?void 0:i.nodeType);let u={id:G(),type:a,children:d&&!c.hasCustomEditor?[{text:""}]:o.map(qi),props:Object.assign({nodeType:"block"},s.props)};if(l)if(R.isElement(l))u=l;else if(Array.isArray(l)){return l}if(0===u.children.length&&(u.children=[{text:""}]),!l&&t.parse)return;const f=n.getAttribute("data-meta-align"),p=parseInt(n.getAttribute("data-meta-depth")||"0",10);return Q({id:G(),type:t.type,value:[u],meta:{order:0,depth:p,align:Ki.includes(f)?f:void 0}})}function Xi(e,t,n){var o,r;if(3===n.nodeType){return null===(o=n.textContent)||void 0===o?void 0:o.replace(/[\t\n\r\f\v]+/g," ")}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return"\n";const i=n;let l=Array.from(i.childNodes).map((n=>Xi(e,t,n))).flat();if(Wi[n.nodeName]){return{[Wi[n.nodeName].type]:!0,text:null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}const c=t[n.nodeName];if(c){if(Array.isArray(c)){return c.map((t=>Yi(e,t,n,l))).filter(Boolean)}return Yi(e,c,n,l)}return l}function qi(e){if("string"==typeof e)return{text:e};if(R.isElement(e))return e;if(Array.isArray(e))return{text:e[0]};if(null==e?void 0:e.text)return e;if($i(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}function Zi(e,t){console.log("pasted html",t);const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const o=e.plugins[n],{parsers:r}=o;if(r){const{html:e}=r;if(e){const{deserialize:o}=e;if(o){const{nodeNames:e}=o;e&&e.forEach((e=>{const r=t[e];if(r){const i=Array.isArray(r)?r:[r];t[e]=[...i,{type:n,parse:o.parse}]}else t[e]={type:n,parse:o.parse}}))}}}})),t}(e);return Xi(e,n,t).filter($i)}const Gi=({id:t,customEditor:n,elements:o,marks:r,events:i,options:l,placeholder:a="Type '/' for commands"})=>{var s,f,p;const h=H(),g=U(t),v=c(g.value).current,y=d((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(o)),[o]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(r)),[r]),b=d((()=>{let e=h.blockEditorsMap[t];const{normalizeNode:n}=e,r=Object.keys(o);return r.forEach((t=>{var n;const r=null===(n=o[t].props)||void 0===n?void 0:n.nodeType,i="inline"===r,l="void"===r,c="inlineVoid"===r;c&&(e.markableVoid=e=>e.type===t),(l||c)&&(e.isVoid=e=>e.type===t),(i||c)&&(e.isInline=e=>e.type===t,e=((e,t)=>{const{insertData:n,insertText:o}=t;return t.insertText=n=>{n&&Hi(n)?Ui(e,t,n):o(n)},t.insertData=o=>{const r=o.getData("text/plain");r&&Hi(r)?Ui(e,t,r):n(o)},t})(h,e))})),e.normalizeNode=t=>{const[o,i]=t,l=h.blocks[g.type].elements;if(Object.keys(l).length>1)return n(t);if(R.isElement(o)){const{type:t}=o,n=ri(l);if(!r.includes(t))return void D.setNodes(e,{type:n,props:Object.assign({},o.props)},{at:i});if(o.type===n)for(const[t,n]of A.children(e,i))if(R.isElement(t)&&!e.isInline(t))return void D.unwrapNodes(e,{at:n})}n(t)},e}),[o,t]),x=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Ii,currentBlock:g,defaultBlock:Q({id:G()})},t={};return Object.keys(i).forEach((n=>{t[n]=function(t){if(i[n]){i[n](h,b,e)(t)}}})),t}),[i,h,g]),k=u((e=>h.updateBlock(t,{value:e})),[t]),E=u((n=>{const o=y[n.element.type],{attributes:r}=n,i=fi(n,["attributes"]);let c;r["data-element-type"]=i.element.type;try{c=w.findPath(b,n.element)}catch(e){c=[]}return o?e(o,Object.assign({},i,{path:c,attributes:r,blockId:t,HTMLAttributes:null==l?void 0:l.HTMLAttributes})):e(O,Object.assign({},i,{attributes:r}))}),[o,b.children]),C=u((t=>{var n,o,r,i,l;let{children:c,leaf:s,attributes:d}=t;const u=fi(s,["text"]),f=(null===(n=h.selection)||void 0===n?void 0:n[0])===g.meta.order;u&&Object.keys(u).forEach((e=>{const t=m[e];t&&(c=t.render({children:c,leaf:s}))}));const p=!("void"===(null===(l=null===(i=null===(r=null===(o=t.children)||void 0===o?void 0:o.props)||void 0===r?void 0:r.parent)||void 0===i?void 0:i.props)||void 0===l?void 0:l.nodeType))&&f&&s.withPlaceholder;return e(Fi,Object.assign({attributes:d,placeholder:p?a:void 0},{children:c}))}),[r]),j=u((e=>{var t;h.readOnly||(null===(t=x.onKeyDown)||void 0===t||t.call(x,e),zi.onKeyDown(h)(e))}),[x.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],g.meta.order]),_=u((e=>{var t;h.readOnly||null===(t=null==x?void 0:x.onKeyUp)||void 0===t||t.call(x,e)}),[x.onKeyUp,h.readOnly]),M=u((e=>{var t,n;h.readOnly||((null===(t=h.selection)||void 0===t?void 0:t[0])!==g.meta.order&&h.setSelection([g.meta.order]),null===(n=null==x?void 0:x.onMouseDown)||void 0===n||n.call(x,e))}),[x.onMouseDown,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],g.meta.order]),T=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==x?void 0:x.onBlur)||void 0===t||t.call(x,e))}),[x.onBlur,h.readOnly]),N=u((e=>{var t;h.readOnly||(h.isFocused()||(Vi.set(h,!0),h.emit("focus",!0)),null===(t=null==x?void 0:x.onFocus)||void 0===t||t.call(x,e))}),[x.onFocus,h.readOnly]),L=u((e=>{var t;if(h.readOnly)return;null===(t=null==x?void 0:x.onPaste)||void 0===t||t.call(x,e);const n=e.clipboardData.getData("text/html"),o=(new DOMParser).parseFromString(n,"text/html");if(o.body.childNodes.length>0){const t=Zi(h,o.body);if(t.length>0)return e.preventDefault(),void h.insertBlocks(t,{at:h.selection,focus:!0})}}),[x.onPaste,h.readOnly]),P=u((e=>{var t;const n=[];if(h.readOnly)return n;const[o,r]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===g.meta.order;return b.selection&&i&&!S.isEditor(o)&&""===S.string(b,[r[0]])&&B.includes(b.selection,r)&&B.isCollapsed(b.selection)&&n.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),n}),[h.readOnly,null===(p=h.selection)||void 0===p?void 0:p[0],g.meta.order]);return e(Ji,{id:t,slate:b,initialValue:v,onChange:k,decorate:P,renderLeaf:C,renderElement:E,eventHandlers:x,onKeyDown:j,onKeyUp:_,onFocus:N,onMouseDown:M,onBlur:T,customEditor:n,readOnly:h.readOnly,onPaste:L})},Ji=p((({id:t,slate:n,initialValue:o,onChange:r,renderLeaf:i,renderElement:l,eventHandlers:c,onKeyDown:a,onKeyUp:s,onFocus:d,onMouseDown:u,onBlur:f,onPaste:p,customEditor:h,decorate:g,readOnly:v})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:n,initialValue:o,onChange:r},{children:e(E,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:l,renderLeaf:i,className:"yoopta-slate",spellCheck:!0},c,{onKeyDown:a,onKeyUp:s,onFocus:d,onMouseDown:u,decorate:g,onBlur:f,readOnly:v,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));Ji.displayName="SlateEditorInstance";const Qi=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Me(Ot,{activationConstraint:{distance:20}}),Me(bt,{coordinateGetter:jn})),handleDragEnd:u((t=>{const{active:n,over:o}=t;if(n&&o&&n.id!==o.id){const t=e.children[o.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),el=[],tl=({editor:t,marks:o,placeholder:r})=>{const i=$(),{sensors:l,handleDragEnd:c,handleDragStart:a}=Qi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?el:s.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[s]),f=[];for(let n=0;n<u.length;n++){const i=u[n],l=t.children[i],c=t.plugins[l.type];l&&c?f.push(e(xi,Object.assign({block:l,blockId:i},{children:e(Gi,{type:l.type,id:i,marks:o,customEditor:c.customEditor,events:c.events,elements:c.elements,options:c.options,placeholder:r},i)}),i)):console.error(`Plugin ${l.type} not found`)}return i?e(n,{children:f}):e(nn,Object.assign({sensors:l,collisionDetection:He,onDragStart:a,onDragEnd:c},{children:e(mn,Object.assign({disabled:i,items:u,strategy:gn},{children:f}))}))},nl=({editor:e,root:t})=>{const[n,o]=f({origin:[0,0],coords:[0,0],selection:!1}),r=r=>{var i;if(e.readOnly||!1===t)return;const l=null===(i=e.refElement)||void 0===i?void 0:i.contains(r.target);if(!l&&!n.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();l||o({origin:[r.pageX,r.pageY-window.pageYOffset],coords:[r.pageX,r.pageY-window.pageYOffset],selection:!0})},i=r=>{if(!n.selection||e.readOnly||!1===t)return;o((e=>Object.assign(Object.assign({},e),{coords:[r.pageX,r.pageY-window.pageYOffset]})));const i=((e,t,n)=>{var o;const r=[],i=null===(o=e.refElement)||void 0===o?void 0:o.querySelectorAll("[data-yoopta-block]");return i?(i.forEach(((e,o)=>{if(!e)return;const i=e.getBoundingClientRect(),l=Math.min(t[1],n[1]),c=Math.min(t[0],n[0]),a=Math.max(t[1],n[1]),s=Math.max(t[0],n[0]);l<i.bottom&&a>i.top&&c<i.right&&s>i.left&&r.push(o)})),r):r})(e,n.origin,[r.pageX,r.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},l=()=>{e.readOnly||c()};s((()=>{var n;if(e.readOnly||!1===t)return;const o=t&&"current"in t?t.current:t||document;if(!o)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in o))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(n=e.refElement)||void 0===n?void 0:n.contains(o))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return o.addEventListener("mousedown",r),o.addEventListener("mousemove",i),o.addEventListener("mouseup",l),()=>{o.removeEventListener("mousedown",r),o.removeEventListener("mousemove",i),o.removeEventListener("mouseup",l)}}),[e.selectedBlocks,n,t,e.readOnly]);const c=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},n),{onClose:c})},ol=({origin:t,coords:n,isOpen:o})=>{if(!o)return null;const r={zIndex:10,left:t[0],top:t[1],height:Math.abs(n[1]-t[1]-1),width:Math.abs(n[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>n[1]&&t[0]>n[0]?"scaleY(-1) scaleX(-1)":t[1]>n[1]?"scaleY(-1)":t[0]>n[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:r})};var rl=Symbol.for("immer-nothing"),il=Symbol.for("immer-draftable"),ll=Symbol.for("immer-state");function cl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var al=Object.getPrototypeOf;function sl(e){return!!e&&!!e[ll]}function dl(e){return!!e&&(fl(e)||Array.isArray(e)||!!e[il]||!!e.constructor?.[il]||yl(e)||ml(e))}var ul=Object.prototype.constructor.toString();function fl(e){if(!e||"object"!=typeof e)return!1;const t=al(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ul}function pl(e,t){0===hl(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,o)=>t(o,n,e)))}function hl(e){const t=e[ll];return t?t.type_:Array.isArray(e)?1:yl(e)?2:ml(e)?3:0}function gl(e,t){return 2===hl(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vl(e,t,n){const o=hl(e);2===o?e.set(t,n):3===o?e.add(n):e[t]=n}function yl(e){return e instanceof Map}function ml(e){return e instanceof Set}function bl(e){return e.copy_||e.base_}function wl(e,t){if(yl(e))return new Map(e);if(ml(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&fl(e)){if(!al(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[ll];let o=Reflect.ownKeys(n);for(let t=0;t<o.length;t++){const r=o[t],i=n[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(al(e),n)}function xl(e,t=!1){return El(e)||sl(e)||!dl(e)||(hl(e)>1&&(e.set=e.add=e.clear=e.delete=kl),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>xl(t,!0)))),e}function kl(){cl(2)}function El(e){return Object.isFrozen(e)}var Ol,Cl={};function Sl(e){const t=Cl[e];return t||cl(0),t}function Dl(){return Ol}function jl(e,t){t&&(Sl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bl(e){_l(e),e.drafts_.forEach(Al),e.drafts_=null}function _l(e){e===Ol&&(Ol=e.parent_)}function Rl(e){return Ol={drafts_:[],parent_:Ol,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Al(e){const t=e[ll];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ml(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[ll].modified_&&(Bl(t),cl(4)),dl(e)&&(e=Tl(t,e),t.parent_||Ll(t,e)),t.patches_&&Sl("Patches").generateReplacementPatches_(n[ll].base_,e,t.patches_,t.inversePatches_)):e=Tl(t,n,[]),Bl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==rl?e:void 0}function Tl(e,t,n){if(El(t))return t;const o=t[ll];if(!o)return pl(t,((r,i)=>Nl(e,o,t,r,i,n))),t;if(o.scope_!==e)return t;if(!o.modified_)return Ll(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let r=t,i=!1;3===o.type_&&(r=new Set(t),t.clear(),i=!0),pl(r,((r,l)=>Nl(e,o,t,r,l,n,i))),Ll(e,t,!1),n&&e.patches_&&Sl("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Nl(e,t,n,o,r,i,l){if(sl(r)){const l=Tl(e,r,i&&t&&3!==t.type_&&!gl(t.assigned_,o)?i.concat(o):void 0);if(vl(n,o,l),!sl(l))return;e.canAutoFreeze_=!1}else l&&n.add(r);if(dl(r)&&!El(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Tl(e,r),t&&t.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(n,o)||Ll(e,r)}}function Ll(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xl(t,n)}var Pl={get(e,t){if(t===ll)return e;const n=bl(e);if(!gl(n,t))return function(e,t,n){const o=Fl(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}(e,n,t);const o=n[t];return e.finalized_||!dl(o)?o:o===zl(e.base_,t)?(Ul(e),e.copy_[t]=Vl(o,e)):o},has:(e,t)=>t in bl(e),ownKeys:e=>Reflect.ownKeys(bl(e)),set(e,t,n){const o=Fl(bl(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const o=zl(bl(e),t),l=o?.[ll];if(l&&l.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((r=n)===(i=o)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==n||gl(e.base_,t)))return!0;Ul(e),Hl(e)}var r,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==zl(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Ul(e),Hl(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=bl(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:o.enumerable,value:n[t]}:o},defineProperty(){cl(11)},getPrototypeOf:e=>al(e.base_),setPrototypeOf(){cl(12)}},Il={};function zl(e,t){const n=e[ll];return(n?bl(n):e)[t]}function Fl(e,t){if(!(t in e))return;let n=al(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=al(n)}}function Hl(e){e.modified_||(e.modified_=!0,e.parent_&&Hl(e.parent_))}function Ul(e){e.copy_||(e.copy_=wl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}pl(Pl,((e,t)=>{Il[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Il.deleteProperty=function(e,t){return Il.set.call(this,e,t,void 0)},Il.set=function(e,t,n){return Pl.set.call(this,e[0],t,n,e[0])};function Vl(e,t){const n=yl(e)?Sl("MapSet").proxyMap_(e,t):ml(e)?Sl("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:Dl(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,i=Pl;n&&(r=[o],i=Il);const{revoke:l,proxy:c}=Proxy.revocable(r,i);return o.draft_=c,o.revoke_=l,c}(e,t);return(t?t.scope_:Dl()).drafts_.push(n),n}function $l(e){if(!dl(e)||El(e))return e;const t=e[ll];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=wl(e,t.scope_.immer_.useStrictShallowCopy_)}else n=wl(e,!0);return pl(n,((e,t)=>{vl(n,e,$l(t))})),t&&(t.finalized_=!1),n}var Wl=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const o=this;return function(e=n,...r){return o.produce(e,(e=>t.call(this,e,...r)))}}let o;if("function"!=typeof t&&cl(6),void 0!==n&&"function"!=typeof n&&cl(7),dl(e)){const r=Rl(this),i=Vl(e,void 0);let l=!0;try{o=t(i),l=!1}finally{l?Bl(r):_l(r)}return jl(r,n),Ml(o,r)}if(!e||"object"!=typeof e){if(o=t(e),void 0===o&&(o=e),o===rl&&(o=void 0),this.autoFreeze_&&xl(o,!0),n){const t=[],r=[];Sl("Patches").generateReplacementPatches_(e,o,t,r),n(t,r)}return o}cl(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,o;return[this.produce(e,t,((e,t)=>{n=e,o=t})),n,o]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){dl(e)||cl(8),sl(e)&&(e=function(e){sl(e)||cl(10);return $l(e)}(e));const t=Rl(this),n=Vl(e,void 0);return n[ll].isManual_=!0,_l(t),n}finishDraft(e,t){const n=e&&e[ll];n&&n.isManual_||cl(9);const{scope_:o}=n;return jl(o,t),Ml(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));const o=Sl("Patches").applyPatches_;return sl(e)?o(e,t):this.produce(e,(e=>o(e,t)))}};Wl.produce,Wl.produceWithPatches.bind(Wl),Wl.setAutoFreeze.bind(Wl),Wl.setUseStrictShallowCopy.bind(Wl),Wl.applyPatches.bind(Wl);var Kl=Wl.createDraft.bind(Wl),Yl=Wl.finishDraft.bind(Wl);
7
7
  /*!
8
8
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
9
9
  *
@@ -4,14 +4,15 @@ import { PluginElementRenderProps, Plugin, PluginOptions } from './types';
4
4
  export type ExtendPluginRender<TKeys extends string> = {
5
5
  [x in TKeys]: (props: PluginElementRenderProps) => JSX.Element;
6
6
  };
7
- export type ExtendPlugin<TKeys extends string, TOptions> = {
7
+ export type ExtendPlugin<TKeys extends string, TProps, TOptions> = {
8
8
  renders?: Partial<ExtendPluginRender<TKeys>>;
9
9
  options?: Partial<PluginOptions<TOptions>>;
10
+ defaultProps?: Partial<Record<TKeys, (props: TProps) => TProps>>;
10
11
  };
11
12
  export declare class YooptaPlugin<TKeys extends string = string, TProps = Descendant, TOptions = Record<string, unknown>> {
12
13
  private readonly plugin;
13
14
  constructor(plugin: Plugin<TKeys, TProps, TOptions>);
14
15
  get getPlugin(): Plugin<TKeys, TProps, TOptions>;
15
- extend(extendPlugin: ExtendPlugin<TKeys, TOptions>): YooptaPlugin<TKeys, TProps, TOptions>;
16
+ extend(extendPlugin: ExtendPlugin<TKeys, TProps, TOptions>): YooptaPlugin<TKeys, TProps, TOptions>;
16
17
  }
17
18
  //# sourceMappingURL=createYooptaPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createYooptaPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/createYooptaPlugin.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1E,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,MAAM,IAAI;KACpD,CAAC,IAAI,KAAK,GAAG,CAAC,KAAK,EAAE,wBAAwB,KAAK,GAAG,CAAC,OAAO;CAC/D,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,IAAI;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF,qBAAa,YAAY,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9G,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkC;gBAE7C,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;IAInD,IAAI,SAAS,oCAEZ;IAED,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;CA4B3F"}
1
+ {"version":3,"file":"createYooptaPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/createYooptaPlugin.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1E,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,MAAM,IAAI;KACpD,CAAC,IAAI,KAAK,GAAG,CAAC,KAAK,EAAE,wBAAwB,KAAK,GAAG,CAAC,OAAO;CAC/D,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,KAAK,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,IAAI;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC;CAClE,CAAC;AAEF,qBAAa,YAAY,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9G,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkC;gBAE7C,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;IAInD,IAAI,SAAS,oCAEZ;IAED,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;CAyCnG"}
@@ -1,2 +1,3 @@
1
- export declare const withInlines: (editor: any) => any;
1
+ import { SlateEditor, YooEditor } from '../../editor/types';
2
+ export declare const withInlines: (editor: YooEditor, slate: SlateEditor) => SlateEditor;
2
3
  //# sourceMappingURL=withInlines.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withInlines.d.ts","sourceRoot":"","sources":["../../../src/plugins/extenstions/withInlines.ts"],"names":[],"mappings":"AAwDA,eAAO,MAAM,WAAW,sBAwBvB,CAAC"}
1
+ {"version":3,"file":"withInlines.d.ts","sourceRoot":"","sources":["../../../src/plugins/extenstions/withInlines.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA2D5D,eAAO,MAAM,WAAW,WAAY,SAAS,SAAS,WAAW,gBAwBhE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/editor",
3
- "version": "4.6.8-rc.2",
3
+ "version": "4.6.9-rc.0",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -67,5 +67,5 @@
67
67
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
68
68
  },
69
69
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
70
- "gitHead": "da6fe4a17d3d3e620ddbaa86f236cd415b450b62"
70
+ "gitHead": "06ca135d5877d96ceee2c72347a05d237ce8e802"
71
71
  }