@yoopta/editor 4.0.0-rc.23 → 4.0.0-rc.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),r=require("slate-react"),o=require("slate");function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var a=i(t),s=i(n);class l{constructor(e){this.plugin=e}get getPlugin(){return this.plugin}extend(e){const{renders:t,options:n}=e,r=Object.assign(Object.assign({},this.plugin.options),n),o=Object.assign({},this.plugin.elements);return t&&Object.keys(t).forEach((e=>{const n=o[e];n&&n.render&&(o[e].render=n=>t[e](n))})),new l({type:this.plugin.type,elements:o,events:this.plugin.events,parsers:this.plugin.parsers,options:r})}}function c(e,t={}){const n=Object.keys(e.children),{at:r=e.selection}=t,o=n.find((t=>e.children[t].meta.order===(null==r?void 0:r[0])));return o?e.children[o]:null}const d={editor:{getBlock:()=>{},insertBlock:()=>{},insertBlocks:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},toggleBlock:()=>{},focusBlock:()=>{},setSelection:()=>{},applyChanges:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},setBlockSelected:()=>{},selectedBlocks:[],duplicateBlock:()=>{},getEditorValue:()=>{},blur:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,readOnly:!1,blockEditorsMap:{},children:{},emit:()=>{},on:()=>{},off:()=>{},once:()=>{}}},u=t.createContext(d),f=({children:n,editorState:r})=>{const o=t.useRef(d);return o.current={editor:r.editor},e.jsx(u.Provider,Object.assign({value:o.current},{children:n}))},p=()=>{const e=t.useContext(u);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},h=e=>p().children[e],g=e=>p().plugins[e],v=()=>p().readOnly;var m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},b={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new o(r,i||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o<i;o++)a[o]=r[o].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,o,i,a){var s=n?n+e:e;if(!this._events[s])return!1;var l,c,d=this._events[s],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,r),!0;case 4:return d.fn.call(d.context,t,r,o),!0;case 5:return d.fn.call(d.context,t,r,o,i),!0;case 6:return d.fn.call(d.context,t,r,o,i,a),!0}for(c=1,l=new Array(u-1);c<u;c++)l[c-1]=arguments[c];d.fn.apply(d.context,l)}else{var f,p=d.length;for(c=0;c<p;c++)switch(d[c].once&&this.removeListener(e,d[c].fn,void 0,!0),u){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,t);break;case 3:d[c].fn.call(d[c].context,t,r);break;case 4:d[c].fn.call(d[c].context,t,r,o);break;default:if(!l)for(f=1,l=new Array(u-1);f<u;f++)l[f-1]=arguments[f];d[c].fn.apply(d[c].context,l)}}return!0},s.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||r&&s.context!==r||a(this,i);else{for(var l=0,c=[],d=s.length;l<d;l++)(s[l].fn!==t||o&&!s[l].once||r&&s[l].context!==r)&&c.push(s[l]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}({get exports(){return b},set exports(e){b=e}});var y=b;function w(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}const x=()=>{var e,t;return"undefined"==typeof window||"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?w():null===(t=window.crypto)||void 0===t?void 0:t.randomUUID()},k=e=>({id:x(),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)}),E=e=>({id:(null==e?void 0:e.id)||x(),value:(null==e?void 0:e.value)||[k()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function O(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function S(e){return"nodeType"in e}function j(e){var t,n;return e?O(e)?e:S(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function R(e){const{Document:t}=j(e);return e instanceof t}function _(e){return!O(e)&&e instanceof j(e).HTMLElement}function D(e){return e instanceof j(e).SVGElement}function B(e){return e?O(e)?e.document:S(e)?R(e)?e:_(e)||D(e)?e.ownerDocument:document:document:document}const T=C?t.useLayoutEffect:t.useEffect;function A(e){const n=t.useRef(e);return T((()=>{n.current=e})),t.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}function M(e,n){void 0===n&&(n=[e]);const r=t.useRef(e);return T((()=>{r.current!==e&&(r.current=e)}),n),r}function L(e,n){const r=t.useRef();return t.useMemo((()=>{const t=e(r.current);return r.current=t,t}),[...n])}function N(e){const n=A(e),r=t.useRef(null),o=t.useCallback((e=>{e!==r.current&&(null==n||n(e,r.current)),r.current=e}),[]);return[r,o]}function P(e){const n=t.useRef();return t.useEffect((()=>{n.current=e}),[e]),n.current}let I={};function z(e,n){return t.useMemo((()=>{if(n)return n;const t=null==I[e]?0:I[e]+1;return I[e]=t,e+"-"+t}),[e,n])}function F(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const U=F(1),H=F(-1);function V(e){if(!e)return!1;const{KeyboardEvent:t}=j(e.target);return t&&e instanceof t}function Y(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=j(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 W=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[W.Translate.toString(e),W.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),K="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function $(e){return e.matches(K)?e:e.querySelector(K)}const X={display:"none"};function q(e){let{id:n,value:r}=e;return t.createElement("div",{id:n,style:X},r)}function Z(e){let{id:n,announcement:r,ariaLiveType:o="assertive"}=e;return t.createElement("div",{id:n,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},r)}const G=t.createContext(null);const J={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Q={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ee(e){let{announcements:r=Q,container:o,hiddenTextDescribedById:i,screenReaderInstructions:a=J}=e;const{announce:s,announcement:l}=function(){const[e,n]=t.useState("");return{announce:t.useCallback((e=>{null!=e&&n(e)}),[]),announcement:e}}(),c=z("DndLiveRegion"),[d,u]=t.useState(!1);if(t.useEffect((()=>{u(!0)}),[]),function(e){const n=t.useContext(G);t.useEffect((()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)}),[e,n])}(t.useMemo((()=>({onDragStart(e){let{active:t}=e;s(r.onDragStart({active:t}))},onDragMove(e){let{active:t,over:n}=e;r.onDragMove&&s(r.onDragMove({active:t,over:n}))},onDragOver(e){let{active:t,over:n}=e;s(r.onDragOver({active:t,over:n}))},onDragEnd(e){let{active:t,over:n}=e;s(r.onDragEnd({active:t,over:n}))},onDragCancel(e){let{active:t,over:n}=e;s(r.onDragCancel({active:t,over:n}))}})),[s,r])),!d)return null;const f=t.createElement(t.Fragment,null,t.createElement(q,{id:i,value:a.draggable}),t.createElement(Z,{id:c,announcement:l}));return o?n.createPortal(f,o):f}var te;function ne(){}function re(e,n){return t.useMemo((()=>({sensor:e,options:null!=n?n:{}})),[e,n])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(te||(te={}));const oe=Object.freeze({x:0,y:0});function ie(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ae(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function se(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function le(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function ce(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function de(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 ue=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=de(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=ie(de(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(ae)};function fe(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,s=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*s;return Number((o/(n+r-o)).toFixed(4))}return 0}const pe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=fe(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(se)};function he(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:oe}function ge(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const ve=ge(1);const me={ignoreTransform:!1};function be(e,t){void 0===t&&(t=me);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=j(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:s}=r,l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:s,right:l}=n;return{top:r,left:o,width:i,height:a,bottom:s,right:l}}function ye(e){return be(e,{ignoreTransform:!0})}function we(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(R(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!_(o)||D(o))return n;if(n.includes(o))return n;const i=j(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=j(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=j(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function xe(e){const[t]=we(e,1);return null!=t?t:null}function ke(e){return C&&e?O(e)?e:S(e)?R(e)||e===B(e).scrollingElement?window:_(e)?e:null:null:null}function Ee(e){return O(e)?e.scrollX:e.scrollLeft}function Ce(e){return O(e)?e.scrollY:e.scrollTop}function Oe(e){return{x:Ee(e),y:Ce(e)}}var Se;function je(e){return!(!C||!e)&&e===document.scrollingElement}function Re(e){const t={x:0,y:0},n=je(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Se||(Se={}));const _e={x:.2,y:.2};function De(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=_e);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=Re(e),p={x:0,y:0},h={x:0,y:0},g=t.height*o.y,v=t.width*o.x;return!c&&i<=t.top+g?(p.y=Se.Backward,h.y=r*Math.abs((t.top+g-i)/g)):!d&&l>=t.bottom-g&&(p.y=Se.Forward,h.y=r*Math.abs((t.bottom-g-l)/g)),!f&&s>=t.right-v?(p.x=Se.Forward,h.x=r*Math.abs((t.right-v-s)/v)):!u&&a<=t.left+v&&(p.x=Se.Backward,h.x=r*Math.abs((t.left+v-a)/v)),{direction:p,speed:h}}function Be(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Te(e){return e.reduce(((e,t)=>U(e,Oe(t))),oe)}const Ae=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Ee(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+Ce(t)),0)}]];class Me{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=we(t),r=Te(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Ae)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Le{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Ne(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Pe,Ie;function ze(e){e.preventDefault()}function Fe(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Pe||(Pe={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(Ie||(Ie={}));const Ue={start:[Ie.Space,Ie.Enter],cancel:[Ie.Esc],end:[Ie.Space,Ie.Enter]},He=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ie.Right:return{...n,x:n.x+25};case Ie.Left:return{...n,x:n.x-25};case Ie.Down:return{...n,y:n.y+25};case Ie.Up:return{...n,y:n.y-25}}};class Ve{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Le(B(t)),this.windowListeners=new Le(j(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Pe.Resize,this.handleCancel),this.windowListeners.add(Pe.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(Pe.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=be),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);xe(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(oe)}handleKeyDown(e){if(V(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Ue,coordinateGetter:i=He,scrollBehavior:a="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:oe;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=H(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:s,isLeft:l,isBottom:c,maxScroll:u,minScroll:f}=Re(n),p=Be(n),h={x:Math.min(o===Ie.Right?p.right-p.width/2:p.right,Math.max(o===Ie.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(o===Ie.Down?p.bottom-p.height/2:p.bottom,Math.max(o===Ie.Down?p.top:p.top+p.height/2,d.y))},g=o===Ie.Right&&!s||o===Ie.Left&&!l,v=o===Ie.Down&&!c||o===Ie.Up&&!i;if(g&&h.x!==d.x){const e=n.scrollLeft+t.x,i=o===Ie.Right&&e<=u.x||o===Ie.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Ie.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(v&&h.y!==d.y){const e=n.scrollTop+t.y,i=o===Ie.Down&&e<=u.y||o===Ie.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Ie.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,U(H(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Ye(e){return Boolean(e&&"distance"in e)}function We(e){return Boolean(e&&"delay"in e)}Ve.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Ue,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class Ke{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=j(e);return e instanceof t?e:B(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=B(i),this.documentListeners=new Le(this.document),this.listeners=new Le(n),this.windowListeners=new Le(j(i)),this.initialCoordinates=null!=(r=Y(o))?r:oe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Pe.Resize,this.handleCancel),this.windowListeners.add(Pe.DragStart,ze),this.windowListeners.add(Pe.VisibilityChange,this.handleCancel),this.windowListeners.add(Pe.ContextMenu,ze),this.documentListeners.add(Pe.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(We(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(Ye(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(Pe.Click,Fe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Pe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const s=null!=(t=Y(e))?t:oe,l=H(r,s);if(!n&&a){if(Ye(a)){if(null!=a.tolerance&&Ne(l,a.tolerance))return this.handleCancel();if(Ne(l,a.distance))return this.handleStart()}return We(a)&&Ne(l,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(s)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Ie.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const $e={move:{name:"pointermove"},end:{name:"pointerup"}};class Xe extends Ke{constructor(e){const{event:t}=e,n=B(t.target);super(e,$e,n)}}Xe.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const qe={move:{name:"mousemove"},end:{name:"mouseup"}};var Ze;!function(e){e[e.RightClick=2]="RightClick"}(Ze||(Ze={}));(class extends Ke{constructor(e){super(e,qe,B(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Ze.RightClick&&(null==r||r({event:n}),!0)}}];const Ge={move:{name:"touchmove"},end:{name:"touchend"}};var Je,Qe;function et(e){let{acceleration:n,activator:r=Je.Pointer,canScroll:o,draggingRect:i,enabled:a,interval:s=5,order:l=Qe.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=P(t);return L((e=>{if(n||!r||!e)return tt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Se.Backward]:e.x[Se.Backward]||-1===o.x,[Se.Forward]:e.x[Se.Forward]||1===o.x},y:{[Se.Backward]:e.y[Se.Backward]||-1===o.y,[Se.Forward]:e.y[Se.Forward]||1===o.y}}}),[n,t,r])}({delta:f,disabled:!a}),[g,v]=function(){const e=t.useRef(null);return[t.useCallback(((t,n)=>{e.current=setInterval(t,n)}),[]),t.useCallback((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),m=t.useRef({x:0,y:0}),b=t.useRef({x:0,y:0}),y=t.useMemo((()=>{switch(r){case Je.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Je.DraggableRect:return i}}),[r,i,c]),w=t.useRef(null),x=t.useCallback((()=>{const e=w.current;if(!e)return;const t=m.current.x*b.current.x,n=m.current.y*b.current.y;e.scrollBy(t,n)}),[]),k=t.useMemo((()=>l===Qe.TreeOrder?[...d].reverse():d),[l,d]);t.useEffect((()=>{if(a&&d.length&&y){for(const e of k){if(!1===(null==o?void 0:o(e)))continue;const t=d.indexOf(e),r=u[t];if(!r)continue;const{direction:i,speed:a}=De(e,r,y,n,p);for(const e of["x","y"])h[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return v(),w.current=e,g(x,s),m.current=a,void(b.current=i)}m.current={x:0,y:0},b.current={x:0,y:0},v()}else v()}),[n,x,o,v,a,s,JSON.stringify(y),JSON.stringify(h),g,d,k,u,JSON.stringify(p)])}(class extends Ke{constructor(e){super(e,Ge)}static setup(){return window.addEventListener(Ge.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ge.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Je||(Je={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Qe||(Qe={}));const tt={x:{[Se.Backward]:!1,[Se.Forward]:!1},y:{[Se.Backward]:!1,[Se.Forward]:!1}};var nt,rt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(nt||(nt={})),function(e){e.Optimized="optimized"}(rt||(rt={}));const ot=new Map;function it(e,t){return L((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function at(e){let{callback:n,disabled:r}=e;const o=A(n),i=t.useMemo((()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[r]);return t.useEffect((()=>()=>null==i?void 0:i.disconnect()),[i]),i}function st(e){return new Me(be(e),e)}function lt(e,n,r){void 0===n&&(n=st);const[o,i]=t.useReducer((function(t){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=t?t:r)?o:null;const i=n(e);if(JSON.stringify(t)===JSON.stringify(i))return t;return i}),null),a=function(e){let{callback:n,disabled:r}=e;const o=A(n),i=t.useMemo((()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,r]);return t.useEffect((()=>()=>null==i?void 0:i.disconnect()),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),s=at({callback:i});return T((()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())}),[e]),o}const ct=[];function dt(e,n){void 0===n&&(n=[]);const r=t.useRef(null);return t.useEffect((()=>{r.current=null}),n),t.useEffect((()=>{const t=e!==oe;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)}),[e]),r.current?H(e,r.current):oe}function ut(e){return t.useMemo((()=>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 ft=[];function pt(e){let{measure:n}=e;const[r,o]=t.useState(null),i=t.useCallback((e=>{for(const{target:t}of e)if(_(t)){o((e=>{const r=n(t);return e?{...e,width:r.width,height:r.height}:r}));break}}),[n]),a=at({callback:i}),s=t.useCallback((e=>{const t=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return _(t)?t:e}(e);null==a||a.disconnect(),t&&(null==a||a.observe(t)),o(t?n(t):null)}),[n,a]),[l,c]=N(s);return t.useMemo((()=>({nodeRef:l,rect:r,setRef:c})),[r,l,c])}const ht=[{sensor:Xe,options:{}},{sensor:Ve,options:{}}],gt={current:{}},vt={draggable:{measure:ye},droppable:{measure:ye,strategy:nt.WhileDragging,frequency:rt.Optimized},dragOverlay:{measure:be}};class mt 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 bt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ne},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:vt,measureDroppableContainers:ne,windowRect:null,measuringScheduled:!1},yt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ne,draggableNodes:new Map,over:null,measureDroppableContainers:ne},wt=t.createContext(yt),xt=t.createContext(bt);function kt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mt}}}function Et(e,t){switch(t.type){case te.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case te.DragMove:return 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 te.DragEnd:case te.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case te.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new mt(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case te.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new mt(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case te.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new mt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Ct(e){let{disabled:n}=e;const{active:r,activatorEvent:o,draggableNodes:i}=t.useContext(wt),a=P(o),s=P(null==r?void 0:r.id);return t.useEffect((()=>{if(!n&&!o&&a&&null!=s){if(!V(a))return;if(document.activeElement===a.target)return;const e=i.get(s);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=$(e);if(t){t.focus();break}}}))}}),[o,n,i,s,a]),null}const Ot=t.createContext({...oe,scaleX:1,scaleY:1});var St;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(St||(St={}));const jt=t.memo((function(e){var r,o,i,a;let{id:s,accessibility:l,autoScroll:c=!0,children:d,sensors:u=ht,collisionDetection:f=pe,measuring:p,modifiers:h,...g}=e;const v=t.useReducer(Et,void 0,kt),[m,b]=v,[y,w]=function(){const[e]=t.useState((()=>new Set)),n=t.useCallback((t=>(e.add(t),()=>e.delete(t))),[e]);return[t.useCallback((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),n]}(),[x,k]=t.useState(St.Uninitialized),E=x===St.Initialized,{draggable:{active:O,nodes:S,translate:R},droppable:{containers:_}}=m,D=O?S.get(O):null,B=t.useRef({initial:null,translated:null}),A=t.useMemo((()=>{var e;return null!=O?{id:O,data:null!=(e=null==D?void 0:D.data)?e:gt,rect:B}:null}),[O,D]),N=t.useRef(null),[P,I]=t.useState(null),[F,H]=t.useState(null),V=M(g,Object.values(g)),W=z("DndDescribedBy",s),K=t.useMemo((()=>_.getEnabled()),[_]),$=(X=p,t.useMemo((()=>({draggable:{...vt.draggable,...null==X?void 0:X.draggable},droppable:{...vt.droppable,...null==X?void 0:X.droppable},dragOverlay:{...vt.dragOverlay,...null==X?void 0:X.dragOverlay}})),[null==X?void 0:X.draggable,null==X?void 0:X.droppable,null==X?void 0:X.dragOverlay]));var X;const{droppableRects:q,measureDroppableContainers:Z,measuringScheduled:J}=function(e,n){let{dragging:r,dependencies:o,config:i}=n;const[a,s]=t.useState(null),{frequency:l,measure:c,strategy:d}=i,u=t.useRef(e),f=function(){switch(d){case nt.Always:return!1;case nt.BeforeDragging:return r;default:return!r}}(),p=M(f),h=t.useCallback((function(e){void 0===e&&(e=[]),p.current||s((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[p]),g=t.useRef(null),v=L((t=>{if(f&&!r)return ot;if(!t||t===ot||u.current!==e||null!=a){const t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Me(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,a,r,f,c]);return t.useEffect((()=>{u.current=e}),[e]),t.useEffect((()=>{f||h()}),[r,f]),t.useEffect((()=>{a&&a.length>0&&s(null)}),[JSON.stringify(a)]),t.useEffect((()=>{f||"number"!=typeof l||null!==g.current||(g.current=setTimeout((()=>{h(),g.current=null}),l))}),[l,f,h,...o]),{droppableRects:v,measureDroppableContainers:h,measuringScheduled:null!=a}}(K,{dragging:E,dependencies:[R.x,R.y],config:$.droppable}),Q=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return L((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(S,O),ne=t.useMemo((()=>F?Y(F):null),[F]),re=function(){const e=!1===(null==P?void 0:P.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,n=E&&!e&&!t;if("object"==typeof c)return{...c,enabled:n};return{enabled:n}}(),ie=function(e,t){return it(e,t)}(Q,$.draggable.measure);!function(e){let{activeNode:n,measure:r,initialRect:o,config:i=!0}=e;const a=t.useRef(!1),{x:s,y:l}="boolean"==typeof i?{x:i,y:i}:i;T((()=>{if(!s&&!l||!n)return void(a.current=!1);if(a.current||!o)return;const e=null==n?void 0:n.node.current;if(!e||!1===e.isConnected)return;const t=he(r(e),o);if(s||(t.x=0),l||(t.y=0),a.current=!0,Math.abs(t.x)>0||Math.abs(t.y)>0){const n=xe(e);n&&n.scrollBy({top:t.y,left:t.x})}}),[n,s,l,o,r])}({activeNode:O?S.get(O):null,config:re.layoutShiftCompensation,initialRect:ie,measure:$.draggable.measure});const ae=lt(Q,$.draggable.measure,ie),se=lt(Q?Q.parentElement:null),le=t.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),de=_.getNodeFor(null==(r=le.current.over)?void 0:r.id),ue=pt({measure:$.dragOverlay.measure}),fe=null!=(o=ue.nodeRef.current)?o:Q,ge=E?null!=(i=ue.rect)?i:ae:null,me=Boolean(ue.nodeRef.current&&ue.rect),ye=he(Ee=me?null:ae,it(Ee));var Ee;const Ce=ut(fe?j(fe):null),Se=function(e){const n=t.useRef(e),r=L((t=>e?t&&t!==ct&&e&&n.current&&e.parentNode===n.current.parentNode?t:we(e):ct),[e]);return t.useEffect((()=>{n.current=e}),[e]),r}(E?null!=de?de:Q:null),Re=function(e,n){void 0===n&&(n=be);const[r]=e,o=ut(r?j(r):null),[i,a]=t.useReducer((function(){return e.length?e.map((e=>je(e)?o:new Me(n(e),e))):ft}),ft),s=at({callback:a});return e.length>0&&i===ft&&a(),T((()=>{e.length?e.forEach((e=>null==s?void 0:s.observe(e))):(null==s||s.disconnect(),a())}),[e]),i}(Se),_e=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}(h,{transform:{x:R.x-ye.x,y:R.y-ye.y,scaleX:1,scaleY:1},activatorEvent:F,active:A,activeNodeRect:ae,containerNodeRect:se,draggingNodeRect:ge,over:le.current.over,overlayNodeRect:ue.rect,scrollableAncestors:Se,scrollableAncestorRects:Re,windowRect:Ce}),De=ne?U(ne,R):null,Be=function(e){const[n,r]=t.useState(null),o=t.useRef(e),i=t.useCallback((e=>{const t=ke(e.target);t&&r((e=>e?(e.set(t,Oe(t)),new Map(e)):null))}),[]);return t.useEffect((()=>{const t=o.current;if(e!==t){n(t);const a=e.map((e=>{const t=ke(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,Oe(t)]):null})).filter((e=>null!=e));r(a.length?new Map(a):null),o.current=e}return()=>{n(e),n(t)};function n(e){e.forEach((e=>{const t=ke(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,e]),t.useMemo((()=>e.length?n?Array.from(n.values()).reduce(((e,t)=>U(e,t)),oe):Te(e):oe),[e,n])}(Se),Ae=dt(Be),Le=dt(Be,[ae]),Ne=U(_e,Ae),Pe=ge?ve(ge,_e):null,Ie=A&&Pe?f({active:A,collisionRect:Pe,droppableRects:q,droppableContainers:K,pointerCoordinates:De}):null,ze=ce(Ie,"id"),[Fe,Ue]=t.useState(null),He=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(me?_e:U(_e,Le),null!=(a=null==Fe?void 0:Fe.rect)?a:null,ae),Ve=t.useCallback(((e,t)=>{let{sensor:r,options:o}=t;if(null==N.current)return;const i=S.get(N.current);if(!i)return;const a=e.nativeEvent,s=new r({active:N.current,activeNode:i,event:a,options:o,context:le,onStart(e){const t=N.current;if(null==t)return;const r=S.get(t);if(!r)return;const{onDragStart:o}=V.current,i={active:{id:t,data:r.data,rect:B}};n.unstable_batchedUpdates((()=>{null==o||o(i),k(St.Initializing),b({type:te.DragStart,initialCoordinates:e,active:t}),y({type:"onDragStart",event:i})}))},onMove(e){b({type:te.DragMove,coordinates:e})},onEnd:l(te.DragEnd),onCancel:l(te.DragCancel)});function l(e){return async function(){const{active:t,collisions:r,over:o,scrollAdjustedTranslate:i}=le.current;let s=null;if(t&&i){const{cancelDrop:n}=V.current;if(s={activatorEvent:a,active:t,collisions:r,delta:i,over:o},e===te.DragEnd&&"function"==typeof n){await Promise.resolve(n(s))&&(e=te.DragCancel)}}N.current=null,n.unstable_batchedUpdates((()=>{b({type:e}),k(St.Uninitialized),Ue(null),I(null),H(null);const t=e===te.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=V.current[t];null==e||e(s),y({type:t,event:s})}}))}}n.unstable_batchedUpdates((()=>{I(s),H(e.nativeEvent)}))}),[S]),Ye=t.useCallback(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=S.get(r);if(null!==N.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},N.current=r,Ve(n,t))}),[S,Ve]),We=function(e,n){return t.useMemo((()=>e.reduce(((e,t)=>{const{sensor:r}=t;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:n(e.handler,t)})))]}),[])),[e,n])}(u,Ye);!function(e){t.useEffect((()=>{if(!C)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(u),T((()=>{ae&&x===St.Initializing&&k(St.Initialized)}),[ae,x]),t.useEffect((()=>{const{onDragMove:e}=V.current,{active:t,activatorEvent:r,collisions:o,over:i}=le.current;if(!t||!r)return;const a={active:t,activatorEvent:r,collisions:o,delta:{x:Ne.x,y:Ne.y},over:i};n.unstable_batchedUpdates((()=>{null==e||e(a),y({type:"onDragMove",event:a})}))}),[Ne.x,Ne.y]),t.useEffect((()=>{const{active:e,activatorEvent:t,collisions:r,droppableContainers:o,scrollAdjustedTranslate:i}=le.current;if(!e||null==N.current||!t||!i)return;const{onDragOver:a}=V.current,s=o.get(ze),l=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,c={active:e,activatorEvent:t,collisions:r,delta:{x:i.x,y:i.y},over:l};n.unstable_batchedUpdates((()=>{Ue(l),null==a||a(c),y({type:"onDragOver",event:c})}))}),[ze]),T((()=>{le.current={activatorEvent:F,active:A,activeNode:Q,collisionRect:Pe,collisions:Ie,droppableRects:q,draggableNodes:S,draggingNode:fe,draggingNodeRect:ge,droppableContainers:_,over:Fe,scrollableAncestors:Se,scrollAdjustedTranslate:Ne},B.current={initial:ge,translated:Pe}}),[A,Q,Ie,Pe,S,fe,ge,q,_,Fe,Se,Ne]),et({...re,delta:R,draggingRect:Pe,pointerCoordinates:De,scrollableAncestors:Se,scrollableAncestorRects:Re});const Ke=t.useMemo((()=>({active:A,activeNode:Q,activeNodeRect:ae,activatorEvent:F,collisions:Ie,containerNodeRect:se,dragOverlay:ue,draggableNodes:S,droppableContainers:_,droppableRects:q,over:Fe,measureDroppableContainers:Z,scrollableAncestors:Se,scrollableAncestorRects:Re,measuringConfiguration:$,measuringScheduled:J,windowRect:Ce})),[A,Q,ae,F,Ie,se,ue,S,_,q,Fe,Z,Se,Re,$,J,Ce]),$e=t.useMemo((()=>({activatorEvent:F,activators:We,active:A,activeNodeRect:ae,ariaDescribedById:{draggable:W},dispatch:b,draggableNodes:S,over:Fe,measureDroppableContainers:Z})),[F,We,A,ae,b,W,S,Fe,Z]);return t.createElement(G.Provider,{value:w},t.createElement(wt.Provider,{value:$e},t.createElement(xt.Provider,{value:Ke},t.createElement(Ot.Provider,{value:He},d)),t.createElement(Ct,{disabled:!1===(null==l?void 0:l.restoreFocus)})),t.createElement(ee,{...l,hiddenTextDescribedById:W}))})),Rt=t.createContext(null),_t="button",Dt="Droppable";function Bt(e){let{id:n,data:r,disabled:o=!1,attributes:i}=e;const a=z(Dt),{activators:s,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:p}=t.useContext(wt),{role:h=_t,roleDescription:g="draggable",tabIndex:v=0}=null!=i?i:{},m=(null==c?void 0:c.id)===n,b=t.useContext(m?Ot:Rt),[y,w]=N(),[x,k]=N(),E=function(e,n){return t.useMemo((()=>e.reduce(((e,t)=>{let{eventName:r,handler:o}=t;return e[r]=e=>{o(e,n)},e}),{})),[e,n])}(s,n),C=M(r);T((()=>(f.set(n,{id:n,key:a,node:y,activatorNode:x,data:C}),()=>{const e=f.get(n);e&&e.key===a&&f.delete(n)})),[f,n]);return{active:c,activatorEvent:l,activeNodeRect:d,attributes:t.useMemo((()=>({role:h,tabIndex:v,"aria-disabled":o,"aria-pressed":!(!m||h!==_t)||void 0,"aria-roledescription":g,"aria-describedby":u.draggable})),[o,h,v,m,g,u.draggable]),isDragging:m,listeners:o?void 0:E,node:y,over:p,setNodeRef:w,setActivatorNodeRef:k,transform:b}}const Tt="Droppable",At={timeout:25};function Mt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Lt(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function Nt(e){return null!==e&&e>=0}const Pt=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Mt(t,r,n),a=t[o],s=i[o];return s&&a?{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}:null},It={scaleX:1,scaleY:1},zt=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const s=null!=(t=i[n])?t:r;if(!s)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(s.top+s.height):e.top-s.top,...It}:null}const l=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=a?{x:0,y:-s.height-l,...It}:o<n&&o>=a?{x:0,y:s.height+l,...It}:{x:0,y:0,...It}};const Ft="Sortable",Ut=t.createContext({activeIndex:-1,containerId:Ft,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Pt,disabled:{draggable:!1,droppable:!1}});function Ht(e){let{children:n,id:r,items:o,strategy:i=Pt,disabled:a=!1}=e;const{active:s,dragOverlay:l,droppableRects:c,over:d,measureDroppableContainers:u}=t.useContext(xt),f=z(Ft,r),p=Boolean(null!==l.rect),h=t.useMemo((()=>o.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[o]),g=null!=s,v=s?h.indexOf(s.id):-1,m=d?h.indexOf(d.id):-1,b=t.useRef(h),y=!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}(h,b.current),w=-1!==m&&-1===v||y,x=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(a);T((()=>{y&&g&&u(h)}),[y,h,g,u]),t.useEffect((()=>{b.current=h}),[h]);const k=t.useMemo((()=>({activeIndex:v,containerId:f,disabled:x,disableTransforms:w,items:h,overIndex:m,useDragOverlay:p,sortedRects:Lt(h,c),strategy:i})),[v,f,x.draggable,x.droppable,w,h,m,c,p,i]);return t.createElement(Ut.Provider,{value:k},n)}const Vt=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Mt(n,r,o).indexOf(t)},Yt=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:s,previousContainerId:l,transition:c}=e;return!(!c||!r)&&((s===i||o!==a)&&(!!n||a!==o&&t===l))},Wt={duration:200,easing:"ease"},Kt="transform",$t=W.Transition.toString({property:Kt,duration:0,easing:"linear"}),Xt={roleDescription:"sortable"};function qt(e){let{animateLayoutChanges:n=Yt,attributes:r,disabled:o,data:i,getNewIndex:a=Vt,id:s,strategy:l,resizeObserverConfig:c,transition:d=Wt}=e;const{items:u,containerId:f,activeIndex:p,disabled:h,disableTransforms:g,sortedRects:v,overIndex:m,useDragOverlay:b,strategy:y}=t.useContext(Ut),w=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(o,h),x=u.indexOf(s),k=t.useMemo((()=>({sortable:{containerId:f,index:x,items:u},...i})),[f,i,x,u]),E=t.useMemo((()=>u.slice(u.indexOf(s))),[u,s]),{rect:C,node:O,isOver:S,setNodeRef:j}=function(e){let{data:n,disabled:r=!1,id:o,resizeObserverConfig:i}=e;const a=z(Tt),{active:s,dispatch:l,over:c,measureDroppableContainers:d}=t.useContext(wt),u=t.useRef({disabled:r}),f=t.useRef(!1),p=t.useRef(null),h=t.useRef(null),{disabled:g,updateMeasurementsFor:v,timeout:m}={...At,...i},b=M(null!=v?v:o),y=at({callback:t.useCallback((()=>{f.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout((()=>{d(Array.isArray(b.current)?b.current:[b.current]),h.current=null}),m)):f.current=!0}),[m]),disabled:g||!s}),w=t.useCallback(((e,t)=>{y&&(t&&(y.unobserve(t),f.current=!1),e&&y.observe(e))}),[y]),[x,k]=N(w),E=M(n);return t.useEffect((()=>{y&&x.current&&(y.disconnect(),f.current=!1,y.observe(x.current))}),[x,y]),T((()=>(l({type:te.RegisterDroppable,element:{id:o,key:a,disabled:r,node:x,rect:p,data:E}}),()=>l({type:te.UnregisterDroppable,key:a,id:o}))),[o]),t.useEffect((()=>{r!==u.current.disabled&&(l({type:te.SetDroppableDisabled,id:o,key:a,disabled:r}),u.current.disabled=r)}),[o,a,r,l]),{active:s,rect:p,isOver:(null==c?void 0:c.id)===o,node:x,over:c,setNodeRef:k}}({id:s,data:k,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:R,activatorEvent:_,activeNodeRect:D,attributes:B,setNodeRef:A,listeners:L,isDragging:P,over:I,setActivatorNodeRef:F,transform:U}=Bt({id:s,data:k,attributes:{...Xt,...r},disabled:w.draggable}),H=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.useMemo((()=>e=>{n.forEach((t=>t(e)))}),n)}(j,A),Y=Boolean(R),K=Y&&!g&&Nt(p)&&Nt(m),$=!b&&P,X=$&&K?U:null,q=K?null!=X?X:(null!=l?l:y)({rects:v,activeNodeRect:D,activeIndex:p,overIndex:m,index:x}):null,Z=Nt(p)&&Nt(m)?a({id:s,items:u,activeIndex:p,overIndex:m}):x,G=null==R?void 0:R.id,J=t.useRef({activeId:G,items:u,newIndex:Z,containerId:f}),Q=u!==J.current.items,ee=n({active:R,containerId:f,isDragging:P,isSorting:Y,id:s,index:x,items:u,newIndex:J.current.newIndex,previousItems:J.current.items,previousContainerId:J.current.containerId,transition:d,wasDragging:null!=J.current.activeId}),ne=function(e){let{disabled:n,index:r,node:o,rect:i}=e;const[a,s]=t.useState(null),l=t.useRef(r);return T((()=>{if(!n&&r!==l.current&&o.current){const e=i.current;if(e){const t=be(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)&&s(n)}}r!==l.current&&(l.current=r)}),[n,r,o,i]),t.useEffect((()=>{a&&s(null)}),[a]),a}({disabled:!ee,index:x,node:O,rect:C});return t.useEffect((()=>{Y&&J.current.newIndex!==Z&&(J.current.newIndex=Z),f!==J.current.containerId&&(J.current.containerId=f),u!==J.current.items&&(J.current.items=u)}),[Y,Z,f,u]),t.useEffect((()=>{if(G===J.current.activeId)return;if(G&&!J.current.activeId)return void(J.current.activeId=G);const e=setTimeout((()=>{J.current.activeId=G}),50);return()=>clearTimeout(e)}),[G]),{active:R,activeIndex:p,attributes:B,data:k,rect:C,index:x,newIndex:Z,items:u,isOver:S,isSorting:Y,isDragging:P,listeners:L,node:O,overIndex:m,over:I,setNodeRef:H,setActivatorNodeRef:F,setDroppableNodeRef:j,setDraggableNodeRef:A,transform:null!=ne?ne:q,transition:function(){if(ne||Q&&J.current.newIndex===x)return $t;if($&&!V(_)||!d)return;if(Y||ee)return W.Transition.toString({...d,property:Kt});return}()}}function Zt(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 Gt=[Ie.Down,Ie.Right,Ie.Up,Ie.Left],Jt=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:a,scrollableAncestors:s}}=t;if(Gt.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case Ie.Down:r.top<i.top&&t.push(n);break;case Ie.Up:r.top>i.top&&t.push(n);break;case Ie.Left:r.left>i.left&&t.push(n);break;case Ie.Right:r.left<i.left&&t.push(n)}}));const l=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=le(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=le(r),a=o.reduce(((e,t,r)=>e+ie(n[r],t)),0),s=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:s}})}}return i.sort(ae)})({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let c=ce(l,"id");if(c===(null==a?void 0:a.id)&&l.length>1&&(c=l[1].id),null!=c){const e=i.get(n.id),t=i.get(c),a=t?o.get(t.id):null,l=null==t?void 0:t.node.current;if(l&&a&&e&&t){const n=we(l).some(((e,t)=>s[t]!==e)),o=Qt(e,t),i=function(e,t){if(!Zt(e)||!Zt(t))return!1;if(!Qt(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),c=n||!o?{x:0,y:0}:{x:i?r.width-a.width:0,y:i?r.height-a.height:0},d={x:a.left,y:a.top};return c.x&&c.y?d:H(d,c)}}}};function Qt(e,t){return!(!Zt(e)||!Zt(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var en;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 r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tn.apply(this,arguments)}var nn,rn=function(e){return a.createElement("svg",tn({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),en||(en=a.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 on(){return on=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},on.apply(this,arguments)}var an=function(e){return a.createElement("svg",on({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),nn||(nn=a.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 sn(e,t={}){const n=Object.keys(e.children),{at:r=e.selection}=t,o=n.find((t=>e.children[t].meta.order===(null==r?void 0:r[0])));if(o)return e.blockEditorsMap[o]}function ln(e){return un(e)?(e.nodeName||"").toLowerCase():"#document"}function cn(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function dn(e){var t;return null==(t=(un(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function un(e){return e instanceof Node||e instanceof cn(e).Node}function fn(e){return e instanceof Element||e instanceof cn(e).Element}function pn(e){return e instanceof HTMLElement||e instanceof cn(e).HTMLElement}function hn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof cn(e).ShadowRoot)}function gn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=wn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function vn(e){return["table","td","th"].includes(ln(e))}function mn(e){const t=bn(),n=wn(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 bn(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function yn(e){return["html","body","#document"].includes(ln(e))}function wn(e){return cn(e).getComputedStyle(e)}function xn(e){return fn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function kn(e){if("html"===ln(e))return e;const t=e.assignedSlot||e.parentNode||hn(e)&&e.host||dn(e);return hn(t)?t.host:t}function En(e){const t=kn(e);return yn(t)?e.ownerDocument?e.ownerDocument.body:e.body:pn(t)&&gn(t)?t:En(t)}function Cn(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=En(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=cn(o);return i?t.concat(a,a.visualViewport||[],gn(o)?o:[],a.frameElement&&n?Cn(a.frameElement):[]):t.concat(o,Cn(o,[],n))}const On=Math.min,Sn=Math.max,jn=Math.round,Rn=Math.floor,_n=e=>({x:e,y:e}),Dn={left:"right",right:"left",bottom:"top",top:"bottom"},Bn={start:"end",end:"start"};function Tn(e,t,n){return Sn(e,On(t,n))}function An(e,t){return"function"==typeof e?e(t):e}function Mn(e){return e.split("-")[0]}function Ln(e){return e.split("-")[1]}function Nn(e){return"x"===e?"y":"x"}function Pn(e){return"y"===e?"height":"width"}function In(e){return["top","bottom"].includes(Mn(e))?"y":"x"}function zn(e){return Nn(In(e))}function Fn(e){return e.replace(/start|end/g,(e=>Bn[e]))}function Un(e){return e.replace(/left|right|bottom|top/g,(e=>Dn[e]))}function Hn(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 Vn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Yn(e,t,n){let{reference:r,floating:o}=e;const i=In(t),a=zn(t),s=Pn(a),l=Mn(t),c="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Ln(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function Wn(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=An(t,e),h=Hn(p),g=s[f?"floating"===u?"reference":"floating":u],v=Vn(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(s.floating)),boundary:c,rootBoundary:d,strategy:l})),m="floating"===u?{...a.floating,x:r,y:o}:a.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),y=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},w=Vn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:m,offsetParent:b,strategy:l}):m);return{top:(v.top-w.top+h.top)/y.y,bottom:(w.bottom-v.bottom+h.bottom)/y.y,left:(v.left-w.left+h.left)/y.x,right:(w.right-v.right+h.right)/y.x}}function Kn(e){const t=On(...e.map((e=>e.left))),n=On(...e.map((e=>e.top)));return{x:t,y:n,width:Sn(...e.map((e=>e.right)))-t,height:Sn(...e.map((e=>e.bottom)))-n}}const $n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Mn(n),s=Ln(n),l="y"===In(n),c=["left","top"].includes(a)?-1:1,d=i&&l?-1:1,u=An(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 s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*d,y:f*c}:{x:f*c,y:p*d}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}};function Xn(e){const t=wn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pn(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=jn(n)!==i||jn(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function qn(e){return fn(e)?e:e.contextElement}function Zn(e){const t=qn(e);if(!pn(t))return _n(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Xn(t);let a=(i?jn(n.width):n.width)/r,s=(i?jn(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Gn=_n(0);function Jn(e){const t=cn(e);return bn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Gn}function Qn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=qn(e);let a=_n(1);t&&(r?fn(r)&&(a=Zn(r)):a=Zn(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==cn(e))&&t}(i,n,r)?Jn(i):_n(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,d=o.width/a.x,u=o.height/a.y;if(i){const e=cn(i),t=r&&fn(r)?cn(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=Zn(o),t=o.getBoundingClientRect(),r=wn(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=i,c+=a,n=cn(o),o=n.frameElement}}return Vn({width:d,height:u,x:l,y:c})}const er=[":popover-open",":modal"];function tr(e){return er.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function nr(e){return Qn(dn(e)).left+xn(e).scrollLeft}function rr(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=cn(e),r=dn(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=bn();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=dn(e),n=xn(e),r=e.ownerDocument.body,o=Sn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Sn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+nr(e);const s=-n.scrollTop;return"rtl"===wn(r).direction&&(a+=Sn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(dn(e));else if(fn(t))r=function(e,t){const n=Qn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=pn(e)?Zn(e):_n(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Jn(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Vn(r)}function or(e,t){const n=kn(e);return!(n===t||!fn(n)||yn(n))&&("fixed"===wn(n).position||or(n,t))}function ir(e,t,n){const r=pn(t),o=dn(t),i="fixed"===n,a=Qn(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=_n(0);if(r||!r&&!i)if(("body"!==ln(t)||gn(o))&&(s=xn(t)),r){const e=Qn(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=nr(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function ar(e,t){return pn(e)&&"fixed"!==wn(e).position?t?t(e):e.offsetParent:null}function sr(e,t){const n=cn(e);if(!pn(e)||tr(e))return n;let r=ar(e,t);for(;r&&vn(r)&&"static"===wn(r).position;)r=ar(r,t);return r&&("html"===ln(r)||"body"===ln(r)&&"static"===wn(r).position&&!mn(r))?n:r||function(e){let t=kn(e);for(;pn(t)&&!yn(t);){if(mn(t))return t;t=kn(t)}return null}(e)||n}const lr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=dn(r),s=!!t&&tr(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=_n(1);const d=_n(0),u=pn(r);if((u||!u&&!i)&&(("body"!==ln(r)||gn(a))&&(l=xn(r)),pn(r))){const e=Qn(r);c=Zn(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x,y:n.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:dn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=Cn(e,[],!1).filter((e=>fn(e)&&"body"!==ln(e))),o=null;const i="fixed"===wn(e).position;let a=i?kn(e):e;for(;fn(a)&&!yn(a);){const t=wn(a),n=mn(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||gn(a)&&!n&&or(e,a))?r=r.filter((e=>e!==a)):o=t,a=kn(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=rr(t,n,o);return e.top=Sn(r.top,e.top),e.right=On(r.right,e.right),e.bottom=On(r.bottom,e.bottom),e.left=Sn(r.left,e.left),e}),rr(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:sr,getElementRects:async function(e){const t=this.getOffsetParent||sr,n=this.getDimensions;return{reference:ir(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}=Xn(e);return{width:t,height:n}},getScale:Zn,isElement:fn,isRTL:function(e){return"rtl"===wn(e).direction}};function cr(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=qn(e),d=o||i?[...c?Cn(c):[],...Cn(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const u=c&&s?function(e,t){let n,r=null;const o=dn(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:c,top:d,width:u,height:f}=e.getBoundingClientRect();if(s||t(),!u||!f)return;const p={rootMargin:-Rn(d)+"px "+-Rn(o.clientWidth-(c+u))+"px "+-Rn(o.clientHeight-(d+f))+"px "+-Rn(c)+"px",threshold:Sn(0,On(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),100)}h=!1}try{r=new IntersectionObserver(g,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;a&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let g=l?Qn(e):null;return l&&function t(){const r=Qn(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const dr=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=An(e,t),c={x:n,y:r},d=await Wn(t,l),u=In(Mn(o)),f=Nn(u);let p=c[f],h=c[u];if(i){const e="y"===f?"bottom":"right";p=Tn(p+d["y"===f?"top":"left"],p,p-d[e])}if(a){const e="y"===u?"bottom":"right";h=Tn(h+d["y"===u?"top":"left"],h,h-d[e])}const g=s.fn({...t,[f]:p,[u]:h});return{...g,data:{x:g.x-n,y:g.y-r}}}}},ur=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...v}=An(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const m=Mn(o),b=Mn(s)===s,y=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!g?[Un(s)]:function(e){const t=Un(e);return[Fn(e),t,Fn(t)]}(s));f||"none"===h||w.push(...function(e,t,n,r){const o=Ln(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(Mn(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Fn)))),i}(s,g,h,y));const x=[s,...w],k=await Wn(t,v),E=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(d&&E.push(k[m]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=Ln(e),o=zn(e),i=Pn(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Un(a)),[a,Un(a)]}(o,a,y);E.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:E}],!E.every((e=>e<=0))){var O,S;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(S=C.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 j;const e=null==(j=C.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:j[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},fr=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:s=2,x:l,y:c}=An(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[]),u=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),n=[];let r=null;for(let e=0;e<t.length;e++){const o=t[e];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map((e=>Vn(Kn(e))))}(d),f=Vn(Kn(d)),p=Hn(s);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find((e=>l>e.left-p.left&&l<e.right+p.right&&c>e.top-p.top&&c<e.bottom+p.bottom))||f;if(u.length>=2){if("y"===In(n)){const e=u[0],t=u[u.length-1],r="top"===Mn(n),o=e.top,i=t.bottom,a=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:i,left:a,right:s,width:s-a,height:i-o,x:a,y:o}}const e="left"===Mn(n),t=Sn(...u.map((e=>e.right))),r=On(...u.map((e=>e.left))),o=u.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,a=o[o.length-1].bottom;return{top:i,bottom:a,left:r,right:t,width:t-r,height:a-i,x:r,y:i}}return f}},floating:r.floating,strategy:a});return o.reference.x!==h.reference.x||o.reference.y!==h.reference.y||o.reference.width!==h.reference.width||o.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},pr=(e,t,n)=>{const r=new Map,o={platform:lr,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Yn(c,r,l),f=r,p={},h=0;for(let n=0;n<s.length;n++){const{name:i,fn:g}=s[n],{x:v,y:m,data:b,reset:y}=await g({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=m?m:u,p={...p,[i]:{...p[i],...b}},y&&h<=50&&(h++,"object"==typeof y&&(y.placement&&(f=y.placement),y.rects&&(c=!0===y.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:d,y:u}=Yn(c,f,l))),n=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var hr="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function gr(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,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!gr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!gr(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function vr(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mr(e,t){const n=vr(e);return Math.round(t*n)/n}function br(e){const t=a.useRef(e);return hr((()=>{t.current=e})),t}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),o=require("slate-react"),r=require("slate");function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var a=i(t),s=i(n);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];n&&n.render&&(r[e].render=n=>t[e](n))})),new l(Object.assign(Object.assign({},this.plugin),{elements:r,options:o}))}}function c(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 d={editor:{getBlock:()=>{},insertBlock:()=>{},insertBlocks:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},toggleBlock:()=>{},focusBlock:()=>{},setSelection:()=>{},applyChanges:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},setBlockSelected:()=>{},selectedBlocks:[],duplicateBlock:()=>{},getEditorValue:()=>{},blur:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,readOnly:!1,blockEditorsMap:{},children:{},emit:()=>{},on:()=>{},off:()=>{},once:()=>{}}},u=t.createContext(d),f=({children:n,editorState:o})=>{const r=t.useRef(d);return r.current={editor:o.editor},e.jsx(u.Provider,Object.assign({value:r.current},{children:n}))},p=()=>{const e=t.useContext(u);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},h=e=>p().children[e],g=e=>p().plugins[e],v=()=>p().readOnly;var y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},m={};!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,a){if("function"!=typeof o)throw new TypeError("The listener must be a function");var s=new r(o,i||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function s(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),s.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},s.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,a=new Array(i);r<i;r++)a[r]=o[r].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,o=this._events[t];return o?o.fn?1:o.length:0},s.prototype.emit=function(e,t,o,r,i,a){var s=n?n+e:e;if(!this._events[s])return!1;var l,c,d=this._events[s],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,a),!0}for(c=1,l=new Array(u-1);c<u;c++)l[c-1]=arguments[c];d.fn.apply(d.context,l)}else{var f,p=d.length;for(c=0;c<p;c++)switch(d[c].once&&this.removeListener(e,d[c].fn,void 0,!0),u){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,t);break;case 3:d[c].fn.call(d[c].context,t,o);break;case 4:d[c].fn.call(d[c].context,t,o,r);break;default:if(!l)for(f=1,l=new Array(u-1);f<u;f++)l[f-1]=arguments[f];d[c].fn.apply(d[c].context,l)}}return!0},s.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,o,r){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||r&&!s.once||o&&s.context!==o||a(this,i);else{for(var l=0,c=[],d=s.length;l<d;l++)(s[l].fn!==t||r&&!s[l].once||o&&s[l].context!==o)&&c.push(s[l]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new o,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}({get exports(){return m},set exports(e){m=e}});var b=m;function w(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}const x=()=>{var e,t;return"undefined"==typeof window||"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?w():null===(t=window.crypto)||void 0===t?void 0:t.randomUUID()},E=e=>({id:x(),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)}),k=e=>({id:(null==e?void 0:e.id)||x(),value:(null==e?void 0:e.value)||[E()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function O(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function S(e){return"nodeType"in e}function j(e){var t,n;return e?O(e)?e:S(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function R(e){const{Document:t}=j(e);return e instanceof t}function _(e){return!O(e)&&e instanceof j(e).HTMLElement}function D(e){return e instanceof j(e).SVGElement}function B(e){return e?O(e)?e.document:S(e)?R(e)?e:_(e)||D(e)?e.ownerDocument:document:document:document}const T=C?t.useLayoutEffect:t.useEffect;function A(e){const n=t.useRef(e);return T((()=>{n.current=e})),t.useCallback((function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return null==n.current?void 0:n.current(...t)}),[])}function M(e,n){void 0===n&&(n=[e]);const o=t.useRef(e);return T((()=>{o.current!==e&&(o.current=e)}),n),o}function L(e,n){const o=t.useRef();return t.useMemo((()=>{const t=e(o.current);return o.current=t,t}),[...n])}function N(e){const n=A(e),o=t.useRef(null),r=t.useCallback((e=>{e!==o.current&&(null==n||n(e,o.current)),o.current=e}),[]);return[o,r]}function P(e){const n=t.useRef();return t.useEffect((()=>{n.current=e}),[e]),n.current}let I={};function z(e,n){return t.useMemo((()=>{if(n)return n;const t=null==I[e]?0:I[e]+1;return I[e]=t,e+"-"+t}),[e,n])}function F(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 U=F(1),H=F(-1);function V(e){if(!e)return!1;const{KeyboardEvent:t}=j(e.target);return t&&e instanceof t}function W(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=j(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 Y=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[Y.Translate.toString(e),Y.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),K="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function $(e){return e.matches(K)?e:e.querySelector(K)}const X={display:"none"};function q(e){let{id:n,value:o}=e;return t.createElement("div",{id:n,style:X},o)}function Z(e){let{id:n,announcement:o,ariaLiveType:r="assertive"}=e;return t.createElement("div",{id:n,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":r,"aria-atomic":!0},o)}const G=t.createContext(null);const J={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Q={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ee(e){let{announcements:o=Q,container:r,hiddenTextDescribedById:i,screenReaderInstructions:a=J}=e;const{announce:s,announcement:l}=function(){const[e,n]=t.useState("");return{announce:t.useCallback((e=>{null!=e&&n(e)}),[]),announcement:e}}(),c=z("DndLiveRegion"),[d,u]=t.useState(!1);if(t.useEffect((()=>{u(!0)}),[]),function(e){const n=t.useContext(G);t.useEffect((()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)}),[e,n])}(t.useMemo((()=>({onDragStart(e){let{active:t}=e;s(o.onDragStart({active:t}))},onDragMove(e){let{active:t,over:n}=e;o.onDragMove&&s(o.onDragMove({active:t,over:n}))},onDragOver(e){let{active:t,over:n}=e;s(o.onDragOver({active:t,over:n}))},onDragEnd(e){let{active:t,over:n}=e;s(o.onDragEnd({active:t,over:n}))},onDragCancel(e){let{active:t,over:n}=e;s(o.onDragCancel({active:t,over:n}))}})),[s,o])),!d)return null;const f=t.createElement(t.Fragment,null,t.createElement(q,{id:i,value:a.draggable}),t.createElement(Z,{id:c,announcement:l}));return r?n.createPortal(f,r):f}var te;function ne(){}function oe(e,n){return t.useMemo((()=>({sensor:e,options:null!=n?n:{}})),[e,n])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(te||(te={}));const re=Object.freeze({x:0,y:0});function ie(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ae(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function se(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function le(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 ce(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function de(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 ue=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=de(t,t.left,t.top),i=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=ie(de(o),r);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(ae)};function fe(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),a=r-o,s=i-n;if(o<r&&n<i){const n=t.width*t.height,o=e.width*e.height,r=a*s;return Number((r/(n+o-r)).toFixed(4))}return 0}const pe=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=fe(i,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(se)};function he(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:re}function ge(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 ve=ge(1);const ye={ignoreTransform:!1};function me(e,t){void 0===t&&(t=ye);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=j(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:a,y:s}=o,l=e.left-a-(1-r)*parseFloat(n),c=e.top-s-(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:c,right:l+d,bottom:c+u,left:l}}(n,t,o))}const{top:o,left:r,width:i,height:a,bottom:s,right:l}=n;return{top:o,left:r,width:i,height:a,bottom:s,right:l}}function be(e){return me(e,{ignoreTransform:!0})}function we(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t)return n;if(!r)return n;if(R(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!_(r)||D(r))return n;if(n.includes(r))return n;const i=j(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=j(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=j(e).getComputedStyle(e)),"fixed"===t.position}(r,i)?n:o(r.parentNode)}(e):n}function xe(e){const[t]=we(e,1);return null!=t?t:null}function Ee(e){return C&&e?O(e)?e:S(e)?R(e)||e===B(e).scrollingElement?window:_(e)?e:null:null:null}function ke(e){return O(e)?e.scrollX:e.scrollLeft}function Ce(e){return O(e)?e.scrollY:e.scrollTop}function Oe(e){return{x:ke(e),y:Ce(e)}}var Se;function je(e){return!(!C||!e)&&e===document.scrollingElement}function Re(e){const t={x:0,y:0},n=je(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"}(Se||(Se={}));const _e={x:.2,y:.2};function De(e,t,n,o,r){let{top:i,left:a,right:s,bottom:l}=n;void 0===o&&(o=10),void 0===r&&(r=_e);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=Re(e),p={x:0,y:0},h={x:0,y:0},g=t.height*r.y,v=t.width*r.x;return!c&&i<=t.top+g?(p.y=Se.Backward,h.y=o*Math.abs((t.top+g-i)/g)):!d&&l>=t.bottom-g&&(p.y=Se.Forward,h.y=o*Math.abs((t.bottom-g-l)/g)),!f&&s>=t.right-v?(p.x=Se.Forward,h.x=o*Math.abs((t.right-v-s)/v)):!u&&a<=t.left+v&&(p.x=Se.Backward,h.x=o*Math.abs((t.left+v-a)/v)),{direction:p,speed:h}}function Be(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 Te(e){return e.reduce(((e,t)=>U(e,Oe(t))),re)}const Ae=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+ke(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+Ce(t)),0)}]];class Me{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=we(t),o=Te(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of Ae)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=r(n),a=o[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Le{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Ne(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 Pe,Ie;function ze(e){e.preventDefault()}function Fe(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Pe||(Pe={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(Ie||(Ie={}));const Ue={start:[Ie.Space,Ie.Enter],cancel:[Ie.Esc],end:[Ie.Space,Ie.Enter]},He=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ie.Right:return{...n,x:n.x+25};case Ie.Left:return{...n,x:n.x-25};case Ie.Down:return{...n,y:n.y+25};case Ie.Up:return{...n,y:n.y-25}}};class Ve{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Le(B(t)),this.windowListeners=new Le(j(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Pe.Resize,this.handleCancel),this.windowListeners.add(Pe.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(Pe.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=me),!e)return;const{top:n,left:o,bottom:r,right:i}=t(e);xe(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(re)}handleKeyDown(e){if(V(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=Ue,coordinateGetter:i=He,scrollBehavior:a="smooth"}=o,{code:s}=e;if(r.end.includes(s))return void this.handleEnd(e);if(r.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:re;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=H(d,c),o={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:i,isRight:s,isLeft:l,isBottom:c,maxScroll:u,minScroll:f}=Re(n),p=Be(n),h={x:Math.min(r===Ie.Right?p.right-p.width/2:p.right,Math.max(r===Ie.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===Ie.Down?p.bottom-p.height/2:p.bottom,Math.max(r===Ie.Down?p.top:p.top+p.height/2,d.y))},g=r===Ie.Right&&!s||r===Ie.Left&&!l,v=r===Ie.Down&&!c||r===Ie.Up&&!i;if(g&&h.x!==d.x){const e=n.scrollLeft+t.x,i=r===Ie.Right&&e<=u.x||r===Ie.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});o.x=i?n.scrollLeft-e:r===Ie.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,o.x&&n.scrollBy({left:-o.x,behavior:a});break}if(v&&h.y!==d.y){const e=n.scrollTop+t.y,i=r===Ie.Down&&e<=u.y||r===Ie.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});o.y=i?n.scrollTop-e:r===Ie.Down?n.scrollTop-u.y:n.scrollTop-f.y,o.y&&n.scrollBy({top:-o.y,behavior:a});break}}this.handleMove(e,U(H(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 We(e){return Boolean(e&&"distance"in e)}function Ye(e){return Boolean(e&&"delay"in e)}Ve.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=Ue,onActivation:r}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(o.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class Ke{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=j(e);return e instanceof t?e:B(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=B(i),this.documentListeners=new Le(this.document),this.listeners=new Le(n),this.windowListeners=new Le(j(i)),this.initialCoordinates=null!=(o=W(r))?o:re,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(Pe.Resize,this.handleCancel),this.windowListeners.add(Pe.DragStart,ze),this.windowListeners.add(Pe.VisibilityChange,this.handleCancel),this.windowListeners.add(Pe.ContextMenu,ze),this.documentListeners.add(Pe.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ye(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(We(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(Pe.Click,Fe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Pe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!o)return;const s=null!=(t=W(e))?t:re,l=H(o,s);if(!n&&a){if(We(a)){if(null!=a.tolerance&&Ne(l,a.tolerance))return this.handleCancel();if(Ne(l,a.distance))return this.handleStart()}return Ye(a)&&Ne(l,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(s)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Ie.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const $e={move:{name:"pointermove"},end:{name:"pointerup"}};class Xe extends Ke{constructor(e){const{event:t}=e,n=B(t.target);super(e,$e,n)}}Xe.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 qe={move:{name:"mousemove"},end:{name:"mouseup"}};var Ze;!function(e){e[e.RightClick=2]="RightClick"}(Ze||(Ze={}));(class extends Ke{constructor(e){super(e,qe,B(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==Ze.RightClick&&(null==o||o({event:n}),!0)}}];const Ge={move:{name:"touchmove"},end:{name:"touchend"}};var Je,Qe;function et(e){let{acceleration:n,activator:o=Je.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:s=5,order:l=Qe.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const o=P(t);return L((e=>{if(n||!o||!e)return tt;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[Se.Backward]:e.x[Se.Backward]||-1===r.x,[Se.Forward]:e.x[Se.Forward]||1===r.x},y:{[Se.Backward]:e.y[Se.Backward]||-1===r.y,[Se.Forward]:e.y[Se.Forward]||1===r.y}}}),[n,t,o])}({delta:f,disabled:!a}),[g,v]=function(){const e=t.useRef(null);return[t.useCallback(((t,n)=>{e.current=setInterval(t,n)}),[]),t.useCallback((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),y=t.useRef({x:0,y:0}),m=t.useRef({x:0,y:0}),b=t.useMemo((()=>{switch(o){case Je.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Je.DraggableRect:return i}}),[o,i,c]),w=t.useRef(null),x=t.useCallback((()=>{const e=w.current;if(!e)return;const t=y.current.x*m.current.x,n=y.current.y*m.current.y;e.scrollBy(t,n)}),[]),E=t.useMemo((()=>l===Qe.TreeOrder?[...d].reverse():d),[l,d]);t.useEffect((()=>{if(a&&d.length&&b){for(const e of E){if(!1===(null==r?void 0:r(e)))continue;const t=d.indexOf(e),o=u[t];if(!o)continue;const{direction:i,speed:a}=De(e,o,b,n,p);for(const e of["x","y"])h[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return v(),w.current=e,g(x,s),y.current=a,void(m.current=i)}y.current={x:0,y:0},m.current={x:0,y:0},v()}else v()}),[n,x,r,v,a,s,JSON.stringify(b),JSON.stringify(h),g,d,E,u,JSON.stringify(p)])}(class extends Ke{constructor(e){super(e,Ge)}static setup(){return window.addEventListener(Ge.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ge.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"}(Je||(Je={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Qe||(Qe={}));const tt={x:{[Se.Backward]:!1,[Se.Forward]:!1},y:{[Se.Backward]:!1,[Se.Forward]:!1}};var nt,ot;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(nt||(nt={})),function(e){e.Optimized="optimized"}(ot||(ot={}));const rt=new Map;function it(e,t){return L((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function at(e){let{callback:n,disabled:o}=e;const r=A(n),i=t.useMemo((()=>{if(o||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[o]);return t.useEffect((()=>()=>null==i?void 0:i.disconnect()),[i]),i}function st(e){return new Me(me(e),e)}function lt(e,n,o){void 0===n&&(n=st);const[r,i]=t.useReducer((function(t){if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=t?t:o)?r:null;const i=n(e);if(JSON.stringify(t)===JSON.stringify(i))return t;return i}),null),a=function(e){let{callback:n,disabled:o}=e;const r=A(n),i=t.useMemo((()=>{if(o||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,o]);return t.useEffect((()=>()=>null==i?void 0:i.disconnect()),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){i();break}}}}),s=at({callback:i});return T((()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())}),[e]),r}const ct=[];function dt(e,n){void 0===n&&(n=[]);const o=t.useRef(null);return t.useEffect((()=>{o.current=null}),n),t.useEffect((()=>{const t=e!==re;t&&!o.current&&(o.current=e),!t&&o.current&&(o.current=null)}),[e]),o.current?H(e,o.current):re}function ut(e){return t.useMemo((()=>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 ft=[];function pt(e){let{measure:n}=e;const[o,r]=t.useState(null),i=t.useCallback((e=>{for(const{target:t}of e)if(_(t)){r((e=>{const o=n(t);return e?{...e,width:o.width,height:o.height}:o}));break}}),[n]),a=at({callback:i}),s=t.useCallback((e=>{const t=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return _(t)?t:e}(e);null==a||a.disconnect(),t&&(null==a||a.observe(t)),r(t?n(t):null)}),[n,a]),[l,c]=N(s);return t.useMemo((()=>({nodeRef:l,rect:o,setRef:c})),[o,l,c])}const ht=[{sensor:Xe,options:{}},{sensor:Ve,options:{}}],gt={current:{}},vt={draggable:{measure:be},droppable:{measure:be,strategy:nt.WhileDragging,frequency:ot.Optimized},dragOverlay:{measure:me}};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 mt={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:ne},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:vt,measureDroppableContainers:ne,windowRect:null,measuringScheduled:!1},bt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ne,draggableNodes:new Map,over:null,measureDroppableContainers:ne},wt=t.createContext(bt),xt=t.createContext(mt);function Et(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new yt}}}function kt(e,t){switch(t.type){case te.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case te.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 te.DragEnd:case te.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case te.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new yt(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case te.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const a=new yt(e.droppable.containers);return a.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case te.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 Ct(e){let{disabled:n}=e;const{active:o,activatorEvent:r,draggableNodes:i}=t.useContext(wt),a=P(r),s=P(null==o?void 0:o.id);return t.useEffect((()=>{if(!n&&!r&&a&&null!=s){if(!V(a))return;if(document.activeElement===a.target)return;const e=i.get(s);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=$(e);if(t){t.focus();break}}}))}}),[r,n,i,s,a]),null}const Ot=t.createContext({...re,scaleX:1,scaleY:1});var St;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(St||(St={}));const jt=t.memo((function(e){var o,r,i,a;let{id:s,accessibility:l,autoScroll:c=!0,children:d,sensors:u=ht,collisionDetection:f=pe,measuring:p,modifiers:h,...g}=e;const v=t.useReducer(kt,void 0,Et),[y,m]=v,[b,w]=function(){const[e]=t.useState((()=>new Set)),n=t.useCallback((t=>(e.add(t),()=>e.delete(t))),[e]);return[t.useCallback((t=>{let{type:n,event:o}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)}))}),[e]),n]}(),[x,E]=t.useState(St.Uninitialized),k=x===St.Initialized,{draggable:{active:O,nodes:S,translate:R},droppable:{containers:_}}=y,D=O?S.get(O):null,B=t.useRef({initial:null,translated:null}),A=t.useMemo((()=>{var e;return null!=O?{id:O,data:null!=(e=null==D?void 0:D.data)?e:gt,rect:B}:null}),[O,D]),N=t.useRef(null),[P,I]=t.useState(null),[F,H]=t.useState(null),V=M(g,Object.values(g)),Y=z("DndDescribedBy",s),K=t.useMemo((()=>_.getEnabled()),[_]),$=(X=p,t.useMemo((()=>({draggable:{...vt.draggable,...null==X?void 0:X.draggable},droppable:{...vt.droppable,...null==X?void 0:X.droppable},dragOverlay:{...vt.dragOverlay,...null==X?void 0:X.dragOverlay}})),[null==X?void 0:X.draggable,null==X?void 0:X.droppable,null==X?void 0:X.dragOverlay]));var X;const{droppableRects:q,measureDroppableContainers:Z,measuringScheduled:J}=function(e,n){let{dragging:o,dependencies:r,config:i}=n;const[a,s]=t.useState(null),{frequency:l,measure:c,strategy:d}=i,u=t.useRef(e),f=function(){switch(d){case nt.Always:return!1;case nt.BeforeDragging:return o;default:return!o}}(),p=M(f),h=t.useCallback((function(e){void 0===e&&(e=[]),p.current||s((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[p]),g=t.useRef(null),v=L((t=>{if(f&&!o)return rt;if(!t||t===rt||u.current!==e||null!=a){const t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new Me(c(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t}),[e,a,o,f,c]);return t.useEffect((()=>{u.current=e}),[e]),t.useEffect((()=>{f||h()}),[o,f]),t.useEffect((()=>{a&&a.length>0&&s(null)}),[JSON.stringify(a)]),t.useEffect((()=>{f||"number"!=typeof l||null!==g.current||(g.current=setTimeout((()=>{h(),g.current=null}),l))}),[l,f,h,...r]),{droppableRects:v,measureDroppableContainers:h,measuringScheduled:null!=a}}(K,{dragging:k,dependencies:[R.x,R.y],config:$.droppable}),Q=function(e,t){const n=null!==t?e.get(t):void 0,o=n?n.node.current:null;return L((e=>{var n;return null===t?null:null!=(n=null!=o?o:e)?n:null}),[o,t])}(S,O),ne=t.useMemo((()=>F?W(F):null),[F]),oe=function(){const e=!1===(null==P?void 0:P.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,n=k&&!e&&!t;if("object"==typeof c)return{...c,enabled:n};return{enabled:n}}(),ie=function(e,t){return it(e,t)}(Q,$.draggable.measure);!function(e){let{activeNode:n,measure:o,initialRect:r,config:i=!0}=e;const a=t.useRef(!1),{x:s,y:l}="boolean"==typeof i?{x:i,y:i}:i;T((()=>{if(!s&&!l||!n)return void(a.current=!1);if(a.current||!r)return;const e=null==n?void 0:n.node.current;if(!e||!1===e.isConnected)return;const t=he(o(e),r);if(s||(t.x=0),l||(t.y=0),a.current=!0,Math.abs(t.x)>0||Math.abs(t.y)>0){const n=xe(e);n&&n.scrollBy({top:t.y,left:t.x})}}),[n,s,l,r,o])}({activeNode:O?S.get(O):null,config:oe.layoutShiftCompensation,initialRect:ie,measure:$.draggable.measure});const ae=lt(Q,$.draggable.measure,ie),se=lt(Q?Q.parentElement:null),le=t.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),de=_.getNodeFor(null==(o=le.current.over)?void 0:o.id),ue=pt({measure:$.dragOverlay.measure}),fe=null!=(r=ue.nodeRef.current)?r:Q,ge=k?null!=(i=ue.rect)?i:ae:null,ye=Boolean(ue.nodeRef.current&&ue.rect),be=he(ke=ye?null:ae,it(ke));var ke;const Ce=ut(fe?j(fe):null),Se=function(e){const n=t.useRef(e),o=L((t=>e?t&&t!==ct&&e&&n.current&&e.parentNode===n.current.parentNode?t:we(e):ct),[e]);return t.useEffect((()=>{n.current=e}),[e]),o}(k?null!=de?de:Q:null),Re=function(e,n){void 0===n&&(n=me);const[o]=e,r=ut(o?j(o):null),[i,a]=t.useReducer((function(){return e.length?e.map((e=>je(e)?r:new Me(n(e),e))):ft}),ft),s=at({callback:a});return e.length>0&&i===ft&&a(),T((()=>{e.length?e.forEach((e=>null==s?void 0:s.observe(e))):(null==s||s.disconnect(),a())}),[e]),i}(Se),_e=function(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...o})),n):n}(h,{transform:{x:R.x-be.x,y:R.y-be.y,scaleX:1,scaleY:1},activatorEvent:F,active:A,activeNodeRect:ae,containerNodeRect:se,draggingNodeRect:ge,over:le.current.over,overlayNodeRect:ue.rect,scrollableAncestors:Se,scrollableAncestorRects:Re,windowRect:Ce}),De=ne?U(ne,R):null,Be=function(e){const[n,o]=t.useState(null),r=t.useRef(e),i=t.useCallback((e=>{const t=Ee(e.target);t&&o((e=>e?(e.set(t,Oe(t)),new Map(e)):null))}),[]);return t.useEffect((()=>{const t=r.current;if(e!==t){n(t);const a=e.map((e=>{const t=Ee(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,Oe(t)]):null})).filter((e=>null!=e));o(a.length?new Map(a):null),r.current=e}return()=>{n(e),n(t)};function n(e){e.forEach((e=>{const t=Ee(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,e]),t.useMemo((()=>e.length?n?Array.from(n.values()).reduce(((e,t)=>U(e,t)),re):Te(e):re),[e,n])}(Se),Ae=dt(Be),Le=dt(Be,[ae]),Ne=U(_e,Ae),Pe=ge?ve(ge,_e):null,Ie=A&&Pe?f({active:A,collisionRect:Pe,droppableRects:q,droppableContainers:K,pointerCoordinates:De}):null,ze=ce(Ie,"id"),[Fe,Ue]=t.useState(null),He=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ye?_e:U(_e,Le),null!=(a=null==Fe?void 0:Fe.rect)?a:null,ae),Ve=t.useCallback(((e,t)=>{let{sensor:o,options:r}=t;if(null==N.current)return;const i=S.get(N.current);if(!i)return;const a=e.nativeEvent,s=new o({active:N.current,activeNode:i,event:a,options:r,context:le,onStart(e){const t=N.current;if(null==t)return;const o=S.get(t);if(!o)return;const{onDragStart:r}=V.current,i={active:{id:t,data:o.data,rect:B}};n.unstable_batchedUpdates((()=>{null==r||r(i),E(St.Initializing),m({type:te.DragStart,initialCoordinates:e,active:t}),b({type:"onDragStart",event:i})}))},onMove(e){m({type:te.DragMove,coordinates:e})},onEnd:l(te.DragEnd),onCancel:l(te.DragCancel)});function l(e){return async function(){const{active:t,collisions:o,over:r,scrollAdjustedTranslate:i}=le.current;let s=null;if(t&&i){const{cancelDrop:n}=V.current;if(s={activatorEvent:a,active:t,collisions:o,delta:i,over:r},e===te.DragEnd&&"function"==typeof n){await Promise.resolve(n(s))&&(e=te.DragCancel)}}N.current=null,n.unstable_batchedUpdates((()=>{m({type:e}),E(St.Uninitialized),Ue(null),I(null),H(null);const t=e===te.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=V.current[t];null==e||e(s),b({type:t,event:s})}}))}}n.unstable_batchedUpdates((()=>{I(s),H(e.nativeEvent)}))}),[S]),We=t.useCallback(((e,t)=>(n,o)=>{const r=n.nativeEvent,i=S.get(o);if(null!==N.current||!i||r.dndKit||r.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(r.dndKit={capturedBy:t.sensor},N.current=o,Ve(n,t))}),[S,Ve]),Ye=function(e,n){return t.useMemo((()=>e.reduce(((e,t)=>{const{sensor:o}=t;return[...e,...o.activators.map((e=>({eventName:e.eventName,handler:n(e.handler,t)})))]}),[])),[e,n])}(u,We);!function(e){t.useEffect((()=>{if(!C)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(u),T((()=>{ae&&x===St.Initializing&&E(St.Initialized)}),[ae,x]),t.useEffect((()=>{const{onDragMove:e}=V.current,{active:t,activatorEvent:o,collisions:r,over:i}=le.current;if(!t||!o)return;const a={active:t,activatorEvent:o,collisions:r,delta:{x:Ne.x,y:Ne.y},over:i};n.unstable_batchedUpdates((()=>{null==e||e(a),b({type:"onDragMove",event:a})}))}),[Ne.x,Ne.y]),t.useEffect((()=>{const{active:e,activatorEvent:t,collisions:o,droppableContainers:r,scrollAdjustedTranslate:i}=le.current;if(!e||null==N.current||!t||!i)return;const{onDragOver:a}=V.current,s=r.get(ze),l=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,c={active:e,activatorEvent:t,collisions:o,delta:{x:i.x,y:i.y},over:l};n.unstable_batchedUpdates((()=>{Ue(l),null==a||a(c),b({type:"onDragOver",event:c})}))}),[ze]),T((()=>{le.current={activatorEvent:F,active:A,activeNode:Q,collisionRect:Pe,collisions:Ie,droppableRects:q,draggableNodes:S,draggingNode:fe,draggingNodeRect:ge,droppableContainers:_,over:Fe,scrollableAncestors:Se,scrollAdjustedTranslate:Ne},B.current={initial:ge,translated:Pe}}),[A,Q,Ie,Pe,S,fe,ge,q,_,Fe,Se,Ne]),et({...oe,delta:R,draggingRect:Pe,pointerCoordinates:De,scrollableAncestors:Se,scrollableAncestorRects:Re});const Ke=t.useMemo((()=>({active:A,activeNode:Q,activeNodeRect:ae,activatorEvent:F,collisions:Ie,containerNodeRect:se,dragOverlay:ue,draggableNodes:S,droppableContainers:_,droppableRects:q,over:Fe,measureDroppableContainers:Z,scrollableAncestors:Se,scrollableAncestorRects:Re,measuringConfiguration:$,measuringScheduled:J,windowRect:Ce})),[A,Q,ae,F,Ie,se,ue,S,_,q,Fe,Z,Se,Re,$,J,Ce]),$e=t.useMemo((()=>({activatorEvent:F,activators:Ye,active:A,activeNodeRect:ae,ariaDescribedById:{draggable:Y},dispatch:m,draggableNodes:S,over:Fe,measureDroppableContainers:Z})),[F,Ye,A,ae,m,Y,S,Fe,Z]);return t.createElement(G.Provider,{value:w},t.createElement(wt.Provider,{value:$e},t.createElement(xt.Provider,{value:Ke},t.createElement(Ot.Provider,{value:He},d)),t.createElement(Ct,{disabled:!1===(null==l?void 0:l.restoreFocus)})),t.createElement(ee,{...l,hiddenTextDescribedById:Y}))})),Rt=t.createContext(null),_t="button",Dt="Droppable";function Bt(e){let{id:n,data:o,disabled:r=!1,attributes:i}=e;const a=z(Dt),{activators:s,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:p}=t.useContext(wt),{role:h=_t,roleDescription:g="draggable",tabIndex:v=0}=null!=i?i:{},y=(null==c?void 0:c.id)===n,m=t.useContext(y?Ot:Rt),[b,w]=N(),[x,E]=N(),k=function(e,n){return t.useMemo((()=>e.reduce(((e,t)=>{let{eventName:o,handler:r}=t;return e[o]=e=>{r(e,n)},e}),{})),[e,n])}(s,n),C=M(o);T((()=>(f.set(n,{id:n,key:a,node:b,activatorNode:x,data:C}),()=>{const e=f.get(n);e&&e.key===a&&f.delete(n)})),[f,n]);return{active:c,activatorEvent:l,activeNodeRect:d,attributes:t.useMemo((()=>({role:h,tabIndex:v,"aria-disabled":r,"aria-pressed":!(!y||h!==_t)||void 0,"aria-roledescription":g,"aria-describedby":u.draggable})),[r,h,v,y,g,u.draggable]),isDragging:y,listeners:r?void 0:k,node:b,over:p,setNodeRef:w,setActivatorNodeRef:E,transform:m}}const Tt="Droppable",At={timeout:25};function Mt(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function Lt(e,t){return e.reduce(((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e}),Array(e.length))}function Nt(e){return null!==e&&e>=0}const Pt=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const i=Mt(t,o,n),a=t[r],s=i[r];return s&&a?{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}:null},It={scaleX:1,scaleY:1},zt=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:r,rects:i,overIndex:a}=e;const s=null!=(t=i[n])?t:o;if(!s)return null;if(r===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(s.top+s.height):e.top-s.top,...It}:null}const l=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<=a?{x:0,y:-s.height-l,...It}:r<n&&r>=a?{x:0,y:s.height+l,...It}:{x:0,y:0,...It}};const Ft="Sortable",Ut=t.createContext({activeIndex:-1,containerId:Ft,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Pt,disabled:{draggable:!1,droppable:!1}});function Ht(e){let{children:n,id:o,items:r,strategy:i=Pt,disabled:a=!1}=e;const{active:s,dragOverlay:l,droppableRects:c,over:d,measureDroppableContainers:u}=t.useContext(xt),f=z(Ft,o),p=Boolean(null!==l.rect),h=t.useMemo((()=>r.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[r]),g=null!=s,v=s?h.indexOf(s.id):-1,y=d?h.indexOf(d.id):-1,m=t.useRef(h),b=!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}(h,m.current),w=-1!==y&&-1===v||b,x=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(a);T((()=>{b&&g&&u(h)}),[b,h,g,u]),t.useEffect((()=>{m.current=h}),[h]);const E=t.useMemo((()=>({activeIndex:v,containerId:f,disabled:x,disableTransforms:w,items:h,overIndex:y,useDragOverlay:p,sortedRects:Lt(h,c),strategy:i})),[v,f,x.draggable,x.droppable,w,h,y,c,p,i]);return t.createElement(Ut.Provider,{value:E},n)}const Vt=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return Mt(n,o,r).indexOf(t)},Wt=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:a,previousItems:s,previousContainerId:l,transition:c}=e;return!(!c||!o)&&((s===i||r!==a)&&(!!n||a!==r&&t===l))},Yt={duration:200,easing:"ease"},Kt="transform",$t=Y.Transition.toString({property:Kt,duration:0,easing:"linear"}),Xt={roleDescription:"sortable"};function qt(e){let{animateLayoutChanges:n=Wt,attributes:o,disabled:r,data:i,getNewIndex:a=Vt,id:s,strategy:l,resizeObserverConfig:c,transition:d=Yt}=e;const{items:u,containerId:f,activeIndex:p,disabled:h,disableTransforms:g,sortedRects:v,overIndex:y,useDragOverlay:m,strategy:b}=t.useContext(Ut),w=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}}(r,h),x=u.indexOf(s),E=t.useMemo((()=>({sortable:{containerId:f,index:x,items:u},...i})),[f,i,x,u]),k=t.useMemo((()=>u.slice(u.indexOf(s))),[u,s]),{rect:C,node:O,isOver:S,setNodeRef:j}=function(e){let{data:n,disabled:o=!1,id:r,resizeObserverConfig:i}=e;const a=z(Tt),{active:s,dispatch:l,over:c,measureDroppableContainers:d}=t.useContext(wt),u=t.useRef({disabled:o}),f=t.useRef(!1),p=t.useRef(null),h=t.useRef(null),{disabled:g,updateMeasurementsFor:v,timeout:y}={...At,...i},m=M(null!=v?v:r),b=at({callback:t.useCallback((()=>{f.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout((()=>{d(Array.isArray(m.current)?m.current:[m.current]),h.current=null}),y)):f.current=!0}),[y]),disabled:g||!s}),w=t.useCallback(((e,t)=>{b&&(t&&(b.unobserve(t),f.current=!1),e&&b.observe(e))}),[b]),[x,E]=N(w),k=M(n);return t.useEffect((()=>{b&&x.current&&(b.disconnect(),f.current=!1,b.observe(x.current))}),[x,b]),T((()=>(l({type:te.RegisterDroppable,element:{id:r,key:a,disabled:o,node:x,rect:p,data:k}}),()=>l({type:te.UnregisterDroppable,key:a,id:r}))),[r]),t.useEffect((()=>{o!==u.current.disabled&&(l({type:te.SetDroppableDisabled,id:r,key:a,disabled:o}),u.current.disabled=o)}),[r,a,o,l]),{active:s,rect:p,isOver:(null==c?void 0:c.id)===r,node:x,over:c,setNodeRef:E}}({id:s,data:E,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...c}}),{active:R,activatorEvent:_,activeNodeRect:D,attributes:B,setNodeRef:A,listeners:L,isDragging:P,over:I,setActivatorNodeRef:F,transform:U}=Bt({id:s,data:E,attributes:{...Xt,...o},disabled:w.draggable}),H=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.useMemo((()=>e=>{n.forEach((t=>t(e)))}),n)}(j,A),W=Boolean(R),K=W&&!g&&Nt(p)&&Nt(y),$=!m&&P,X=$&&K?U:null,q=K?null!=X?X:(null!=l?l:b)({rects:v,activeNodeRect:D,activeIndex:p,overIndex:y,index:x}):null,Z=Nt(p)&&Nt(y)?a({id:s,items:u,activeIndex:p,overIndex:y}):x,G=null==R?void 0:R.id,J=t.useRef({activeId:G,items:u,newIndex:Z,containerId:f}),Q=u!==J.current.items,ee=n({active:R,containerId:f,isDragging:P,isSorting:W,id:s,index:x,items:u,newIndex:J.current.newIndex,previousItems:J.current.items,previousContainerId:J.current.containerId,transition:d,wasDragging:null!=J.current.activeId}),ne=function(e){let{disabled:n,index:o,node:r,rect:i}=e;const[a,s]=t.useState(null),l=t.useRef(o);return T((()=>{if(!n&&o!==l.current&&r.current){const e=i.current;if(e){const t=me(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&s(n)}}o!==l.current&&(l.current=o)}),[n,o,r,i]),t.useEffect((()=>{a&&s(null)}),[a]),a}({disabled:!ee,index:x,node:O,rect:C});return t.useEffect((()=>{W&&J.current.newIndex!==Z&&(J.current.newIndex=Z),f!==J.current.containerId&&(J.current.containerId=f),u!==J.current.items&&(J.current.items=u)}),[W,Z,f,u]),t.useEffect((()=>{if(G===J.current.activeId)return;if(G&&!J.current.activeId)return void(J.current.activeId=G);const e=setTimeout((()=>{J.current.activeId=G}),50);return()=>clearTimeout(e)}),[G]),{active:R,activeIndex:p,attributes:B,data:E,rect:C,index:x,newIndex:Z,items:u,isOver:S,isSorting:W,isDragging:P,listeners:L,node:O,overIndex:y,over:I,setNodeRef:H,setActivatorNodeRef:F,setDroppableNodeRef:j,setDraggableNodeRef:A,transform:null!=ne?ne:q,transition:function(){if(ne||Q&&J.current.newIndex===x)return $t;if($&&!V(_)||!d)return;if(W||ee)return Y.Transition.toString({...d,property:Kt});return}()}}function Zt(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 Gt=[Ie.Down,Ie.Right,Ie.Up,Ie.Left],Jt=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:s}}=t;if(Gt.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 Ie.Down:o.top<i.top&&t.push(n);break;case Ie.Up:o.top>i.top&&t.push(n);break;case Ie.Left:o.left>i.left&&t.push(n);break;case Ie.Right:o.left<i.left&&t.push(n)}}));const l=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=le(t),i=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=le(o),a=r.reduce(((e,t,o)=>e+ie(n[o],t)),0),s=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:s}})}}return i.sort(ae)})({active:n,collisionRect:o,droppableRects:r,droppableContainers:t,pointerCoordinates:null});let c=ce(l,"id");if(c===(null==a?void 0:a.id)&&l.length>1&&(c=l[1].id),null!=c){const e=i.get(n.id),t=i.get(c),a=t?r.get(t.id):null,l=null==t?void 0:t.node.current;if(l&&a&&e&&t){const n=we(l).some(((e,t)=>s[t]!==e)),r=Qt(e,t),i=function(e,t){if(!Zt(e)||!Zt(t))return!1;if(!Qt(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),c=n||!r?{x:0,y:0}:{x:i?o.width-a.width:0,y:i?o.height-a.height:0},d={x:a.left,y:a.top};return c.x&&c.y?d:H(d,c)}}}};function Qt(e,t){return!(!Zt(e)||!Zt(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var en;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,on=function(e){return a.createElement("svg",tn({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),en||(en=a.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 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=function(e){return a.createElement("svg",rn({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),nn||(nn=a.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 sn(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 ln(e){return un(e)?(e.nodeName||"").toLowerCase():"#document"}function cn(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function dn(e){var t;return null==(t=(un(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function un(e){return e instanceof Node||e instanceof cn(e).Node}function fn(e){return e instanceof Element||e instanceof cn(e).Element}function pn(e){return e instanceof HTMLElement||e instanceof cn(e).HTMLElement}function hn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof cn(e).ShadowRoot)}function gn(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=wn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function vn(e){return["table","td","th"].includes(ln(e))}function yn(e){const t=mn(),n=wn(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 mn(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function bn(e){return["html","body","#document"].includes(ln(e))}function wn(e){return cn(e).getComputedStyle(e)}function xn(e){return fn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function En(e){if("html"===ln(e))return e;const t=e.assignedSlot||e.parentNode||hn(e)&&e.host||dn(e);return hn(t)?t.host:t}function kn(e){const t=En(e);return bn(t)?e.ownerDocument?e.ownerDocument.body:e.body:pn(t)&&gn(t)?t:kn(t)}function Cn(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=kn(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),a=cn(r);return i?t.concat(a,a.visualViewport||[],gn(r)?r:[],a.frameElement&&n?Cn(a.frameElement):[]):t.concat(r,Cn(r,[],n))}const On=Math.min,Sn=Math.max,jn=Math.round,Rn=Math.floor,_n=e=>({x:e,y:e}),Dn={left:"right",right:"left",bottom:"top",top:"bottom"},Bn={start:"end",end:"start"};function Tn(e,t,n){return Sn(e,On(t,n))}function An(e,t){return"function"==typeof e?e(t):e}function Mn(e){return e.split("-")[0]}function Ln(e){return e.split("-")[1]}function Nn(e){return"x"===e?"y":"x"}function Pn(e){return"y"===e?"height":"width"}function In(e){return["top","bottom"].includes(Mn(e))?"y":"x"}function zn(e){return Nn(In(e))}function Fn(e){return e.replace(/start|end/g,(e=>Bn[e]))}function Un(e){return e.replace(/left|right|bottom|top/g,(e=>Dn[e]))}function Hn(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 Vn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Wn(e,t,n){let{reference:o,floating:r}=e;const i=In(t),a=zn(t),s=Pn(a),l=Mn(t),c="y"===i,d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,f=o[s]/2-r[s]/2;let p;switch(l){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(Ln(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function Yn(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=An(t,e),h=Hn(p),g=s[f?"floating"===u?"reference":"floating":u],v=Vn(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(s.floating)),boundary:c,rootBoundary:d,strategy:l})),y="floating"===u?{...a.floating,x:o,y:r}:a.reference,m=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.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=Vn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:m,strategy:l}):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 Kn(e){const t=On(...e.map((e=>e.left))),n=On(...e.map((e=>e.top)));return{x:t,y:n,width:Sn(...e.map((e=>e.right)))-t,height:Sn(...e.map((e=>e.bottom)))-n}}const $n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),a=Mn(n),s=Ln(n),l="y"===In(n),c=["left","top"].includes(a)?-1:1,d=i&&l?-1:1,u=An(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 s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*d,y:f*c}:{x:f*c,y:p*d}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}};function Xn(e){const t=wn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=pn(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=jn(n)!==i||jn(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function qn(e){return fn(e)?e:e.contextElement}function Zn(e){const t=qn(e);if(!pn(t))return _n(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Xn(t);let a=(i?jn(n.width):n.width)/o,s=(i?jn(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Gn=_n(0);function Jn(e){const t=cn(e);return mn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Gn}function Qn(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=qn(e);let a=_n(1);t&&(o?fn(o)&&(a=Zn(o)):a=Zn(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==cn(e))&&t}(i,n,o)?Jn(i):_n(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,d=r.width/a.x,u=r.height/a.y;if(i){const e=cn(i),t=o&&fn(o)?cn(o):o;let n=e,r=n.frameElement;for(;r&&o&&t!==n;){const e=Zn(r),t=r.getBoundingClientRect(),o=wn(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=i,c+=a,n=cn(r),r=n.frameElement}}return Vn({width:d,height:u,x:l,y:c})}const eo=[":popover-open",":modal"];function to(e){return eo.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function no(e){return Qn(dn(e)).left+xn(e).scrollLeft}function oo(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=cn(e),o=dn(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;const e=mn();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=dn(e),n=xn(e),o=e.ownerDocument.body,r=Sn(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Sn(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+no(e);const s=-n.scrollTop;return"rtl"===wn(o).direction&&(a+=Sn(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:s}}(dn(e));else if(fn(t))o=function(e,t){const n=Qn(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=pn(e)?Zn(e):_n(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=Jn(e);o={...t,x:t.x-n.x,y:t.y-n.y}}return Vn(o)}function ro(e,t){const n=En(e);return!(n===t||!fn(n)||bn(n))&&("fixed"===wn(n).position||ro(n,t))}function io(e,t,n){const o=pn(t),r=dn(t),i="fixed"===n,a=Qn(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=_n(0);if(o||!o&&!i)if(("body"!==ln(t)||gn(r))&&(s=xn(t)),o){const e=Qn(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&(l.x=no(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function ao(e,t){return pn(e)&&"fixed"!==wn(e).position?t?t(e):e.offsetParent:null}function so(e,t){const n=cn(e);if(!pn(e)||to(e))return n;let o=ao(e,t);for(;o&&vn(o)&&"static"===wn(o).position;)o=ao(o,t);return o&&("html"===ln(o)||"body"===ln(o)&&"static"===wn(o).position&&!yn(o))?n:o||function(e){let t=En(e);for(;pn(t)&&!bn(t);){if(yn(t))return t;t=En(t)}return null}(e)||n}const lo={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,a=dn(o),s=!!t&&to(t.floating);if(o===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=_n(1);const d=_n(0),u=pn(o);if((u||!u&&!i)&&(("body"!==ln(o)||gn(a))&&(l=xn(o)),pn(o))){const e=Qn(o);c=Zn(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x,y:n.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:dn,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=Cn(e,[],!1).filter((e=>fn(e)&&"body"!==ln(e))),r=null;const i="fixed"===wn(e).position;let a=i?En(e):e;for(;fn(a)&&!bn(a);){const t=wn(a),n=yn(a);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||gn(a)&&!n&&ro(e,a))?o=o.filter((e=>e!==a)):r=t,a=En(a)}return t.set(e,o),o}(t,this._c):[].concat(n),o],a=i[0],s=i.reduce(((e,n)=>{const o=oo(t,n,r);return e.top=Sn(o.top,e.top),e.right=On(o.right,e.right),e.bottom=On(o.bottom,e.bottom),e.left=Sn(o.left,e.left),e}),oo(t,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:so,getElementRects:async function(e){const t=this.getOffsetParent||so,n=this.getDimensions;return{reference:io(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}=Xn(e);return{width:t,height:n}},getScale:Zn,isElement:fn,isRTL:function(e){return"rtl"===wn(e).direction}};function co(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=qn(e),d=r||i?[...c?Cn(c):[],...Cn(t)]:[];d.forEach((e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const u=c&&s?function(e,t){let n,o=null;const r=dn(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:c,top:d,width:u,height:f}=e.getBoundingClientRect();if(s||t(),!u||!f)return;const p={rootMargin:-Rn(d)+"px "+-Rn(r.clientWidth-(c+u))+"px "+-Rn(r.clientHeight-(d+f))+"px "+-Rn(c)+"px",threshold:Sn(0,On(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return a();t?a(!1,t):n=setTimeout((()=>{a(!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}(c,n):null;let f,p=-1,h=null;a&&(h=new ResizeObserver((e=>{let[o]=e;o&&o.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let g=l?Qn(e):null;return l&&function t(){const o=Qn(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,l&&cancelAnimationFrame(f)}}const uo=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:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=An(e,t),c={x:n,y:o},d=await Yn(t,l),u=In(Mn(r)),f=Nn(u);let p=c[f],h=c[u];if(i){const e="y"===f?"bottom":"right";p=Tn(p+d["y"===f?"top":"left"],p,p-d[e])}if(a){const e="y"===u?"bottom":"right";h=Tn(h+d["y"===u?"top":"left"],h,h-d[e])}const g=s.fn({...t,[f]:p,[u]:h});return{...g,data:{x:g.x-n,y:g.y-o}}}}},fo=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...v}=An(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=Mn(r),m=Mn(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(m||!g?[Un(s)]:function(e){const t=Un(e);return[Fn(e),t,Fn(t)]}(s));f||"none"===h||w.push(...function(e,t,n,o){const r=Ln(e);let i=function(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:a;default:return[]}}(Mn(e),"start"===n,o);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(Fn)))),i}(s,g,h,b));const x=[s,...w],E=await Yn(t,v),k=[];let C=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&k.push(E[y]),u){const e=function(e,t,n){void 0===n&&(n=!1);const o=Ln(e),r=zn(e),i=Pn(r);let a="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Un(a)),[a,Un(a)]}(r,a,b);k.push(E[e[0]],E[e[1]])}if(C=[...C,{placement:r,overflows:k}],!k.every((e=>e<=0))){var O,S;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(S=C.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 j;const e=null==(j=C.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:j[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},po=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:r,platform:i,strategy:a}=t,{padding:s=2,x:l,y:c}=An(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=>Vn(Kn(e))))}(d),f=Vn(Kn(d)),p=Hn(s);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find((e=>l>e.left-p.left&&l<e.right+p.right&&c>e.top-p.top&&c<e.bottom+p.bottom))||f;if(u.length>=2){if("y"===In(n)){const e=u[0],t=u[u.length-1],o="top"===Mn(n),r=e.top,i=t.bottom,a=o?e.left:t.left,s=o?e.right:t.right;return{top:r,bottom:i,left:a,right:s,width:s-a,height:i-r,x:a,y:r}}const e="left"===Mn(n),t=Sn(...u.map((e=>e.right))),o=On(...u.map((e=>e.left))),r=u.filter((n=>e?n.left===o:n.right===t)),i=r[0].top,a=r[r.length-1].bottom;return{top:i,bottom:a,left:o,right:t,width:t-o,height:a-i,x:o,y:i}}return f}},floating:o.floating,strategy:a});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}}:{}}}},ho=(e,t,n)=>{const o=new Map,r={platform:lo,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=Wn(c,o,l),f=o,p={},h=0;for(let n=0;n<s.length;n++){const{name:i,fn:g}=s[n],{x:v,y:y,data:m,reset:b}=await g({x:d,y:u,initialPlacement:o,placement:f,strategy:r,middlewareData:p,rects:c,platform:a,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&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:d,y:u}=Wn(c,f,l))),n=-1)}return{x:d,y:u,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var go="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function vo(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(!vo(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)&&!vo(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function yo(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mo(e,t){const n=yo(e);return Math.round(t*n)/n}function bo(e){const t=a.useRef(e);return go((()=>{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 yr=["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(","),wr="undefined"==typeof Element,xr=wr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,kr=!wr&&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},Er=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Cr=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!Er(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:a,candidates:l})}else{xr.call(a,yr)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var c=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),d=!Er(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(c&&d){var u=e(!0===c?a.children:c.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return o},Or=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Sr=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))&&!Or(e)?0:e.tabIndex},jr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Rr=function(e){return"INPUT"===e.tagName},_r=function(e){return function(e){return Rr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||kr(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(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 o=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!o||o===e}(e)},Dr=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Br=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=xr.call(e,"details>summary:first-of-type")?e.parentElement:e;if(xr.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Dr(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=kr(e);if(a&&!a.shadowRoot&&!0===r(a))return Dr(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){var t,n,r,o,i=e&&kr(e),a=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var l,c,d;s=!(null===(c=a=null===(l=i=kr(a))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Tr=function(e,t){return!(t.disabled||Er(t)||function(e){return Rr(e)&&"hidden"===e.type}(t)||Br(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 r=t.children.item(n);if("LEGEND"===r.tagName)return!!xr.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ar=function(e,t){return!(_r(t)||Sr(t)<0||!Tr(e,t))},Mr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Lr=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=function(e,t){var n=Sr(e);return n<0&&t&&!Or(e)?0:n}(a,i),l=i?e(t.candidates):a;0===s?i?n.push.apply(n,l):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:l})})),r.sort(jr).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Nr=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Cr([e],t.includeContainer,{filter:Ar.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Mr}):function(e,t,n){if(Er(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(yr));return t&&xr.call(e,yr)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Ar.bind(null,t)),Lr(n)};const Pr=a["useInsertionEffect".toString()]||(e=>e());var Ir="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function zr(){return zr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zr.apply(this,arguments)}let Fr=!1,Ur=0;const Hr=()=>"floating-ui-"+Ur++;const Vr=a["useId".toString()]||function(){const[e,t]=a.useState((()=>Fr?Hr():void 0));return Ir((()=>{null==e&&t(Hr())}),[]),a.useEffect((()=>{Fr||(Fr=!0)}),[]),e};const Yr=a.createContext(null),Wr=a.createContext(null);function Kr(e){return"data-floating-ui-"+e}function $r(e){const n=t.useRef(e);return Ir((()=>{n.current=e})),n}const Xr=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function qr(e,t){const n=Nr(e,Xr());"prev"===t&&n.reverse();const r=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==(o=e)?void 0:o.ownerDocument)||document));var o;return n.slice(r+1)[0]}function Zr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!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&&hn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function Gr(e){Nr(e,Xr()).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 Qr={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 eo(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const to=a.forwardRef((function(e,t){const[n,r]=a.useState();Ir((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",eo),()=>{document.removeEventListener("keydown",eo)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Kr("focus-guard")]:"",style:Qr};return a.createElement("span",zr({},e,o))})),no=a.createContext(null),ro=Kr("portal");function oo(e){let{children:t,id:r,root:o=null,preserveTabOrder:i=!0}=e;const s=function(e){let{id:t,root:n}=void 0===e?{}:e;const[r,o]=a.useState(null),i=Vr(),s=io(),l=a.useRef(null);return Ir((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{l.current=null}))}),[r]),Ir((()=>{if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=i,n.setAttribute(ro,""),e.appendChild(n),l.current=n,o(n)}),[t,i]),Ir((()=>{if(l.current)return;let e=n||(null==s?void 0:s.portalNode);e&&!fn(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const a=document.createElement("div");a.id=i,a.setAttribute(ro,""),e=r||e,e.appendChild(a),l.current=a,o(a)}),[t,n,i,s]),r}({id:r,root:o}),[l,c]=a.useState(null),d=a.useRef(null),u=a.useRef(null),f=a.useRef(null),p=a.useRef(null),h=!!l&&!l.modal&&l.open&&i&&!(!o&&!s);return a.useEffect((()=>{if(s&&i&&(null==l||!l.modal))return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){if(s&&Zr(e)){("focusin"===e.type?Jr:Gr)(s)}}}),[s,i,null==l?void 0:l.modal]),a.createElement(no.Provider,{value:a.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:p,portalNode:s,setFocusManagerState:c})),[i,s])},h&&s&&a.createElement(to,{"data-type":"outside",ref:d,onFocus:e=>{if(Zr(e,s)){var t;null==(t=f.current)||t.focus()}else{const e=qr(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),h&&s&&a.createElement("span",{"aria-owns":s.id,style:Qr}),s&&n.createPortal(t,s),h&&s&&a.createElement(to,{"data-type":"outside",ref:u,onFocus:e=>{if(Zr(e,s)){var t;null==(t=p.current)||t.focus()}else{const t=qr(document.body,"next")||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const io=()=>a.useContext(no),ao=new Set,so=a.forwardRef((function(e,t){let{lockScroll:n=!1,...r}=e;const o=Vr();return Ir((()=>{if(!n)return;ao.add(o);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,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",i=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,s=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",i&&(t[r]=i+"px"),e){var l,c;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(s-Math.floor(n))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{ao.delete(o),0===ao.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,s)))}}),[o,n]),a.createElement("div",zr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function lo(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:r,nodeId:o}=e,[i,l]=a.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||i,d=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[f,p]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=a.useState(r);gr(h,r)||g(r);const[v,m]=a.useState(null),[b,y]=a.useState(null),w=a.useCallback((e=>{e!==C.current&&(C.current=e,m(e))}),[]),x=a.useCallback((e=>{e!==O.current&&(O.current=e,y(e))}),[]),k=i||v,E=l||b,C=a.useRef(null),O=a.useRef(null),S=a.useRef(f),j=null!=d,R=br(d),_=br(o),D=a.useCallback((()=>{if(!C.current||!O.current)return;const e={placement:t,strategy:n,middleware:h};_.current&&(e.platform=_.current),pr(C.current,O.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!gr(S.current,t)&&(S.current=t,s.flushSync((()=>{p(t)})))}))}),[h,t,n,_]);hr((()=>{!1===u&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[u]);const B=a.useRef(!1);hr((()=>(B.current=!0,()=>{B.current=!1})),[]),hr((()=>{if(k&&(C.current=k),E&&(O.current=E),k&&E){if(R.current)return R.current(k,E,D);D()}}),[k,E,D,R,j]);const T=a.useMemo((()=>({reference:C,floating:O,setReference:w,setFloating:x})),[w,x]),A=a.useMemo((()=>({reference:k,floating:E})),[k,E]),M=a.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=mr(A.floating,f.x),r=mr(A.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...vr(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,A.floating,f.x,f.y]);return a.useMemo((()=>({...f,update:D,refs:T,elements:A,floatingStyles:M})),[f,D,T,A,M])}(e),u=a.useContext(Wr),f=null!=((null==(p=a.useContext(Yr))?void 0:p.id)||null);var p;const h=function(e){const t=a.useRef((()=>{}));return Pr((()=>{t.current=e})),a.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(v.current.openEvent=t),m.emit("openchange",{open:e,event:t,reason:n,nested:f}),null==r||r(e,t,n)})),g=a.useRef(null),v=a.useRef({}),m=a.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],b=Vr(),y=a.useCallback((e=>{const t=fn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;d.refs.setReference(t)}),[d.refs]),w=a.useCallback((e=>{(fn(e)||null===e)&&(g.current=e,l(e)),(fn(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!fn(e))&&d.refs.setReference(e)}),[d.refs]),x=a.useMemo((()=>({...d.refs,setReference:w,setPositionReference:y,domReference:g})),[d.refs,w,y]),k=a.useMemo((()=>({...d.elements,domReference:c})),[d.elements,c]),E=a.useMemo((()=>({...d,refs:x,elements:k,dataRef:v,nodeId:o,floatingId:b,events:m,open:n,onOpenChange:h})),[d,o,b,m,n,h,x,k]);return Ir((()=>{const e=null==u?void 0:u.nodesRef.current.find((e=>e.id===o));e&&(e.context=E)})),a.useMemo((()=>({...d,context:E,refs:x,elements:k})),[d,x,k,E])}const co=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function uo(e,t){return"function"==typeof e?e(t):e}function fo(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[s,l]=a.useState(!1),[c,d]=a.useState("unmounted"),u=function(e,t){const[n,r]=a.useState(e);return e&&!n&&r(!0),a.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return Ir((()=>{s&&!u&&d("unmounted")}),[s,u]),Ir((()=>{if(r){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),d("close")}}),[n,r]),{isMounted:u,status:c}}function po(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:s=250}=t,l=e.placement,c=l.split("-")[0],d=a.useMemo((()=>({side:c,placement:l})),[c,l]),u="number"==typeof s,f=(u?s:s.open)||0,p=(u?s:s.close)||0,[h,g]=a.useState((()=>({...uo(i,d),...uo(n,d)}))),{isMounted:v,status:m}=fo(e,{duration:s}),b=$r(n),y=$r(r),w=$r(o),x=$r(i);return Ir((()=>{const e=uo(b.current,d),t=uo(w.current,d),n=uo(x.current,d),r=uo(y.current,d)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===m&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===m&&g({transitionProperty:Object.keys(r).map(co).join(","),transitionDuration:f+"ms",...n,...r}),"close"===m){const r=t||e;g({transitionProperty:Object.keys(r).map(co).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,b,y,x,f,m,d]),{isMounted:v,styles:h}}var ho;function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},go.apply(this,arguments)}var vo=function(e){return a.createElement("svg",go({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),ho||(ho=a.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 mo(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}var bo=["color"],yo=t.forwardRef((function(e,n){var r=e.color,o=void 0===r?"currentColor":r,i=mo(e,bo);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),t.createElement("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"}))})),wo=["color"],xo=t.forwardRef((function(e,n){var r=e.color,o=void 0===r?"currentColor":r,i=mo(e,wo);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),t.createElement("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"}))})),ko=["color"],Eo=t.forwardRef((function(e,n){var r=e.color,o=void 0===r?"currentColor":r,i=mo(e,ko);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),t.createElement("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"}))})),Co=["color"],Oo=t.forwardRef((function(e,n){var r=e.color,o=void 0===r?"currentColor":r,i=mo(e,Co);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),t.createElement("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"}))})),So=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));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()}},jo={"text/plain":"Text","text/html":"Url",default:"Text"};var Ro=function(e,t){var n,r,o,i,a,s,l=!1;t||(t={}),n=t.debug||!1;try{if(o=So(),i=document.createRange(),a=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=jo[t.format]||jo.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(s),i.selectNodeContents(s),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),r=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(r,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),s&&document.body.removeChild(s),o()}return l};function _o(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function Do(e){if(!e)return;const t=_o(e);return t?e[t]:void 0}const Bo=t.createContext(void 0),To=({children:n,tools:r})=>{const o=v(),i=t.useMemo((()=>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]),a=t.useMemo((()=>!r||o?null:Object.keys(r).map((t=>{var n,o,i;const a=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.tool,s=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.render,l=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return a?e.jsx(a,Object.assign({render:s},l),t):null}))),[t.useMemo]);return e.jsx(Bo.Provider,Object.assign({value:i},{children:e.jsxs(e.Fragment,{children:[a,n]})}))},Ao=()=>{const e=t.useContext(Bo);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e},Mo=({children:t})=>e.jsx("div",Object.assign({className:"flex flex-col"},{children:t})),Lo=({children:t})=>e.jsx("div",Object.assign({onClick:e=>e.stopPropagation(),className:"bg-[#FFF] relative min-w-[200px] w-auto overflow-hidden rounded-md border bg-popover py-[6px] px-0 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"},{children:t})),No=({children:t})=>e.jsx("div",Object.assign({className:"relative flex cursor-default select-none items-center text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"},{children:t})),Po=({isOpen:n,onClose:r,refs:o,style:i,children:a})=>{var s,l;const d=p(),u=Ao(),[f,h]=t.useState(!1),{refs:g,floatingStyles:v,context:m}=lo({placement:"right",open:f,onOpenChange:h,middleware:[fr(),ur(),dr(),$n(10)],whileElementsMounted:cr}),{isMounted:b,styles:y}=po(m,{duration:100});if(!n)return null;const w=c(d,{at:d.selection}),x=Do(d.blocks[(null==w?void 0:w.type)||""].elements),k="void"===(null===(s=null==x?void 0:x.props)||void 0===s?void 0:s.nodeType),E=u.ActionMenu,C=Object.assign(Object.assign({},v),y);return e.jsx(oo,Object.assign({root:document.getElementById("yoopta-editor")},{children:e.jsx(so,Object.assign({lockScroll:!0,className:"z-[100]",onClick:r},{children:e.jsx("div",Object.assign({style:i,ref:o.setFloating},{children:e.jsxs(Lo,{children:[e.jsxs(Mo,{children:[e.jsx(No,{children:e.jsxs("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{const e=d.selection;d.deleteBlock({at:e}),d.setBlockSelected(null),d.setSelection(null),r()}},{children:[e.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Delete"]}))}),e.jsx(No,{children:e.jsxs("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{d.duplicateBlock({at:d.selection,focus:!0}),d.setBlockSelected(null),r()}},{children:[e.jsx(yo,{className:"w-4 h-4 mr-2"}),"Duplicate"]}))}),!k&&!(null===(l=d.blocks[(null==w?void 0:w.type)||""])||void 0===l?void 0:l.hasCustomEditor)&&e.jsxs(No,{children:[b&&!!E&&e.jsx(oo,Object.assign({root:document.getElementById("yoopta-editor")},{children:e.jsx(so,Object.assign({lockScroll:!0,className:"z-[100]",onClick:()=>h(!1)},{children:e.jsx("div",Object.assign({style:C,ref:g.setFloating},{children:e.jsx(E,{actions:Object.keys(d.blocks),editor:d,selectedAction:"",onClose:()=>{h(!1),r()},empty:!1,onMouseEnter:()=>{},mode:"toggle"})}))}))})),e.jsxs("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",ref:g.setReference,onClick:()=>h((e=>!e))},{children:[e.jsx(vo,{className:"w-4 h-4 mr-2"}),"Turn into"]}))]}),e.jsx(No,{children:e.jsxs("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{const e=c(d);e&&(Ro(`${window.location.origin}${window.location.pathname}#${e.id}`),d.emit("block:copy",e)),r()}},{children:[e.jsx(Eo,{className:"w-4 h-4 mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var Io=Object.freeze({__proto__:null,BlockOptions:Po,BlockOptionsMenuContent:Lo,BlockOptionsMenuGroup:Mo,BlockOptionsMenuItem:No,BlockOptionsSeparator:({className:t})=>e.jsx("div",{className:`h-[1px] bg-[#37352f14] my-[4px] w-full ${t}`})});function zo(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var Fo={actions:"vuZgncnq",hovered:"_8Eqjiv7m",actionButton:"WabGEp54",plusButton:"_0C8RpLmz"};function Uo(...e){return e.filter(Boolean).join(" ")}zo(".vuZgncnq{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition:opacity .18s ease-in}._8Eqjiv7m{opacity:1}.WabGEp54{all:unset;align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;color:rgba(55,53,47,.35);cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition:background-color .18s cubic-bezier(.4,0,.2,1);width:auto;width:18px}.WabGEp54:active,.WabGEp54:focus,.WabGEp54:hover{background-color:rgba(55,54,47,.08)}._0C8RpLmz{width:24px}");const Ho=({block:n,editor:i,dragHandleProps:a,showActions:s,onChangeActiveBlock:l})=>{const[c,d]=t.useState(!1),{refs:u,floatingStyles:f,context:p}=lo({placement:"right-start",open:c,onOpenChange:d,middleware:[fr(),ur(),dr(),$n()]}),{isMounted:h,styles:g}=po(p,{duration:100}),{setActivatorNodeRef:v,attributes:m,listeners:b}=a,y=Object.assign(Object.assign({},f),g);return e.jsxs("div",Object.assign({contentEditable:!1,className:Uo(Fo.actions,s&&Fo.hovered,"yoopta-element-actions")},{children:[e.jsx("button",Object.assign({type:"button",onClick:()=>{const e=E({id:x()}),t=[n.meta.order+1];i.setSelection([n.meta.order]),i.insertBlock(e,{at:t,focus:!0})},className:Uo(Fo.actionButton,Fo.plusButton,"yoopta-element-actions-plus")},{children:e.jsx(an,{})})),e.jsx("button",Object.assign({type:"button",className:Uo(Fo.actionButton,"yoopta-element-actions-drag"),ref:e=>{v(e),u.setReference(e)}},m,b,{onClick:e=>{e.stopPropagation(),l(n.id);const t=sn(i,{at:[n.meta.order]});i.focusBlock(n.id),t&&setTimeout((()=>{i.blocks[n.type].hasCustomEditor||(r.ReactEditor.blur(t),r.ReactEditor.deselect(t),o.Transforms.deselect(t)),i.setBlockSelected([n.meta.order],{only:!0}),i.setSelection([n.meta.order]),d(!0)}),10)}},{children:e.jsx(rn,{})})),e.jsx(Po,{isOpen:h,refs:u,style:y,onClose:()=>d(!1)})]}))},Vo=({children:n,block:r,blockId:o})=>{var i;const a=p(),[s,l]=t.useState(null),{attributes:c,listeners:d,setNodeRef:u,setActivatorNodeRef:f,transform:h,transition:g,isOver:v,isDragging:m}=qt({id:o,disabled:a.readOnly}),b={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:m?.7:1,marginLeft:20*r.meta.depth+"px"},y=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(r.meta.order),w=s===o,x={borderBottom:v&&!m?"2px solid #007aff":"none"};return e.jsxs("div",Object.assign({className:"relative py-0 px-[2px] mt-[2px] mb-[1px] rounded yoopta-block-wrapper",onMouseEnter:()=>{a.readOnly||l(o)},onMouseLeave:()=>{a.readOnly||l(null)},"data-yoopta-block-id":o,style:b,"data-yoopta-block":!0,ref:u},{children:[!a.readOnly&&e.jsx(Ho,{block:r,editor:a,dragHandleProps:{setActivatorNodeRef:f,attributes:c,listeners:d},showActions:w,onChangeActiveBlock:e=>l(e)}),e.jsx("div",Object.assign({className:Fo.content,style:x},{children:n})),y&&!a.readOnly&&e.jsx("div",{className:"absolute left-0 top-0 bg-[#2383e224] z-[90] rounded opacity-100 h-full w-full pointer-events-none yoopta-selection-block"})]}))};function Yo(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var Wo={};Object.defineProperty(Wo,"__esModule",{value:!0});for(var Ko="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),$o={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Xo={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Ko?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},qo={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},Zo=1;Zo<20;Zo++)qo["f"+Zo]=111+Zo;function Go(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return Jo(e,t)})),o=function(e){return r.some((function(t){return Qo(t,e)}))};return null==n?o:o(n)}function Jo(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var a in $o)r[$o[a]]=!1;var s=!0,l=!1,c=void 0;try{for(var d,u=o[Symbol.iterator]();!(s=(d=u.next()).done);s=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=ti(f),g=$o[h];if(f.length>1&&!g&&!Xo[f]&&!qo[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?r.key=h:r.which=ei(f)),g&&(r[g]=!p||null)}}catch(e){l=!0,c=e}finally{try{!s&&u.return&&u.return()}finally{if(l)throw c}}return r}function Qo(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function ei(e){return e=ti(e),qo[e]||e.toUpperCase().charCodeAt(0)}function ti(e){return e=e.toLowerCase(),e=Xo[e]||e}Wo.default=Go,Wo.isHotkey=Go,Wo.isCodeHotkey=function(e,t){return Go(e,t)};var ni=Wo.isKeyHotkey=function(e,t){return Go(e,{byKey:!0},t)};Wo.parseHotkey=Jo,Wo.compareHotkey=Qo,Wo.toKeyCode=ei,Wo.toKeyName=ti;const ri={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:"/",kekCeburek:"mod+enter"},oi={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"},ii={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},ai=e=>{const t=ri[e],n=oi[e],r=ii[e],o=t&&ni(t),i=n&&ni(n),a=r&&ni(r);return e=>!(!o||!o(e))||(!(!i||!i(e))||!(!a||!a(e)))},si={isBold:ai("bold"),isCompose:ai("compose"),isArrowLeft:ai("arrowLeft"),isArrowRight:ai("arrowRight"),isArrowUp:ai("arrowUp"),isArrowDown:ai("arrowDown"),isDeleteBackward:ai("deleteBackward"),isDeleteForward:ai("deleteForward"),isDeleteLineBackward:ai("deleteLineBackward"),isDeleteLineForward:ai("deleteLineForward"),isDeleteWordBackward:ai("deleteWordBackward"),isDeleteWordForward:ai("deleteWordForward"),isExtendBackward:ai("extendBackward"),isExtendForward:ai("extendForward"),isExtendLineBackward:ai("extendLineBackward"),isExtendLineForward:ai("extendLineForward"),isItalic:ai("italic"),isMoveLineBackward:ai("moveLineBackward"),isMoveLineForward:ai("moveLineForward"),isCtrlLeft:ai("ctrlLeft"),isCtrlRight:ai("ctrlRight"),isRedo:ai("redo"),isShiftEnter:ai("shiftEnter"),isEnter:ai("enter"),isTransposeCharacter:ai("transposeCharacter"),isUndo:ai("undo"),isSpace:ai("space"),isSelect:ai("select"),isTab:ai("tab"),isShiftTab:ai("shiftTab"),isBackspace:ai("backspace"),isCmdEnter:ai("cmdEnter"),isCmd:ai("cmd"),isEscape:ai("escape"),isSlashCommand:ai("slashCommand"),isShiftArrowUp:ai("shiftArrowUp"),isShiftArrowDown:ai("shiftArrowDown"),isKekceburek:ai("kekCeburek")};const li={onKeyDown:function(e){return t=>{const n=sn(e,{at:e.selection});if(!n||!n.selection)return;const i=o.Path.parent(n.selection.anchor.path);if(si.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(si.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=o.Editor.isStart(n,n.selection.anchor,i),a=o.Editor.isEnd(n,n.selection.anchor,i);if(!r&&!a)return void e.splitBlock({slate:n,focus:!0});const s=E({id:x()}),l=e.selection?[e.selection[0]+1]:[0];e.insertBlock(s,{at:l,slate:n,focus:!0})}else if(si.isBackspace(t)){if(t.isDefaultPrevented())return;const r=c(e,{at:e.selection}),i=e.blocks[(null==r?void 0:r.type)||""],a=o.Path.parent(n.selection.anchor.path);if(o.Editor.isStart(n,n.selection.anchor,a)){t.preventDefault();const r=o.Editor.string(n,a),s=e.selection?e.selection[0]-1:0,l=sn(e,{at:[s]});let c;if(l&&!i.hasCustomEditor&&(c=function(e,t){const[,n]=o.Editor.last(e,t);return{path:n,offset:o.Editor.string(e,n).length}}(l,a)),0===r.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:c});{if(o.Range.isExpanded(n.selection))return o.Transforms.delete(n,{at:n.selection});if(!l)return;if(0===o.Editor.string(l,[0,0]).length)return e.deleteBlock({at:[s],focus:!0,focusAt:c});const t=Array.from(o.Editor.nodes(n,{at:[0],match:e=>!o.Editor.isEditor(e)&&(o.Text.isText(e)||o.Editor.isInline(n,e)),mode:"highest"})).map((([e])=>e));return o.Transforms.insertNodes(l,t,{at:o.Editor.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:c})}}}else{if(si.isSelect(t)){if(t.isDefaultPrevented())return;const[,i]=o.Editor.first(n,[0]),[,a]=o.Editor.last(n,[n.children.length-1]),s=o.Editor.range(n,i,a),l=o.Range.equals(n.selection,s);if(o.Range.isExpanded(n.selection)&&l)return t.preventDefault(),r.ReactEditor.blur(n),r.ReactEditor.deselect(n),o.Transforms.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(si.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(si.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(si.isArrowUp(t)){if(t.isDefaultPrevented())return;const r=o.Path.parent(n.selection.anchor.path);if(o.Editor.isStart(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]-1]:null,r=sn(e,{at:n}),i=c(e,{at:n});if(r&&i){const[,n]=o.Editor.last(r,[0]),a={path:n,offset:o.Editor.string(r,n).length};return t.preventDefault(),void e.focusBlock(i.id,{focusAt:a,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(si.isArrowDown(t)){const r=o.Path.parent(n.selection.anchor.path);if(o.Editor.isEnd(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]+1]:null,i=sn(e,{at:n}),a=c(e,{at:n});if(i&&a){const n=function(e,t){const[,n]=o.Editor.first(e,t);return{path:n,offset:0}}(i,r);return t.preventDefault(),void e.focusBlock(a.id,{focusAt:n,waitExecution:!1})}}}if(o.Range.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&ni(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},ci=({children:t,attributes:n,placeholder:o})=>{const i=r.useSelected(),a=Object.assign({},n);return i&&o&&(a["data-placeholder"]=o,a.className="yoopta-placeholder"),e.jsx("span",Object.assign({},a,{children:t}))};function di(e){try{return new URL(e),!0}catch(e){return!1}}const ui=(e,t)=>{(e=>{const[t]=o.Editor.nodes(e,{match:e=>!o.Editor.isEditor(e)&&o.Element.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{o.Transforms.unwrapNodes(e,{match:e=>!o.Editor.isEditor(e)&&o.Element.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,r=n&&o.Range.isCollapsed(n),i={type:"link",children:r?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};r?o.Transforms.insertNodes(e,i):(o.Transforms.wrapNodes(e,i,{split:!0}),o.Transforms.collapse(e,{edge:"end"}))};function fi(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const pi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function hi(e,t,n){var r,i,a;if(3===n.nodeType){return null===(r=n.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}if(1!==n.nodeType)return null;if("BR"===n.nodeName)return"\n";const s=n;let l=Array.from(s.childNodes).map((n=>hi(e,t,n))).flat();if(pi[n.nodeName]){return{[pi[n.nodeName].type]:!0,text:null===(i=n.textContent)||void 0===i?void 0:i.replace(/[\t\n\r\f\v]+/g," ")}}if(t[n.nodeName]){const r=t[n.nodeName],i=e.blocks[r.type],s=_o(i.elements)||"",c=i.elements[s],d="void"===(null===(a=c.props)||void 0===a?void 0:a.nodeType);let u={id:x(),type:s,children:d&&!i.hasCustomEditor?[{text:""}]:l.map(gi),props:Object.assign({nodeType:"block"},c.props)};if(r.parse){const e=r.parse(n);if(e)if(o.Element.isElement(e))u=e;else if(Array.isArray(e)){return e}}0===u.children.length&&(u.children=[{text:""}]);return E({id:x(),type:r.type,value:[u],meta:{order:0,depth:0}})}return l}function gi(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(fi(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const vi={html:{deserialize:function(e,t){const n=function(e){const t={};return Object.keys(e.plugins).forEach((n=>{const r=e.plugins[n],{parsers:o}=r;if(o){const{html:e}=o;if(e){const{deserialize:r}=e;if(r){const{nodeNames:e}=r;e&&e.forEach((e=>{t[e]={type:n,parse:r.parse}}))}}}})),t}(e),r=hi(e,n,t).filter(fi);return console.log("html",t),r},serialize:function(){}},markdown:{}},mi=({id:n,customEditor:i,elements:a,marks:s,events:l,options:c,placeholder:d="Type '/' for commands"})=>{const u=p(),f=h(n),g=t.useRef(f.value).current,v=f.type,m=t.useMemo((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(a)),[a]),b=t.useMemo((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(s)),[s]),y=t.useMemo((()=>{let e=u.blockEditorsMap[n];return Object.keys(a).forEach((t=>{var n;const r=null===(n=a[t].props)||void 0===n?void 0:n.nodeType,o="inline"===r,i="void"===r,s="inlineVoid"===r;s&&(e.markableVoid=e=>e.type===t),(i||s)&&(e.isVoid=e=>e.type===t),(o||s)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&di(t)?ui(e,t):n(t)},e.insertData=n=>{const r=n.getData("text/plain");r&&di(r)?ui(e,r):t(n)},e})(e))})),e}),[]),w=t.useMemo((()=>{if(!l||u.readOnly)return{};const e={hotkeys:si,currentBlock:f,defaultBlock:E({id:x()})},t={};return Object.keys(l).forEach((n=>{t[n]=function(t){if(l[n]){l[n](u,y,e)(t)}}})),t}),[l,u,f]);return e.jsx("div",Object.assign({"data-plugin-id":n,"data-plugin-type":v},{children:e.jsx(bi,{id:n,slate:y,initialValue:g,onChange:e=>u.updateBlock(n,{value:e}),decorate:e=>{var t;const n=[];if(u.readOnly)return n;const[r,i]=e,a=(null===(t=u.selection)||void 0===t?void 0:t[0])===f.meta.order;return y.selection&&a&&!o.Editor.isEditor(r)&&""===o.Editor.string(y,[i[0]])&&o.Range.includes(y.selection,i)&&o.Range.isCollapsed(y.selection)&&n.push(Object.assign(Object.assign({},y.selection),{withPlaceholder:!0})),n},renderLeaf:t=>{var n,r,o,i,a;let{children:s,leaf:l,attributes:c}=t;const p=Yo(l,["text"]),h=(null===(n=u.selection)||void 0===n?void 0:n[0])===f.meta.order;p&&Object.keys(p).forEach((e=>{const t=b[e];t&&(s=t.render({children:s,leaf:l}))}));const g=!("void"===(null===(a=null===(i=null===(o=null===(r=t.children)||void 0===r?void 0:r.props)||void 0===o?void 0:o.parent)||void 0===i?void 0:i.props)||void 0===a?void 0:a.nodeType))&&h&&l.withPlaceholder;return e.jsx(ci,Object.assign({attributes:c,placeholder:g?d:void 0},{children:s}))},renderElement:t=>{const o=m[t.element.type];return o?e.jsx(o,Object.assign({},t,{blockId:n,HTMLAttributes:null==c?void 0:c.HTMLAttributes})):e.jsx(r.DefaultElement,Object.assign({},t))},eventHandlers:w,onKeyDown:e=>{var t;u.readOnly||(null===(t=w.onKeyDown)||void 0===t||t.call(w,e),li.onKeyDown(u)(e))},onKeyUp:e=>{var t;u.readOnly||null===(t=null==w?void 0:w.onKeyUp)||void 0===t||t.call(w,e)},onFocus:e=>{var t;u.readOnly||null===(t=null==w?void 0:w.onFocus)||void 0===t||t.call(w,e)},onClick:e=>{var t,n;u.readOnly||((null===(t=u.selection)||void 0===t?void 0:t[0])!==f.meta.order&&u.setSelection([f.meta.order]),null===(n=null==w?void 0:w.onClick)||void 0===n||n.call(w,e))},onBlur:e=>{var t;u.readOnly||(e.preventDefault(),null===(t=null==w?void 0:w.onBlur)||void 0===t||t.call(w,e))},customEditor:i,readOnly:u.readOnly,onPaste:e=>{var t;if(u.readOnly)return;null===(t=null==w?void 0:w.onPaste)||void 0===t||t.call(w,e);const n=e.clipboardData.getData("text/html"),r=(new DOMParser).parseFromString(n,"text/html");if(r.body.childNodes.length>0){const e=vi.html.deserialize(u,r.body);if(e.length>0)return void u.insertBlocks(e,{at:u.selection,focus:!0})}},onCopy:e=>{var t;u.readOnly||null===(t=null==w?void 0:w.onCopy)||void 0===t||t.call(w,e)}})}))},bi=t.memo((({id:t,slate:n,initialValue:o,onChange:i,renderLeaf:a,renderElement:s,eventHandlers:l,onKeyDown:c,onKeyUp:d,onFocus:u,onClick:f,onBlur:p,onPaste:h,customEditor:g,decorate:v,readOnly:m})=>"function"==typeof g?g({blockId:t}):e.jsx(r.Slate,Object.assign({editor:n,initialValue:o,onChange:i},{children:e.jsx(r.Editable,Object.assign({renderElement:s,renderLeaf:a,className:"focus-visible:outline-none focus:outline-none",spellCheck:!0},l,{onKeyDown:c,onKeyUp:d,onFocus:u,onClick:f,decorate:v,onBlur:p,readOnly:m,onPaste:h}),`editable-${t}`)}),`slate-${t}`)));bi.displayName="SlateEditorInstance";const yi=({editor:e})=>({sensors:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.useMemo((()=>[...n].filter((e=>null!=e))),[...n])}(re(Xe,{activationConstraint:{delay:100,tolerance:0}}),re(Ve,{coordinateGetter:Jt})),handleDragEnd:t.useCallback((t=>{const{active:n,over:r}=t;if(n&&r&&n.id!==r.id){const t=e.children[r.id].meta.order;e.moveBlock(n.id,[t])}}),[]),handleDragStart:t.useCallback((t=>{e.setBlockSelected(null)}),[])}),wi=[],xi=({editor:n,marks:r,placeholder:o})=>{const i=v(),{sensors:a,handleDragEnd:s,handleDragStart:l}=yi({editor:n}),c=Object.keys(n.children),d=t.useMemo((()=>0===c.length?wi:c.sort(((e,t)=>n.children[e].meta.order-n.children[t].meta.order))),[c]),u=[];for(let t=0;t<d.length;t++){const i=d[t],a=n.children[i],s=n.plugins[a.type];a&&s?u.push(e.jsx(Vo,Object.assign({block:a,blockId:i},{children:e.jsx(mi,{type:a.type,id:i,marks:r,customEditor:s.customEditor,events:s.events,elements:s.elements,options:s.options,placeholder:o},i)}),i)):console.error(`Plugin ${a.type} not found`)}return i?e.jsx(e.Fragment,{children:u}):e.jsx(jt,Object.assign({sensors:a,collisionDetection:ue,onDragStart:l,onDragEnd:s},{children:e.jsx(Ht,Object.assign({disabled:i,items:d,strategy:zt},{children:u}))}))},ki=({editor:e,yooptaEditorRef:n,root:r})=>{const[o,i]=t.useState({origin:[0,0],coords:[0,0],selection:!1}),a=t=>{var a;if(e.readOnly||!1===r)return;const s=null===(a=n.current)||void 0===a?void 0:a.contains(t.target);if(!s&&!o.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();s||i({origin:[t.pageX,t.pageY-window.pageYOffset],coords:[t.pageX,t.pageY-window.pageYOffset],selection:!0})},s=t=>{if(!o.selection||e.readOnly||!1===r)return;i((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const n=((e,t)=>{const n=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((r,o)=>{if(!r)return;const i=r.getBoundingClientRect(),a=Math.min(e[1],t[1]),s=Math.min(e[0],t[0]),l=Math.max(e[1],t[1]),c=Math.max(e[0],t[0]);a<i.bottom&&l>i.top&&s<i.right&&c>i.left&&n.push(o)})),n})(o.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(n,{only:!0})},l=()=>{e.readOnly||c()};t.useEffect((()=>{var t;if(e.readOnly||!1===r)return;const o=r&&"current"in r?r.current:r||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===(t=n.current)||void 0===t?void 0:t.contains(o))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return o.addEventListener("mousedown",a),o.addEventListener("mousemove",s),o.addEventListener("mouseup",l),()=>{o.removeEventListener("mousedown",a),o.removeEventListener("mousemove",s),o.removeEventListener("mouseup",l)}}),[e.selectedBlocks,o,r,e.readOnly]);const c=()=>{i({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},o),{onClose:c})},Ei=({origin:t,coords:n,isOpen:r})=>{if(!r)return null;const o={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.jsx("div",{style:o})},Ci={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},Oi=({placeholder:n,marks:i,className:a,selectionBoxRoot:s,width:l,autoFocus:d=!0})=>{const u=p(),f=v(),h=t.useRef(null),g=ki({editor:u,yooptaEditorRef:h,root:s});let m=t.useRef(Ci).current;t.useEffect((()=>{if(!d||f)return;const e=c(u,{at:[0]});e&&u.focusBlock(e.id,{waitExecution:!0})}),[d,f]),t.useEffect((()=>{if(!f)return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)}),[u.selectedBlocks,f]);const b=()=>{f||Array.isArray(u.selectedBlocks)&&u.selectedBlocks.length>0&&u.setBlockSelected(null)},y=()=>{m.indexToSelect=null,m.startedIndexToSelect=null,m.selectionStarted=!1},w=e=>{var t,n,i,a,s;if(!f){if(si.isSelect(e)){if((null===(t=u.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(u.children).length)return void e.preventDefault();if(m.selectionStarted)return e.preventDefault(),void u.setBlockSelected([],{allSelected:!0})}if(si.isBackspace(e)){e.stopPropagation();if(Array.isArray(u.selectedBlocks)&&(null===(n=u.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(u.children).length)return e.preventDefault(),u.deleteBlock({deleteAll:!0}),u.setBlockSelected(null),void y();if(Array.isArray(u.selectedBlocks)&&(null===(i=u.selectedBlocks)||void 0===i?void 0:i.length)>0)return e.preventDefault(),u.deleteBlock({fromPaths:u.selectedBlocks}),u.setBlockSelected(null),void y()}if(si.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(m.selectionStarted&&null!==m.startedIndexToSelect&&null!==m.indexToSelect){const e=m.indexToSelect,t=e-1;if(0===e)return;if(e===m.startedIndexToSelect)return u.setBlockSelected([t]),void(m.indexToSelect=t);if(t<m.startedIndexToSelect)return u.setBlockSelected([t]),void(m.indexToSelect=t);if((null===(a=u.selectedBlocks)||void 0===a?void 0:a.includes(e))&&e!==m.startedIndexToSelect){const n=u.selectedBlocks.filter((t=>t!==e));return u.setBlockSelected(n,{only:!0}),void(m.indexToSelect=t)}return}const t=c(u),n=sn(u);if(!n||!n.selection||!t)return;const i=o.Path.parent(n.selection.anchor.path),s=o.Editor.isStart(n,n.selection.focus,i);if(o.Range.isExpanded(n.selection)&&s){const i=u.selection?[u.selection[0]-1]:[0],a=c(u,{at:i});t&&a&&(e.preventDefault(),r.ReactEditor.blur(n),r.ReactEditor.deselect(n),o.Transforms.deselect(n),u.setSelection(null),u.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),m.startedIndexToSelect=t.meta.order,m.indexToSelect=t.meta.order-1,m.selectionStarted=!0)}}if(si.isShiftArrowDown(e)){if(m.selectionStarted&&null!==m.indexToSelect&&null!==m.startedIndexToSelect){const e=m.indexToSelect,t=e+1;if(t===Object.keys(u.children).length)return;if(e===m.startedIndexToSelect)return u.setBlockSelected([t]),void(m.indexToSelect=t);if(t>m.startedIndexToSelect)return u.setBlockSelected([t]),void(m.indexToSelect=t);if((null===(s=u.selectedBlocks)||void 0===s?void 0:s.includes(e))&&e!==m.startedIndexToSelect){const n=u.selectedBlocks.filter((t=>t!==e));return u.setBlockSelected(n,{only:!0}),void(m.indexToSelect=t)}return}const t=c(u),n=sn(u);if(!n||!n.selection||!t)return;const i=o.Path.parent(n.selection.anchor.path),a=o.Editor.isEnd(n,n.selection.focus,i);if(o.Range.isExpanded(n.selection)&&a){const i=u.selection?[u.selection[0]+1]:[0],a=c(u,{at:i});t&&a&&(e.preventDefault(),r.ReactEditor.blur(n),r.ReactEditor.deselect(n),o.Transforms.deselect(n),u.setSelection(null),u.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),m.startedIndexToSelect=t.meta.order,m.indexToSelect=t.meta.order+1,m.selectionStarted=!0)}}}},k=(C={userSelect:g.selection?"none":"auto",pointerEvents:g.selection?"none":"auto",width:l},Object.assign({paddingBottom:150},C));var C;return e.jsxs("div",Object.assign({id:"yoopta-editor",className:a,style:k,ref:h,onClick:e=>{f||(y(),(e=>{var t;const n=h.current;if(!n)return;const{bottom:r}=n.getBoundingClientRect(),i=r-parseInt(getComputedStyle(n).paddingBottom,10),a=E({id:x()});if(e.clientY>=i){const e=Object.keys(u.children).length-1,n=c(u,{at:[e]}),r=sn(u,{at:[e]});if(n&&r&&r.selection){const e=o.Editor.string(r,r.selection.anchor.path),i=o.Path.parent(r.selection.anchor.path),[s]=o.Editor.node(r,i);if(n.type===a.type&&o.Element.isElement(s)&&"void"!==(null===(t=s.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void u.focusBlock(n.id,{slate:r})}const i=e+1;u.insertBlock(a,{at:[i],focus:!0})}})(e),b())},onBlur:e=>{var t;(null===(t=h.current)||void 0===t?void 0:t.contains(e.relatedTarget))||f||(y(),b())}},{children:[e.jsx(xi,{editor:u,marks:i,placeholder:n}),!1!==s&&e.jsx(Ei,{origin:g.origin,coords:g.coords,isOpen:g.selection&&!f})]}))},Si=({children:e,fallback:n=null})=>{const[r,o]=t.useState(!1);return t.useEffect((()=>o(!0)),[]),r?e:n};var ji=Symbol.for("immer-nothing"),Ri=Symbol.for("immer-draftable"),_i=Symbol.for("immer-state");function Di(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Bi=Object.getPrototypeOf;function Ti(e){return!!e&&!!e[_i]}function Ai(e){return!!e&&(Li(e)||Array.isArray(e)||!!e[Ri]||!!e.constructor?.[Ri]||Fi(e)||Ui(e))}var Mi=Object.prototype.constructor.toString();function Li(e){if(!e||"object"!=typeof e)return!1;const t=Bi(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)===Mi}function Ni(e,t){0===Pi(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function Pi(e){const t=e[_i];return t?t.type_:Array.isArray(e)?1:Fi(e)?2:Ui(e)?3:0}function Ii(e,t){return 2===Pi(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zi(e,t,n){const r=Pi(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Fi(e){return e instanceof Map}function Ui(e){return e instanceof Set}function Hi(e){return e.copy_||e.base_}function Vi(e,t){if(Fi(e))return new Map(e);if(Ui(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Li(e)){if(!Bi(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[_i];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){const o=r[t],i=n[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Bi(e),n)}function Yi(e,t=!1){return Ki(e)||Ti(e)||!Ai(e)||(Pi(e)>1&&(e.set=e.add=e.clear=e.delete=Wi),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Yi(t,!0)))),e}function Wi(){Di(2)}function Ki(e){return Object.isFrozen(e)}var $i,Xi={};function qi(e){const t=Xi[e];return t||Di(0),t}function Zi(){return $i}function Gi(e,t){t&&(qi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ji(e){Qi(e),e.drafts_.forEach(ta),e.drafts_=null}function Qi(e){e===$i&&($i=e.parent_)}function ea(e){return $i={drafts_:[],parent_:$i,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ta(e){const t=e[_i];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function na(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[_i].modified_&&(Ji(t),Di(4)),Ai(e)&&(e=ra(t,e),t.parent_||ia(t,e)),t.patches_&&qi("Patches").generateReplacementPatches_(n[_i].base_,e,t.patches_,t.inversePatches_)):e=ra(t,n,[]),Ji(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ji?e:void 0}function ra(e,t,n){if(Ki(t))return t;const r=t[_i];if(!r)return Ni(t,((o,i)=>oa(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return ia(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),Ni(o,((o,a)=>oa(e,r,t,o,a,n,i))),ia(e,t,!1),n&&e.patches_&&qi("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function oa(e,t,n,r,o,i,a){if(Ti(o)){const a=ra(e,o,i&&t&&3!==t.type_&&!Ii(t.assigned_,r)?i.concat(r):void 0);if(zi(n,r,a),!Ti(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(Ai(o)&&!Ki(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ra(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||ia(e,o)}}function ia(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Yi(t,n)}var aa={get(e,t){if(t===_i)return e;const n=Hi(e);if(!Ii(n,t))return function(e,t,n){const r=ca(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!Ai(r)?r:r===la(e.base_,t)?(ua(e),e.copy_[t]=fa(r,e)):r},has:(e,t)=>t in Hi(e),ownKeys:e=>Reflect.ownKeys(Hi(e)),set(e,t,n){const r=ca(Hi(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=la(Hi(e),t),a=r?.[_i];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||Ii(e.base_,t)))return!0;ua(e),da(e)}var o,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!==la(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ua(e),da(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Hi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Di(11)},getPrototypeOf:e=>Bi(e.base_),setPrototypeOf(){Di(12)}},sa={};function la(e,t){const n=e[_i];return(n?Hi(n):e)[t]}function ca(e,t){if(!(t in e))return;let n=Bi(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Bi(n)}}function da(e){e.modified_||(e.modified_=!0,e.parent_&&da(e.parent_))}function ua(e){e.copy_||(e.copy_=Vi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Ni(aa,((e,t)=>{sa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),sa.deleteProperty=function(e,t){return sa.set.call(this,e,t,void 0)},sa.set=function(e,t,n){return aa.set.call(this,e[0],t,n,e[0])};function fa(e,t){const n=Fi(e)?qi("MapSet").proxyMap_(e,t):Ui(e)?qi("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Zi(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=aa;n&&(o=[r],i=sa);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}(e,t);return(t?t.scope_:Zi()).drafts_.push(n),n}function pa(e){if(!Ai(e)||Ki(e))return e;const t=e[_i];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Vi(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Vi(e,!0);return Ni(n,((e,t)=>{zi(n,e,pa(t))})),t&&(t.finalized_=!1),n}var ha=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 r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&Di(6),void 0!==n&&"function"!=typeof n&&Di(7),Ai(e)){const o=ea(this),i=fa(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?Ji(o):Qi(o)}return Gi(o,n),na(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===ji&&(r=void 0),this.autoFreeze_&&Yi(r,!0),n){const t=[],o=[];qi("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}Di(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ai(e)||Di(8),Ti(e)&&(e=function(e){Ti(e)||Di(10);return pa(e)}(e));const t=ea(this),n=fa(e,void 0);return n[_i].isManual_=!0,Qi(t),n}finishDraft(e,t){const n=e&&e[_i];n&&n.isManual_||Di(9);const{scope_:r}=n;return Gi(r,t),na(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=qi("Patches").applyPatches_;return Ti(e)?r(e,t):this.produce(e,(e=>r(e,t)))}};ha.produce,ha.produceWithPatches.bind(ha),ha.setAutoFreeze.bind(ha),ha.setUseStrictShallowCopy.bind(ha),ha.applyPatches.bind(ha);var ga=ha.createDraft.bind(ha),va=ha.finishDraft.bind(ha);function ma(e,t){const n=sn(e);if(!n)return!1;const r=o.Editor.marks(n);return!!(null==r?void 0:r[t])}const ba=(e,t)=>{const{insertText:n}=t;return t.insertText=r=>{var i;const{selection:a}=t;if(" "===r&&a&&o.Range.isCollapsed(a)){const{anchor:s}=a,l=o.Editor.above(t,{match:e=>o.Element.isElement(e)&&o.Editor.isBlock(t,e),mode:"lowest"});if(!l)return;const[,c]=l,d=o.Editor.parent(t,c),[u]=d;if(o.Element.isElement(u)&&!o.Text.isText(u.children[0]))return n(r);const f=l?c:[],p={anchor:s,focus:o.Editor.start(t,f)},h=o.Editor.string(t,p),g=null===(i=e.shortcuts)||void 0===i?void 0:i[h];if(!!g&&!g.isActive())return o.Transforms.select(t,p),o.Transforms.delete(t),void g.create({deleteText:!1})}n(r)},t};function ya(e,t,n){e.children=ga(e.children);let r=!1;const o=e.children[t];if(!o)throw Error(`Block with id ${t} not found`);n.id&&(o.id=n.id,r=!0),n.type&&(o.type=n.type,r=!0),n.meta&&(o.meta=n.meta,r=!0),n.value&&(o.value=n.value),e.children=va(e.children),r&&e.applyChanges(),e.emit("change",e.children)}function wa(e,t,n){e.children=ga(e.children);const r=c(e,{at:e.selection});if(!r)throw new Error("Block from not found at current selection");const i=_o(e.blocks[r.type].elements);if(r.type===t)return void(e.children=va(e.children));const a=sn(e,{at:[r.meta.order]});if(!a)throw new Error(`Slate not found for block in position ${r.meta.order}`);const s=_o(e.blocks[t].elements);o.Editor.withoutNormalizing(a,(()=>{!function(e,t={}){var n;const{at:r,elementType:i}=t,a=r||(null===(n=e.selection)||void 0===n?void 0:n.anchor.path);if(!a)return;let s=e=>!o.Editor.isEditor(e)&&o.Element.isElement(e);i&&(s=e=>!o.Editor.isEditor(e)&&o.Element.isElement(e)&&e.type===i);const l=o.Path.parent(a),c=o.Editor.nodes(e,{at:l,match:s,mode:"lowest"});if(c){const[e]=c}}(a,{elementType:i}),o.Transforms.setNodes(a,{type:s},{at:[0],mode:"lowest",match:e=>o.Element.isElement(e)&&!o.Editor.isInline(a,e)});const n={id:r.id,type:t,meta:Object.assign(Object.assign({},r.meta),{order:r.meta.order}),value:a.children};e.blockEditorsMap[r.id]=a,e.children[r.id]=n,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children)}))}function xa(e,t={}){const{at:n=e.selection,deleteAll:r=!1,fromPaths:o,focus:i}=t;if(Array.isArray(o)&&o.length>0){e.children=ga(e.children),o.forEach((t=>{const n=c(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])}));return Object.keys(e.children).forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=va(e.children),e.applyChanges(),void e.emit("change",e.children)}if(r||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=E({id:x()}),n=Ca(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=n,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:n,waitExecution:!0}),e.applyChanges(),void e.emit("change",e.children)}if(!n)return;e.children=ga(e.children);const[a]=n,s=Object.keys(e.children),l=s.find((t=>e.children[t].meta.order===a));if(s.forEach((t=>{const n=e.children[t];n.meta.order>a&&(n.meta.order-=1)})),l&&(delete e.children[l],delete e.blockEditorsMap[l]),e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),i){const n=e.selection?e.selection[0]-1:0,r=c(e,{at:[n]});r&&e.focusBlock(r.id,{focusAt:t.focusAt})}}function ka(e,t){const n={};return t.forEach((t=>{const r=t.type;n[r]={hotkey:t.hotkey,type:r,getValue:()=>function(e,t){const n=sn(e);if(!n)return null;const r=o.Editor.marks(n);return null==r?void 0:r[t]}(e,r),isActive:()=>ma(e,r),toggle:()=>function(e,t){const n=sn(e),r=ma(e,t);n&&(r?o.Editor.removeMark(n,t):o.Editor.addMark(n,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,r),update:t=>function(e,t,n){const r=sn(e);r&&r.selection&&o.Range.isExpanded(r.selection)&&(o.Editor.addMark(r,t,n),e.applyChanges(),e.emit("change",e.children))}(e,r,t)}})),n}function Ea(e,t){const n={};return t.forEach(((t,r)=>{var i;const a=Do(t.elements),s=null===(i=null==a?void 0:a.props)||void 0===i?void 0:i.nodeType;if(!("inline"===s||"inlineVoid"===s)){const r={};Object.keys(t.elements).forEach((e=>{const n=Yo(t.elements[e],["render"]);r[e]=n}));const{display:i,placeholder:a,align:s,shortcuts:l}=t.options||{};n[t.type]={type:t.type,elements:r,hasCustomEditor:!!t.customEditor,options:{display:i,placeholder:a,align:s,shortcuts:l},isActive:()=>{const n=c(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:(t,n)=>{wa(e,t)},create:n=>{!function(e,t,n){var r;e.children=ga(e.children);const i=c(e);if(!i)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const a=(null==n?void 0:n.slate)||sn(e,{at:[null==i?void 0:i.meta.order]});if(!a||!a.selection)return;const s=e.blocks[t],l=_o(s.elements),d=s.elements[l];if(!d)return;const u=Object.assign({nodeType:(null===(r=d.props)||void 0===r?void 0:r.nodeType)||"block"},d.props),f=k({id:x(),type:l,props:u});o.Transforms.setNodes(a,f,{at:[0,0],match:e=>o.Element.isElement(e),mode:"highest"}),(null==n?void 0:n.deleteText)&&o.Transforms.delete(a,{at:[0,0]});const p=E({id:i.id,type:s.type,meta:{order:i.meta.order,depth:i.meta.depth},value:[f]}),h=p.id;e.children[h]=p,e.blockEditorsMap[h]=a,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(h,{slate:a,waitExecution:!0})}(e,t.type,n)},update:(t,n)=>{ya(e,t,n)},updateElement:(t,n,r)=>{!function(e,t,n,r){const i=e.children[t];if(!i)throw new Error(`Block with id ${t} not found`);const a=sn(e,{at:[i.meta.order]});a?o.Editor.withoutNormalizing(a,(()=>{const[t]=o.Editor.nodes(a,{at:[0],match:e=>o.Element.isElement(e)&&e.type===n}),i=null==t?void 0:t[0],s=(null==i?void 0:i.props)||{},l={props:Object.assign(Object.assign({},s),r)};o.Transforms.setNodes(a,l,{at:[0],match:e=>o.Element.isElement(e)&&e.type===n,mode:"lowest"}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")}(e,t,n,r)},delete:t=>{xa(e,t)}}}})),n}function Ca(e){return ba(e,r.withReact(o.createEditor()))}function Oa({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}const Sa=Oa({type:"fakeSelection",render:t=>e.jsx("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),ja=(()=>{const e=x();return{[e]:E({id:e})}})(),Ra=new y,_a=(e,t)=>Ra.on(e,t),Da=(e,t)=>Ra.once(e,t),Ba=(e,t)=>Ra.off(e,t),Ta=(e,t)=>Ra.emit(e,t);const Aa=Object.assign(Object.assign({},Io),{ExtendedBlockActions:({className:n,style:r,onClick:o,children:i})=>{const a=v(),[s,l]=t.useState(!1),{refs:c,floatingStyles:d,context:u}=lo({placement:"bottom-start",open:s,onOpenChange:l,middleware:[fr(),ur(),dr(),$n(10)],whileElementsMounted:cr}),{isMounted:f,styles:p}=po(u,{duration:100}),h=Object.assign(Object.assign({},p),d);return a?null:e.jsxs(e.Fragment,{children:[f&&e.jsx(Po,Object.assign({isOpen:!0,onClose:()=>l(!1),refs:c,style:h},{children:i})),e.jsx("button",Object.assign({type:"button",ref:c.setReference,className:`absolute right-[8px] top-[8px] flex items-center justify-between z-10 opacity-1 bg-[#eee] w-[22px] h-[22px] transition-opacity duration-150 ease-in border-none cursor-pointer rounded-[2px] p-[0_4px] ${n||""} yoopta-extended-block-actions`,onClick:()=>{null==o||o(),l(!0)},style:s?Object.assign(Object.assign({},r),{opacity:1}):r},{children:e.jsx(xo,{})}))]})}});function Ma(e,t,n={}){const{focusAt:i,waitExecution:a=!0,waitExecutionMs:s=0,shouldUpdateBlockSelection:l=!0}=n,c=()=>{const a=n.slate||e.blockEditorsMap[t],s=e.children[t];if(!a||!s)return;if(!e.blocks[s.type].hasCustomEditor){const e=function(e,t){if(o.Point.isPoint(t))return t;if(o.Path.isPath(t))return{path:t,offset:0};const[,n]=o.Editor.first(e,[0]);return{path:n||[0,0],offset:0}}(a,i);o.Transforms.select(a,e),r.ReactEditor.focus(a)}l&&setTimeout((()=>{e.setSelection([s.meta.order])}),0)};a?setTimeout((()=>c()),s):c()}function La(e){return Array.from(new Set(e))}var Na={};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Boolean]",a="[object Date]",s="[object Function]",l="[object GeneratorFunction]",c="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",g="[object String]",v="[object Symbol]",b="[object WeakMap]",y="[object ArrayBuffer]",w="[object DataView]",x="[object Float32Array]",k="[object Float64Array]",E="[object Int8Array]",C="[object Int16Array]",O="[object Int32Array]",S="[object Uint8Array]",j="[object Uint8ClampedArray]",R="[object Uint16Array]",_="[object Uint32Array]",D=/\w*$/,B=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,A={};A[o]=A["[object Array]"]=A[y]=A[w]=A[i]=A[a]=A[x]=A[k]=A[E]=A[C]=A[O]=A[c]=A[d]=A[u]=A[p]=A[h]=A[g]=A[v]=A[S]=A[j]=A[R]=A[_]=!0,A["[object Error]"]=A[s]=A[b]=!1;var M="object"==typeof m&&m&&m.Object===Object&&m,L="object"==typeof self&&self&&self.Object===Object&&self,N=M||L||Function("return this")(),P=t&&!t.nodeType&&t,I=P&&e&&!e.nodeType&&e,z=I&&I.exports===P;function F(e,t){return e.set(t[0],t[1]),e}function U(e,t){return e.add(t),e}function H(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function V(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function Y(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function W(e,t){return function(n){return e(t(n))}}function K(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var $,X=Array.prototype,q=Function.prototype,Z=Object.prototype,G=N["__core-js_shared__"],J=($=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Q=q.toString,ee=Z.hasOwnProperty,te=Z.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=z?N.Buffer:void 0,oe=N.Symbol,ie=N.Uint8Array,ae=W(Object.getPrototypeOf,Object),se=Object.create,le=Z.propertyIsEnumerable,ce=X.splice,de=Object.getOwnPropertySymbols,ue=re?re.isBuffer:void 0,fe=W(Object.keys,Object),pe=Ie(N,"DataView"),he=Ie(N,"Map"),ge=Ie(N,"Promise"),ve=Ie(N,"Set"),me=Ie(N,"WeakMap"),be=Ie(Object,"create"),ye=Ve(pe),we=Ve(he),xe=Ve(ge),ke=Ve(ve),Ee=Ve(me),Ce=oe?oe.prototype:void 0,Oe=Ce?Ce.valueOf:void 0;function Se(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function je(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Re(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _e(e){this.__data__=new je(e)}function De(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ke(e)}(e)&&ee.call(e,"callee")&&(!le.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||Ue(a,r))||n.push(a);return n}function Be(e,t,n){var r=e[t];ee.call(e,t)&&Ye(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Te(e,t){for(var n=e.length;n--;)if(Ye(e[n][0],t))return n;return-1}function Ae(e,t,n,r,f,m,b){var B;if(r&&(B=m?r(e,f,m,b):r(e)),void 0!==B)return B;if(!qe(e))return e;var T=We(e);if(T){if(B=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,B)}else{var M=Fe(e),L=M==s||M==l;if($e(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(M==u||M==o||L&&!m){if(V(e))return m?e:{};if(B=function(e){return"function"!=typeof e.constructor||He(e)?{}:(t=ae(e),qe(t)?se(t):{});var t}(L?{}:e),!t)return function(e,t){return Ne(e,ze(e),t)}(e,function(e,t){return e&&Ne(t,Ze(t),e)}(B,e))}else{if(!A[M])return m?e:{};B=function(e,t,n,r){var o=e.constructor;switch(t){case y:return Le(e);case i:case a:return new o(+e);case w:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case x:case k:case E:case C:case O:case S:case j:case R:case _:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case c:return function(e,t,n){var r=t?n(Y(e),!0):Y(e);return H(r,F,new e.constructor)}(e,r,n);case d:case g:return new o(e);case p:return function(e){var t=new e.constructor(e.source,D.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var r=t?n(K(e),!0):K(e);return H(r,U,new e.constructor)}(e,r,n);case v:return s=e,Oe?Object(Oe.call(s)):{}}var s}(e,M,Ae,t)}}b||(b=new _e);var N=b.get(e);if(N)return N;if(b.set(e,B),!T)var P=n?function(e){return function(e,t,n){var r=t(e);return We(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ze,ze)}(e):Ze(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(P||e,(function(o,i){P&&(o=e[i=o]),Be(B,i,Ae(o,t,n,r,i,e,b))})),B}function Me(e){return!(!qe(e)||(t=e,J&&J in t))&&(Xe(e)||V(e)?ne:B).test(Ve(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Ne(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],s=r?r(n[a],e[a],a,n,e):void 0;Be(n,a,void 0===s?e[a]:s)}return n}function Pe(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Ie(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(n)?n:void 0}Se.prototype.clear=function(){this.__data__=be?be(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(be){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return be?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=be&&void 0===t?n:t,this},je.prototype.clear=function(){this.__data__=[]},je.prototype.delete=function(e){var t=this.__data__,n=Te(t,e);return!(n<0)&&(n==t.length-1?t.pop():ce.call(t,n,1),!0)},je.prototype.get=function(e){var t=this.__data__,n=Te(t,e);return n<0?void 0:t[n][1]},je.prototype.has=function(e){return Te(this.__data__,e)>-1},je.prototype.set=function(e,t){var n=this.__data__,r=Te(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Re.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||je),string:new Se}},Re.prototype.delete=function(e){return Pe(this,e).delete(e)},Re.prototype.get=function(e){return Pe(this,e).get(e)},Re.prototype.has=function(e){return Pe(this,e).has(e)},Re.prototype.set=function(e,t){return Pe(this,e).set(e,t),this},_e.prototype.clear=function(){this.__data__=new je},_e.prototype.delete=function(e){return this.__data__.delete(e)},_e.prototype.get=function(e){return this.__data__.get(e)},_e.prototype.has=function(e){return this.__data__.has(e)},_e.prototype.set=function(e,t){var n=this.__data__;if(n instanceof je){var r=n.__data__;if(!he||r.length<199)return r.push([e,t]),this;n=this.__data__=new Re(r)}return n.set(e,t),this};var ze=de?W(de,Object):function(){return[]},Fe=function(e){return te.call(e)};function Ue(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||T.test(e))&&e>-1&&e%1==0&&e<t}function He(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Z)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ye(e,t){return e===t||e!=e&&t!=t}(pe&&Fe(new pe(new ArrayBuffer(1)))!=w||he&&Fe(new he)!=c||ge&&Fe(ge.resolve())!=f||ve&&Fe(new ve)!=h||me&&Fe(new me)!=b)&&(Fe=function(e){var t=te.call(e),n=t==u?e.constructor:void 0,r=n?Ve(n):void 0;if(r)switch(r){case ye:return w;case we:return c;case xe:return f;case ke:return h;case Ee:return b}return t});var We=Array.isArray;function Ke(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Xe(e)}var $e=ue||function(){return!1};function Xe(e){var t=qe(e)?te.call(e):"";return t==s||t==l}function qe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ze(e){return Ke(e)?De(e):function(e){if(!He(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Ae(e,!0,!0)}}({get exports(){return Na},set exports(e){Na=e}},Na);var Pa=Na;function Ia(e,t={}){const{blockId:n,focus:r}=t;if(!n&&!t.at)throw new Error("blockId or path should be provided");let o=null;if(n&&(o=e.children[n],!o))throw new Error(`Block not with blockId: ${n} found`);if(t.at&&(o=c(e,{at:t.at}),!o))throw new Error(`Block in path ${t.at} not found`);if(!o)throw new Error("Block not found");e.children=ga(e.children);Object.values(e.children).forEach((e=>{e.meta.order>o.meta.order&&(e.meta.order+=1)}));const i=(a=o,"function"==typeof window.structuredClone?window.structuredClone(a):Pa(a));var a;const s=Ca(e);i.id=x(),i.meta.order=o.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=s;const l=i.id;e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(l,{waitExecution:!0})}function za(e,t){r.ReactEditor.blur(t),r.ReactEditor.deselect(t),o.Transforms.deselect(t),e.setBlockSelected(null),e.setSelection(null)}zo('/*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.right-\\[8px\\]{right:8px}.top-0{top:0}.top-\\[8px\\]{top:8px}.z-10{z-index:10}.z-\\[100\\]{z-index:100}.z-\\[90\\]{z-index:90}.mx-\\[4px\\]{margin-left:4px;margin-right:4px}.my-\\[4px\\]{margin-bottom:4px;margin-top:4px}.mb-\\[1px\\]{margin-bottom:1px}.mr-2{margin-right:.5rem}.mt-\\[2px\\]{margin-top:2px}.\\!block{display:block!important}.block{display:block}.inline{display:inline}.flex{display:flex}.h-4{height:1rem}.h-\\[1px\\]{height:1px}.h-\\[22px\\]{height:22px}.h-full{height:100%}.w-4{width:1rem}.w-\\[22px\\]{width:22px}.w-auto{width:auto}.w-full{width:100%}.min-w-\\[200px\\]{min-width:200px}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-between{justify-content:space-between}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-none{border-style:none}.bg-\\[\\#2383e224\\]{background-color:#2383e224}.bg-\\[\\#37352f14\\]{background-color:#37352f14}.bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}.p-\\[0_4px\\]{padding:0 4px}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\\[2px\\]{padding-left:2px;padding-right:2px}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.text-sm{font-size:.875rem;line-height:1.25rem}.italic{font-style:italic}.leading-\\[120\\%\\]{line-height:120%}.underline{text-decoration-line:underline}.opacity-100{opacity:1}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-opacity{transition-duration:.15s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}#yoopta-editor{height:auto;min-width:400px}.yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.hover\\:bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}'),exports.HOTKEYS=si,exports.UI=Aa,exports.YooptaPlugin=l,exports.buildBlockData=E,exports.buildBlockElement=k,exports.createYooptaEditor=()=>{const e={children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,n={}){e.children=ga(e.children);const{at:r=null,focus:i=!1,slate:a=null}=n,s=c(e),l=r,d={id:x(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let u=!1;if(a&&a.selection){const e=o.Editor.string(a,a.selection.anchor.path);u=o.Editor.isStart(a,a.selection.anchor,a.selection.anchor.path)&&e.length>0}if(l){const[t]=l;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),d.meta.order=t}else{const t=Object.keys(e.children).length;d.meta.order=t}const f=Ca(e);e.blockEditorsMap[d.id]=f,u&&s&&(d.meta.order=s.meta.order,s.meta.order+=1),e.children[d.id]=d;const p=null==s?void 0:s.id;e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),i&&e.focusBlock(u&&p?p:d.id)}(e,...t),insertBlocks:(...t)=>function(e,t,n={}){e.children=ga(e.children);const{at:i,focus:a}=n;let s=i||[0];const l=c(e),d=sn(e);let u=!1,f=!1;if(d&&d.selection){const t=o.Path.parent(d.selection.anchor.path),n=o.Editor.string(d,t).trim(),i=o.Editor.isStart(d,d.selection.anchor,t);u=""===n&&i,f=!i||n.length>0,r.ReactEditor.blur(d),e.setSelection(null)}f&&(s=[s[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=s[0]&&(e.meta.order+=t.length)}));const p=[];if(t.forEach(((t,n)=>{const r={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:s[0]+n})};p.push(r.meta.order),e.children[r.id]=r;const o=Ca(e);e.blockEditorsMap[r.id]=o})),l&&u){const t=l.meta.order;delete e.children[l.id],delete e.blockEditorsMap[l.id],Object.keys(e.children).forEach((n=>{const r=e.children[n];r.meta.order>t&&(r.meta.order-=1)}))}e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),a&&e.setBlockSelected(p)}(e,...t),deleteBlock:(...t)=>xa(e,...t),duplicateBlock:(...t)=>Ia(e,...t),toggleBlock:(...t)=>wa(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=ga(e.children);const r=c(e);r&&(r.meta.depth=r.meta.depth+1,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=ga(e.children);const r=c(e);r&&(r.meta.depth=0===r.meta.depth?0:r.meta.depth-1,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),moveBlock:(...t)=>function(e,t,n){e.children=ga(e.children);const[r]=n,o=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===r)),a=o.meta.order<i.meta.order,s=o.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>o.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:s&&e.meta.order<o.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),o.meta.order=r,o.meta.depth=i.meta.depth,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children)}(e,...t),focusBlock:(...t)=>Ma(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>ya(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:n,focus:r=!0}=t,i=c(e);n&&n.selection&&i&&o.Editor.withoutNormalizing(n,(()=>{e.children=ga(e.children);const t=o.Path.parent(n.selection.anchor.path);o.Transforms.splitNodes(n,{at:n.selection,match:e=>o.Element.isElement(e),always:!0,mode:"highest"});const a=t[0]+1,s=n.children.slice()[a];o.Transforms.removeNodes(n,{at:[a],match:e=>o.Element.isElement(e),mode:"highest"});const l={id:x(),type:i.type,meta:{order:i.meta.order+1,depth:i.meta.depth},value:[s]};Object.values(e.children).forEach((e=>{e.meta.order>=l.meta.order&&(e.meta.order+=1)}));const c=Ca(e);e.blockEditorsMap[l.id]=c,e.children[l.id]=l,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(l.id,{slate:c})}))}(e,...t),setSelection:(...t)=>function(e,t,n={}){const{applyChanges:r=!0}=n;e.selection=t,r&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,n={}){const{only:r=!1,allSelected:o=!1}=n,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(t.length>1)e.selectedBlocks=t;else if(r)e.selectedBlocks=t;else if(o){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=La(t)}else e.selectedBlocks=La(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var n;const r=null!==(n=t.slate)&&void 0!==n?n:sn(e);if(!r)return;const{waitExecution:o,waitExecutionMs:i}=t;o?setTimeout((()=>za(e,r)),i):(za(e,r),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e},exports.createYooptaMark=Oa,exports.default=({editor:n,value:r,marks:o,plugins:i,autoFocus:a,className:s,tools:l,selectionBoxRoot:c,children:d,placeholder:u,readOnly:p,width:h})=>{const g=()=>{y((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},v=t.useMemo((()=>o?[Sa,...o]:[Sa]),[o]),m=t.useMemo((()=>i.map((e=>e.getPlugin))),[i]),[b,y]=t.useState((()=>(n.applyChanges=g,n.readOnly=p||!1,v&&(n.formats=ka(n,v)),n.blocks=Ea(n,m),n.children=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(r)?r:ja,n.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((n=>{const r=Ca(e);t[n]=r})),t}(n),n.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,r,o,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(r=e.options)||void 0===r?void 0:r.shortcuts.length)>0&&(null===(i=null===(o=e.options)||void 0===o?void 0:o.shortcuts)||void 0===i||i.forEach((n=>{t[n]=e})))})),t}(n),n.plugins=function(e){const t={},n={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var r;const o=e.elements[t],i=null===(r=o.props)||void 0===r?void 0:r.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=o)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const r=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:r})}})),t}(m),n.on=_a,n.once=Da,n.off=Ba,n.emit=Ta,{editor:n,version:0})));return e.jsx(Si,{children:e.jsx(f,Object.assign({editorState:b},{children:e.jsxs(To,Object.assign({tools:l},{children:[e.jsx(Oi,{placeholder:u,marks:v,autoFocus:a,className:s,selectionBoxRoot:c,width:h}),d]}))}))})},exports.findPluginBlockBySelectionPath=c,exports.findPluginBlockByType=function(e,t){const n=Object.keys(e.children),{type:r}=t||{},o=n.find((t=>e.children[t].type===r));return o?e.children[o]:null},exports.findSlateBySelectionPath=sn,exports.generateId=x,exports.getRootBlockElement=Do,exports.getRootBlockElementType=_o,exports.useBlockData=h,exports.useBlockSelected=({blockId:e,path:t})=>{var n;const r=p();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let o;return e&&(o=r.children[e]),t&&(o=c(r,{at:t})),(null===(n=r.selection)||void 0===n?void 0:n[0])===(null==o?void 0:o.meta.order)},exports.useYooptaBlock=e=>p().blocks[e],exports.useYooptaEditor=p,exports.useYooptaPlugin=g,exports.useYooptaPluginOptions=e=>{var t;return null===(t=g(e))||void 0===t?void 0:t.options},exports.useYooptaReadOnly=v,exports.useYooptaTools=Ao;
|
|
6
|
+
var wo=["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(","),xo="undefined"==typeof Element,Eo=xo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ko=!xo&&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},Co=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)},Oo=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!Co(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:a,candidates:l})}else{Eo.call(a,wo)&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var c=a.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(a),d=!Co(c,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(c&&d){var u=e(!0===c?a.children:c.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},So=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},jo=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))&&!So(e)?0:e.tabIndex},Ro=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},_o=function(e){return"INPUT"===e.tagName},Do=function(e){return function(e){return _o(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ko(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)},Bo=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},To=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=Eo.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Eo.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Bo(e)}else{if("function"==typeof o){for(var i=e;e;){var a=e.parentElement,s=ko(e);if(a&&!a.shadowRoot&&!0===o(a))return Bo(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){var t,n,o,r,i=e&&ko(e),a=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(a)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!s&&a;){var l,c,d;s=!(null===(c=a=null===(l=i=ko(a))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Ao=function(e,t){return!(t.disabled||Co(t)||function(e){return _o(e)&&"hidden"===e.type}(t)||To(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!!Eo.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},Mo=function(e,t){return!(Do(t)||jo(t)<0||!Ao(e,t))},Lo=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},No=function e(t){var n=[],o=[];return t.forEach((function(t,r){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=function(e,t){var n=jo(e);return n<0&&t&&!So(e)?0:n}(a,i),l=i?e(t.candidates):a;0===s?i?n.push.apply(n,l):n.push(a):o.push({documentOrder:r,tabIndex:s,item:t,isScope:i,content:l})})),o.sort(Ro).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Po=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Oo([e],t.includeContainer,{filter:Mo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Lo}):function(e,t,n){if(Co(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(wo));return t&&Eo.call(e,wo)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,Mo.bind(null,t)),No(n)};const Io=a["useInsertionEffect".toString()]||(e=>e());var zo="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function Fo(){return Fo=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},Fo.apply(this,arguments)}let Uo=!1,Ho=0;const Vo=()=>"floating-ui-"+Ho++;const Wo=a["useId".toString()]||function(){const[e,t]=a.useState((()=>Uo?Vo():void 0));return zo((()=>{null==e&&t(Vo())}),[]),a.useEffect((()=>{Uo||(Uo=!0)}),[]),e};const Yo=a.createContext(null),Ko=a.createContext(null);function $o(e){return"data-floating-ui-"+e}function Xo(e){const n=t.useRef(e);return zo((()=>{n.current=e})),n}const qo=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Zo(e,t){const n=Po(e,qo());"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 Go(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&&hn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,o)}function Jo(e){Po(e,qo()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Qo(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 er={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 tr(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const nr=a.forwardRef((function(e,t){const[n,o]=a.useState();zo((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",tr),()=>{document.removeEventListener("keydown",tr)})),[]);const r={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[$o("focus-guard")]:"",style:er};return a.createElement("span",Fo({},e,r))})),or=a.createContext(null),rr=$o("portal");function ir(e){let{children:t,id:o,root:r=null,preserveTabOrder:i=!0}=e;const s=function(e){let{id:t,root:n}=void 0===e?{}:e;const[o,r]=a.useState(null),i=Wo(),s=ar(),l=a.useRef(null);return zo((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{l.current=null}))}),[o]),zo((()=>{if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=i,n.setAttribute(rr,""),e.appendChild(n),l.current=n,r(n)}),[t,i]),zo((()=>{if(l.current)return;let e=n||(null==s?void 0:s.portalNode);e&&!fn(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const a=document.createElement("div");a.id=i,a.setAttribute(rr,""),e=o||e,e.appendChild(a),l.current=a,r(a)}),[t,n,i,s]),o}({id:o,root:r}),[l,c]=a.useState(null),d=a.useRef(null),u=a.useRef(null),f=a.useRef(null),p=a.useRef(null),h=!!l&&!l.modal&&l.open&&i&&!(!r&&!s);return a.useEffect((()=>{if(s&&i&&(null==l||!l.modal))return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){if(s&&Go(e)){("focusin"===e.type?Qo:Jo)(s)}}}),[s,i,null==l?void 0:l.modal]),a.createElement(or.Provider,{value:a.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:p,portalNode:s,setFocusManagerState:c})),[i,s])},h&&s&&a.createElement(nr,{"data-type":"outside",ref:d,onFocus:e=>{if(Go(e,s)){var t;null==(t=f.current)||t.focus()}else{const e=Zo(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),h&&s&&a.createElement("span",{"aria-owns":s.id,style:er}),s&&n.createPortal(t,s),h&&s&&a.createElement(nr,{"data-type":"outside",ref:u,onFocus:e=>{if(Go(e,s)){var t;null==(t=p.current)||t.focus()}else{const t=Zo(document.body,"next")||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const ar=()=>a.useContext(or),sr=new Set,lr=a.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const r=Wo();return zo((()=>{if(!n)return;sr.add(r);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",i=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,s=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",i&&(t[o]=i+"px"),e){var l,c;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(s-Math.floor(n))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{sr.delete(r),0===sr.size&&(Object.assign(t,{overflow:"",[o]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,s)))}}),[r,n]),a.createElement("div",Fo({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function cr(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:r}=e,[i,l]=a.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||i,d=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[f,p]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=a.useState(o);vo(h,o)||g(o);const[v,y]=a.useState(null),[m,b]=a.useState(null),w=a.useCallback((e=>{e!==C.current&&(C.current=e,y(e))}),[]),x=a.useCallback((e=>{e!==O.current&&(O.current=e,b(e))}),[]),E=i||v,k=l||m,C=a.useRef(null),O=a.useRef(null),S=a.useRef(f),j=null!=d,R=bo(d),_=bo(r),D=a.useCallback((()=>{if(!C.current||!O.current)return;const e={placement:t,strategy:n,middleware:h};_.current&&(e.platform=_.current),ho(C.current,O.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!vo(S.current,t)&&(S.current=t,s.flushSync((()=>{p(t)})))}))}),[h,t,n,_]);go((()=>{!1===u&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[u]);const B=a.useRef(!1);go((()=>(B.current=!0,()=>{B.current=!1})),[]),go((()=>{if(E&&(C.current=E),k&&(O.current=k),E&&k){if(R.current)return R.current(E,k,D);D()}}),[E,k,D,R,j]);const T=a.useMemo((()=>({reference:C,floating:O,setReference:w,setFloating:x})),[w,x]),A=a.useMemo((()=>({reference:E,floating:k})),[E,k]),M=a.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=mo(A.floating,f.x),o=mo(A.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...yo(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}}),[n,c,A.floating,f.x,f.y]);return a.useMemo((()=>({...f,update:D,refs:T,elements:A,floatingStyles:M})),[f,D,T,A,M])}(e),u=a.useContext(Ko),f=null!=((null==(p=a.useContext(Yo))?void 0:p.id)||null);var p;const h=function(e){const t=a.useRef((()=>{}));return Io((()=>{t.current=e})),a.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&&(v.current.openEvent=t),y.emit("openchange",{open:e,event:t,reason:n,nested:f}),null==o||o(e,t,n)})),g=a.useRef(null),v=a.useRef({}),y=a.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=Wo(),b=a.useCallback((e=>{const t=fn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;d.refs.setReference(t)}),[d.refs]),w=a.useCallback((e=>{(fn(e)||null===e)&&(g.current=e,l(e)),(fn(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!fn(e))&&d.refs.setReference(e)}),[d.refs]),x=a.useMemo((()=>({...d.refs,setReference:w,setPositionReference:b,domReference:g})),[d.refs,w,b]),E=a.useMemo((()=>({...d.elements,domReference:c})),[d.elements,c]),k=a.useMemo((()=>({...d,refs:x,elements:E,dataRef:v,nodeId:r,floatingId:m,events:y,open:n,onOpenChange:h})),[d,r,m,y,n,h,x,E]);return zo((()=>{const e=null==u?void 0:u.nodesRef.current.find((e=>e.id===r));e&&(e.context=k)})),a.useMemo((()=>({...d,context:k,refs:x,elements:E})),[d,x,E,k])}const dr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function ur(e,t){return"function"==typeof e?e(t):e}function fr(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:r=250}=t,i=("number"==typeof r?r:r.close)||0,[s,l]=a.useState(!1),[c,d]=a.useState("unmounted"),u=function(e,t){const[n,o]=a.useState(e);return e&&!n&&o(!0),a.useEffect((()=>{if(!e){const e=setTimeout((()=>o(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return zo((()=>{s&&!u&&d("unmounted")}),[s,u]),zo((()=>{if(o){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),d("close")}}),[n,o]),{isMounted:u,status:c}}function pr(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:r,common:i,duration:s=250}=t,l=e.placement,c=l.split("-")[0],d=a.useMemo((()=>({side:c,placement:l})),[c,l]),u="number"==typeof s,f=(u?s:s.open)||0,p=(u?s:s.close)||0,[h,g]=a.useState((()=>({...ur(i,d),...ur(n,d)}))),{isMounted:v,status:y}=fr(e,{duration:s}),m=Xo(n),b=Xo(o),w=Xo(r),x=Xo(i);return zo((()=>{const e=ur(m.current,d),t=ur(w.current,d),n=ur(x.current,d),o=ur(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(dr).join(","),transitionDuration:f+"ms",...n,...o}),"close"===y){const o=t||e;g({transitionProperty:Object.keys(o).map(dr).join(","),transitionDuration:p+"ms",...n,...o})}}),[p,w,m,b,x,f,y,d]),{isMounted:v,styles:h}}var hr;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)}var vr=function(e){return a.createElement("svg",gr({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),hr||(hr=a.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 yr(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 mr=["color"],br=t.forwardRef((function(e,n){var o=e.color,r=void 0===o?"currentColor":o,i=yr(e,mr);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),t.createElement("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),wr=["color"],xr=t.forwardRef((function(e,n){var o=e.color,r=void 0===o?"currentColor":o,i=yr(e,wr);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),t.createElement("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Er=["color"],kr=t.forwardRef((function(e,n){var o=e.color,r=void 0===o?"currentColor":o,i=yr(e,Er);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),t.createElement("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Cr=["color"],Or=t.forwardRef((function(e,n){var o=e.color,r=void 0===o?"currentColor":o,i=yr(e,Cr);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),t.createElement("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:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Sr=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()}},jr={"text/plain":"Text","text/html":"Url",default:"Text"};var Rr=function(e,t){var n,o,r,i,a,s,l=!1;t||(t={}),n=t.debug||!1;try{if(r=Sr(),i=document.createRange(),a=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.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=jr[t.format]||jr.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(s),i.selectNodeContents(s),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!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),l=!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{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),s&&document.body.removeChild(s),r()}return l};function _r(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function Dr(e){if(!e)return;const t=_r(e);return t?e[t]:void 0}const Br=t.createContext(void 0),Tr=({children:n,tools:o})=>{const r=v(),i=t.useMemo((()=>o?Object.keys(o).reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t]:null===(n=o[t])||void 0===n?void 0:n.render})}),{}):{}),[o]),a=t.useMemo((()=>!o||r?null:Object.keys(o).map((t=>{var n,r,i;const a=null===(n=null==o?void 0:o[t])||void 0===n?void 0:n.tool,s=null===(r=null==o?void 0:o[t])||void 0===r?void 0:r.render,l=null===(i=null==o?void 0:o[t])||void 0===i?void 0:i.props;return a?e.jsx(a,Object.assign({render:s},l),t):null}))),[t.useMemo]);return e.jsx(Br.Provider,Object.assign({value:i},{children:e.jsxs(e.Fragment,{children:[a,n]})}))},Ar=()=>{const e=t.useContext(Br);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e},Mr=({children:t})=>e.jsx("div",Object.assign({className:"yoo-editor-flex yoo-editor-flex-col"},{children:t})),Lr=({children:t})=>e.jsx("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoo-editor-bg-[#FFF] yoo-editor-relative yoo-editor-min-w-[200px] yoo-editor-w-auto yoo-editor-overflow-hidden yoo-editor-rounded-md yoo-editor-border yoo-editor-bg-popover yoo-editor-py-[6px] yoo-editor-px-0 yoo-editor-text-popover-foreground yoo-editor-shadow-md 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})),Nr=({children:t})=>e.jsx("div",Object.assign({className:"yoo-editor-relative yoo-editor-flex yoo-editor-cursor-default yoo-editor-select-none yoo-editor-items-center yoo-editor-text-sm yoo-editor-outline-none yoo-editor-transition-colors focus:yoo-editor-bg-accent focus:yoo-editor-text-accent-foreground data-[disabled]:yoo-editor-pointer-events-none data-[disabled]:yoo-editor-opacity-50"},{children:t})),Pr=({isOpen:n,onClose:o,refs:r,style:i,children:a})=>{var s,l;const d=p(),u=Ar(),[f,h]=t.useState(!1),{refs:g,floatingStyles:v,context:y}=cr({placement:"right",open:f,onOpenChange:h,middleware:[po(),fo(),uo(),$n(10)],whileElementsMounted:co}),{isMounted:m,styles:b}=pr(y,{duration:100});if(!n)return null;const w=c(d,{at:d.selection}),x=Dr(d.blocks[(null==w?void 0:w.type)||""].elements),E="void"===(null===(s=null==x?void 0:x.props)||void 0===s?void 0:s.nodeType),k=u.ActionMenu,C=Object.assign(Object.assign({},v),b);return e.jsx(ir,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e.jsx(lr,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:o},{children:e.jsx("div",Object.assign({style:i,ref:r.setFloating},{children:e.jsxs(Lr,{children:[e.jsxs(Mr,{children:[e.jsx(Nr,{children:e.jsxs("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=d.selection;d.deleteBlock({at:e}),d.setBlockSelected(null),d.setSelection(null),o()}},{children:[e.jsx(Or,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e.jsx(Nr,{children:e.jsxs("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{d.duplicateBlock({at:d.selection,focus:!0}),d.setBlockSelected(null),o()}},{children:[e.jsx(br,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!E&&!(null===(l=d.blocks[(null==w?void 0:w.type)||""])||void 0===l?void 0:l.hasCustomEditor)&&e.jsxs(Nr,{children:[m&&!!k&&e.jsx(ir,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e.jsx(lr,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>h(!1)},{children:e.jsx("div",Object.assign({style:C,ref:g.setFloating},{children:e.jsx(k,{actions:Object.keys(d.blocks),editor:d,selectedAction:"",onClose:()=>{h(!1),o()},empty:!1,onMouseEnter:()=>{},mode:"toggle"})}))}))})),e.jsxs("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",ref:g.setReference,onClick:()=>h((e=>!e))},{children:[e.jsx(vr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e.jsx(Nr,{children:e.jsxs("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=c(d);e&&(Rr(`${window.location.origin}${window.location.pathname}#${e.id}`),d.emit("block:copy",e)),o()}},{children:[e.jsx(kr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var Ir=Object.freeze({__proto__:null,BlockOptions:Pr,BlockOptionsMenuContent:Lr,BlockOptionsMenuGroup:Mr,BlockOptionsMenuItem:Nr,BlockOptionsSeparator:({className:t})=>e.jsx("div",{className:`yoo-editor-h-[1px] yoo-editor-bg-[#37352f14] yoo-editor-my-[4px] yoo-editor-w-full ${t}`})});function zr(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}var Fr={actions:"vuZgncnq",hovered:"_8Eqjiv7m",actionButton:"WabGEp54",plusButton:"_0C8RpLmz"};function Ur(...e){return e.filter(Boolean).join(" ")}zr(".vuZgncnq{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition:opacity .18s ease-in}._8Eqjiv7m{opacity:1}.WabGEp54{all:unset;align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;color:rgba(55,53,47,.35);cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition:background-color .18s cubic-bezier(.4,0,.2,1);width:auto;width:18px}.WabGEp54:active,.WabGEp54:focus,.WabGEp54:hover{background-color:rgba(55,54,47,.08)}._0C8RpLmz{width:24px}");const Hr=({block:n,editor:i,dragHandleProps:a,showActions:s,onChangeActiveBlock:l})=>{const[c,d]=t.useState(!1),{refs:u,floatingStyles:f,context:p}=cr({placement:"right-start",open:c,onOpenChange:d,middleware:[po(),fo(),uo(),$n()]}),{isMounted:h,styles:g}=pr(p,{duration:100}),{setActivatorNodeRef:v,attributes:y,listeners:m}=a,b=Object.assign(Object.assign({},f),g);return e.jsxs("div",Object.assign({contentEditable:!1,className:Ur(Fr.actions,s&&Fr.hovered,"yoopta-element-actions")},{children:[e.jsx("button",Object.assign({type:"button",onClick:()=>{const e=k({id:x()}),t=[n.meta.order+1];i.setSelection([n.meta.order]),i.insertBlock(e,{at:t,focus:!0})},className:Ur(Fr.actionButton,Fr.plusButton,"yoopta-element-actions-plus")},{children:e.jsx(an,{})})),e.jsx("button",Object.assign({type:"button",className:Ur(Fr.actionButton,"yoopta-element-actions-drag"),ref:e=>{v(e),u.setReference(e)}},y,m,{onClick:e=>{e.stopPropagation(),l(n.id);const t=sn(i,{at:[n.meta.order]});i.focusBlock(n.id),t&&setTimeout((()=>{i.blocks[n.type].hasCustomEditor||(o.ReactEditor.blur(t),o.ReactEditor.deselect(t),r.Transforms.deselect(t)),i.setBlockSelected([n.meta.order],{only:!0}),i.setSelection([n.meta.order]),d(!0)}),10)}},{children:e.jsx(on,{})})),e.jsx(Pr,{isOpen:h,refs:u,style:b,onClose:()=>d(!1)})]}))},Vr=({children:n,block:o,blockId:r})=>{var i;const a=p(),[s,l]=t.useState(null),{attributes:c,listeners:d,setNodeRef:u,setActivatorNodeRef:f,transform:h,transition:g,isOver:v,isDragging:y}=qt({id:r,disabled:a.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:y?.7:1,marginLeft:20*o.meta.depth+"px"},b=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(o.meta.order),w=s===r,x={borderBottom:v&&!y?"2px solid #007aff":"none"};return e.jsxs("div",Object.assign({className:"yoo-editor-relative yoo-editor-py-0 yoo-editor-px-[2px] yoo-editor-mt-[2px] yoo-editor-mb-[1px] yoo-editor-rounded yoopta-block-wrapper",onMouseEnter:()=>{a.readOnly||l(r)},onMouseLeave:()=>{a.readOnly||l(null)},"data-yoopta-block-id":r,style:m,"data-yoopta-block":!0,ref:u},{children:[!a.readOnly&&e.jsx(Hr,{block:o,editor:a,dragHandleProps:{setActivatorNodeRef:f,attributes:c,listeners:d},showActions:w,onChangeActiveBlock:e=>l(e)}),e.jsx("div",Object.assign({className:Fr.content,style:x},{children:n})),b&&!a.readOnly&&e.jsx("div",{className:"yoo-editor-absolute yoo-editor-left-0 yoo-editor-top-0 yoo-editor-bg-[#2383e224] yoo-editor-z-[90] yoo-editor-rounded yoo-editor-opacity-100 yoo-editor-h-full yoo-editor-w-full yoo-editor-pointer-events-none yoopta-selection-block"})]}))};function Wr(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;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});for(var Kr="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),$r={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Xr={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:Kr?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},qr={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},Zr=1;Zr<20;Zr++)qr["f"+Zr]=111+Zr;function Gr(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var o=e.map((function(e){return Jr(e,t)})),r=function(e){return o.some((function(t){return Qr(t,e)}))};return null==n?r:r(n)}function Jr(e,t){var n=t&&t.byKey,o={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var a in $r)o[$r[a]]=!1;var s=!0,l=!1,c=void 0;try{for(var d,u=r[Symbol.iterator]();!(s=(d=u.next()).done);s=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=ti(f),g=$r[h];if(f.length>1&&!g&&!Xr[f]&&!qr[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?o.key=h:o.which=ei(f)),g&&(o[g]=!p||null)}}catch(e){l=!0,c=e}finally{try{!s&&u.return&&u.return()}finally{if(l)throw c}}return o}function Qr(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 ei(e){return e=ti(e),qr[e]||e.toUpperCase().charCodeAt(0)}function ti(e){return e=e.toLowerCase(),e=Xr[e]||e}Yr.default=Gr,Yr.isHotkey=Gr,Yr.isCodeHotkey=function(e,t){return Gr(e,t)};var ni=Yr.isKeyHotkey=function(e,t){return Gr(e,{byKey:!0},t)};Yr.parseHotkey=Jr,Yr.compareHotkey=Qr,Yr.toKeyCode=ei,Yr.toKeyName=ti;const oi={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:"/",kekCeburek:"mod+enter"},ri={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"},ii={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},ai=e=>{const t=oi[e],n=ri[e],o=ii[e],r=t&&ni(t),i=n&&ni(n),a=o&&ni(o);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!a||!a(e)))},si={isBold:ai("bold"),isCompose:ai("compose"),isArrowLeft:ai("arrowLeft"),isArrowRight:ai("arrowRight"),isArrowUp:ai("arrowUp"),isArrowDown:ai("arrowDown"),isDeleteBackward:ai("deleteBackward"),isDeleteForward:ai("deleteForward"),isDeleteLineBackward:ai("deleteLineBackward"),isDeleteLineForward:ai("deleteLineForward"),isDeleteWordBackward:ai("deleteWordBackward"),isDeleteWordForward:ai("deleteWordForward"),isExtendBackward:ai("extendBackward"),isExtendForward:ai("extendForward"),isExtendLineBackward:ai("extendLineBackward"),isExtendLineForward:ai("extendLineForward"),isItalic:ai("italic"),isMoveLineBackward:ai("moveLineBackward"),isMoveLineForward:ai("moveLineForward"),isCtrlLeft:ai("ctrlLeft"),isCtrlRight:ai("ctrlRight"),isRedo:ai("redo"),isShiftEnter:ai("shiftEnter"),isEnter:ai("enter"),isTransposeCharacter:ai("transposeCharacter"),isUndo:ai("undo"),isSpace:ai("space"),isSelect:ai("select"),isTab:ai("tab"),isShiftTab:ai("shiftTab"),isBackspace:ai("backspace"),isCmdEnter:ai("cmdEnter"),isCmd:ai("cmd"),isEscape:ai("escape"),isSlashCommand:ai("slashCommand"),isShiftArrowUp:ai("shiftArrowUp"),isShiftArrowDown:ai("shiftArrowDown"),isKekceburek:ai("kekCeburek")};const li={onKeyDown:function(e){return t=>{const n=sn(e,{at:e.selection});if(!n||!n.selection)return;const i=r.Path.parent(n.selection.anchor.path);if(si.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(si.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const o=r.Editor.isStart(n,n.selection.anchor,i),a=r.Editor.isEnd(n,n.selection.anchor,i);if(!o&&!a)return void e.splitBlock({slate:n,focus:!0});const s=k({id:x()}),l=e.selection?[e.selection[0]+1]:[0];e.insertBlock(s,{at:l,slate:n,focus:!0})}else if(si.isBackspace(t)){if(t.isDefaultPrevented())return;const o=c(e,{at:e.selection}),i=e.blocks[(null==o?void 0:o.type)||""],a=r.Path.parent(n.selection.anchor.path);if(r.Editor.isStart(n,n.selection.anchor,a)){t.preventDefault();const o=r.Editor.string(n,a),s=e.selection?e.selection[0]-1:0,l=sn(e,{at:[s]});let c;if(l&&!i.hasCustomEditor&&(c=function(e,t){const[,n]=r.Editor.last(e,t);return{path:n,offset:r.Editor.string(e,n).length}}(l,a)),0===o.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:c});{if(r.Range.isExpanded(n.selection))return r.Transforms.delete(n,{at:n.selection});if(!l)return;if(0===r.Editor.string(l,[0,0]).length)return e.deleteBlock({at:[s],focus:!0,focusAt:c});const t=Array.from(r.Editor.nodes(n,{at:[0],match:e=>!r.Editor.isEditor(e)&&(r.Text.isText(e)||r.Editor.isInline(n,e)),mode:"highest"})).map((([e])=>e));return r.Transforms.insertNodes(l,t,{at:r.Editor.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:c})}}}else{if(si.isSelect(t)){if(t.isDefaultPrevented())return;const[,i]=r.Editor.first(n,[0]),[,a]=r.Editor.last(n,[n.children.length-1]),s=r.Editor.range(n,i,a),l=r.Range.equals(n.selection,s);if(r.Range.isExpanded(n.selection)&&l)return t.preventDefault(),o.ReactEditor.blur(n),o.ReactEditor.deselect(n),r.Transforms.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(si.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(si.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(si.isArrowUp(t)){if(t.isDefaultPrevented())return;const o=r.Path.parent(n.selection.anchor.path);if(r.Editor.isStart(n,n.selection.anchor,o)){const n=e.selection?[e.selection[0]-1]:null,o=sn(e,{at:n}),i=c(e,{at:n});if(o&&i){const[,n]=r.Editor.last(o,[0]),a={path:n,offset:r.Editor.string(o,n).length};return t.preventDefault(),void e.focusBlock(i.id,{focusAt:a,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(si.isArrowDown(t)){const o=r.Path.parent(n.selection.anchor.path);if(r.Editor.isEnd(n,n.selection.anchor,o)){const n=e.selection?[e.selection[0]+1]:null,i=sn(e,{at:n}),a=c(e,{at:n});if(i&&a){const n=function(e,t){const[,n]=r.Editor.first(e,t);return{path:n,offset:0}}(i,o);return t.preventDefault(),void e.focusBlock(a.id,{focusAt:n,waitExecution:!1})}}}if(r.Range.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&ni(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},ci=({children:t,attributes:n,placeholder:r})=>{const i=o.useSelected(),a=Object.assign({},n);return i&&r&&(a["data-placeholder"]=r,a.className="yoopta-placeholder"),e.jsx("span",Object.assign({},a,{children:t}))};function di(e){try{return new URL(e),!0}catch(e){return!1}}const ui=(e,t)=>{(e=>{const[t]=r.Editor.nodes(e,{match:e=>!r.Editor.isEditor(e)&&r.Element.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{r.Transforms.unwrapNodes(e,{match:e=>!r.Editor.isEditor(e)&&r.Element.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,o=n&&r.Range.isCollapsed(n),i={type:"link",children:o?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};o?r.Transforms.insertNodes(e,i):(r.Transforms.wrapNodes(e,i,{split:!0}),r.Transforms.collapse(e,{edge:"end"}))};function fi(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const pi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function hi(e,t,n){var o,i,a;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 s=n;let l=Array.from(s.childNodes).map((n=>hi(e,t,n))).flat();if(pi[n.nodeName]){return{[pi[n.nodeName].type]:!0,text:null===(i=n.textContent)||void 0===i?void 0:i.replace(/[\t\n\r\f\v]+/g," ")}}if(t[n.nodeName]){const o=t[n.nodeName],i=e.blocks[o.type],s=_r(i.elements)||"",c=i.elements[s],d="void"===(null===(a=c.props)||void 0===a?void 0:a.nodeType);let u={id:x(),type:s,children:d&&!i.hasCustomEditor?[{text:""}]:l.map(gi),props:Object.assign({nodeType:"block"},c.props)};if(o.parse){const e=o.parse(n);if(e)if(r.Element.isElement(e))u=e;else if(Array.isArray(e)){return e}}0===u.children.length&&(u.children=[{text:""}]);return k({id:x(),type:o.type,value:[u],meta:{order:0,depth:0}})}return l}function gi(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(fi(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const vi={html:{deserialize:function(e,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=>{t[e]={type:n,parse:o.parse}}))}}}})),t}(e),o=hi(e,n,t).filter(fi);return console.log("html",t),o},serialize:function(){}},markdown:{}},yi=({id:n,customEditor:i,elements:a,marks:s,events:l,options:c,placeholder:d="Type '/' for commands"})=>{const u=p(),f=h(n),g=t.useRef(f.value).current,v=f.type,y=t.useMemo((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(a)),[a]),m=t.useMemo((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(s)),[s]),b=t.useMemo((()=>{let e=u.blockEditorsMap[n];return Object.keys(a).forEach((t=>{var n;const o=null===(n=a[t].props)||void 0===n?void 0:n.nodeType,r="inline"===o,i="void"===o,s="inlineVoid"===o;s&&(e.markableVoid=e=>e.type===t),(i||s)&&(e.isVoid=e=>e.type===t),(r||s)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&di(t)?ui(e,t):n(t)},e.insertData=n=>{const o=n.getData("text/plain");o&&di(o)?ui(e,o):t(n)},e})(e))})),e}),[]),w=t.useMemo((()=>{if(!l||u.readOnly)return{};const e={hotkeys:si,currentBlock:f,defaultBlock:k({id:x()})},t={};return Object.keys(l).forEach((n=>{t[n]=function(t){if(l[n]){l[n](u,b,e)(t)}}})),t}),[l,u,f]);return e.jsx("div",Object.assign({"data-plugin-id":n,"data-plugin-type":v},{children:e.jsx(mi,{id:n,slate:b,initialValue:g,onChange:e=>u.updateBlock(n,{value:e}),decorate:e=>{var t;const n=[];if(u.readOnly)return n;const[o,i]=e,a=(null===(t=u.selection)||void 0===t?void 0:t[0])===f.meta.order;return b.selection&&a&&!r.Editor.isEditor(o)&&""===r.Editor.string(b,[i[0]])&&r.Range.includes(b.selection,i)&&r.Range.isCollapsed(b.selection)&&n.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),n},renderLeaf:t=>{var n,o,r,i,a;let{children:s,leaf:l,attributes:c}=t;const p=Wr(l,["text"]),h=(null===(n=u.selection)||void 0===n?void 0:n[0])===f.meta.order;p&&Object.keys(p).forEach((e=>{const t=m[e];t&&(s=t.render({children:s,leaf:l}))}));const g=!("void"===(null===(a=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===a?void 0:a.nodeType))&&h&&l.withPlaceholder;return e.jsx(ci,Object.assign({attributes:c,placeholder:g?d:void 0},{children:s}))},renderElement:t=>{const r=y[t.element.type];return r?e.jsx(r,Object.assign({},t,{blockId:n,HTMLAttributes:null==c?void 0:c.HTMLAttributes})):e.jsx(o.DefaultElement,Object.assign({},t))},eventHandlers:w,onKeyDown:e=>{var t;u.readOnly||(null===(t=w.onKeyDown)||void 0===t||t.call(w,e),li.onKeyDown(u)(e))},onKeyUp:e=>{var t;u.readOnly||null===(t=null==w?void 0:w.onKeyUp)||void 0===t||t.call(w,e)},onFocus:e=>{var t;u.readOnly||null===(t=null==w?void 0:w.onFocus)||void 0===t||t.call(w,e)},onClick:e=>{var t,n;u.readOnly||((null===(t=u.selection)||void 0===t?void 0:t[0])!==f.meta.order&&u.setSelection([f.meta.order]),null===(n=null==w?void 0:w.onClick)||void 0===n||n.call(w,e))},onBlur:e=>{var t;u.readOnly||(e.preventDefault(),null===(t=null==w?void 0:w.onBlur)||void 0===t||t.call(w,e))},customEditor:i,readOnly:u.readOnly,onPaste:e=>{var t;if(u.readOnly)return;null===(t=null==w?void 0:w.onPaste)||void 0===t||t.call(w,e);const n=e.clipboardData.getData("text/html"),o=(new DOMParser).parseFromString(n,"text/html");if(o.body.childNodes.length>0){const e=vi.html.deserialize(u,o.body);if(e.length>0)return void u.insertBlocks(e,{at:u.selection,focus:!0})}},onCopy:e=>{var t;u.readOnly||null===(t=null==w?void 0:w.onCopy)||void 0===t||t.call(w,e)}})}))},mi=t.memo((({id:t,slate:n,initialValue:r,onChange:i,renderLeaf:a,renderElement:s,eventHandlers:l,onKeyDown:c,onKeyUp:d,onFocus:u,onClick:f,onBlur:p,onPaste:h,customEditor:g,decorate:v,readOnly:y})=>"function"==typeof g?g({blockId:t}):e.jsx(o.Slate,Object.assign({editor:n,initialValue:r,onChange:i},{children:e.jsx(o.Editable,Object.assign({renderElement:s,renderLeaf:a,className:"focus-visible:yoo-editor-outline-none focus:yoo-editor-outline-none",spellCheck:!0},l,{onKeyDown:c,onKeyUp:d,onFocus:u,onClick:f,decorate:v,onBlur:p,readOnly:y,onPaste:h}),`editable-${t}`)}),`slate-${t}`)));mi.displayName="SlateEditorInstance";const bi=({editor:e})=>({sensors:function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.useMemo((()=>[...n].filter((e=>null!=e))),[...n])}(oe(Xe,{activationConstraint:{delay:100,tolerance:0}}),oe(Ve,{coordinateGetter:Jt})),handleDragEnd:t.useCallback((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:t.useCallback((t=>{e.setBlockSelected(null)}),[])}),wi=[],xi=({editor:n,marks:o,placeholder:r})=>{const i=v(),{sensors:a,handleDragEnd:s,handleDragStart:l}=bi({editor:n}),c=Object.keys(n.children),d=t.useMemo((()=>0===c.length?wi:c.sort(((e,t)=>n.children[e].meta.order-n.children[t].meta.order))),[c]),u=[];for(let t=0;t<d.length;t++){const i=d[t],a=n.children[i],s=n.plugins[a.type];a&&s?u.push(e.jsx(Vr,Object.assign({block:a,blockId:i},{children:e.jsx(yi,{type:a.type,id:i,marks:o,customEditor:s.customEditor,events:s.events,elements:s.elements,options:s.options,placeholder:r},i)}),i)):console.error(`Plugin ${a.type} not found`)}return i?e.jsx(e.Fragment,{children:u}):e.jsx(jt,Object.assign({sensors:a,collisionDetection:ue,onDragStart:l,onDragEnd:s},{children:e.jsx(Ht,Object.assign({disabled:i,items:d,strategy:zt},{children:u}))}))},Ei=({editor:e,yooptaEditorRef:n,root:o})=>{const[r,i]=t.useState({origin:[0,0],coords:[0,0],selection:!1}),a=t=>{var a;if(e.readOnly||!1===o)return;const s=null===(a=n.current)||void 0===a?void 0:a.contains(t.target);if(!s&&!r.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();s||i({origin:[t.pageX,t.pageY-window.pageYOffset],coords:[t.pageX,t.pageY-window.pageYOffset],selection:!0})},s=t=>{if(!r.selection||e.readOnly||!1===o)return;i((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const n=((e,t)=>{const n=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((o,r)=>{if(!o)return;const i=o.getBoundingClientRect(),a=Math.min(e[1],t[1]),s=Math.min(e[0],t[0]),l=Math.max(e[1],t[1]),c=Math.max(e[0],t[0]);a<i.bottom&&l>i.top&&s<i.right&&c>i.left&&n.push(r)})),n})(r.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(n,{only:!0})},l=()=>{e.readOnly||c()};t.useEffect((()=>{var t;if(e.readOnly||!1===o)return;const r=o&&"current"in o?o.current:o||document;if(!r)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in r))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(t=n.current)||void 0===t?void 0:t.contains(r))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return r.addEventListener("mousedown",a),r.addEventListener("mousemove",s),r.addEventListener("mouseup",l),()=>{r.removeEventListener("mousedown",a),r.removeEventListener("mousemove",s),r.removeEventListener("mouseup",l)}}),[e.selectedBlocks,r,o,e.readOnly]);const c=()=>{i({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},r),{onClose:c})},ki=({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.jsx("div",{style:r})},Ci={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},Oi=({placeholder:n,marks:i,className:a,selectionBoxRoot:s,width:l,autoFocus:d=!0})=>{const u=p(),f=v(),h=t.useRef(null),g=Ei({editor:u,yooptaEditorRef:h,root:s});let y=t.useRef(Ci).current;t.useEffect((()=>{if(!d||f)return;const e=c(u,{at:[0]});e&&u.focusBlock(e.id,{waitExecution:!0})}),[d,f]),t.useEffect((()=>{if(!f)return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)}),[u.selectedBlocks,f]);const m=()=>{f||Array.isArray(u.selectedBlocks)&&u.selectedBlocks.length>0&&u.setBlockSelected(null)},b=()=>{y.indexToSelect=null,y.startedIndexToSelect=null,y.selectionStarted=!1},w=e=>{var t,n,i,a,s;if(!f){if(si.isSelect(e)){if((null===(t=u.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(u.children).length)return void e.preventDefault();if(y.selectionStarted)return e.preventDefault(),void u.setBlockSelected([],{allSelected:!0})}if(si.isBackspace(e)){e.stopPropagation();if(Array.isArray(u.selectedBlocks)&&(null===(n=u.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(u.children).length)return e.preventDefault(),u.deleteBlock({deleteAll:!0}),u.setBlockSelected(null),void b();if(Array.isArray(u.selectedBlocks)&&(null===(i=u.selectedBlocks)||void 0===i?void 0:i.length)>0)return e.preventDefault(),u.deleteBlock({fromPaths:u.selectedBlocks}),u.setBlockSelected(null),void b()}if(si.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(y.selectionStarted&&null!==y.startedIndexToSelect&&null!==y.indexToSelect){const e=y.indexToSelect,t=e-1;if(0===e)return;if(e===y.startedIndexToSelect)return u.setBlockSelected([t]),void(y.indexToSelect=t);if(t<y.startedIndexToSelect)return u.setBlockSelected([t]),void(y.indexToSelect=t);if((null===(a=u.selectedBlocks)||void 0===a?void 0:a.includes(e))&&e!==y.startedIndexToSelect){const n=u.selectedBlocks.filter((t=>t!==e));return u.setBlockSelected(n,{only:!0}),void(y.indexToSelect=t)}return}const t=c(u),n=sn(u);if(!n||!n.selection||!t)return;const i=r.Path.parent(n.selection.anchor.path),s=r.Editor.isStart(n,n.selection.focus,i);if(r.Range.isExpanded(n.selection)&&s){const i=u.selection?[u.selection[0]-1]:[0],a=c(u,{at:i});t&&a&&(e.preventDefault(),o.ReactEditor.blur(n),o.ReactEditor.deselect(n),r.Transforms.deselect(n),u.setSelection(null),u.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),y.startedIndexToSelect=t.meta.order,y.indexToSelect=t.meta.order-1,y.selectionStarted=!0)}}if(si.isShiftArrowDown(e)){if(y.selectionStarted&&null!==y.indexToSelect&&null!==y.startedIndexToSelect){const e=y.indexToSelect,t=e+1;if(t===Object.keys(u.children).length)return;if(e===y.startedIndexToSelect)return u.setBlockSelected([t]),void(y.indexToSelect=t);if(t>y.startedIndexToSelect)return u.setBlockSelected([t]),void(y.indexToSelect=t);if((null===(s=u.selectedBlocks)||void 0===s?void 0:s.includes(e))&&e!==y.startedIndexToSelect){const n=u.selectedBlocks.filter((t=>t!==e));return u.setBlockSelected(n,{only:!0}),void(y.indexToSelect=t)}return}const t=c(u),n=sn(u);if(!n||!n.selection||!t)return;const i=r.Path.parent(n.selection.anchor.path),a=r.Editor.isEnd(n,n.selection.focus,i);if(r.Range.isExpanded(n.selection)&&a){const i=u.selection?[u.selection[0]+1]:[0],a=c(u,{at:i});t&&a&&(e.preventDefault(),o.ReactEditor.blur(n),o.ReactEditor.deselect(n),r.Transforms.deselect(n),u.setSelection(null),u.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),y.startedIndexToSelect=t.meta.order,y.indexToSelect=t.meta.order+1,y.selectionStarted=!0)}}}},E=(C={userSelect:g.selection?"none":"auto",pointerEvents:g.selection?"none":"auto",width:l},Object.assign({paddingBottom:150},C));var C;return e.jsxs("div",Object.assign({id:"yoopta-editor",className:a,style:E,ref:h,onClick:e=>{f||(b(),(e=>{var t;const n=h.current;if(!n)return;const{bottom:o}=n.getBoundingClientRect(),i=o-parseInt(getComputedStyle(n).paddingBottom,10),a=k({id:x()});if(e.clientY>=i){const e=Object.keys(u.children).length-1,n=c(u,{at:[e]}),o=sn(u,{at:[e]});if(n&&o&&o.selection){const e=r.Editor.string(o,o.selection.anchor.path),i=r.Path.parent(o.selection.anchor.path),[s]=r.Editor.node(o,i);if(n.type===a.type&&r.Element.isElement(s)&&"void"!==(null===(t=s.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void u.focusBlock(n.id,{slate:o})}const i=e+1;u.insertBlock(a,{at:[i],focus:!0})}})(e),m())},onBlur:e=>{var t;(null===(t=h.current)||void 0===t?void 0:t.contains(e.relatedTarget))||f||(b(),m())}},{children:[e.jsx(xi,{editor:u,marks:i,placeholder:n}),!1!==s&&e.jsx(ki,{origin:g.origin,coords:g.coords,isOpen:g.selection&&!f})]}))},Si=({children:e,fallback:n=null})=>{const[o,r]=t.useState(!1);return t.useEffect((()=>r(!0)),[]),o?e:n};var ji=Symbol.for("immer-nothing"),Ri=Symbol.for("immer-draftable"),_i=Symbol.for("immer-state");function Di(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Bi=Object.getPrototypeOf;function Ti(e){return!!e&&!!e[_i]}function Ai(e){return!!e&&(Li(e)||Array.isArray(e)||!!e[Ri]||!!e.constructor?.[Ri]||Fi(e)||Ui(e))}var Mi=Object.prototype.constructor.toString();function Li(e){if(!e||"object"!=typeof e)return!1;const t=Bi(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)===Mi}function Ni(e,t){0===Pi(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,o)=>t(o,n,e)))}function Pi(e){const t=e[_i];return t?t.type_:Array.isArray(e)?1:Fi(e)?2:Ui(e)?3:0}function Ii(e,t){return 2===Pi(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zi(e,t,n){const o=Pi(e);2===o?e.set(t,n):3===o?e.add(n):e[t]=n}function Fi(e){return e instanceof Map}function Ui(e){return e instanceof Set}function Hi(e){return e.copy_||e.base_}function Vi(e,t){if(Fi(e))return new Map(e);if(Ui(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Li(e)){if(!Bi(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[_i];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(Bi(e),n)}function Wi(e,t=!1){return Ki(e)||Ti(e)||!Ai(e)||(Pi(e)>1&&(e.set=e.add=e.clear=e.delete=Yi),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Wi(t,!0)))),e}function Yi(){Di(2)}function Ki(e){return Object.isFrozen(e)}var $i,Xi={};function qi(e){const t=Xi[e];return t||Di(0),t}function Zi(){return $i}function Gi(e,t){t&&(qi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ji(e){Qi(e),e.drafts_.forEach(ta),e.drafts_=null}function Qi(e){e===$i&&($i=e.parent_)}function ea(e){return $i={drafts_:[],parent_:$i,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ta(e){const t=e[_i];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function na(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[_i].modified_&&(Ji(t),Di(4)),Ai(e)&&(e=oa(t,e),t.parent_||ia(t,e)),t.patches_&&qi("Patches").generateReplacementPatches_(n[_i].base_,e,t.patches_,t.inversePatches_)):e=oa(t,n,[]),Ji(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ji?e:void 0}function oa(e,t,n){if(Ki(t))return t;const o=t[_i];if(!o)return Ni(t,((r,i)=>ra(e,o,t,r,i,n))),t;if(o.scope_!==e)return t;if(!o.modified_)return ia(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),Ni(r,((r,a)=>ra(e,o,t,r,a,n,i))),ia(e,t,!1),n&&e.patches_&&qi("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function ra(e,t,n,o,r,i,a){if(Ti(r)){const a=oa(e,r,i&&t&&3!==t.type_&&!Ii(t.assigned_,o)?i.concat(o):void 0);if(zi(n,o,a),!Ti(a))return;e.canAutoFreeze_=!1}else a&&n.add(r);if(Ai(r)&&!Ki(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;oa(e,r),t&&t.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(n,o)||ia(e,r)}}function ia(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Wi(t,n)}var aa={get(e,t){if(t===_i)return e;const n=Hi(e);if(!Ii(n,t))return function(e,t,n){const o=ca(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_||!Ai(o)?o:o===la(e.base_,t)?(ua(e),e.copy_[t]=fa(o,e)):o},has:(e,t)=>t in Hi(e),ownKeys:e=>Reflect.ownKeys(Hi(e)),set(e,t,n){const o=ca(Hi(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const o=la(Hi(e),t),a=o?.[_i];if(a&&a.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||Ii(e.base_,t)))return!0;ua(e),da(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!==la(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ua(e),da(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Hi(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:o.enumerable,value:n[t]}:o},defineProperty(){Di(11)},getPrototypeOf:e=>Bi(e.base_),setPrototypeOf(){Di(12)}},sa={};function la(e,t){const n=e[_i];return(n?Hi(n):e)[t]}function ca(e,t){if(!(t in e))return;let n=Bi(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Bi(n)}}function da(e){e.modified_||(e.modified_=!0,e.parent_&&da(e.parent_))}function ua(e){e.copy_||(e.copy_=Vi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Ni(aa,((e,t)=>{sa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),sa.deleteProperty=function(e,t){return sa.set.call(this,e,t,void 0)},sa.set=function(e,t,n){return aa.set.call(this,e[0],t,n,e[0])};function fa(e,t){const n=Fi(e)?qi("MapSet").proxyMap_(e,t):Ui(e)?qi("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:Zi(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,i=aa;n&&(r=[o],i=sa);const{revoke:a,proxy:s}=Proxy.revocable(r,i);return o.draft_=s,o.revoke_=a,s}(e,t);return(t?t.scope_:Zi()).drafts_.push(n),n}function pa(e){if(!Ai(e)||Ki(e))return e;const t=e[_i];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Vi(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Vi(e,!0);return Ni(n,((e,t)=>{zi(n,e,pa(t))})),t&&(t.finalized_=!1),n}var ha=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&&Di(6),void 0!==n&&"function"!=typeof n&&Di(7),Ai(e)){const r=ea(this),i=fa(e,void 0);let a=!0;try{o=t(i),a=!1}finally{a?Ji(r):Qi(r)}return Gi(r,n),na(o,r)}if(!e||"object"!=typeof e){if(o=t(e),void 0===o&&(o=e),o===ji&&(o=void 0),this.autoFreeze_&&Wi(o,!0),n){const t=[],r=[];qi("Patches").generateReplacementPatches_(e,o,t,r),n(t,r)}return o}Di(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){Ai(e)||Di(8),Ti(e)&&(e=function(e){Ti(e)||Di(10);return pa(e)}(e));const t=ea(this),n=fa(e,void 0);return n[_i].isManual_=!0,Qi(t),n}finishDraft(e,t){const n=e&&e[_i];n&&n.isManual_||Di(9);const{scope_:o}=n;return Gi(o,t),na(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=qi("Patches").applyPatches_;return Ti(e)?o(e,t):this.produce(e,(e=>o(e,t)))}};ha.produce,ha.produceWithPatches.bind(ha),ha.setAutoFreeze.bind(ha),ha.setUseStrictShallowCopy.bind(ha),ha.applyPatches.bind(ha);var ga=ha.createDraft.bind(ha),va=ha.finishDraft.bind(ha);function ya(e,t){const n=sn(e);if(!n)return!1;const o=r.Editor.marks(n);return!!(null==o?void 0:o[t])}const ma=(e,t)=>{const{insertText:n}=t;return t.insertText=o=>{var i;const{selection:a}=t;if(" "===o&&a&&r.Range.isCollapsed(a)){const{anchor:s}=a,l=r.Editor.above(t,{match:e=>r.Element.isElement(e)&&r.Editor.isBlock(t,e),mode:"lowest"});if(!l)return;const[,c]=l,d=r.Editor.parent(t,c),[u]=d;if(r.Element.isElement(u)&&!r.Text.isText(u.children[0]))return n(o);const f=l?c:[],p={anchor:s,focus:r.Editor.start(t,f)},h=r.Editor.string(t,p),g=null===(i=e.shortcuts)||void 0===i?void 0:i[h];if(!!g&&!g.isActive())return r.Transforms.select(t,p),r.Transforms.delete(t),void g.create({deleteText:!1})}n(o)},t};function ba(e,t,n){e.children=ga(e.children);let o=!1;const r=e.children[t];if(!r)throw Error(`Block with id ${t} not found`);n.id&&(r.id=n.id,o=!0),n.type&&(r.type=n.type,o=!0),n.meta&&(r.meta=n.meta,o=!0),n.value&&(r.value=n.value),e.children=va(e.children),o&&e.applyChanges(),e.emit("change",e.children)}function wa(e,t,n){e.children=ga(e.children);const o=c(e,{at:e.selection});if(!o)throw new Error("Block from not found at current selection");const i=_r(e.blocks[o.type].elements);if(o.type===t)return void(e.children=va(e.children));const a=sn(e,{at:[o.meta.order]});if(!a)throw new Error(`Slate not found for block in position ${o.meta.order}`);const s=_r(e.blocks[t].elements);r.Editor.withoutNormalizing(a,(()=>{!function(e,t={}){var n;const{at:o,elementType:i}=t,a=o||(null===(n=e.selection)||void 0===n?void 0:n.anchor.path);if(!a)return;let s=e=>!r.Editor.isEditor(e)&&r.Element.isElement(e);i&&(s=e=>!r.Editor.isEditor(e)&&r.Element.isElement(e)&&e.type===i);const l=r.Path.parent(a),c=r.Editor.nodes(e,{at:l,match:s,mode:"lowest"});if(c){const[e]=c}}(a,{elementType:i}),r.Transforms.setNodes(a,{type:s},{at:[0],mode:"lowest",match:e=>r.Element.isElement(e)&&!r.Editor.isInline(a,e)});const n={id:o.id,type:t,meta:Object.assign(Object.assign({},o.meta),{order:o.meta.order}),value:a.children};e.blockEditorsMap[o.id]=a,e.children[o.id]=n,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children)}))}function xa(e,t={}){const{at:n=e.selection,deleteAll:o=!1,fromPaths:r,focus:i}=t;if(Array.isArray(r)&&r.length>0){e.children=ga(e.children),r.forEach((t=>{const n=c(e,{at:[t]});n&&(delete e.children[n.id],delete e.blockEditorsMap[n.id])}));return Object.keys(e.children).forEach(((t,n)=>{e.children[t].meta.order=n})),e.children=va(e.children),e.applyChanges(),void e.emit("change",e.children)}if(o||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=k({id:x()}),n=Ca(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=n,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:n,waitExecution:!0}),e.applyChanges(),void e.emit("change",e.children)}if(!n)return;e.children=ga(e.children);const[a]=n,s=Object.keys(e.children),l=s.find((t=>e.children[t].meta.order===a));if(s.forEach((t=>{const n=e.children[t];n.meta.order>a&&(n.meta.order-=1)})),l&&(delete e.children[l],delete e.blockEditorsMap[l]),e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),i){const n=e.selection?e.selection[0]-1:0,o=c(e,{at:[n]});o&&e.focusBlock(o.id,{focusAt:t.focusAt})}}function Ea(e,t){const n={};return t.forEach((t=>{const o=t.type;n[o]={hotkey:t.hotkey,type:o,getValue:()=>function(e,t){const n=sn(e);if(!n)return null;const o=r.Editor.marks(n);return null==o?void 0:o[t]}(e,o),isActive:()=>ya(e,o),toggle:()=>function(e,t){const n=sn(e),o=ya(e,t);n&&(o?r.Editor.removeMark(n,t):r.Editor.addMark(n,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,o),update:t=>function(e,t,n){const o=sn(e);o&&o.selection&&r.Range.isExpanded(o.selection)&&(r.Editor.addMark(o,t,n),e.applyChanges(),e.emit("change",e.children))}(e,o,t)}})),n}function ka(e,t){const n={};return t.forEach(((t,o)=>{var i;const a=Dr(t.elements),s=null===(i=null==a?void 0:a.props)||void 0===i?void 0:i.nodeType;if(!("inline"===s||"inlineVoid"===s)){const o={};Object.keys(t.elements).forEach((e=>{const n=Wr(t.elements[e],["render"]);o[e]=n}));const{display:i,placeholder:a,align:s,shortcuts:l}=t.options||{};n[t.type]={type:t.type,elements:o,hasCustomEditor:!!t.customEditor,options:{display:i,placeholder:a,align:s,shortcuts:l},isActive:()=>{const n=c(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:(t,n)=>{wa(e,t)},create:n=>{!function(e,t,n){var o;e.children=ga(e.children);const i=c(e);if(!i)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const a=(null==n?void 0:n.slate)||sn(e,{at:[null==i?void 0:i.meta.order]});if(!a||!a.selection)return;const s=e.blocks[t],l=_r(s.elements),d=s.elements[l];if(!d)return;const u=Object.assign({nodeType:(null===(o=d.props)||void 0===o?void 0:o.nodeType)||"block"},d.props),f=E({id:x(),type:l,props:u});r.Transforms.setNodes(a,f,{at:[0,0],match:e=>r.Element.isElement(e),mode:"highest"}),(null==n?void 0:n.deleteText)&&r.Transforms.delete(a,{at:[0,0]});const p=k({id:i.id,type:s.type,meta:{order:i.meta.order,depth:i.meta.depth},value:[f]}),h=p.id;e.children[h]=p,e.blockEditorsMap[h]=a,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(h,{slate:a,waitExecution:!0})}(e,t.type,n)},update:(t,n)=>{ba(e,t,n)},updateElement:(t,n,o)=>{!function(e,t,n,o){const i=e.children[t];if(!i)throw new Error(`Block with id ${t} not found`);const a=sn(e,{at:[i.meta.order]});a?r.Editor.withoutNormalizing(a,(()=>{const[t]=r.Editor.nodes(a,{at:[0],match:e=>r.Element.isElement(e)&&e.type===n}),i=null==t?void 0:t[0],s=(null==i?void 0:i.props)||{},l={props:Object.assign(Object.assign({},s),o)};r.Transforms.setNodes(a,l,{at:[0],match:e=>r.Element.isElement(e)&&e.type===n,mode:"lowest"}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")}(e,t,n,o)},delete:t=>{xa(e,t)}}}})),n}function Ca(e){return ma(e,o.withReact(r.createEditor()))}function Oa({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}const Sa=Oa({type:"fakeSelection",render:t=>e.jsx("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),ja=(()=>{const e=x();return{[e]:k({id:e})}})(),Ra=new b,_a=(e,t)=>Ra.on(e,t),Da=(e,t)=>Ra.once(e,t),Ba=(e,t)=>Ra.off(e,t),Ta=(e,t)=>Ra.emit(e,t);const Aa=Object.assign(Object.assign({},Ir),{ExtendedBlockActions:({className:n,style:o,onClick:r,children:i})=>{const a=v(),[s,l]=t.useState(!1),{refs:c,floatingStyles:d,context:u}=cr({placement:"bottom-start",open:s,onOpenChange:l,middleware:[po(),fo(),uo(),$n(10)],whileElementsMounted:co}),{isMounted:f,styles:p}=pr(u,{duration:100}),h=Object.assign(Object.assign({},p),d);return a?null:e.jsxs(e.Fragment,{children:[f&&e.jsx(Pr,Object.assign({isOpen:!0,onClose:()=>l(!1),refs:c,style:h},{children:i})),e.jsx("button",Object.assign({type:"button",ref:c.setReference,className:`yoo-editor-absolute yoo-editor-right-[8px] yoo-editor-top-[8px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-between yoo-editor-z-10 yoo-editor-opacity-1 yoo-editor-bg-[#eee] yoo-editor-w-[22px] yoo-editor-h-[22px] yoo-editor-transition-opacity yoo-editor-duration-150 yoo-editor-ease-in yoo-editor-border-none yoo-editor-cursor-pointer yoo-editor-rounded-[2px] yoo-editor-p-[0_4px] ${n||""} yoopta-extended-block-actions`,onClick:()=>{null==r||r(),l(!0)},style:s?Object.assign(Object.assign({},o),{opacity:1}):o},{children:e.jsx(xr,{})}))]})}});function Ma(e,t,n={}){try{const{focusAt:i,waitExecution:a=!0,waitExecutionMs:s=0,shouldUpdateBlockSelection:l=!0}=n,c=()=>{const a=n.slate||e.blockEditorsMap[t],s=e.children[t];if(!a||!s)return;if(!e.blocks[s.type].hasCustomEditor){const e=function(e,t){if(r.Point.isPoint(t))return t;if(r.Path.isPath(t))return{path:t,offset:0};const[,n]=r.Editor.first(e,[0]);return{path:n||[0,0],offset:0}}(a,i);r.Transforms.select(a,e),o.ReactEditor.focus(a)}l&&setTimeout((()=>{e.setSelection([s.meta.order])}),0)};a?setTimeout((()=>c()),s):c()}catch(e){}}function La(e){return Array.from(new Set(e))}var Na={};!function(e,t){var n="__lodash_hash_undefined__",o=9007199254740991,r="[object Arguments]",i="[object Boolean]",a="[object Date]",s="[object Function]",l="[object GeneratorFunction]",c="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",g="[object String]",v="[object Symbol]",m="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",x="[object Float32Array]",E="[object Float64Array]",k="[object Int8Array]",C="[object Int16Array]",O="[object Int32Array]",S="[object Uint8Array]",j="[object Uint8ClampedArray]",R="[object Uint16Array]",_="[object Uint32Array]",D=/\w*$/,B=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,A={};A[r]=A["[object Array]"]=A[b]=A[w]=A[i]=A[a]=A[x]=A[E]=A[k]=A[C]=A[O]=A[c]=A[d]=A[u]=A[p]=A[h]=A[g]=A[v]=A[S]=A[j]=A[R]=A[_]=!0,A["[object Error]"]=A[s]=A[m]=!1;var M="object"==typeof y&&y&&y.Object===Object&&y,L="object"==typeof self&&self&&self.Object===Object&&self,N=M||L||Function("return this")(),P=t&&!t.nodeType&&t,I=P&&e&&!e.nodeType&&e,z=I&&I.exports===P;function F(e,t){return e.set(t[0],t[1]),e}function U(e,t){return e.add(t),e}function H(e,t,n,o){var r=-1,i=e?e.length:0;for(o&&i&&(n=e[++r]);++r<i;)n=t(n,e[r],r,e);return n}function V(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n}function Y(e,t){return function(n){return e(t(n))}}function K(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var $,X=Array.prototype,q=Function.prototype,Z=Object.prototype,G=N["__core-js_shared__"],J=($=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Q=q.toString,ee=Z.hasOwnProperty,te=Z.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=z?N.Buffer:void 0,re=N.Symbol,ie=N.Uint8Array,ae=Y(Object.getPrototypeOf,Object),se=Object.create,le=Z.propertyIsEnumerable,ce=X.splice,de=Object.getOwnPropertySymbols,ue=oe?oe.isBuffer:void 0,fe=Y(Object.keys,Object),pe=Ie(N,"DataView"),he=Ie(N,"Map"),ge=Ie(N,"Promise"),ve=Ie(N,"Set"),ye=Ie(N,"WeakMap"),me=Ie(Object,"create"),be=Ve(pe),we=Ve(he),xe=Ve(ge),Ee=Ve(ve),ke=Ve(ye),Ce=re?re.prototype:void 0,Oe=Ce?Ce.valueOf:void 0;function Se(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function je(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function Re(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function _e(e){this.__data__=new je(e)}function De(e,t){var n=Ye(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ke(e)}(e)&&ee.call(e,"callee")&&(!le.call(e,"callee")||te.call(e)==r)}(e)?function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}(e.length,String):[],o=n.length,i=!!o;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||Ue(a,o))||n.push(a);return n}function Be(e,t,n){var o=e[t];ee.call(e,t)&&We(o,n)&&(void 0!==n||t in e)||(e[t]=n)}function Te(e,t){for(var n=e.length;n--;)if(We(e[n][0],t))return n;return-1}function Ae(e,t,n,o,f,y,m){var B;if(o&&(B=y?o(e,f,y,m):o(e)),void 0!==B)return B;if(!qe(e))return e;var T=Ye(e);if(T){if(B=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,o=e.length;t||(t=Array(o));for(;++n<o;)t[n]=e[n];return t}(e,B)}else{var M=Fe(e),L=M==s||M==l;if($e(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(M==u||M==r||L&&!y){if(V(e))return y?e:{};if(B=function(e){return"function"!=typeof e.constructor||He(e)?{}:(t=ae(e),qe(t)?se(t):{});var t}(L?{}:e),!t)return function(e,t){return Ne(e,ze(e),t)}(e,function(e,t){return e&&Ne(t,Ze(t),e)}(B,e))}else{if(!A[M])return y?e:{};B=function(e,t,n,o){var r=e.constructor;switch(t){case b:return Le(e);case i:case a:return new r(+e);case w:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,o);case x:case E:case k:case C:case O:case S:case j:case R:case _:return function(e,t){var n=t?Le(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,o);case c:return function(e,t,n){var o=t?n(W(e),!0):W(e);return H(o,F,new e.constructor)}(e,o,n);case d:case g:return new r(e);case p:return function(e){var t=new e.constructor(e.source,D.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var o=t?n(K(e),!0):K(e);return H(o,U,new e.constructor)}(e,o,n);case v:return s=e,Oe?Object(Oe.call(s)):{}}var s}(e,M,Ae,t)}}m||(m=new _e);var N=m.get(e);if(N)return N;if(m.set(e,B),!T)var P=n?function(e){return function(e,t,n){var o=t(e);return Ye(e)?o:function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}(o,n(e))}(e,Ze,ze)}(e):Ze(e);return function(e,t){for(var n=-1,o=e?e.length:0;++n<o&&!1!==t(e[n],n,e););}(P||e,(function(r,i){P&&(r=e[i=r]),Be(B,i,Ae(r,t,n,o,i,e,m))})),B}function Me(e){return!(!qe(e)||(t=e,J&&J in t))&&(Xe(e)||V(e)?ne:B).test(Ve(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Ne(e,t,n,o){n||(n={});for(var r=-1,i=t.length;++r<i;){var a=t[r],s=o?o(n[a],e[a],a,n,e):void 0;Be(n,a,void 0===s?e[a]:s)}return n}function Pe(e,t){var n,o,r=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Ie(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(n)?n:void 0}Se.prototype.clear=function(){this.__data__=me?me(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(me){var o=t[e];return o===n?void 0:o}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?n:t,this},je.prototype.clear=function(){this.__data__=[]},je.prototype.delete=function(e){var t=this.__data__,n=Te(t,e);return!(n<0)&&(n==t.length-1?t.pop():ce.call(t,n,1),!0)},je.prototype.get=function(e){var t=this.__data__,n=Te(t,e);return n<0?void 0:t[n][1]},je.prototype.has=function(e){return Te(this.__data__,e)>-1},je.prototype.set=function(e,t){var n=this.__data__,o=Te(n,e);return o<0?n.push([e,t]):n[o][1]=t,this},Re.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||je),string:new Se}},Re.prototype.delete=function(e){return Pe(this,e).delete(e)},Re.prototype.get=function(e){return Pe(this,e).get(e)},Re.prototype.has=function(e){return Pe(this,e).has(e)},Re.prototype.set=function(e,t){return Pe(this,e).set(e,t),this},_e.prototype.clear=function(){this.__data__=new je},_e.prototype.delete=function(e){return this.__data__.delete(e)},_e.prototype.get=function(e){return this.__data__.get(e)},_e.prototype.has=function(e){return this.__data__.has(e)},_e.prototype.set=function(e,t){var n=this.__data__;if(n instanceof je){var o=n.__data__;if(!he||o.length<199)return o.push([e,t]),this;n=this.__data__=new Re(o)}return n.set(e,t),this};var ze=de?Y(de,Object):function(){return[]},Fe=function(e){return te.call(e)};function Ue(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||T.test(e))&&e>-1&&e%1==0&&e<t}function He(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Z)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function We(e,t){return e===t||e!=e&&t!=t}(pe&&Fe(new pe(new ArrayBuffer(1)))!=w||he&&Fe(new he)!=c||ge&&Fe(ge.resolve())!=f||ve&&Fe(new ve)!=h||ye&&Fe(new ye)!=m)&&(Fe=function(e){var t=te.call(e),n=t==u?e.constructor:void 0,o=n?Ve(n):void 0;if(o)switch(o){case be:return w;case we:return c;case xe:return f;case Ee:return h;case ke:return m}return t});var Ye=Array.isArray;function Ke(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Xe(e)}var $e=ue||function(){return!1};function Xe(e){var t=qe(e)?te.call(e):"";return t==s||t==l}function qe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ze(e){return Ke(e)?De(e):function(e){if(!He(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Ae(e,!0,!0)}}({get exports(){return Na},set exports(e){Na=e}},Na);var Pa=Na;function Ia(e,t={}){const{blockId:n,focus:o}=t;if(!n&&!t.at)throw new Error("blockId or path should be provided");let r=null;if(n&&(r=e.children[n],!r))throw new Error(`Block not with blockId: ${n} found`);if(t.at&&(r=c(e,{at:t.at}),!r))throw new Error(`Block in path ${t.at} not found`);if(!r)throw new Error("Block not found");e.children=ga(e.children);Object.values(e.children).forEach((e=>{e.meta.order>r.meta.order&&(e.meta.order+=1)}));const i=(a=r,"function"==typeof window.structuredClone?window.structuredClone(a):Pa(a));var a;const s=Ca(e);i.id=x(),i.meta.order=r.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=s;const l=i.id;e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(l,{waitExecution:!0})}function za(e,t){o.ReactEditor.blur(t),o.ReactEditor.deselect(t),r.Transforms.deselect(t),e.setBlockSelected(null),e.setSelection(null)}zr('/*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.yoo-editor-pointer-events-none{pointer-events:none}.yoo-editor-absolute{position:absolute}.yoo-editor-relative{position:relative}.yoo-editor-left-0{left:0}.yoo-editor-right-\\[8px\\]{right:8px}.yoo-editor-top-0{top:0}.yoo-editor-top-\\[8px\\]{top:8px}.yoo-editor-z-10{z-index:10}.yoo-editor-z-\\[100\\]{z-index:100}.yoo-editor-z-\\[90\\]{z-index:90}.yoo-editor-mx-\\[4px\\]{margin-left:4px;margin-right:4px}.yoo-editor-my-\\[4px\\]{margin-bottom:4px;margin-top:4px}.yoo-editor-mb-\\[1px\\]{margin-bottom:1px}.yoo-editor-mr-2{margin-right:.5rem}.yoo-editor-mt-\\[2px\\]{margin-top:2px}.yoo-editor-flex{display:flex}.yoo-editor-h-4{height:1rem}.yoo-editor-h-\\[1px\\]{height:1px}.yoo-editor-h-\\[22px\\]{height:22px}.yoo-editor-h-full{height:100%}.yoo-editor-w-4{width:1rem}.yoo-editor-w-\\[22px\\]{width:22px}.yoo-editor-w-auto{width:auto}.yoo-editor-w-full{width:100%}.yoo-editor-min-w-\\[200px\\]{min-width:200px}.yoo-editor-cursor-default{cursor:default}.yoo-editor-cursor-pointer{cursor:pointer}.yoo-editor-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoo-editor-flex-col{flex-direction:column}.yoo-editor-items-center{align-items:center}.yoo-editor-justify-start{justify-content:flex-start}.yoo-editor-justify-between{justify-content:space-between}.yoo-editor-overflow-hidden{overflow:hidden}.yoo-editor-rounded{border-radius:.25rem}.yoo-editor-rounded-\\[2px\\]{border-radius:2px}.yoo-editor-rounded-md{border-radius:.375rem}.yoo-editor-rounded-sm{border-radius:.125rem}.yoo-editor-border{border-width:1px}.yoo-editor-border-none{border-style:none}.yoo-editor-bg-\\[\\#2383e224\\]{background-color:#2383e224}.yoo-editor-bg-\\[\\#37352f14\\]{background-color:#37352f14}.yoo-editor-bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-editor-bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}.yoo-editor-p-\\[0_4px\\]{padding:0 4px}.yoo-editor-px-0{padding-left:0;padding-right:0}.yoo-editor-px-2{padding-left:.5rem;padding-right:.5rem}.yoo-editor-px-\\[2px\\]{padding-left:2px;padding-right:2px}.yoo-editor-py-0{padding-bottom:0;padding-top:0}.yoo-editor-py-1{padding-bottom:.25rem;padding-top:.25rem}.yoo-editor-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.yoo-editor-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-editor-text-sm{font-size:.875rem;line-height:1.25rem}.yoo-editor-leading-\\[120\\%\\]{line-height:120%}.yoo-editor-opacity-100{opacity:1}.yoo-editor-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.yoo-editor-outline-none{outline:2px solid transparent;outline-offset:2px}.yoo-editor-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-editor-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-editor-duration-150{transition-duration:.15s}.yoo-editor-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}::-moz-selection{background:#c6ddf8}::selection{background:#c6ddf8}#yoopta-editor{height:auto;min-width:400px}.yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.hover\\:yoo-editor-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.focus\\:yoo-editor-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:yoo-editor-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.data-\\[disabled\\]\\:yoo-editor-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:yoo-editor-opacity-50[data-disabled]{opacity:.5}'),exports.HOTKEYS=si,exports.UI=Aa,exports.YooptaPlugin=l,exports.buildBlockData=k,exports.buildBlockElement=E,exports.createYooptaEditor=()=>{const e={children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,n={}){e.children=ga(e.children);const{at:o=null,focus:i=!1,slate:a=null}=n,s=c(e),l=o,d={id:x(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let u=!1;if(a&&a.selection){const e=r.Editor.string(a,a.selection.anchor.path);u=r.Editor.isStart(a,a.selection.anchor,a.selection.anchor.path)&&e.length>0}if(l){const[t]=l;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),d.meta.order=t}else{const t=Object.keys(e.children).length;d.meta.order=t}const f=Ca(e);e.blockEditorsMap[d.id]=f,u&&s&&(d.meta.order=s.meta.order,s.meta.order+=1),e.children[d.id]=d;const p=null==s?void 0:s.id;e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),i&&e.focusBlock(u&&p?p:d.id)}(e,...t),insertBlocks:(...t)=>function(e,t,n={}){e.children=ga(e.children);const{at:i,focus:a}=n;let s=i||[0];const l=c(e),d=sn(e);let u=!1,f=!1;if(d&&d.selection){const t=r.Path.parent(d.selection.anchor.path),n=r.Editor.string(d,t).trim(),i=r.Editor.isStart(d,d.selection.anchor,t);u=""===n&&i,f=!i||n.length>0,o.ReactEditor.blur(d),e.setSelection(null)}f&&(s=[s[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=s[0]&&(e.meta.order+=t.length)}));const p=[];if(t.forEach(((t,n)=>{const o={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:s[0]+n})};p.push(o.meta.order),e.children[o.id]=o;const r=Ca(e);e.blockEditorsMap[o.id]=r})),l&&u){const t=l.meta.order;delete e.children[l.id],delete e.blockEditorsMap[l.id],Object.keys(e.children).forEach((n=>{const o=e.children[n];o.meta.order>t&&(o.meta.order-=1)}))}e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),a&&e.setBlockSelected(p)}(e,...t),deleteBlock:(...t)=>xa(e,...t),duplicateBlock:(...t)=>Ia(e,...t),toggleBlock:(...t)=>wa(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=ga(e.children);const o=c(e);o&&(o.meta.depth=o.meta.depth+1,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=ga(e.children);const o=c(e);o&&(o.meta.depth=0===o.meta.depth?0:o.meta.depth-1,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),moveBlock:(...t)=>function(e,t,n){e.children=ga(e.children);const[o]=n,r=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===o)),a=r.meta.order<i.meta.order,s=r.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>r.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:s&&e.meta.order<r.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),r.meta.order=o,r.meta.depth=i.meta.depth,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children)}(e,...t),focusBlock:(...t)=>Ma(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>ba(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:n,focus:o=!0}=t,i=c(e);n&&n.selection&&i&&r.Editor.withoutNormalizing(n,(()=>{e.children=ga(e.children);const t=r.Path.parent(n.selection.anchor.path);r.Transforms.splitNodes(n,{at:n.selection,match:e=>r.Element.isElement(e),always:!0,mode:"highest"});const a=t[0]+1,s=n.children.slice()[a];r.Transforms.removeNodes(n,{at:[a],match:e=>r.Element.isElement(e),mode:"highest"});const l={id:x(),type:i.type,meta:{order:i.meta.order+1,depth:i.meta.depth},value:[s]};Object.values(e.children).forEach((e=>{e.meta.order>=l.meta.order&&(e.meta.order+=1)}));const c=Ca(e);e.blockEditorsMap[l.id]=c,e.children[l.id]=l,e.children=va(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(l.id,{slate:c})}))}(e,...t),setSelection:(...t)=>function(e,t,n={}){const{applyChanges:o=!0}=n;e.selection=t,o&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,n={}){const{only:o=!1,allSelected:r=!1}=n,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(t.length>1)e.selectedBlocks=t;else if(o)e.selectedBlocks=t;else if(r){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=La(t)}else e.selectedBlocks=La(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var n;const o=null!==(n=t.slate)&&void 0!==n?n:sn(e);if(!o)return;const{waitExecution:r,waitExecutionMs:i}=t;r?setTimeout((()=>za(e,o)),i):(za(e,o),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e},exports.createYooptaMark=Oa,exports.default=({editor:n,value:o,marks:r,plugins:i,autoFocus:a,className:s,tools:l,selectionBoxRoot:c,children:d,placeholder:u,readOnly:p,width:h})=>{const g=()=>{b((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},v=t.useMemo((()=>r?[Sa,...r]:[Sa]),[r]),y=t.useMemo((()=>i.map((e=>e.getPlugin))),[i]),[m,b]=t.useState((()=>(n.applyChanges=g,n.readOnly=p||!1,v&&(n.formats=Ea(n,v)),n.blocks=ka(n,y),n.children=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(o)?o:ja,n.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((n=>{const o=Ca(e);t[n]=o})),t}(n),n.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var n,o,r,i;e.options&&Array.isArray(null===(n=e.options)||void 0===n?void 0:n.shortcuts)&&(null===(o=e.options)||void 0===o?void 0:o.shortcuts.length)>0&&(null===(i=null===(r=e.options)||void 0===r?void 0:r.shortcuts)||void 0===i||i.forEach((n=>{t[n]=e})))})),t}(n),n.plugins=function(e){const t={},n={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var o;const r=e.elements[t],i=null===(o=r.props)||void 0===o?void 0:o.nodeType;"inline"!==i&&"inlineVoid"!==i||(n[t]=r)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const o=Object.assign(Object.assign({},e.elements),n);t[e.type]=Object.assign(Object.assign({},e),{elements:o})}})),t}(y),n.on=_a,n.once=Da,n.off=Ba,n.emit=Ta,{editor:n,version:0})));return e.jsx(Si,{children:e.jsx(f,Object.assign({editorState:m},{children:e.jsxs(Tr,Object.assign({tools:l},{children:[e.jsx(Oi,{placeholder:u,marks:v,autoFocus:a,className:s,selectionBoxRoot:c,width:h}),d]}))}))})},exports.findPluginBlockBySelectionPath=c,exports.findPluginBlockByType=function(e,t){const n=Object.keys(e.children),{type:o}=t||{},r=n.find((t=>e.children[t].type===o));return r?e.children[r]:null},exports.findSlateBySelectionPath=sn,exports.generateId=x,exports.getRootBlockElement=Dr,exports.getRootBlockElementType=_r,exports.useBlockData=h,exports.useBlockSelected=({blockId:e,path:t})=>{var n;const o=p();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let r;return e&&(r=o.children[e]),t&&(r=c(o,{at:t})),(null===(n=o.selection)||void 0===n?void 0:n[0])===(null==r?void 0:r.meta.order)},exports.useYooptaBlock=e=>p().blocks[e],exports.useYooptaEditor=p,exports.useYooptaPlugin=g,exports.useYooptaPluginOptions=e=>{var t;return null===(t=g(e))||void 0===t?void 0:t.options},exports.useYooptaReadOnly=v,exports.useYooptaTools=Ar;
|