@yoopta/editor 4.3.0 → 4.3.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"dnd.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/dnd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAwD,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAInH,eAAO,MAAM,iBAAiB;YAA0B,SAAS;;;2BAarB,YAAY;6BASV,cAAc;CAK3D,CAAC"}
1
+ {"version":3,"file":"dnd.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/dnd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAwD,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAInH,eAAO,MAAM,iBAAiB;YAA0B,SAAS;;;2BAYrB,YAAY;6BASV,cAAc;CAK3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"YooptaContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/YooptaContext/YooptaContext.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAsCF,eAAO,MAAM,aAAa,8CAAuD,CAAC;AAElF;;GAEG;AACH,QAAA,MAAM,qBAAqB;;;6CAQ1B,CAAC;AAEF,QAAA,MAAM,eAAe,QAAO,SAQ3B,CAAC;AAEF,QAAA,MAAM,YAAY,YAAa,MAAM,6EAAwC,CAAC;AAC9E,QAAA,MAAM,cAAc,cAAe,MAAM,6CAAwC,CAAC;AAClF,QAAA,MAAM,eAAe,SAAU,MAAM,mFAAoC,CAAC;AAC1E,QAAA,MAAM,iBAAiB,eAAmC,CAAC;AAC3D,QAAA,MAAM,sBAAsB,wBAA0B,MAAM,4BACI,CAAC;AAEjE,KAAK,qBAAqB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACvH,QAAA,MAAM,gBAAgB,sBAAuB,qBAAqB,YAkBjE,CAAC;AAEF,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,CAAC"}
1
+ {"version":3,"file":"YooptaContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/YooptaContext/YooptaContext.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAuCF,eAAO,MAAM,aAAa,8CAAuD,CAAC;AAElF;;GAEG;AACH,QAAA,MAAM,qBAAqB;;;6CAQ1B,CAAC;AAEF,QAAA,MAAM,eAAe,QAAO,SAQ3B,CAAC;AAEF,QAAA,MAAM,YAAY,YAAa,MAAM,6EAAwC,CAAC;AAC9E,QAAA,MAAM,cAAc,cAAe,MAAM,6CAAwC,CAAC;AAClF,QAAA,MAAM,eAAe,SAAU,MAAM,mFAAoC,CAAC;AAC1E,QAAA,MAAM,iBAAiB,eAAmC,CAAC;AAC3D,QAAA,MAAM,sBAAsB,wBAA0B,MAAM,4BACI,CAAC;AAEjE,KAAK,qBAAqB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACvH,QAAA,MAAM,gBAAgB,sBAAuB,qBAAqB,YAkBjE,CAAC;AAEF,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA4BpC,eAAO,MAAM,kBAAkB,QAAO,SAqCrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA4BpC,eAAO,MAAM,kBAAkB,QAAO,SAsCrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from"react";import o,{createContext as i,useContext as l,useRef as a,useLayoutEffect as c,useEffect as s,useMemo as d,useCallback as u,useState as f,memo as p,useReducer as h,forwardRef as g,createElement as v}from"react";import*as y from"react-dom";import{unstable_batchedUpdates as m,createPortal as b}from"react-dom";import{ReactEditor as w,useSelected as x,Slate as k,Editable as O,DefaultElement as C,withReact as E}from"slate-react";import{Editor as S,Transforms as D,Path as R,Range as _,Text as j,Element as B,Operation as A,createEditor as T,Point as M}from"slate";class N{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 N(Object.assign(Object.assign({},this.plugin),{elements:o,options:r}))}}function L(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 P={editor:{id:"",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:()=>{}}},I=i(P),F=({children:t,editorState:n})=>{const r=a(P);return r.current={editor:n.editor},e(I.Provider,Object.assign({value:r.current},{children:t}))},z=()=>{const e=l(I);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},H=e=>z().children[e],U=e=>z().blocks[e],V=e=>z().plugins[e],K=()=>z().readOnly,W=e=>{var t;return null===(t=V(e))||void 0===t?void 0:t.options},Y=({blockId:e,path:t})=>{var n;const r=z();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let o;return e&&(o=r.children[e]),t&&(o=L(r,{at:t})),(null===(n=r.selection)||void 0===n?void 0:n[0])===(null==o?void 0:o.meta.order)};var $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},X={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,l){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new o(r,i||e,l),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function l(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.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},a.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,l=new Array(i);o<i;o++)l[o]=r[o].fn;return l},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,o,i,l){var a=n?n+e:e;if(!this._events[a])return!1;var c,s,d=this._events[a],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,l),!0}for(s=1,c=new Array(u-1);s<u;s++)c[s-1]=arguments[s];d.fn.apply(d.context,c)}else{var f,p=d.length;for(s=0;s<p;s++)switch(d[s].once&&this.removeListener(e,d[s].fn,void 0,!0),u){case 1:d[s].fn.call(d[s].context);break;case 2:d[s].fn.call(d[s].context,t);break;case 3:d[s].fn.call(d[s].context,t,r);break;case 4:d[s].fn.call(d[s].context,t,r,o);break;default:if(!c)for(f=1,c=new Array(u-1);f<u;f++)c[f-1]=arguments[f];d[s].fn.apply(d[s].context,c)}}return!0},a.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return l(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||r&&a.context!==r||l(this,i);else{for(var c=0,s=[],d=a.length;c<d;c++)(a[c].fn!==t||o&&!a[c].once||r&&a[c].context!==r)&&s.push(a[c]);s.length?this._events[i]=1===s.length?s[0]:s:l(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&l(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}({get exports(){return X},set exports(e){X=e}});var Z=X;function q(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}const G=()=>{var e,t;return"undefined"==typeof window||"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?q():null===(t=window.crypto)||void 0===t?void 0:t.randomUUID()},J=e=>({id:G(),type:(null==e?void 0:e.type)||"paragraph",children:(null==e?void 0:e.children)||[{text:""}],props:Object.assign({nodeType:"block"},null==e?void 0:e.props)}),Q=e=>({id:(null==e?void 0:e.id)||G(),value:(null==e?void 0:e.value)||[J()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const ee="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function te(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function ne(e){return"nodeType"in e}function re(e){var t,n;return e?te(e)?e:ne(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function oe(e){const{Document:t}=re(e);return e instanceof t}function ie(e){return!te(e)&&e instanceof re(e).HTMLElement}function le(e){return e instanceof re(e).SVGElement}function ae(e){return e?te(e)?e.document:ne(e)?oe(e)?e:ie(e)||le(e)?e.ownerDocument:document:document:document}const ce=ee?c:s;function se(e){const t=a(e);return ce((()=>{t.current=e})),u((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function de(e,t){void 0===t&&(t=[e]);const n=a(e);return ce((()=>{n.current!==e&&(n.current=e)}),t),n}function ue(e,t){const n=a();return d((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function fe(e){const t=se(e),n=a(null),r=u((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,r]}function pe(e){const t=a();return s((()=>{t.current=e}),[e]),t.current}let he={};function ge(e,t){return d((()=>{if(t)return t;const n=null==he[e]?0:he[e]+1;return he[e]=n,e+"-"+n}),[e,t])}function ve(e){return function(t){for(var n=arguments.length,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 ye=ve(1),me=ve(-1);function be(e){if(!e)return!1;const{KeyboardEvent:t}=re(e.target);return t&&e instanceof t}function we(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=re(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const xe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[xe.Translate.toString(e),xe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),ke="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Oe(e){return e.matches(ke)?e:e.querySelector(ke)}const Ce={display:"none"};function Ee(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:Ce},n)}function Se(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return o.createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const De=i(null);const Re={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 "},_e={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 je(e){let{announcements:t=_e,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Re}=e;const{announce:a,announcement:c}=function(){const[e,t]=f("");return{announce:u((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=ge("DndLiveRegion"),[h,g]=f(!1);if(s((()=>{g(!0)}),[]),function(e){const t=l(De);s((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(d((()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}})),[a,t])),!h)return null;const v=o.createElement(o.Fragment,null,o.createElement(Ee,{id:r,value:i.draggable}),o.createElement(Se,{id:p,announcement:c}));return n?b(v,n):v}var Be;function Ae(){}function Te(e,t){return d((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Be||(Be={}));const Me=Object.freeze({x:0,y:0});function Ne(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Le(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Pe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ie(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 Fe(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function ze(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const He=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=ze(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Ne(ze(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(Le)};function Ue(e,t){const n=Math.max(t.top,e.top),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),l=o-r,a=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=l*a;return Number((o/(n+r-o)).toFixed(4))}return 0}const Ve=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=Ue(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Pe)};function Ke(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Me}function We(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 Ye=We(1);const $e={ignoreTransform:!1};function Xe(e,t){void 0===t&&(t=$e);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=re(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:l,y:a}=r,c=e.left-l-(1-o)*parseFloat(n),s=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:c+d,bottom:s+u,left:c}}(n,t,r))}const{top:r,left:o,width:i,height:l,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:l,bottom:a,right:c}}function Ze(e){return Xe(e,{ignoreTransform:!0})}function qe(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(oe(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ie(o)||le(o))return n;if(n.includes(o))return n;const i=re(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=re(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=re(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Ge(e){const[t]=qe(e,1);return null!=t?t:null}function Je(e){return ee&&e?te(e)?e:ne(e)?oe(e)||e===ae(e).scrollingElement?window:ie(e)?e:null:null:null}function Qe(e){return te(e)?e.scrollX:e.scrollLeft}function et(e){return te(e)?e.scrollY:e.scrollTop}function tt(e){return{x:Qe(e),y:et(e)}}var nt;function rt(e){return!(!ee||!e)&&e===document.scrollingElement}function ot(e){const t={x:0,y:0},n=rt(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"}(nt||(nt={}));const it={x:.2,y:.2};function lt(e,t,n,r,o){let{top:i,left:l,right:a,bottom:c}=n;void 0===r&&(r=10),void 0===o&&(o=it);const{isTop:s,isBottom:d,isLeft:u,isRight:f}=ot(e),p={x:0,y:0},h={x:0,y:0},g=t.height*o.y,v=t.width*o.x;return!s&&i<=t.top+g?(p.y=nt.Backward,h.y=r*Math.abs((t.top+g-i)/g)):!d&&c>=t.bottom-g&&(p.y=nt.Forward,h.y=r*Math.abs((t.bottom-g-c)/g)),!f&&a>=t.right-v?(p.x=nt.Forward,h.x=r*Math.abs((t.right-v-a)/v)):!u&&l<=t.left+v&&(p.x=nt.Backward,h.x=r*Math.abs((t.left+v-l)/v)),{direction:p,speed:h}}function at(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 ct(e){return e.reduce(((e,t)=>ye(e,tt(t))),Me)}const st=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Qe(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+et(t)),0)}]];class dt{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=qe(t),r=ct(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of st)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),l=r[e]-t;return this.rect[i]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ut{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ft(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 pt,ht;function gt(e){e.preventDefault()}function vt(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(pt||(pt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ht||(ht={}));const yt={start:[ht.Space,ht.Enter],cancel:[ht.Esc],end:[ht.Space,ht.Enter]},mt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ht.Right:return{...n,x:n.x+25};case ht.Left:return{...n,x:n.x-25};case ht.Down:return{...n,y:n.y+25};case ht.Up:return{...n,y:n.y-25}}};class bt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ut(ae(t)),this.windowListeners=new ut(re(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(pt.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Xe),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Ge(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(Me)}handleKeyDown(e){if(be(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=yt,coordinateGetter:i=mt,scrollBehavior:l="smooth"}=r,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:c}=n.current,s=c?{x:c.left,y:c.top}:Me;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:n.current,currentCoordinates:s});if(d){const t=me(d,s),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:a,isLeft:c,isBottom:s,maxScroll:u,minScroll:f}=ot(n),p=at(n),h={x:Math.min(o===ht.Right?p.right-p.width/2:p.right,Math.max(o===ht.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(o===ht.Down?p.bottom-p.height/2:p.bottom,Math.max(o===ht.Down?p.top:p.top+p.height/2,d.y))},g=o===ht.Right&&!a||o===ht.Left&&!c,v=o===ht.Down&&!s||o===ht.Up&&!i;if(g&&h.x!==d.x){const e=n.scrollLeft+t.x,i=o===ht.Right&&e<=u.x||o===ht.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=i?n.scrollLeft-e:o===ht.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(v&&h.y!==d.y){const e=n.scrollTop+t.y,i=o===ht.Down&&e<=u.y||o===ht.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=i?n.scrollTop-e:o===ht.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,ye(me(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 wt(e){return Boolean(e&&"distance"in e)}function xt(e){return Boolean(e&&"delay"in e)}bt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=yt,onActivation:o}=t,{active:i}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class kt{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=re(e);return e instanceof t?e:ae(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=ae(i),this.documentListeners=new ut(this.document),this.listeners=new ut(n),this.windowListeners=new ut(re(i)),this.initialCoordinates=null!=(r=we(o))?r:Me,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.DragStart,gt),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),this.windowListeners.add(pt.ContextMenu,gt),this.documentListeners.add(pt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(wt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(pt.Click,vt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:l}}=o;if(!r)return;const a=null!=(t=we(e))?t:Me,c=me(r,a);if(!n&&l){if(wt(l)){if(null!=l.tolerance&&ft(c,l.tolerance))return this.handleCancel();if(ft(c,l.distance))return this.handleStart()}return xt(l)&&ft(c,l.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(a)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ht.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Ot={move:{name:"pointermove"},end:{name:"pointerup"}};class Ct extends kt{constructor(e){const{event:t}=e,n=ae(t.target);super(e,Ot,n)}}Ct.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 Et={move:{name:"mousemove"},end:{name:"mouseup"}};var St;!function(e){e[e.RightClick=2]="RightClick"}(St||(St={}));(class extends kt{constructor(e){super(e,Et,ae(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==St.RightClick&&(null==r||r({event:n}),!0)}}];const Dt={move:{name:"touchmove"},end:{name:"touchend"}};var Rt,_t;function jt(e){let{acceleration:t,activator:n=Rt.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:l=5,order:c=_t.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:h,delta:g,threshold:v}=e;const y=function(e){let{delta:t,disabled:n}=e;const r=pe(t);return ue((e=>{if(n||!r||!e)return Bt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[nt.Backward]:e.x[nt.Backward]||-1===o.x,[nt.Forward]:e.x[nt.Forward]||1===o.x},y:{[nt.Backward]:e.y[nt.Backward]||-1===o.y,[nt.Forward]:e.y[nt.Forward]||1===o.y}}}),[n,t,r])}({delta:g,disabled:!i}),[m,b]=function(){const e=a(null);return[u(((t,n)=>{e.current=setInterval(t,n)}),[]),u((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),w=a({x:0,y:0}),x=a({x:0,y:0}),k=d((()=>{switch(n){case Rt.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Rt.DraggableRect:return o}}),[n,o,f]),O=a(null),C=u((()=>{const e=O.current;if(!e)return;const t=w.current.x*x.current.x,n=w.current.y*x.current.y;e.scrollBy(t,n)}),[]),E=d((()=>c===_t.TreeOrder?[...p].reverse():p),[c,p]);s((()=>{if(i&&p.length&&k){for(const e of E){if(!1===(null==r?void 0:r(e)))continue;const n=p.indexOf(e),o=h[n];if(!o)continue;const{direction:i,speed:a}=lt(e,o,k,t,v);for(const e of["x","y"])y[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return b(),O.current=e,m(C,l),w.current=a,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},b()}else b()}),[t,C,r,b,i,l,JSON.stringify(k),JSON.stringify(y),m,p,E,h,JSON.stringify(v)])}(class extends kt{constructor(e){super(e,Dt)}static setup(){return window.addEventListener(Dt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Dt.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation: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"}(Rt||(Rt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(_t||(_t={}));const Bt={x:{[nt.Backward]:!1,[nt.Forward]:!1},y:{[nt.Backward]:!1,[nt.Forward]:!1}};var At,Tt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(At||(At={})),function(e){e.Optimized="optimized"}(Tt||(Tt={}));const Mt=new Map;function Nt(e,t){return ue((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Lt(e){let{callback:t,disabled:n}=e;const r=se(t),o=d((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[n]);return s((()=>()=>null==o?void 0:o.disconnect()),[o]),o}function Pt(e){return new dt(Xe(e),e)}function It(e,t,n){void 0===t&&(t=Pt);const[r,o]=h((function(r){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);if(JSON.stringify(r)===JSON.stringify(i))return r;return i}),null),i=function(e){let{callback:t,disabled:n}=e;const r=se(t),o=d((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,n]);return s((()=>()=>null==o?void 0:o.disconnect()),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),l=Lt({callback:o});return ce((()=>{o(),e?(null==l||l.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==i||i.disconnect())}),[e]),r}const Ft=[];function zt(e,t){void 0===t&&(t=[]);const n=a(null);return s((()=>{n.current=null}),t),s((()=>{const t=e!==Me;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?me(e,n.current):Me}function Ht(e){return d((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Ut=[];function Vt(e){let{measure:t}=e;const[n,r]=f(null),o=u((e=>{for(const{target:n}of e)if(ie(n)){r((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t]),i=Lt({callback:o}),l=u((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ie(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)}),[t,i]),[a,c]=fe(l);return d((()=>({nodeRef:a,rect:n,setRef:c})),[n,a,c])}const Kt=[{sensor:Ct,options:{}},{sensor:bt,options:{}}],Wt={current:{}},Yt={draggable:{measure:Ze},droppable:{measure:Ze,strategy:At.WhileDragging,frequency:Tt.Optimized},dragOverlay:{measure:Xe}};class $t extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Xt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $t,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ae},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Yt,measureDroppableContainers:Ae,windowRect:null,measuringScheduled:!1},Zt=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ae,draggableNodes:new Map,over:null,measureDroppableContainers:Ae}),qt=i(Xt);function Gt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $t}}}function Jt(e,t){switch(t.type){case Be.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Be.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 Be.DragEnd:case Be.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Be.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new $t(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Be.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const l=new $t(e.droppable.containers);return l.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case Be.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new $t(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Qt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=l(Zt),i=pe(r),a=pe(null==n?void 0:n.id);return s((()=>{if(!t&&!r&&i&&null!=a){if(!be(i))return;if(document.activeElement===i.target)return;const e=o.get(a);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=Oe(e);if(t){t.focus();break}}}))}}),[r,t,o,a,i]),null}const en=i({...Me,scaleX:1,scaleY:1});var tn;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(tn||(tn={}));const nn=p((function(e){var t,n,r,i;let{id:l,accessibility:c,autoScroll:p=!0,children:g,sensors:v=Kt,collisionDetection:y=Ve,measuring:b,modifiers:w,...x}=e;const k=h(Jt,void 0,Gt),[O,C]=k,[E,S]=function(){const[e]=f((()=>new Set)),t=u((t=>(e.add(t),()=>e.delete(t))),[e]);return[u((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[D,R]=f(tn.Uninitialized),_=D===tn.Initialized,{draggable:{active:j,nodes:B,translate:A},droppable:{containers:T}}=O,M=j?B.get(j):null,N=a({initial:null,translated:null}),L=d((()=>{var e;return null!=j?{id:j,data:null!=(e=null==M?void 0:M.data)?e:Wt,rect:N}:null}),[j,M]),P=a(null),[I,F]=f(null),[z,H]=f(null),U=de(x,Object.values(x)),V=ge("DndDescribedBy",l),K=d((()=>T.getEnabled()),[T]),W=d((()=>({draggable:{...Yt.draggable,...null==Y?void 0:Y.draggable},droppable:{...Yt.droppable,...null==Y?void 0:Y.droppable},dragOverlay:{...Yt.dragOverlay,...null==Y?void 0:Y.dragOverlay}})),[null==(Y=b)?void 0:Y.draggable,null==Y?void 0:Y.droppable,null==Y?void 0:Y.dragOverlay]);var Y;const{droppableRects:$,measureDroppableContainers:X,measuringScheduled:Z}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,l]=f(null),{frequency:c,measure:d,strategy:p}=o,h=a(e),g=function(){switch(p){case At.Always:return!1;case At.BeforeDragging:return n;default:return!n}}(),v=de(g),y=u((function(e){void 0===e&&(e=[]),v.current||l((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[v]),m=a(null),b=ue((t=>{if(g&&!n)return Mt;if(!t||t===Mt||h.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new dt(d(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,i,n,g,d]);return s((()=>{h.current=e}),[e]),s((()=>{g||y()}),[n,g]),s((()=>{i&&i.length>0&&l(null)}),[JSON.stringify(i)]),s((()=>{g||"number"!=typeof c||null!==m.current||(m.current=setTimeout((()=>{y(),m.current=null}),c))}),[c,g,y,...r]),{droppableRects:b,measureDroppableContainers:y,measuringScheduled:null!=i}}(K,{dragging:_,dependencies:[A.x,A.y],config:W.droppable}),q=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return ue((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(B,j),G=d((()=>z?we(z):null),[z]),J=function(){const e=!1===(null==I?void 0:I.autoScrollEnabled),t="object"==typeof p?!1===p.enabled:!1===p,n=_&&!e&&!t;if("object"==typeof p)return{...p,enabled:n};return{enabled:n}}(),Q=function(e,t){return Nt(e,t)}(q,W.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=a(!1),{x:l,y:c}="boolean"==typeof o?{x:o,y:o}:o;ce((()=>{if(!l&&!c||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=Ke(n(e),r);if(l||(o.x=0),c||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Ge(e);t&&t.scrollBy({top:o.y,left:o.x})}}),[t,l,c,r,n])}({activeNode:j?B.get(j):null,config:J.layoutShiftCompensation,initialRect:Q,measure:W.draggable.measure});const te=It(q,W.draggable.measure,Q),ne=It(q?q.parentElement:null),oe=a({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:$,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=T.getNodeFor(null==(t=oe.current.over)?void 0:t.id),le=Vt({measure:W.dragOverlay.measure}),ae=null!=(n=le.nodeRef.current)?n:q,se=_?null!=(r=le.rect)?r:te:null,fe=Boolean(le.nodeRef.current&&le.rect),pe=Ke(he=fe?null:te,Nt(he));var he;const ve=Ht(ae?re(ae):null),me=function(e){const t=a(e),n=ue((n=>e?n&&n!==Ft&&e&&t.current&&e.parentNode===t.current.parentNode?n:qe(e):Ft),[e]);return s((()=>{t.current=e}),[e]),n}(_?null!=ie?ie:q:null),be=function(e,t){void 0===t&&(t=Xe);const[n]=e,r=Ht(n?re(n):null),[o,i]=h((function(){return e.length?e.map((e=>rt(e)?r:new dt(t(e),e))):Ut}),Ut),l=Lt({callback:i});return e.length>0&&o===Ut&&i(),ce((()=>{e.length?e.forEach((e=>null==l?void 0:l.observe(e))):(null==l||l.disconnect(),i())}),[e]),o}(me),xe=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}(w,{transform:{x:A.x-pe.x,y:A.y-pe.y,scaleX:1,scaleY:1},activatorEvent:z,active:L,activeNodeRect:te,containerNodeRect:ne,draggingNodeRect:se,over:oe.current.over,overlayNodeRect:le.rect,scrollableAncestors:me,scrollableAncestorRects:be,windowRect:ve}),ke=G?ye(G,A):null,Oe=function(e){const[t,n]=f(null),r=a(e),o=u((e=>{const t=Je(e.target);t&&n((e=>e?(e.set(t,tt(t)),new Map(e)):null))}),[]);return s((()=>{const t=r.current;if(e!==t){i(t);const l=e.map((e=>{const t=Je(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,tt(t)]):null})).filter((e=>null!=e));n(l.length?new Map(l):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=Je(e);null==t||t.removeEventListener("scroll",o)}))}}),[o,e]),d((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ye(e,t)),Me):ct(e):Me),[e,t])}(me),Ce=zt(Oe),Ee=zt(Oe,[te]),Se=ye(xe,Ce),Re=se?Ye(se,xe):null,_e=L&&Re?y({active:L,collisionRect:Re,droppableRects:$,droppableContainers:K,pointerCoordinates:ke}):null,Ae=Fe(_e,"id"),[Te,Ne]=f(null),Le=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(fe?xe:ye(xe,Ee),null!=(i=null==Te?void 0:Te.rect)?i:null,te),Pe=u(((e,t)=>{let{sensor:n,options:r}=t;if(null==P.current)return;const o=B.get(P.current);if(!o)return;const i=e.nativeEvent,l=new n({active:P.current,activeNode:o,event:i,options:r,context:oe,onStart(e){const t=P.current;if(null==t)return;const n=B.get(t);if(!n)return;const{onDragStart:r}=U.current,o={active:{id:t,data:n.data,rect:N}};m((()=>{null==r||r(o),R(tn.Initializing),C({type:Be.DragStart,initialCoordinates:e,active:t}),E({type:"onDragStart",event:o})}))},onMove(e){C({type:Be.DragMove,coordinates:e})},onEnd:a(Be.DragEnd),onCancel:a(Be.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=oe.current;let l=null;if(t&&o){const{cancelDrop:a}=U.current;if(l={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Be.DragEnd&&"function"==typeof a){await Promise.resolve(a(l))&&(e=Be.DragCancel)}}P.current=null,m((()=>{C({type:e}),R(tn.Uninitialized),Ne(null),F(null),H(null);const t=e===Be.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=U.current[t];null==e||e(l),E({type:t,event:l})}}))}}m((()=>{F(l),H(e.nativeEvent)}))}),[B]),Ie=u(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=B.get(r);if(null!==P.current||!i||o.dndKit||o.defaultPrevented)return;const l={active:i};!0===e(n,t.options,l)&&(o.dndKit={capturedBy:t.sensor},P.current=r,Pe(n,t))}),[B,Pe]),ze=function(e,t){return d((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(v,Ie);!function(e){s((()=>{if(!ee)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(v),ce((()=>{te&&D===tn.Initializing&&R(tn.Initialized)}),[te,D]),s((()=>{const{onDragMove:e}=U.current,{active:t,activatorEvent:n,collisions:r,over:o}=oe.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Se.x,y:Se.y},over:o};m((()=>{null==e||e(i),E({type:"onDragMove",event:i})}))}),[Se.x,Se.y]),s((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=oe.current;if(!e||null==P.current||!t||!o)return;const{onDragOver:i}=U.current,l=r.get(Ae),a=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};m((()=>{Ne(a),null==i||i(c),E({type:"onDragOver",event:c})}))}),[Ae]),ce((()=>{oe.current={activatorEvent:z,active:L,activeNode:q,collisionRect:Re,collisions:_e,droppableRects:$,draggableNodes:B,draggingNode:ae,draggingNodeRect:se,droppableContainers:T,over:Te,scrollableAncestors:me,scrollAdjustedTranslate:Se},N.current={initial:se,translated:Re}}),[L,q,_e,Re,B,ae,se,$,T,Te,me,Se]),jt({...J,delta:A,draggingRect:Re,pointerCoordinates:ke,scrollableAncestors:me,scrollableAncestorRects:be});const He=d((()=>({active:L,activeNode:q,activeNodeRect:te,activatorEvent:z,collisions:_e,containerNodeRect:ne,dragOverlay:le,draggableNodes:B,droppableContainers:T,droppableRects:$,over:Te,measureDroppableContainers:X,scrollableAncestors:me,scrollableAncestorRects:be,measuringConfiguration:W,measuringScheduled:Z,windowRect:ve})),[L,q,te,z,_e,ne,le,B,T,$,Te,X,me,be,W,Z,ve]),Ue=d((()=>({activatorEvent:z,activators:ze,active:L,activeNodeRect:te,ariaDescribedById:{draggable:V},dispatch:C,draggableNodes:B,over:Te,measureDroppableContainers:X})),[z,ze,L,te,C,V,B,Te,X]);return o.createElement(De.Provider,{value:S},o.createElement(Zt.Provider,{value:Ue},o.createElement(qt.Provider,{value:He},o.createElement(en.Provider,{value:Le},g)),o.createElement(Qt,{disabled:!1===(null==c?void 0:c.restoreFocus)})),o.createElement(je,{...c,hiddenTextDescribedById:V}))})),rn=i(null),on="button",ln="Droppable";function an(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=ge(ln),{activators:a,activatorEvent:c,active:s,activeNodeRect:u,ariaDescribedById:f,draggableNodes:p,over:h}=l(Zt),{role:g=on,roleDescription:v="draggable",tabIndex:y=0}=null!=o?o:{},m=(null==s?void 0:s.id)===t,b=l(m?en:rn),[w,x]=fe(),[k,O]=fe(),C=function(e,t){return d((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(a,t),E=de(n);ce((()=>(p.set(t,{id:t,key:i,node:w,activatorNode:k,data:E}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:s,activatorEvent:c,activeNodeRect:u,attributes:d((()=>({role:g,tabIndex:y,"aria-disabled":r,"aria-pressed":!(!m||g!==on)||void 0,"aria-roledescription":v,"aria-describedby":f.draggable})),[r,g,y,m,v,f.draggable]),isDragging:m,listeners:r?void 0:C,node:w,over:h,setNodeRef:x,setActivatorNodeRef:O,transform:b}}const cn="Droppable",sn={timeout:25};function dn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function un(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function fn(e){return null!==e&&e>=0}const pn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=dn(t,r,n),l=t[o],a=i[o];return a&&l?{x:a.left-l.left,y:a.top-l.top,scaleX:a.width/l.width,scaleY:a.height/l.height}:null},hn={scaleX:1,scaleY:1},gn=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:l}=e;const a=null!=(t=i[n])?t:r;if(!a)return null;if(o===n){const e=i[l];return e?{x:0,y:n<l?e.top+e.height-(a.top+a.height):e.top-a.top,...hn}:null}const c=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=l?{x:0,y:-a.height-c,...hn}:o<n&&o>=l?{x:0,y:a.height+c,...hn}:{x:0,y:0,...hn}};const vn="Sortable",yn=o.createContext({activeIndex:-1,containerId:vn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pn,disabled:{draggable:!1,droppable:!1}});function mn(e){let{children:t,id:n,items:r,strategy:i=pn,disabled:c=!1}=e;const{active:u,dragOverlay:f,droppableRects:p,over:h,measureDroppableContainers:g}=l(qt),v=ge(vn,n),y=Boolean(null!==f.rect),m=d((()=>r.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[r]),b=null!=u,w=u?m.indexOf(u.id):-1,x=h?m.indexOf(h.id):-1,k=a(m),O=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(m,k.current),C=-1!==x&&-1===w||O,E=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);ce((()=>{O&&b&&g(m)}),[O,m,b,g]),s((()=>{k.current=m}),[m]);const S=d((()=>({activeIndex:w,containerId:v,disabled:E,disableTransforms:C,items:m,overIndex:x,useDragOverlay:y,sortedRects:un(m,p),strategy:i})),[w,v,E.draggable,E.droppable,C,m,x,p,y,i]);return o.createElement(yn.Provider,{value:S},t)}const bn=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return dn(n,r,o).indexOf(t)},wn=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:l,previousItems:a,previousContainerId:c,transition:s}=e;return!(!s||!r)&&((a===i||o!==l)&&(!!n||l!==o&&t===c))},xn={duration:200,easing:"ease"},kn="transform",On=xe.Transition.toString({property:kn,duration:0,easing:"linear"}),Cn={roleDescription:"sortable"};function En(e){let{animateLayoutChanges:t=wn,attributes:n,disabled:r,data:o,getNewIndex:i=bn,id:c,strategy:p,resizeObserverConfig:h,transition:g=xn}=e;const{items:v,containerId:y,activeIndex:m,disabled:b,disableTransforms:w,sortedRects:x,overIndex:k,useDragOverlay:O,strategy:C}=l(yn),E=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,b),S=v.indexOf(c),D=d((()=>({sortable:{containerId:y,index:S,items:v},...o})),[y,o,S,v]),R=d((()=>v.slice(v.indexOf(c))),[v,c]),{rect:_,node:j,isOver:B,setNodeRef:A}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=ge(cn),{active:c,dispatch:d,over:f,measureDroppableContainers:p}=l(Zt),h=a({disabled:n}),g=a(!1),v=a(null),y=a(null),{disabled:m,updateMeasurementsFor:b,timeout:w}={...sn,...o},x=de(null!=b?b:r),k=Lt({callback:u((()=>{g.current?(null!=y.current&&clearTimeout(y.current),y.current=setTimeout((()=>{p(Array.isArray(x.current)?x.current:[x.current]),y.current=null}),w)):g.current=!0}),[w]),disabled:m||!c}),O=u(((e,t)=>{k&&(t&&(k.unobserve(t),g.current=!1),e&&k.observe(e))}),[k]),[C,E]=fe(O),S=de(t);return s((()=>{k&&C.current&&(k.disconnect(),g.current=!1,k.observe(C.current))}),[C,k]),ce((()=>(d({type:Be.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:v,data:S}}),()=>d({type:Be.UnregisterDroppable,key:i,id:r}))),[r]),s((()=>{n!==h.current.disabled&&(d({type:Be.SetDroppableDisabled,id:r,key:i,disabled:n}),h.current.disabled=n)}),[r,i,n,d]),{active:c,rect:v,isOver:(null==f?void 0:f.id)===r,node:C,over:f,setNodeRef:E}}({id:c,data:D,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...h}}),{active:T,activatorEvent:M,activeNodeRect:N,attributes:L,setNodeRef:P,listeners:I,isDragging:F,over:z,setActivatorNodeRef:H,transform:U}=an({id:c,data:D,attributes:{...Cn,...n},disabled:E.draggable}),V=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>e=>{t.forEach((t=>t(e)))}),t)}(A,P),K=Boolean(T),W=K&&!w&&fn(m)&&fn(k),Y=!O&&F,$=Y&&W?U:null,X=W?null!=$?$:(null!=p?p:C)({rects:x,activeNodeRect:N,activeIndex:m,overIndex:k,index:S}):null,Z=fn(m)&&fn(k)?i({id:c,items:v,activeIndex:m,overIndex:k}):S,q=null==T?void 0:T.id,G=a({activeId:q,items:v,newIndex:Z,containerId:y}),J=v!==G.current.items,Q=t({active:T,containerId:y,isDragging:F,isSorting:K,id:c,index:S,items:v,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:g,wasDragging:null!=G.current.activeId}),ee=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,l]=f(null),c=a(n);return ce((()=>{if(!t&&n!==c.current&&r.current){const e=o.current;if(e){const t=Xe(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&l(n)}}n!==c.current&&(c.current=n)}),[t,n,r,o]),s((()=>{i&&l(null)}),[i]),i}({disabled:!Q,index:S,node:j,rect:_});return s((()=>{K&&G.current.newIndex!==Z&&(G.current.newIndex=Z),y!==G.current.containerId&&(G.current.containerId=y),v!==G.current.items&&(G.current.items=v)}),[K,Z,y,v]),s((()=>{if(q===G.current.activeId)return;if(q&&!G.current.activeId)return void(G.current.activeId=q);const e=setTimeout((()=>{G.current.activeId=q}),50);return()=>clearTimeout(e)}),[q]),{active:T,activeIndex:m,attributes:L,data:D,rect:_,index:S,newIndex:Z,items:v,isOver:B,isSorting:K,isDragging:F,listeners:I,node:j,overIndex:k,over:z,setNodeRef:V,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:P,transform:null!=ee?ee:X,transition:function(){if(ee||J&&G.current.newIndex===S)return On;if(Y&&!be(M)||!g)return;if(K||Q)return xe.Transition.toString({...g,property:kn});return}()}}function Sn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Dn=[ht.Down,ht.Right,ht.Up,ht.Left],Rn=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:l,scrollableAncestors:a}}=t;if(Dn.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case ht.Down:r.top<i.top&&t.push(n);break;case ht.Up:r.top>i.top&&t.push(n);break;case ht.Left:r.left>i.left&&t.push(n);break;case ht.Right:r.left<i.left&&t.push(n)}}));const c=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Ie(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Ie(r),l=o.reduce(((e,t,r)=>e+Ne(n[r],t)),0),a=Number((l/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:a}})}}return i.sort(Le)})({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let s=Fe(c,"id");if(s===(null==l?void 0:l.id)&&c.length>1&&(s=c[1].id),null!=s){const e=i.get(n.id),t=i.get(s),l=t?o.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&l&&e&&t){const n=qe(c).some(((e,t)=>a[t]!==e)),o=_n(e,t),i=function(e,t){if(!Sn(e)||!Sn(t))return!1;if(!_n(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=n||!o?{x:0,y:0}:{x:i?r.width-l.width:0,y:i?r.height-l.height:0},d={x:l.left,y:l.top};return s.x&&s.y?d:me(d,s)}}}};function _n(e,t){return!(!Sn(e)||!Sn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var jn;function Bn(){return Bn=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},Bn.apply(this,arguments)}var An,Tn=function(e){return r.createElement("svg",Bn({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),jn||(jn=r.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 Mn(){return Mn=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},Mn.apply(this,arguments)}var Nn=function(e){return r.createElement("svg",Mn({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),An||(An=r.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function Ln(e,t={}){const n=Object.keys(e.children),{at: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 Pn(e){return zn(e)?(e.nodeName||"").toLowerCase():"#document"}function In(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Fn(e){var t;return null==(t=(zn(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function zn(e){return e instanceof Node||e instanceof In(e).Node}function Hn(e){return e instanceof Element||e instanceof In(e).Element}function Un(e){return e instanceof HTMLElement||e instanceof In(e).HTMLElement}function Vn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof In(e).ShadowRoot)}function Kn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Wn(e){return["table","td","th"].includes(Pn(e))}function Yn(e){const t=$n(),n=Zn(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 $n(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Xn(e){return["html","body","#document"].includes(Pn(e))}function Zn(e){return In(e).getComputedStyle(e)}function qn(e){return Hn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Gn(e){if("html"===Pn(e))return e;const t=e.assignedSlot||e.parentNode||Vn(e)&&e.host||Fn(e);return Vn(t)?t.host:t}function Jn(e){const t=Gn(e);return Xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Un(t)&&Kn(t)?t:Jn(t)}function Qn(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Jn(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=In(o);return i?t.concat(l,l.visualViewport||[],Kn(o)?o:[],l.frameElement&&n?Qn(l.frameElement):[]):t.concat(o,Qn(o,[],n))}const er=Math.min,tr=Math.max,nr=Math.round,rr=Math.floor,or=e=>({x:e,y:e}),ir={left:"right",right:"left",bottom:"top",top:"bottom"},lr={start:"end",end:"start"};function ar(e,t,n){return tr(e,er(t,n))}function cr(e,t){return"function"==typeof e?e(t):e}function sr(e){return e.split("-")[0]}function dr(e){return e.split("-")[1]}function ur(e){return"x"===e?"y":"x"}function fr(e){return"y"===e?"height":"width"}function pr(e){return["top","bottom"].includes(sr(e))?"y":"x"}function hr(e){return ur(pr(e))}function gr(e){return e.replace(/start|end/g,(e=>lr[e]))}function vr(e){return e.replace(/left|right|bottom|top/g,(e=>ir[e]))}function yr(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 mr(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function br(e,t,n){let{reference:r,floating:o}=e;const i=pr(t),l=hr(t),a=fr(l),c=sr(t),s="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(c){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(dr(t)){case"start":p[l]-=f*(n&&s?-1:1);break;case"end":p[l]+=f*(n&&s?-1:1)}return p}async function wr(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=cr(t,e),h=yr(p),g=a[f?"floating"===u?"reference":"floating":u],v=mr(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(a.floating)),boundary:s,rootBoundary:d,strategy:c})),y="floating"===u?{...l.floating,x:r,y:o}:l.reference,m=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.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=mr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:m,strategy:c}):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 xr(e){const t=er(...e.map((e=>e.left))),n=er(...e.map((e=>e.top)));return{x:t,y:n,width:tr(...e.map((e=>e.right)))-t,height:tr(...e.map((e=>e.bottom)))-n}}const kr=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:a}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=sr(n),a=dr(n),c="y"===pr(n),s=["left","top"].includes(l)?-1:1,d=i&&c?-1:1,u=cr(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 a&&"number"==typeof h&&(p="end"===a?-1*h:h),c?{x:p*d,y:f*s}:{x:f*s,y:p*d}}(t,e);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:l}}}}};function Or(e){const t=Zn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Un(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=nr(n)!==i||nr(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function Cr(e){return Hn(e)?e:e.contextElement}function Er(e){const t=Cr(e);if(!Un(t))return or(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Or(t);let l=(i?nr(n.width):n.width)/r,a=(i?nr(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const Sr=or(0);function Dr(e){const t=In(e);return $n()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Sr}function Rr(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Cr(e);let l=or(1);t&&(r?Hn(r)&&(l=Er(r)):l=Er(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==In(e))&&t}(i,n,r)?Dr(i):or(0);let c=(o.left+a.x)/l.x,s=(o.top+a.y)/l.y,d=o.width/l.x,u=o.height/l.y;if(i){const e=In(i),t=r&&Hn(r)?In(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=Er(o),t=o.getBoundingClientRect(),r=Zn(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,d*=e.x,u*=e.y,c+=i,s+=l,n=In(o),o=n.frameElement}}return mr({width:d,height:u,x:c,y:s})}const _r=[":popover-open",":modal"];function jr(e){return _r.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Br(e){return Rr(Fn(e)).left+qn(e).scrollLeft}function Ar(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=In(e),r=Fn(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,c=0;if(o){i=o.width,l=o.height;const e=$n();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:a,y:c}}(e,n);else if("document"===t)r=function(e){const t=Fn(e),n=qn(e),r=e.ownerDocument.body,o=tr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Br(e);const a=-n.scrollTop;return"rtl"===Zn(r).direction&&(l+=tr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(Fn(e));else if(Hn(t))r=function(e,t){const n=Rr(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Un(e)?Er(e):or(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=Dr(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return mr(r)}function Tr(e,t){const n=Gn(e);return!(n===t||!Hn(n)||Xn(n))&&("fixed"===Zn(n).position||Tr(n,t))}function Mr(e,t,n){const r=Un(t),o=Fn(t),i="fixed"===n,l=Rr(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=or(0);if(r||!r&&!i)if(("body"!==Pn(t)||Kn(o))&&(a=qn(t)),r){const e=Rr(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=Br(o));return{x:l.left+a.scrollLeft-c.x,y:l.top+a.scrollTop-c.y,width:l.width,height:l.height}}function Nr(e,t){return Un(e)&&"fixed"!==Zn(e).position?t?t(e):e.offsetParent:null}function Lr(e,t){const n=In(e);if(!Un(e)||jr(e))return n;let r=Nr(e,t);for(;r&&Wn(r)&&"static"===Zn(r).position;)r=Nr(r,t);return r&&("html"===Pn(r)||"body"===Pn(r)&&"static"===Zn(r).position&&!Yn(r))?n:r||function(e){let t=Gn(e);for(;Un(t)&&!Xn(t);){if(Yn(t))return t;t=Gn(t)}return null}(e)||n}const Pr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=Fn(r),a=!!t&&jr(t.floating);if(r===l||a&&i)return n;let c={scrollLeft:0,scrollTop:0},s=or(1);const d=or(0),u=Un(r);if((u||!u&&!i)&&(("body"!==Pn(r)||Kn(l))&&(c=qn(r)),Un(r))){const e=Rr(r);s=Er(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+d.x,y:n.y*s.y-c.scrollTop*s.y+d.y}},getDocumentElement:Fn,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=Qn(e,[],!1).filter((e=>Hn(e)&&"body"!==Pn(e))),o=null;const i="fixed"===Zn(e).position;let l=i?Gn(e):e;for(;Hn(l)&&!Xn(l);){const t=Zn(l),n=Yn(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Kn(l)&&!n&&Tr(e,l))?r=r.filter((e=>e!==l)):o=t,l=Gn(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],a=i.reduce(((e,n)=>{const r=Ar(t,n,o);return e.top=tr(r.top,e.top),e.right=er(r.right,e.right),e.bottom=er(r.bottom,e.bottom),e.left=tr(r.left,e.left),e}),Ar(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Lr,getElementRects:async function(e){const t=this.getOffsetParent||Lr,n=this.getDimensions;return{reference:Mr(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}=Or(e);return{width:t,height:n}},getScale:Er,isElement:Hn,isRTL:function(e){return"rtl"===Zn(e).direction}};function Ir(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,s=Cr(e),d=o||i?[...s?Qn(s):[],...Qn(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const u=s&&a?function(e,t){let n,r=null;const o=Fn(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(a,c){void 0===a&&(a=!1),void 0===c&&(c=1),i();const{left:s,top:d,width:u,height:f}=e.getBoundingClientRect();if(a||t(),!u||!f)return;const p={rootMargin:-rr(d)+"px "+-rr(o.clientWidth-(s+u))+"px "+-rr(o.clientHeight-(d+f))+"px "+-rr(s)+"px",threshold:tr(0,er(1,c))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==c){if(!h)return l();t?l(!1,t):n=setTimeout((()=>{l(!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}(s,n):null;let f,p=-1,h=null;l&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===s&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),s&&!c&&h.observe(s),h.observe(t));let g=c?Rr(e):null;return c&&function t(){const r=Rr(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,c&&cancelAnimationFrame(f)}}const Fr=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:l=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=cr(e,t),s={x:n,y:r},d=await wr(t,c),u=pr(sr(o)),f=ur(u);let p=s[f],h=s[u];if(i){const e="y"===f?"bottom":"right";p=ar(p+d["y"===f?"top":"left"],p,p-d[e])}if(l){const e="y"===u?"bottom":"right";h=ar(h+d["y"===u?"top":"left"],h,h-d[e])}const g=a.fn({...t,[f]:p,[u]:h});return{...g,data:{x:g.x-n,y:g.y-r}}}}},zr=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:a,platform:c,elements:s}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...v}=cr(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=sr(o),m=sr(a)===a,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),w=f||(m||!g?[vr(a)]:function(e){const t=vr(e);return[gr(e),t,gr(t)]}(a));f||"none"===h||w.push(...function(e,t,n,r){const o=dr(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(sr(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(gr)))),i}(a,g,h,b));const x=[a,...w],k=await wr(t,v),O=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(d&&O.push(k[y]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=dr(e),o=hr(e),i=fr(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=vr(l)),[l,vr(l)]}(o,l,b);O.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:O}],!O.every((e=>e<=0))){var E,S;const e=((null==(E=i.flip)?void 0:E.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 D;const e=null==(D=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:D[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Hr=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:l}=t,{padding:a=2,x:c,y:s}=cr(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=>mr(xr(e))))}(d),f=mr(xr(d)),p=yr(a);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=c&&null!=s)return u.find((e=>c>e.left-p.left&&c<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||f;if(u.length>=2){if("y"===pr(n)){const e=u[0],t=u[u.length-1],r="top"===sr(n),o=e.top,i=t.bottom,l=r?e.left:t.left,a=r?e.right:t.right;return{top:o,bottom:i,left:l,right:a,width:a-l,height:i-o,x:l,y:o}}const e="left"===sr(n),t=tr(...u.map((e=>e.right))),r=er(...u.map((e=>e.left))),o=u.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,l=o[o.length-1].bottom;return{top:i,bottom:l,left:r,right:t,width:t-r,height:l-i,x:r,y:i}}return f}},floating:r.floating,strategy:l});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}}:{}}}},Ur=(e,t,n)=>{const r=new Map,o={platform:Pr,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=br(s,r,c),f=r,p={},h=0;for(let n=0;n<a.length;n++){const{name:i,fn:g}=a[n],{x:v,y:y,data:m,reset:b}=await g({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=y?y:u,p={...p,[i]:{...p[i],...m}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:d,y:u}=br(s,f,c))),n=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Vr="undefined"!=typeof document?c:s;function Kr(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(!Kr(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)&&!Kr(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Wr(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yr(e,t){const n=Wr(e);return Math.round(t*n)/n}function $r(e){const t=r.useRef(e);return Vr((()=>{t.current=e})),t}
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from"react";import o,{createContext as i,useContext as l,useRef as a,useLayoutEffect as c,useEffect as s,useMemo as d,useCallback as u,useState as f,memo as p,useReducer as h,forwardRef as g,createElement as v}from"react";import*as y from"react-dom";import{unstable_batchedUpdates as m,createPortal as b}from"react-dom";import{ReactEditor as w,useSelected as x,Slate as k,Editable as O,DefaultElement as C,withReact as E}from"slate-react";import{Editor as S,Transforms as D,Path as R,Range as _,Text as j,Element as B,Operation as A,createEditor as T,Point as M}from"slate";class N{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 N(Object.assign(Object.assign({},this.plugin),{elements:o,options:r}))}}function L(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 P={editor:{id:"",getBlock:()=>{},insertBlock:()=>{},insertBlocks:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},toggleBlock:()=>{},focusBlock:()=>{},setSelection:()=>{},applyChanges:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},setBlockSelected:()=>{},selectedBlocks:[],duplicateBlock:()=>{},getEditorValue:()=>{},setEditorValue:()=>{},blur:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,readOnly:!1,blockEditorsMap:{},children:{},emit:()=>{},on:()=>{},off:()=>{},once:()=>{}}},I=i(P),F=({children:t,editorState:n})=>{const r=a(P);return r.current={editor:n.editor},e(I.Provider,Object.assign({value:r.current},{children:t}))},z=()=>{const e=l(I);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},H=e=>z().children[e],U=e=>z().blocks[e],V=e=>z().plugins[e],K=()=>z().readOnly,W=e=>{var t;return null===(t=V(e))||void 0===t?void 0:t.options},Y=({blockId:e,path:t})=>{var n;const r=z();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let o;return e&&(o=r.children[e]),t&&(o=L(r,{at:t})),(null===(n=r.selection)||void 0===n?void 0:n[0])===(null==o?void 0:o.meta.order)};var $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},X={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,l){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new o(r,i||e,l),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function l(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.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},a.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,l=new Array(i);o<i;o++)l[o]=r[o].fn;return l},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,o,i,l){var a=n?n+e:e;if(!this._events[a])return!1;var c,s,d=this._events[a],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,l),!0}for(s=1,c=new Array(u-1);s<u;s++)c[s-1]=arguments[s];d.fn.apply(d.context,c)}else{var f,p=d.length;for(s=0;s<p;s++)switch(d[s].once&&this.removeListener(e,d[s].fn,void 0,!0),u){case 1:d[s].fn.call(d[s].context);break;case 2:d[s].fn.call(d[s].context,t);break;case 3:d[s].fn.call(d[s].context,t,r);break;case 4:d[s].fn.call(d[s].context,t,r,o);break;default:if(!c)for(f=1,c=new Array(u-1);f<u;f++)c[f-1]=arguments[f];d[s].fn.apply(d[s].context,c)}}return!0},a.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return l(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||r&&a.context!==r||l(this,i);else{for(var c=0,s=[],d=a.length;c<d;c++)(a[c].fn!==t||o&&!a[c].once||r&&a[c].context!==r)&&s.push(a[c]);s.length?this._events[i]=1===s.length?s[0]:s:l(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&l(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}({get exports(){return X},set exports(e){X=e}});var Z=X;function q(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}const G=()=>{var e,t;return"undefined"==typeof window||"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?q():null===(t=window.crypto)||void 0===t?void 0:t.randomUUID()},J=e=>({id:G(),type:(null==e?void 0:e.type)||"paragraph",children:(null==e?void 0:e.children)||[{text:""}],props:Object.assign({nodeType:"block"},null==e?void 0:e.props)}),Q=e=>({id:(null==e?void 0:e.id)||G(),value:(null==e?void 0:e.value)||[J()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const ee="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function te(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function ne(e){return"nodeType"in e}function re(e){var t,n;return e?te(e)?e:ne(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function oe(e){const{Document:t}=re(e);return e instanceof t}function ie(e){return!te(e)&&e instanceof re(e).HTMLElement}function le(e){return e instanceof re(e).SVGElement}function ae(e){return e?te(e)?e.document:ne(e)?oe(e)?e:ie(e)||le(e)?e.ownerDocument:document:document:document}const ce=ee?c:s;function se(e){const t=a(e);return ce((()=>{t.current=e})),u((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function de(e,t){void 0===t&&(t=[e]);const n=a(e);return ce((()=>{n.current!==e&&(n.current=e)}),t),n}function ue(e,t){const n=a();return d((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function fe(e){const t=se(e),n=a(null),r=u((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,r]}function pe(e){const t=a();return s((()=>{t.current=e}),[e]),t.current}let he={};function ge(e,t){return d((()=>{if(t)return t;const n=null==he[e]?0:he[e]+1;return he[e]=n,e+"-"+n}),[e,t])}function ve(e){return function(t){for(var n=arguments.length,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 ye=ve(1),me=ve(-1);function be(e){if(!e)return!1;const{KeyboardEvent:t}=re(e.target);return t&&e instanceof t}function we(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=re(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const xe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[xe.Translate.toString(e),xe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),ke="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Oe(e){return e.matches(ke)?e:e.querySelector(ke)}const Ce={display:"none"};function Ee(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:Ce},n)}function Se(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return o.createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const De=i(null);const Re={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 "},_e={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 je(e){let{announcements:t=_e,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Re}=e;const{announce:a,announcement:c}=function(){const[e,t]=f("");return{announce:u((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=ge("DndLiveRegion"),[h,g]=f(!1);if(s((()=>{g(!0)}),[]),function(e){const t=l(De);s((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(d((()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}})),[a,t])),!h)return null;const v=o.createElement(o.Fragment,null,o.createElement(Ee,{id:r,value:i.draggable}),o.createElement(Se,{id:p,announcement:c}));return n?b(v,n):v}var Be;function Ae(){}function Te(e,t){return d((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Be||(Be={}));const Me=Object.freeze({x:0,y:0});function Ne(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Le(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Pe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ie(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 Fe(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function ze(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const He=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=ze(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Ne(ze(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(Le)};function Ue(e,t){const n=Math.max(t.top,e.top),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),l=o-r,a=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=l*a;return Number((o/(n+r-o)).toFixed(4))}return 0}const Ve=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=Ue(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Pe)};function Ke(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Me}function We(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 Ye=We(1);const $e={ignoreTransform:!1};function Xe(e,t){void 0===t&&(t=$e);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=re(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:l,y:a}=r,c=e.left-l-(1-o)*parseFloat(n),s=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:c+d,bottom:s+u,left:c}}(n,t,r))}const{top:r,left:o,width:i,height:l,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:l,bottom:a,right:c}}function Ze(e){return Xe(e,{ignoreTransform:!0})}function qe(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(oe(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ie(o)||le(o))return n;if(n.includes(o))return n;const i=re(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=re(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=re(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Ge(e){const[t]=qe(e,1);return null!=t?t:null}function Je(e){return ee&&e?te(e)?e:ne(e)?oe(e)||e===ae(e).scrollingElement?window:ie(e)?e:null:null:null}function Qe(e){return te(e)?e.scrollX:e.scrollLeft}function et(e){return te(e)?e.scrollY:e.scrollTop}function tt(e){return{x:Qe(e),y:et(e)}}var nt;function rt(e){return!(!ee||!e)&&e===document.scrollingElement}function ot(e){const t={x:0,y:0},n=rt(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"}(nt||(nt={}));const it={x:.2,y:.2};function lt(e,t,n,r,o){let{top:i,left:l,right:a,bottom:c}=n;void 0===r&&(r=10),void 0===o&&(o=it);const{isTop:s,isBottom:d,isLeft:u,isRight:f}=ot(e),p={x:0,y:0},h={x:0,y:0},g=t.height*o.y,v=t.width*o.x;return!s&&i<=t.top+g?(p.y=nt.Backward,h.y=r*Math.abs((t.top+g-i)/g)):!d&&c>=t.bottom-g&&(p.y=nt.Forward,h.y=r*Math.abs((t.bottom-g-c)/g)),!f&&a>=t.right-v?(p.x=nt.Forward,h.x=r*Math.abs((t.right-v-a)/v)):!u&&l<=t.left+v&&(p.x=nt.Backward,h.x=r*Math.abs((t.left+v-l)/v)),{direction:p,speed:h}}function at(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 ct(e){return e.reduce(((e,t)=>ye(e,tt(t))),Me)}const st=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Qe(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+et(t)),0)}]];class dt{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=qe(t),r=ct(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of st)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),l=r[e]-t;return this.rect[i]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ut{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ft(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 pt,ht;function gt(e){e.preventDefault()}function vt(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(pt||(pt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ht||(ht={}));const yt={start:[ht.Space,ht.Enter],cancel:[ht.Esc],end:[ht.Space,ht.Enter]},mt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ht.Right:return{...n,x:n.x+25};case ht.Left:return{...n,x:n.x-25};case ht.Down:return{...n,y:n.y+25};case ht.Up:return{...n,y:n.y-25}}};class bt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ut(ae(t)),this.windowListeners=new ut(re(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(pt.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Xe),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Ge(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(Me)}handleKeyDown(e){if(be(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=yt,coordinateGetter:i=mt,scrollBehavior:l="smooth"}=r,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:c}=n.current,s=c?{x:c.left,y:c.top}:Me;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:n.current,currentCoordinates:s});if(d){const t=me(d,s),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:a,isLeft:c,isBottom:s,maxScroll:u,minScroll:f}=ot(n),p=at(n),h={x:Math.min(o===ht.Right?p.right-p.width/2:p.right,Math.max(o===ht.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(o===ht.Down?p.bottom-p.height/2:p.bottom,Math.max(o===ht.Down?p.top:p.top+p.height/2,d.y))},g=o===ht.Right&&!a||o===ht.Left&&!c,v=o===ht.Down&&!s||o===ht.Up&&!i;if(g&&h.x!==d.x){const e=n.scrollLeft+t.x,i=o===ht.Right&&e<=u.x||o===ht.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=i?n.scrollLeft-e:o===ht.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(v&&h.y!==d.y){const e=n.scrollTop+t.y,i=o===ht.Down&&e<=u.y||o===ht.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=i?n.scrollTop-e:o===ht.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,ye(me(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 wt(e){return Boolean(e&&"distance"in e)}function xt(e){return Boolean(e&&"delay"in e)}bt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=yt,onActivation:o}=t,{active:i}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class kt{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=re(e);return e instanceof t?e:ae(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=ae(i),this.documentListeners=new ut(this.document),this.listeners=new ut(n),this.windowListeners=new ut(re(i)),this.initialCoordinates=null!=(r=we(o))?r:Me,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.DragStart,gt),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),this.windowListeners.add(pt.ContextMenu,gt),this.documentListeners.add(pt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(wt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(pt.Click,vt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:l}}=o;if(!r)return;const a=null!=(t=we(e))?t:Me,c=me(r,a);if(!n&&l){if(wt(l)){if(null!=l.tolerance&&ft(c,l.tolerance))return this.handleCancel();if(ft(c,l.distance))return this.handleStart()}return xt(l)&&ft(c,l.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(a)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ht.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Ot={move:{name:"pointermove"},end:{name:"pointerup"}};class Ct extends kt{constructor(e){const{event:t}=e,n=ae(t.target);super(e,Ot,n)}}Ct.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 Et={move:{name:"mousemove"},end:{name:"mouseup"}};var St;!function(e){e[e.RightClick=2]="RightClick"}(St||(St={}));(class extends kt{constructor(e){super(e,Et,ae(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==St.RightClick&&(null==r||r({event:n}),!0)}}];const Dt={move:{name:"touchmove"},end:{name:"touchend"}};var Rt,_t;function jt(e){let{acceleration:t,activator:n=Rt.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:l=5,order:c=_t.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:h,delta:g,threshold:v}=e;const y=function(e){let{delta:t,disabled:n}=e;const r=pe(t);return ue((e=>{if(n||!r||!e)return Bt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[nt.Backward]:e.x[nt.Backward]||-1===o.x,[nt.Forward]:e.x[nt.Forward]||1===o.x},y:{[nt.Backward]:e.y[nt.Backward]||-1===o.y,[nt.Forward]:e.y[nt.Forward]||1===o.y}}}),[n,t,r])}({delta:g,disabled:!i}),[m,b]=function(){const e=a(null);return[u(((t,n)=>{e.current=setInterval(t,n)}),[]),u((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),w=a({x:0,y:0}),x=a({x:0,y:0}),k=d((()=>{switch(n){case Rt.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Rt.DraggableRect:return o}}),[n,o,f]),O=a(null),C=u((()=>{const e=O.current;if(!e)return;const t=w.current.x*x.current.x,n=w.current.y*x.current.y;e.scrollBy(t,n)}),[]),E=d((()=>c===_t.TreeOrder?[...p].reverse():p),[c,p]);s((()=>{if(i&&p.length&&k){for(const e of E){if(!1===(null==r?void 0:r(e)))continue;const n=p.indexOf(e),o=h[n];if(!o)continue;const{direction:i,speed:a}=lt(e,o,k,t,v);for(const e of["x","y"])y[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return b(),O.current=e,m(C,l),w.current=a,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},b()}else b()}),[t,C,r,b,i,l,JSON.stringify(k),JSON.stringify(y),m,p,E,h,JSON.stringify(v)])}(class extends kt{constructor(e){super(e,Dt)}static setup(){return window.addEventListener(Dt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Dt.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation: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"}(Rt||(Rt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(_t||(_t={}));const Bt={x:{[nt.Backward]:!1,[nt.Forward]:!1},y:{[nt.Backward]:!1,[nt.Forward]:!1}};var At,Tt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(At||(At={})),function(e){e.Optimized="optimized"}(Tt||(Tt={}));const Mt=new Map;function Nt(e,t){return ue((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Lt(e){let{callback:t,disabled:n}=e;const r=se(t),o=d((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[n]);return s((()=>()=>null==o?void 0:o.disconnect()),[o]),o}function Pt(e){return new dt(Xe(e),e)}function It(e,t,n){void 0===t&&(t=Pt);const[r,o]=h((function(r){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);if(JSON.stringify(r)===JSON.stringify(i))return r;return i}),null),i=function(e){let{callback:t,disabled:n}=e;const r=se(t),o=d((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,n]);return s((()=>()=>null==o?void 0:o.disconnect()),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),l=Lt({callback:o});return ce((()=>{o(),e?(null==l||l.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==i||i.disconnect())}),[e]),r}const Ft=[];function zt(e,t){void 0===t&&(t=[]);const n=a(null);return s((()=>{n.current=null}),t),s((()=>{const t=e!==Me;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?me(e,n.current):Me}function Ht(e){return d((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Ut=[];function Vt(e){let{measure:t}=e;const[n,r]=f(null),o=u((e=>{for(const{target:n}of e)if(ie(n)){r((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t]),i=Lt({callback:o}),l=u((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ie(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)}),[t,i]),[a,c]=fe(l);return d((()=>({nodeRef:a,rect:n,setRef:c})),[n,a,c])}const Kt=[{sensor:Ct,options:{}},{sensor:bt,options:{}}],Wt={current:{}},Yt={draggable:{measure:Ze},droppable:{measure:Ze,strategy:At.WhileDragging,frequency:Tt.Optimized},dragOverlay:{measure:Xe}};class $t extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Xt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $t,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ae},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Yt,measureDroppableContainers:Ae,windowRect:null,measuringScheduled:!1},Zt=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ae,draggableNodes:new Map,over:null,measureDroppableContainers:Ae}),qt=i(Xt);function Gt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $t}}}function Jt(e,t){switch(t.type){case Be.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Be.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 Be.DragEnd:case Be.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Be.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new $t(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Be.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const l=new $t(e.droppable.containers);return l.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case Be.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new $t(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Qt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=l(Zt),i=pe(r),a=pe(null==n?void 0:n.id);return s((()=>{if(!t&&!r&&i&&null!=a){if(!be(i))return;if(document.activeElement===i.target)return;const e=o.get(a);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=Oe(e);if(t){t.focus();break}}}))}}),[r,t,o,a,i]),null}const en=i({...Me,scaleX:1,scaleY:1});var tn;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(tn||(tn={}));const nn=p((function(e){var t,n,r,i;let{id:l,accessibility:c,autoScroll:p=!0,children:g,sensors:v=Kt,collisionDetection:y=Ve,measuring:b,modifiers:w,...x}=e;const k=h(Jt,void 0,Gt),[O,C]=k,[E,S]=function(){const[e]=f((()=>new Set)),t=u((t=>(e.add(t),()=>e.delete(t))),[e]);return[u((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[D,R]=f(tn.Uninitialized),_=D===tn.Initialized,{draggable:{active:j,nodes:B,translate:A},droppable:{containers:T}}=O,M=j?B.get(j):null,N=a({initial:null,translated:null}),L=d((()=>{var e;return null!=j?{id:j,data:null!=(e=null==M?void 0:M.data)?e:Wt,rect:N}:null}),[j,M]),P=a(null),[I,F]=f(null),[z,H]=f(null),U=de(x,Object.values(x)),V=ge("DndDescribedBy",l),K=d((()=>T.getEnabled()),[T]),W=d((()=>({draggable:{...Yt.draggable,...null==Y?void 0:Y.draggable},droppable:{...Yt.droppable,...null==Y?void 0:Y.droppable},dragOverlay:{...Yt.dragOverlay,...null==Y?void 0:Y.dragOverlay}})),[null==(Y=b)?void 0:Y.draggable,null==Y?void 0:Y.droppable,null==Y?void 0:Y.dragOverlay]);var Y;const{droppableRects:$,measureDroppableContainers:X,measuringScheduled:Z}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,l]=f(null),{frequency:c,measure:d,strategy:p}=o,h=a(e),g=function(){switch(p){case At.Always:return!1;case At.BeforeDragging:return n;default:return!n}}(),v=de(g),y=u((function(e){void 0===e&&(e=[]),v.current||l((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[v]),m=a(null),b=ue((t=>{if(g&&!n)return Mt;if(!t||t===Mt||h.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new dt(d(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,i,n,g,d]);return s((()=>{h.current=e}),[e]),s((()=>{g||y()}),[n,g]),s((()=>{i&&i.length>0&&l(null)}),[JSON.stringify(i)]),s((()=>{g||"number"!=typeof c||null!==m.current||(m.current=setTimeout((()=>{y(),m.current=null}),c))}),[c,g,y,...r]),{droppableRects:b,measureDroppableContainers:y,measuringScheduled:null!=i}}(K,{dragging:_,dependencies:[A.x,A.y],config:W.droppable}),q=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return ue((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(B,j),G=d((()=>z?we(z):null),[z]),J=function(){const e=!1===(null==I?void 0:I.autoScrollEnabled),t="object"==typeof p?!1===p.enabled:!1===p,n=_&&!e&&!t;if("object"==typeof p)return{...p,enabled:n};return{enabled:n}}(),Q=function(e,t){return Nt(e,t)}(q,W.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=a(!1),{x:l,y:c}="boolean"==typeof o?{x:o,y:o}:o;ce((()=>{if(!l&&!c||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=Ke(n(e),r);if(l||(o.x=0),c||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Ge(e);t&&t.scrollBy({top:o.y,left:o.x})}}),[t,l,c,r,n])}({activeNode:j?B.get(j):null,config:J.layoutShiftCompensation,initialRect:Q,measure:W.draggable.measure});const te=It(q,W.draggable.measure,Q),ne=It(q?q.parentElement:null),oe=a({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:$,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=T.getNodeFor(null==(t=oe.current.over)?void 0:t.id),le=Vt({measure:W.dragOverlay.measure}),ae=null!=(n=le.nodeRef.current)?n:q,se=_?null!=(r=le.rect)?r:te:null,fe=Boolean(le.nodeRef.current&&le.rect),pe=Ke(he=fe?null:te,Nt(he));var he;const ve=Ht(ae?re(ae):null),me=function(e){const t=a(e),n=ue((n=>e?n&&n!==Ft&&e&&t.current&&e.parentNode===t.current.parentNode?n:qe(e):Ft),[e]);return s((()=>{t.current=e}),[e]),n}(_?null!=ie?ie:q:null),be=function(e,t){void 0===t&&(t=Xe);const[n]=e,r=Ht(n?re(n):null),[o,i]=h((function(){return e.length?e.map((e=>rt(e)?r:new dt(t(e),e))):Ut}),Ut),l=Lt({callback:i});return e.length>0&&o===Ut&&i(),ce((()=>{e.length?e.forEach((e=>null==l?void 0:l.observe(e))):(null==l||l.disconnect(),i())}),[e]),o}(me),xe=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}(w,{transform:{x:A.x-pe.x,y:A.y-pe.y,scaleX:1,scaleY:1},activatorEvent:z,active:L,activeNodeRect:te,containerNodeRect:ne,draggingNodeRect:se,over:oe.current.over,overlayNodeRect:le.rect,scrollableAncestors:me,scrollableAncestorRects:be,windowRect:ve}),ke=G?ye(G,A):null,Oe=function(e){const[t,n]=f(null),r=a(e),o=u((e=>{const t=Je(e.target);t&&n((e=>e?(e.set(t,tt(t)),new Map(e)):null))}),[]);return s((()=>{const t=r.current;if(e!==t){i(t);const l=e.map((e=>{const t=Je(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,tt(t)]):null})).filter((e=>null!=e));n(l.length?new Map(l):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=Je(e);null==t||t.removeEventListener("scroll",o)}))}}),[o,e]),d((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ye(e,t)),Me):ct(e):Me),[e,t])}(me),Ce=zt(Oe),Ee=zt(Oe,[te]),Se=ye(xe,Ce),Re=se?Ye(se,xe):null,_e=L&&Re?y({active:L,collisionRect:Re,droppableRects:$,droppableContainers:K,pointerCoordinates:ke}):null,Ae=Fe(_e,"id"),[Te,Ne]=f(null),Le=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(fe?xe:ye(xe,Ee),null!=(i=null==Te?void 0:Te.rect)?i:null,te),Pe=u(((e,t)=>{let{sensor:n,options:r}=t;if(null==P.current)return;const o=B.get(P.current);if(!o)return;const i=e.nativeEvent,l=new n({active:P.current,activeNode:o,event:i,options:r,context:oe,onStart(e){const t=P.current;if(null==t)return;const n=B.get(t);if(!n)return;const{onDragStart:r}=U.current,o={active:{id:t,data:n.data,rect:N}};m((()=>{null==r||r(o),R(tn.Initializing),C({type:Be.DragStart,initialCoordinates:e,active:t}),E({type:"onDragStart",event:o})}))},onMove(e){C({type:Be.DragMove,coordinates:e})},onEnd:a(Be.DragEnd),onCancel:a(Be.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=oe.current;let l=null;if(t&&o){const{cancelDrop:a}=U.current;if(l={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Be.DragEnd&&"function"==typeof a){await Promise.resolve(a(l))&&(e=Be.DragCancel)}}P.current=null,m((()=>{C({type:e}),R(tn.Uninitialized),Ne(null),F(null),H(null);const t=e===Be.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=U.current[t];null==e||e(l),E({type:t,event:l})}}))}}m((()=>{F(l),H(e.nativeEvent)}))}),[B]),Ie=u(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=B.get(r);if(null!==P.current||!i||o.dndKit||o.defaultPrevented)return;const l={active:i};!0===e(n,t.options,l)&&(o.dndKit={capturedBy:t.sensor},P.current=r,Pe(n,t))}),[B,Pe]),ze=function(e,t){return d((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(v,Ie);!function(e){s((()=>{if(!ee)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(v),ce((()=>{te&&D===tn.Initializing&&R(tn.Initialized)}),[te,D]),s((()=>{const{onDragMove:e}=U.current,{active:t,activatorEvent:n,collisions:r,over:o}=oe.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Se.x,y:Se.y},over:o};m((()=>{null==e||e(i),E({type:"onDragMove",event:i})}))}),[Se.x,Se.y]),s((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=oe.current;if(!e||null==P.current||!t||!o)return;const{onDragOver:i}=U.current,l=r.get(Ae),a=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};m((()=>{Ne(a),null==i||i(c),E({type:"onDragOver",event:c})}))}),[Ae]),ce((()=>{oe.current={activatorEvent:z,active:L,activeNode:q,collisionRect:Re,collisions:_e,droppableRects:$,draggableNodes:B,draggingNode:ae,draggingNodeRect:se,droppableContainers:T,over:Te,scrollableAncestors:me,scrollAdjustedTranslate:Se},N.current={initial:se,translated:Re}}),[L,q,_e,Re,B,ae,se,$,T,Te,me,Se]),jt({...J,delta:A,draggingRect:Re,pointerCoordinates:ke,scrollableAncestors:me,scrollableAncestorRects:be});const He=d((()=>({active:L,activeNode:q,activeNodeRect:te,activatorEvent:z,collisions:_e,containerNodeRect:ne,dragOverlay:le,draggableNodes:B,droppableContainers:T,droppableRects:$,over:Te,measureDroppableContainers:X,scrollableAncestors:me,scrollableAncestorRects:be,measuringConfiguration:W,measuringScheduled:Z,windowRect:ve})),[L,q,te,z,_e,ne,le,B,T,$,Te,X,me,be,W,Z,ve]),Ue=d((()=>({activatorEvent:z,activators:ze,active:L,activeNodeRect:te,ariaDescribedById:{draggable:V},dispatch:C,draggableNodes:B,over:Te,measureDroppableContainers:X})),[z,ze,L,te,C,V,B,Te,X]);return o.createElement(De.Provider,{value:S},o.createElement(Zt.Provider,{value:Ue},o.createElement(qt.Provider,{value:He},o.createElement(en.Provider,{value:Le},g)),o.createElement(Qt,{disabled:!1===(null==c?void 0:c.restoreFocus)})),o.createElement(je,{...c,hiddenTextDescribedById:V}))})),rn=i(null),on="button",ln="Droppable";function an(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=ge(ln),{activators:a,activatorEvent:c,active:s,activeNodeRect:u,ariaDescribedById:f,draggableNodes:p,over:h}=l(Zt),{role:g=on,roleDescription:v="draggable",tabIndex:y=0}=null!=o?o:{},m=(null==s?void 0:s.id)===t,b=l(m?en:rn),[w,x]=fe(),[k,O]=fe(),C=function(e,t){return d((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(a,t),E=de(n);ce((()=>(p.set(t,{id:t,key:i,node:w,activatorNode:k,data:E}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:s,activatorEvent:c,activeNodeRect:u,attributes:d((()=>({role:g,tabIndex:y,"aria-disabled":r,"aria-pressed":!(!m||g!==on)||void 0,"aria-roledescription":v,"aria-describedby":f.draggable})),[r,g,y,m,v,f.draggable]),isDragging:m,listeners:r?void 0:C,node:w,over:h,setNodeRef:x,setActivatorNodeRef:O,transform:b}}const cn="Droppable",sn={timeout:25};function dn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function un(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function fn(e){return null!==e&&e>=0}const pn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=dn(t,r,n),l=t[o],a=i[o];return a&&l?{x:a.left-l.left,y:a.top-l.top,scaleX:a.width/l.width,scaleY:a.height/l.height}:null},hn={scaleX:1,scaleY:1},gn=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:l}=e;const a=null!=(t=i[n])?t:r;if(!a)return null;if(o===n){const e=i[l];return e?{x:0,y:n<l?e.top+e.height-(a.top+a.height):e.top-a.top,...hn}:null}const c=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=l?{x:0,y:-a.height-c,...hn}:o<n&&o>=l?{x:0,y:a.height+c,...hn}:{x:0,y:0,...hn}};const vn="Sortable",yn=o.createContext({activeIndex:-1,containerId:vn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pn,disabled:{draggable:!1,droppable:!1}});function mn(e){let{children:t,id:n,items:r,strategy:i=pn,disabled:c=!1}=e;const{active:u,dragOverlay:f,droppableRects:p,over:h,measureDroppableContainers:g}=l(qt),v=ge(vn,n),y=Boolean(null!==f.rect),m=d((()=>r.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[r]),b=null!=u,w=u?m.indexOf(u.id):-1,x=h?m.indexOf(h.id):-1,k=a(m),O=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(m,k.current),C=-1!==x&&-1===w||O,E=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);ce((()=>{O&&b&&g(m)}),[O,m,b,g]),s((()=>{k.current=m}),[m]);const S=d((()=>({activeIndex:w,containerId:v,disabled:E,disableTransforms:C,items:m,overIndex:x,useDragOverlay:y,sortedRects:un(m,p),strategy:i})),[w,v,E.draggable,E.droppable,C,m,x,p,y,i]);return o.createElement(yn.Provider,{value:S},t)}const bn=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return dn(n,r,o).indexOf(t)},wn=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:l,previousItems:a,previousContainerId:c,transition:s}=e;return!(!s||!r)&&((a===i||o!==l)&&(!!n||l!==o&&t===c))},xn={duration:200,easing:"ease"},kn="transform",On=xe.Transition.toString({property:kn,duration:0,easing:"linear"}),Cn={roleDescription:"sortable"};function En(e){let{animateLayoutChanges:t=wn,attributes:n,disabled:r,data:o,getNewIndex:i=bn,id:c,strategy:p,resizeObserverConfig:h,transition:g=xn}=e;const{items:v,containerId:y,activeIndex:m,disabled:b,disableTransforms:w,sortedRects:x,overIndex:k,useDragOverlay:O,strategy:C}=l(yn),E=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,b),S=v.indexOf(c),D=d((()=>({sortable:{containerId:y,index:S,items:v},...o})),[y,o,S,v]),R=d((()=>v.slice(v.indexOf(c))),[v,c]),{rect:_,node:j,isOver:B,setNodeRef:A}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=ge(cn),{active:c,dispatch:d,over:f,measureDroppableContainers:p}=l(Zt),h=a({disabled:n}),g=a(!1),v=a(null),y=a(null),{disabled:m,updateMeasurementsFor:b,timeout:w}={...sn,...o},x=de(null!=b?b:r),k=Lt({callback:u((()=>{g.current?(null!=y.current&&clearTimeout(y.current),y.current=setTimeout((()=>{p(Array.isArray(x.current)?x.current:[x.current]),y.current=null}),w)):g.current=!0}),[w]),disabled:m||!c}),O=u(((e,t)=>{k&&(t&&(k.unobserve(t),g.current=!1),e&&k.observe(e))}),[k]),[C,E]=fe(O),S=de(t);return s((()=>{k&&C.current&&(k.disconnect(),g.current=!1,k.observe(C.current))}),[C,k]),ce((()=>(d({type:Be.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:v,data:S}}),()=>d({type:Be.UnregisterDroppable,key:i,id:r}))),[r]),s((()=>{n!==h.current.disabled&&(d({type:Be.SetDroppableDisabled,id:r,key:i,disabled:n}),h.current.disabled=n)}),[r,i,n,d]),{active:c,rect:v,isOver:(null==f?void 0:f.id)===r,node:C,over:f,setNodeRef:E}}({id:c,data:D,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...h}}),{active:T,activatorEvent:M,activeNodeRect:N,attributes:L,setNodeRef:P,listeners:I,isDragging:F,over:z,setActivatorNodeRef:H,transform:U}=an({id:c,data:D,attributes:{...Cn,...n},disabled:E.draggable}),V=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>e=>{t.forEach((t=>t(e)))}),t)}(A,P),K=Boolean(T),W=K&&!w&&fn(m)&&fn(k),Y=!O&&F,$=Y&&W?U:null,X=W?null!=$?$:(null!=p?p:C)({rects:x,activeNodeRect:N,activeIndex:m,overIndex:k,index:S}):null,Z=fn(m)&&fn(k)?i({id:c,items:v,activeIndex:m,overIndex:k}):S,q=null==T?void 0:T.id,G=a({activeId:q,items:v,newIndex:Z,containerId:y}),J=v!==G.current.items,Q=t({active:T,containerId:y,isDragging:F,isSorting:K,id:c,index:S,items:v,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:g,wasDragging:null!=G.current.activeId}),ee=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,l]=f(null),c=a(n);return ce((()=>{if(!t&&n!==c.current&&r.current){const e=o.current;if(e){const t=Xe(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&l(n)}}n!==c.current&&(c.current=n)}),[t,n,r,o]),s((()=>{i&&l(null)}),[i]),i}({disabled:!Q,index:S,node:j,rect:_});return s((()=>{K&&G.current.newIndex!==Z&&(G.current.newIndex=Z),y!==G.current.containerId&&(G.current.containerId=y),v!==G.current.items&&(G.current.items=v)}),[K,Z,y,v]),s((()=>{if(q===G.current.activeId)return;if(q&&!G.current.activeId)return void(G.current.activeId=q);const e=setTimeout((()=>{G.current.activeId=q}),50);return()=>clearTimeout(e)}),[q]),{active:T,activeIndex:m,attributes:L,data:D,rect:_,index:S,newIndex:Z,items:v,isOver:B,isSorting:K,isDragging:F,listeners:I,node:j,overIndex:k,over:z,setNodeRef:V,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:P,transform:null!=ee?ee:X,transition:function(){if(ee||J&&G.current.newIndex===S)return On;if(Y&&!be(M)||!g)return;if(K||Q)return xe.Transition.toString({...g,property:kn});return}()}}function Sn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Dn=[ht.Down,ht.Right,ht.Up,ht.Left],Rn=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:l,scrollableAncestors:a}}=t;if(Dn.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case ht.Down:r.top<i.top&&t.push(n);break;case ht.Up:r.top>i.top&&t.push(n);break;case ht.Left:r.left>i.left&&t.push(n);break;case ht.Right:r.left<i.left&&t.push(n)}}));const c=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Ie(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Ie(r),l=o.reduce(((e,t,r)=>e+Ne(n[r],t)),0),a=Number((l/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:a}})}}return i.sort(Le)})({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let s=Fe(c,"id");if(s===(null==l?void 0:l.id)&&c.length>1&&(s=c[1].id),null!=s){const e=i.get(n.id),t=i.get(s),l=t?o.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&l&&e&&t){const n=qe(c).some(((e,t)=>a[t]!==e)),o=_n(e,t),i=function(e,t){if(!Sn(e)||!Sn(t))return!1;if(!_n(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=n||!o?{x:0,y:0}:{x:i?r.width-l.width:0,y:i?r.height-l.height:0},d={x:l.left,y:l.top};return s.x&&s.y?d:me(d,s)}}}};function _n(e,t){return!(!Sn(e)||!Sn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var jn;function Bn(){return Bn=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},Bn.apply(this,arguments)}var An,Tn=function(e){return r.createElement("svg",Bn({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),jn||(jn=r.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 Mn(){return Mn=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},Mn.apply(this,arguments)}var Nn=function(e){return r.createElement("svg",Mn({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),An||(An=r.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function Ln(e,t={}){const n=Object.keys(e.children),{at: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 Pn(e){return zn(e)?(e.nodeName||"").toLowerCase():"#document"}function In(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Fn(e){var t;return null==(t=(zn(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function zn(e){return e instanceof Node||e instanceof In(e).Node}function Hn(e){return e instanceof Element||e instanceof In(e).Element}function Un(e){return e instanceof HTMLElement||e instanceof In(e).HTMLElement}function Vn(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof In(e).ShadowRoot)}function Kn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Wn(e){return["table","td","th"].includes(Pn(e))}function Yn(e){const t=$n(),n=Zn(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 $n(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Xn(e){return["html","body","#document"].includes(Pn(e))}function Zn(e){return In(e).getComputedStyle(e)}function qn(e){return Hn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Gn(e){if("html"===Pn(e))return e;const t=e.assignedSlot||e.parentNode||Vn(e)&&e.host||Fn(e);return Vn(t)?t.host:t}function Jn(e){const t=Gn(e);return Xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Un(t)&&Kn(t)?t:Jn(t)}function Qn(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Jn(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=In(o);return i?t.concat(l,l.visualViewport||[],Kn(o)?o:[],l.frameElement&&n?Qn(l.frameElement):[]):t.concat(o,Qn(o,[],n))}const er=Math.min,tr=Math.max,nr=Math.round,rr=Math.floor,or=e=>({x:e,y:e}),ir={left:"right",right:"left",bottom:"top",top:"bottom"},lr={start:"end",end:"start"};function ar(e,t,n){return tr(e,er(t,n))}function cr(e,t){return"function"==typeof e?e(t):e}function sr(e){return e.split("-")[0]}function dr(e){return e.split("-")[1]}function ur(e){return"x"===e?"y":"x"}function fr(e){return"y"===e?"height":"width"}function pr(e){return["top","bottom"].includes(sr(e))?"y":"x"}function hr(e){return ur(pr(e))}function gr(e){return e.replace(/start|end/g,(e=>lr[e]))}function vr(e){return e.replace(/left|right|bottom|top/g,(e=>ir[e]))}function yr(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 mr(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function br(e,t,n){let{reference:r,floating:o}=e;const i=pr(t),l=hr(t),a=fr(l),c=sr(t),s="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(c){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(dr(t)){case"start":p[l]-=f*(n&&s?-1:1);break;case"end":p[l]+=f*(n&&s?-1:1)}return p}async function wr(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=cr(t,e),h=yr(p),g=a[f?"floating"===u?"reference":"floating":u],v=mr(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(a.floating)),boundary:s,rootBoundary:d,strategy:c})),y="floating"===u?{...l.floating,x:r,y:o}:l.reference,m=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.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=mr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:m,strategy:c}):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 xr(e){const t=er(...e.map((e=>e.left))),n=er(...e.map((e=>e.top)));return{x:t,y:n,width:tr(...e.map((e=>e.right)))-t,height:tr(...e.map((e=>e.bottom)))-n}}const kr=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:a}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=sr(n),a=dr(n),c="y"===pr(n),s=["left","top"].includes(l)?-1:1,d=i&&c?-1:1,u=cr(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 a&&"number"==typeof h&&(p="end"===a?-1*h:h),c?{x:p*d,y:f*s}:{x:f*s,y:p*d}}(t,e);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:l}}}}};function Or(e){const t=Zn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Un(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=nr(n)!==i||nr(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function Cr(e){return Hn(e)?e:e.contextElement}function Er(e){const t=Cr(e);if(!Un(t))return or(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Or(t);let l=(i?nr(n.width):n.width)/r,a=(i?nr(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const Sr=or(0);function Dr(e){const t=In(e);return $n()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Sr}function Rr(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Cr(e);let l=or(1);t&&(r?Hn(r)&&(l=Er(r)):l=Er(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==In(e))&&t}(i,n,r)?Dr(i):or(0);let c=(o.left+a.x)/l.x,s=(o.top+a.y)/l.y,d=o.width/l.x,u=o.height/l.y;if(i){const e=In(i),t=r&&Hn(r)?In(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=Er(o),t=o.getBoundingClientRect(),r=Zn(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,d*=e.x,u*=e.y,c+=i,s+=l,n=In(o),o=n.frameElement}}return mr({width:d,height:u,x:c,y:s})}const _r=[":popover-open",":modal"];function jr(e){return _r.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Br(e){return Rr(Fn(e)).left+qn(e).scrollLeft}function Ar(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=In(e),r=Fn(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,c=0;if(o){i=o.width,l=o.height;const e=$n();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:a,y:c}}(e,n);else if("document"===t)r=function(e){const t=Fn(e),n=qn(e),r=e.ownerDocument.body,o=tr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Br(e);const a=-n.scrollTop;return"rtl"===Zn(r).direction&&(l+=tr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}(Fn(e));else if(Hn(t))r=function(e,t){const n=Rr(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Un(e)?Er(e):or(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=Dr(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return mr(r)}function Tr(e,t){const n=Gn(e);return!(n===t||!Hn(n)||Xn(n))&&("fixed"===Zn(n).position||Tr(n,t))}function Mr(e,t,n){const r=Un(t),o=Fn(t),i="fixed"===n,l=Rr(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=or(0);if(r||!r&&!i)if(("body"!==Pn(t)||Kn(o))&&(a=qn(t)),r){const e=Rr(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=Br(o));return{x:l.left+a.scrollLeft-c.x,y:l.top+a.scrollTop-c.y,width:l.width,height:l.height}}function Nr(e,t){return Un(e)&&"fixed"!==Zn(e).position?t?t(e):e.offsetParent:null}function Lr(e,t){const n=In(e);if(!Un(e)||jr(e))return n;let r=Nr(e,t);for(;r&&Wn(r)&&"static"===Zn(r).position;)r=Nr(r,t);return r&&("html"===Pn(r)||"body"===Pn(r)&&"static"===Zn(r).position&&!Yn(r))?n:r||function(e){let t=Gn(e);for(;Un(t)&&!Xn(t);){if(Yn(t))return t;t=Gn(t)}return null}(e)||n}const Pr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=Fn(r),a=!!t&&jr(t.floating);if(r===l||a&&i)return n;let c={scrollLeft:0,scrollTop:0},s=or(1);const d=or(0),u=Un(r);if((u||!u&&!i)&&(("body"!==Pn(r)||Kn(l))&&(c=qn(r)),Un(r))){const e=Rr(r);s=Er(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+d.x,y:n.y*s.y-c.scrollTop*s.y+d.y}},getDocumentElement:Fn,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=Qn(e,[],!1).filter((e=>Hn(e)&&"body"!==Pn(e))),o=null;const i="fixed"===Zn(e).position;let l=i?Gn(e):e;for(;Hn(l)&&!Xn(l);){const t=Zn(l),n=Yn(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Kn(l)&&!n&&Tr(e,l))?r=r.filter((e=>e!==l)):o=t,l=Gn(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],a=i.reduce(((e,n)=>{const r=Ar(t,n,o);return e.top=tr(r.top,e.top),e.right=er(r.right,e.right),e.bottom=er(r.bottom,e.bottom),e.left=tr(r.left,e.left),e}),Ar(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Lr,getElementRects:async function(e){const t=this.getOffsetParent||Lr,n=this.getDimensions;return{reference:Mr(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}=Or(e);return{width:t,height:n}},getScale:Er,isElement:Hn,isRTL:function(e){return"rtl"===Zn(e).direction}};function Ir(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,s=Cr(e),d=o||i?[...s?Qn(s):[],...Qn(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const u=s&&a?function(e,t){let n,r=null;const o=Fn(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(a,c){void 0===a&&(a=!1),void 0===c&&(c=1),i();const{left:s,top:d,width:u,height:f}=e.getBoundingClientRect();if(a||t(),!u||!f)return;const p={rootMargin:-rr(d)+"px "+-rr(o.clientWidth-(s+u))+"px "+-rr(o.clientHeight-(d+f))+"px "+-rr(s)+"px",threshold:tr(0,er(1,c))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==c){if(!h)return l();t?l(!1,t):n=setTimeout((()=>{l(!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}(s,n):null;let f,p=-1,h=null;l&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===s&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),s&&!c&&h.observe(s),h.observe(t));let g=c?Rr(e):null;return c&&function t(){const r=Rr(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,c&&cancelAnimationFrame(f)}}const Fr=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:l=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=cr(e,t),s={x:n,y:r},d=await wr(t,c),u=pr(sr(o)),f=ur(u);let p=s[f],h=s[u];if(i){const e="y"===f?"bottom":"right";p=ar(p+d["y"===f?"top":"left"],p,p-d[e])}if(l){const e="y"===u?"bottom":"right";h=ar(h+d["y"===u?"top":"left"],h,h-d[e])}const g=a.fn({...t,[f]:p,[u]:h});return{...g,data:{x:g.x-n,y:g.y-r}}}}},zr=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:a,platform:c,elements:s}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...v}=cr(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=sr(o),m=sr(a)===a,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),w=f||(m||!g?[vr(a)]:function(e){const t=vr(e);return[gr(e),t,gr(t)]}(a));f||"none"===h||w.push(...function(e,t,n,r){const o=dr(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(sr(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(gr)))),i}(a,g,h,b));const x=[a,...w],k=await wr(t,v),O=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(d&&O.push(k[y]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=dr(e),o=hr(e),i=fr(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=vr(l)),[l,vr(l)]}(o,l,b);O.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:O}],!O.every((e=>e<=0))){var E,S;const e=((null==(E=i.flip)?void 0:E.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 D;const e=null==(D=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:D[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Hr=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:l}=t,{padding:a=2,x:c,y:s}=cr(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=>mr(xr(e))))}(d),f=mr(xr(d)),p=yr(a);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=c&&null!=s)return u.find((e=>c>e.left-p.left&&c<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||f;if(u.length>=2){if("y"===pr(n)){const e=u[0],t=u[u.length-1],r="top"===sr(n),o=e.top,i=t.bottom,l=r?e.left:t.left,a=r?e.right:t.right;return{top:o,bottom:i,left:l,right:a,width:a-l,height:i-o,x:l,y:o}}const e="left"===sr(n),t=tr(...u.map((e=>e.right))),r=er(...u.map((e=>e.left))),o=u.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,l=o[o.length-1].bottom;return{top:i,bottom:l,left:r,right:t,width:t-r,height:l-i,x:r,y:i}}return f}},floating:r.floating,strategy:l});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}}:{}}}},Ur=(e,t,n)=>{const r=new Map,o={platform:Pr,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=br(s,r,c),f=r,p={},h=0;for(let n=0;n<a.length;n++){const{name:i,fn:g}=a[n],{x:v,y:y,data:m,reset:b}=await g({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=y?y:u,p={...p,[i]:{...p[i],...m}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:d,y:u}=br(s,f,c))),n=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Vr="undefined"!=typeof document?c:s;function Kr(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(!Kr(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)&&!Kr(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Wr(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yr(e,t){const n=Wr(e);return Math.round(t*n)/n}function $r(e){const t=r.useRef(e);return Vr((()=>{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 Xr=["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(","),Zr="undefined"==typeof Element,qr=Zr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gr=!Zr&&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},Jr=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)},Qr=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!Jr(l,!1))if("SLOT"===l.tagName){var a=l.assignedElements(),c=e(a.length?a:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{qr.call(l,Xr)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),d=!Jr(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&d){var u=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else i.unshift.apply(i,l.children)}}return o},eo=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},to=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))&&!eo(e)?0:e.tabIndex},no=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ro=function(e){return"INPUT"===e.tagName},oo=function(e){return function(e){return ro(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Gr(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)},io=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},lo=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=qr.call(e,"details>summary:first-of-type")?e.parentElement:e;if(qr.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return io(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,a=Gr(e);if(l&&!l.shadowRoot&&!0===r(l))return io(e);e=e.assignedSlot?e.assignedSlot:l||a===e.ownerDocument?l:a.host}e=i}if(function(e){var t,n,r,o,i=e&&Gr(e),l=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&l;){var c,s,d;a=!(null===(s=l=null===(c=i=Gr(l))||void 0===c?void 0:c.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(l))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ao=function(e,t){return!(t.disabled||Jr(t)||function(e){return ro(e)&&"hidden"===e.type}(t)||lo(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!!qr.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},co=function(e,t){return!(oo(t)||to(t)<0||!ao(e,t))},so=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},uo=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,a=function(e,t){var n=to(e);return n<0&&t&&!eo(e)?0:n}(l,i),c=i?e(t.candidates):l;0===a?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:c})})),r.sort(no).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},fo=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Qr([e],t.includeContainer,{filter:co.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:so}):function(e,t,n){if(Jr(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Xr));return t&&qr.call(e,Xr)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,co.bind(null,t)),uo(n)};const po=r["useInsertionEffect".toString()]||(e=>e());var ho="undefined"!=typeof document?c:s;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)}let vo=!1,yo=0;const mo=()=>"floating-ui-"+yo++;const bo=r["useId".toString()]||function(){const[e,t]=r.useState((()=>vo?mo():void 0));return ho((()=>{null==e&&t(mo())}),[]),r.useEffect((()=>{vo||(vo=!0)}),[]),e};const wo=r.createContext(null),xo=r.createContext(null);function ko(e){return"data-floating-ui-"+e}function Oo(e){const t=a(e);return ho((()=>{t.current=e})),t}const Co=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Eo(e,t){const n=fo(e,Co());"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 So(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&&Vn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function Do(e){fo(e,Co()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Ro(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 _o={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 jo(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Bo=r.forwardRef((function(e,t){const[n,o]=r.useState();ho((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",jo),()=>{document.removeEventListener("keydown",jo)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[ko("focus-guard")]:"",style:_o};return r.createElement("span",go({},e,i))})),Ao=r.createContext(null),To=ko("portal");function Mo(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const l=function(e){let{id:t,root:n}=void 0===e?{}:e;const[o,i]=r.useState(null),l=bo(),a=No(),c=r.useRef(null);return ho((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{c.current=null}))}),[o]),ho((()=>{if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=l,n.setAttribute(To,""),e.appendChild(n),c.current=n,i(n)}),[t,l]),ho((()=>{if(c.current)return;let e=n||(null==a?void 0:a.portalNode);e&&!Hn(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const o=document.createElement("div");o.id=l,o.setAttribute(To,""),e=r||e,e.appendChild(o),c.current=o,i(o)}),[t,n,l,a]),o}({id:n,root:o}),[a,c]=r.useState(null),s=r.useRef(null),d=r.useRef(null),u=r.useRef(null),f=r.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!(!o&&!l);return r.useEffect((()=>{if(l&&i&&(null==a||!a.modal))return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&So(e)){("focusin"===e.type?Ro:Do)(l)}}}),[l,i,null==a?void 0:a.modal]),r.createElement(Ao.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:l,setFocusManagerState:c})),[i,l])},p&&l&&r.createElement(Bo,{"data-type":"outside",ref:s,onFocus:e=>{if(So(e,l)){var t;null==(t=u.current)||t.focus()}else{const e=Eo(document.body,"prev")||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),p&&l&&r.createElement("span",{"aria-owns":l.id,style:_o}),l&&b(t,l),p&&l&&r.createElement(Bo,{"data-type":"outside",ref:d,onFocus:e=>{if(So(e,l)){var t;null==(t=f.current)||t.focus()}else{const t=Eo(document.body,"next")||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent))}}}))}const No=()=>r.useContext(Ao),Lo=new Set,Po=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=bo();return ho((()=>{if(!n)return;Lo.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,a=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{Lo.delete(i),0===Lo.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,a)))}}),[i,n]),r.createElement("div",go({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Io(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e,[l,a]=r.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||l,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:a}={},transform:c=!0,whileElementsMounted:s,open:d}=e,[u,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);Kr(p,o)||h(o);const[g,v]=r.useState(null),[m,b]=r.useState(null),w=r.useCallback((e=>{e!==C.current&&(C.current=e,v(e))}),[]),x=r.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),k=l||g,O=a||m,C=r.useRef(null),E=r.useRef(null),S=r.useRef(u),D=null!=s,R=$r(s),_=$r(i),j=r.useCallback((()=>{if(!C.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};_.current&&(e.platform=_.current),Ur(C.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!Kr(S.current,t)&&(S.current=t,y.flushSync((()=>{f(t)})))}))}),[p,t,n,_]);Vr((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const B=r.useRef(!1);Vr((()=>(B.current=!0,()=>{B.current=!1})),[]),Vr((()=>{if(k&&(C.current=k),O&&(E.current=O),k&&O){if(R.current)return R.current(k,O,j);j()}}),[k,O,j,R,D]);const A=r.useMemo((()=>({reference:C,floating:E,setReference:w,setFloating:x})),[w,x]),T=r.useMemo((()=>({reference:k,floating:O})),[k,O]),M=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Yr(T.floating,u.x),r=Yr(T.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Wr(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,T.floating,u.x,u.y]);return r.useMemo((()=>({...u,update:j,refs:A,elements:T,floatingStyles:M})),[u,j,A,T,M])}(e),d=r.useContext(xo),u=null!=((null==(f=r.useContext(wo))?void 0:f.id)||null);var f;const p=function(e){const t=r.useRef((()=>{}));return po((()=>{t.current=e})),r.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&&(g.current.openEvent=t),v.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==o||o(e,t,n)})),h=r.useRef(null),g=r.useRef({}),v=r.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],m=bo(),b=r.useCallback((e=>{const t=Hn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=r.useCallback((e=>{(Hn(e)||null===e)&&(h.current=e,a(e)),(Hn(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Hn(e))&&s.refs.setReference(e)}),[s.refs]),x=r.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=r.useMemo((()=>({...s.elements,domReference:c})),[s.elements,c]),O=r.useMemo((()=>({...s,refs:x,elements:k,dataRef:g,nodeId:i,floatingId:m,events:v,open:n,onOpenChange:p})),[s,i,m,v,n,p,x,k]);return ho((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=O)})),r.useMemo((()=>({...s,context:O,refs:x,elements:k})),[s,x,k,O])}const Fo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zo(e,t){return"function"==typeof e?e(t):e}function Ho(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:i=250}=t,l=("number"==typeof i?i:i.close)||0,[a,c]=r.useState(!1),[s,d]=r.useState("unmounted"),u=function(e,t){const[n,o]=r.useState(e);return e&&!n&&o(!0),r.useEffect((()=>{if(!e){const e=setTimeout((()=>o(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,l);return ho((()=>{a&&!u&&d("unmounted")}),[a,u]),ho((()=>{if(o){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),d("close")}}),[n,o]),{isMounted:u,status:s}}function Uo(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:i,common:l,duration:a=250}=t,c=e.placement,s=c.split("-")[0],d=r.useMemo((()=>({side:s,placement:c})),[s,c]),u="number"==typeof a,f=(u?a:a.open)||0,p=(u?a:a.close)||0,[h,g]=r.useState((()=>({...zo(l,d),...zo(n,d)}))),{isMounted:v,status:y}=Ho(e,{duration:a}),m=Oo(n),b=Oo(o),w=Oo(i),x=Oo(l);return ho((()=>{const e=zo(m.current,d),t=zo(w.current,d),n=zo(x.current,d),r=zo(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(r).map(Fo).join(","),transitionDuration:f+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(Fo).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,m,b,x,f,y,d]),{isMounted:v,styles:h}}var Vo;function Ko(){return Ko=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},Ko.apply(this,arguments)}var Wo=function(e){return r.createElement("svg",Ko({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Vo||(Vo=r.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 Yo(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 $o=["color"],Xo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,$o);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Zo=["color"],qo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Zo);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Go=["color"],Jo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Go);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Qo=["color"],ei=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Qo);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),ti=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()}},ni={"text/plain":"Text","text/html":"Url",default:"Text"};var ri=function(e,t){var n,r,o,i,l,a,c=!1;t||(t={}),n=t.debug||!1;try{if(o=ti(),i=document.createRange(),l=document.getSelection(),(a=document.createElement("span")).textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.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=ni[t.format]||ni.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(a),i.selectNodeContents(a),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!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),c=!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{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),a&&document.body.removeChild(a),o()}return c};function oi(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ii(e){if(!e)return;const t=oi(e);return t?e[t]:void 0}const li=i(void 0),ai=({children:r,tools:o})=>{const i=K(),l=d((()=>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=d((()=>!o||i?null:Object.keys(o).map((t=>{var n,r,i;const l=null===(n=null==o?void 0:o[t])||void 0===n?void 0:n.tool,a=null===(r=null==o?void 0:o[t])||void 0===r?void 0:r.render,c=null===(i=null==o?void 0:o[t])||void 0===i?void 0:i.props;return l?e(l,Object.assign({render:a},c),t):null}))),[o]);return e(li.Provider,Object.assign({value:l},{children:t(n,{children:[a,r]})}))},ci=()=>{const e=l(li);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e};function si({editor:e,view:t,onClose:n,mode:r="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===r&&(t=t.filter((t=>function(e,t){var n;const r=e.blocks[t];if(!r)return!1;const o=ii(r.elements);return"void"!==(null===(n=null==o?void 0:o.props)||void 0===n?void 0:n.nodeType)}(e,t)))),t.map((t=>{var n,r,o,i;return{type:t,title:(null===(r=null===(n=e.blocks[t].options)||void 0===n?void 0:n.display)||void 0===r?void 0:r.title)||t,description:null===(i=null===(o=e.blocks[t].options)||void 0===o?void 0:o.display)||void 0===i?void 0:i.description}}))})(),onClose:n,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===r&&e.blocks[t].toggle({focus:!0}),"create"===r&&e.blocks[t].create({deleteText:!0,focus:!0}),n()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}const di=t=>e(Po,Object.assign({lockScroll:!0,className:t.className,onClick:t.onClick},{children:t.children})),ui=t=>{const[n,r]=f(!1),o=z();return s((()=>{r(!0)}),[]),n?e(Mo,Object.assign({id:`${t.id}-${o.id}`,root:document.querySelector(`[data-yoopta-editor-id="${o.id}"]`)},{children:t.children})):null},fi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-group"},{children:t})),pi=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoopta-block-options-menu-content data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),hi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-item"},{children:t})),gi=({isOpen:n,onClose:r,refs:o,style:i,children:l})=>{var a,c;const s=z(),d=ci(),[u,p]=f(!1),{refs:h,floatingStyles:g,context:v}=Io({placement:"right",open:u,onOpenChange:p,middleware:[Hr(),zr(),Fr(),kr(10)],whileElementsMounted:Ir}),{isMounted:y,styles:m}=Uo(v,{duration:100});if(!n)return null;const b=L(s,{at:s.selection}),w=ii(s.blocks[(null==b?void 0:b.type)||""].elements),x="void"===(null===(a=null==w?void 0:w.props)||void 0===a?void 0:a.nodeType),k=d.ActionMenu,O=Object.assign(Object.assign({},g),m),C=si({editor:s,view:"small",onClose:()=>{p(!1),r()}});return e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:r},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:t(pi,{children:[t(fi,{children:[e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),r()}},{children:[e(ei,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),r()}},{children:[e(Xo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!k&&!x&&!(null===(c=s.blocks[(null==b?void 0:b.type)||""])||void 0===c?void 0:c.hasCustomEditor)&&t(hi,{children:[y&&e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>p(!1)},{children:e("div",Object.assign({style:O,ref:h.setFloating},{children:e(k,Object.assign({},C))}))}))})),t("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:h.setReference,onClick:()=>p((e=>!e))},{children:[e(Wo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=L(s);e&&(ri(`${window.location.origin}${window.location.pathname}#${e.id}`),s.emit("block:copy",e)),r()}},{children:[e(Jo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),l]})}))}))}))};var vi=Object.freeze({__proto__:null,BlockOptions:gi,BlockOptionsMenuContent:pi,BlockOptionsMenuGroup:fi,BlockOptionsMenuItem:hi,BlockOptionsSeparator:({className:t=""})=>e("div",{className:`yoopta-block-options-separator ${t}`})});const yi=({block:n,editor:r,dragHandleProps:o,onChangeActiveBlock:i,showActions:l})=>{const[a,c]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:g,actionMenuRenderProps:v,ActionMenu:y}=(({editor:e})=>{const t=ci().ActionMenu,[n,r]=f(!1),{refs:o,floatingStyles:i,context:l}=Io({placement:"bottom-start",open:n,onOpenChange:r,middleware:[Hr(),zr(),Fr(),kr(10)],whileElementsMounted:Ir}),{isMounted:a,styles:c}=Uo(l,{duration:100}),s=Object.assign(Object.assign({},i),c),d=e=>r(e),u=()=>d(!1),p=si({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:a,actionMenuStyles:s,actionMenuRefs:o,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:r}),{refs:m,floatingStyles:b,context:x}=Io({placement:"right-start",open:a,onOpenChange:c,middleware:[Hr(),zr(),Fr(),kr()]}),{isMounted:k,styles:O}=Uo(x,{duration:100}),{setActivatorNodeRef:C,attributes:E,listeners:R}=o,_=Object.assign(Object.assign({},b),O);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":l,className:"yoopta-block-actions"},{children:[s&&u&&e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:g},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(y,Object.assign({},v))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=Ln(r,{at:[n.meta.order]}),o=r.blocks[n.type];if(!t)return;const i=document.querySelector(`[data-yoopta-block-id="${n.id}"]`),l=ii(o.elements);let a;o.hasCustomEditor||(a=S.string(t,[0]));const c="string"==typeof a&&0===a.trim().length;if(u&&c&&"void"!==(null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.nodeType))r.setSelection([n.meta.order]),r.focusBlock(n.id),d.setReference(i),h(!0);else{const e=Q({id:G()}),t=[n.meta.order+1];r.setSelection([n.meta.order]),r.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{i&&d.setReference(i.nextSibling),h(!0)}),0)}},className:"yoopta-block-actions-plus"},{children:e(Nn,{})})),e("button",Object.assign({type:"button",className:"yoopta-block-actions-drag",ref:e=>{C(e),m.setReference(e)}},E,R,{onClick:e=>{e.stopPropagation(),i(n.id);const t=Ln(r,{at:[n.meta.order]});r.focusBlock(n.id),t&&setTimeout((()=>{r.blocks[n.type].hasCustomEditor||(w.blur(t),w.deselect(t),D.deselect(t)),r.setBlockSelected([n.meta.order],{only:!0}),r.setSelection([n.meta.order]),c(!0)}),10)}},{children:e(Tn,{})})),e(gi,{isOpen:k,refs:m,style:_,onClose:()=>c(!1)})]}))},mi=({children:n,block:r,blockId:o})=>{var i;const l=z(),[a,c]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:g,isOver:v,isDragging:y}=En({id:o,disabled:l.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:y?.7:1,marginLeft:20*r.meta.depth+"px"},b=null===(i=l.selectedBlocks)||void 0===i?void 0:i.includes(r.meta.order),w=a===o,x={borderBottom:v&&!y?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:"yoopta-block",onMouseEnter:()=>{l.readOnly||c(o)},onMouseLeave:()=>{l.readOnly||c(null)},style:m,"data-hovered-block":w,"data-yoopta-block":!0,"data-yoopta-block-id":o,"data-yoopta-block-type":r.type},{children:[!l.readOnly&&e(yi,{block:r,editor:l,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:w,onChangeActiveBlock:e=>c(e)}),e("div",Object.assign({style:x},{children:n})),b&&!l.readOnly&&e("div",{className:"yoopta-selection-block"})]}))};function bi(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 wi={};Object.defineProperty(wi,"__esModule",{value:!0});for(var xi="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),ki={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Oi={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:xi?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Ci={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},Ei=1;Ei<20;Ei++)Ci["f"+Ei]=111+Ei;function Si(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return Di(e,t)})),o=function(e){return r.some((function(t){return Ri(t,e)}))};return null==n?o:o(n)}function Di(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var l in ki)r[ki[l]]=!1;var a=!0,c=!1,s=void 0;try{for(var d,u=o[Symbol.iterator]();!(a=(d=u.next()).done);a=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=ji(f),g=ki[h];if(f.length>1&&!g&&!Oi[f]&&!Ci[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?r.key=h:r.which=_i(f)),g&&(r[g]=!p||null)}}catch(e){c=!0,s=e}finally{try{!a&&u.return&&u.return()}finally{if(c)throw s}}return r}function Ri(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 _i(e){return e=ji(e),Ci[e]||e.toUpperCase().charCodeAt(0)}function ji(e){return e=e.toLowerCase(),e=Oi[e]||e}wi.default=Si,wi.isHotkey=Si,wi.isCodeHotkey=function(e,t){return Si(e,t)};var Bi=wi.isKeyHotkey=function(e,t){return Si(e,{byKey:!0},t)};wi.parseHotkey=Di,wi.compareHotkey=Ri,wi.toKeyCode=_i,wi.toKeyName=ji;const Ai={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"},Ti={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"},Mi={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ni=e=>{const t=Ai[e],n=Ti[e],r=Mi[e],o=t&&Bi(t),i=n&&Bi(n),l=r&&Bi(r);return e=>!(!o||!o(e))||(!(!i||!i(e))||!(!l||!l(e)))},Li={isBold:Ni("bold"),isCompose:Ni("compose"),isArrowLeft:Ni("arrowLeft"),isArrowRight:Ni("arrowRight"),isArrowUp:Ni("arrowUp"),isArrowDown:Ni("arrowDown"),isDeleteBackward:Ni("deleteBackward"),isDeleteForward:Ni("deleteForward"),isDeleteLineBackward:Ni("deleteLineBackward"),isDeleteLineForward:Ni("deleteLineForward"),isDeleteWordBackward:Ni("deleteWordBackward"),isDeleteWordForward:Ni("deleteWordForward"),isExtendBackward:Ni("extendBackward"),isExtendForward:Ni("extendForward"),isExtendLineBackward:Ni("extendLineBackward"),isExtendLineForward:Ni("extendLineForward"),isItalic:Ni("italic"),isMoveLineBackward:Ni("moveLineBackward"),isMoveLineForward:Ni("moveLineForward"),isCtrlLeft:Ni("ctrlLeft"),isCtrlRight:Ni("ctrlRight"),isRedo:Ni("redo"),isShiftEnter:Ni("shiftEnter"),isEnter:Ni("enter"),isTransposeCharacter:Ni("transposeCharacter"),isUndo:Ni("undo"),isSpace:Ni("space"),isSelect:Ni("select"),isTab:Ni("tab"),isShiftTab:Ni("shiftTab"),isBackspace:Ni("backspace"),isCmdEnter:Ni("cmdEnter"),isCmd:Ni("cmd"),isEscape:Ni("escape"),isSlashCommand:Ni("slashCommand"),isShiftArrowUp:Ni("shiftArrowUp"),isShiftArrowDown:Ni("shiftArrowDown"),isKekceburek:Ni("kekCeburek")};const Pi={onKeyDown:function(e){return t=>{const n=Ln(e,{at:e.selection});if(!n||!n.selection)return;const r=R.parent(n.selection.anchor.path);if(Li.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(Li.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const o=S.isStart(n,n.selection.anchor,r),i=S.isEnd(n,n.selection.anchor,r);if(!o&&!i)return void e.splitBlock({slate:n,focus:!0});const l=Q({id:G()}),a=e.selection?[e.selection[0]+1]:[0];e.insertBlock(l,{at:a,slate:n,focus:!0})}else if(Li.isBackspace(t)){if(t.isDefaultPrevented())return;const r=L(e,{at:e.selection});e.blocks[(null==r?void 0:r.type)||""];const o=R.parent(n.selection.anchor.path);if(S.isStart(n,n.selection.anchor,o)){t.preventDefault();const r=S.string(n,o),i=e.selection?e.selection[0]-1:0,l=Ln(e,{at:[i]}),a=L(e,{at:[i]}),c=e.blocks[(null==a?void 0:a.type)||""];let s;if(l&&!c.hasCustomEditor&&(s=function(e,t){const[,n]=S.last(e,t);return{path:n,offset:S.string(e,n).length}}(l,o)),0===r.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:s});{if(_.isExpanded(n.selection))return D.delete(n,{at:n.selection});const t=e.selection?e.selection[0]-1:0,r=L(e,{at:[t]});if(e.blocks[(null==r?void 0:r.type)||""].hasCustomEditor)return;if(!l)return;if(0===S.string(l,[0,0]).length)return e.deleteBlock({at:[t],focus:!0,focusAt:s});const o=Array.from(S.nodes(n,{at:[0],match:e=>!S.isEditor(e)&&(j.isText(e)||S.isInline(n,e)),mode:"highest"})).map((([e])=>e));return D.insertNodes(l,o,{at:S.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:s})}}}else{if(Li.isSelect(t)){if(t.isDefaultPrevented())return;const[,r]=S.first(n,[0]),[,o]=S.last(n,[n.children.length-1]),i=S.range(n,r,o),l=_.equals(n.selection,i);if(_.isExpanded(n.selection)&&l)return t.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(Li.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Li.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Li.isArrowUp(t)){if(t.isDefaultPrevented())return;const r=R.parent(n.selection.anchor.path);if(S.isStart(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]-1]:null,r=Ln(e,{at:n}),o=L(e,{at:n});if(r&&o){const[,n]=S.last(r,[0]),i={path:n,offset:S.string(r,n).length};return t.preventDefault(),void e.focusBlock(o.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Li.isArrowDown(t)){if(t.isDefaultPrevented())return;const r=R.parent(n.selection.anchor.path);if(S.isEnd(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]+1]:null,o=Ln(e,{at:n}),i=L(e,{at:n});if(o&&i){const n=function(e,t){const[,n]=S.first(e,t);return{path:n,offset:0}}(o,r);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(_.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Bi(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Ii=({children:t,attributes:n,placeholder:r})=>{const o=x(),i=Object.assign({},n);return o&&r&&(i["data-placeholder"]=r,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Fi(e){try{return new URL(e),!0}catch(e){return!1}}const zi=(e,t)=>{(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{D.unwrapNodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,r=n&&_.isCollapsed(n),o={type:"link",children:r?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};r?D.insertNodes(e,o):(D.wrapNodes(e,o,{split:!0}),D.collapse(e,{edge:"end"}))};function Hi(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Ui={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function Vi(e,t,n){var r,o,i;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 l=n;let a=Array.from(l.childNodes).map((n=>Vi(e,t,n))).flat();if(Ui[n.nodeName]){return{[Ui[n.nodeName].type]:!0,text:null===(o=n.textContent)||void 0===o?void 0:o.replace(/[\t\n\r\f\v]+/g," ")}}if(t[n.nodeName]){const r=t[n.nodeName],o=e.blocks[r.type],l=oi(o.elements)||"",c=o.elements[l],s="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:G(),type:l,children:s&&!o.hasCustomEditor?[{text:""}]:a.map(Ki),props:Object.assign({nodeType:"block"},c.props)};if(r.parse){const e=r.parse(n);if(e)if(B.isElement(e))d=e;else if(Array.isArray(e)){return e}}0===d.children.length&&(d.children=[{text:""}]);return Q({id:G(),type:r.type,value:[d],meta:{order:0,depth:0}})}return a}function Ki(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Hi(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const Wi={html:{deserialize:function(e,t){console.log("pasted html",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);return Vi(e,n,t).filter(Hi)},serialize:function(){}},markdown:{}},Yi=({id:t,customEditor:n,elements:r,marks:o,events:i,options:l,placeholder:c="Type '/' for commands"})=>{var s,f,p;const h=z(),g=H(t),v=a(g.value).current;g.type;const y=d((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(r)),[r]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(o)),[o]),b=d((()=>{let e=h.blockEditorsMap[t];return Object.keys(r).forEach((t=>{var n;const o=null===(n=r[t].props)||void 0===n?void 0:n.nodeType,i="inline"===o,l="void"===o,a="inlineVoid"===o;a&&(e.markableVoid=e=>e.type===t),(l||a)&&(e.isVoid=e=>e.type===t),(i||a)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&Fi(t)?zi(e,t):n(t)},e.insertData=n=>{const r=n.getData("text/plain");r&&Fi(r)?zi(e,r):t(n)},e})(e))})),e}),[]),w=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Li,currentBlock:g,defaultBlock:Q({id:G()})},t={};return Object.keys(i).forEach((n=>{t[n]=function(t){if(i[n]){i[n](h,b,e)(t)}}})),t}),[i,h,g]),x=u((e=>h.updateBlock(t,{value:e})),[t]),k=u((n=>{const r=y[n.element.type];return r?e(r,Object.assign({},n,{blockId:t,HTMLAttributes:null==l?void 0:l.HTMLAttributes})):e(C,Object.assign({},n))}),[r]),O=u((t=>{var n,r,o,i,l;let{children:a,leaf:s,attributes:d}=t;const u=bi(s,["text"]),f=(null===(n=h.selection)||void 0===n?void 0:n[0])===g.meta.order;u&&Object.keys(u).forEach((e=>{const t=m[e];t&&(a=t.render({children:a,leaf:s}))}));const p=!("void"===(null===(l=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===l?void 0:l.nodeType))&&f&&s.withPlaceholder;return e(Ii,Object.assign({attributes:d,placeholder:p?c:void 0},{children:a}))}),[o]),E=u((e=>{var t;h.readOnly||(null===(t=w.onKeyDown)||void 0===t||t.call(w,e),Pi.onKeyDown(h)(e))}),[w.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],g.meta.order]),D=u((e=>{var t;h.readOnly||null===(t=null==w?void 0:w.onKeyUp)||void 0===t||t.call(w,e)}),[w.onKeyUp,h.readOnly]),R=u((e=>{var t,n;h.readOnly||((null===(t=h.selection)||void 0===t?void 0:t[0])!==g.meta.order&&h.setSelection([g.meta.order]),null===(n=null==w?void 0:w.onClick)||void 0===n||n.call(w,e))}),[w.onClick,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],g.meta.order]),j=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==w?void 0:w.onBlur)||void 0===t||t.call(w,e))}),[w.onBlur,h.readOnly]),B=u((e=>{var t;h.readOnly||null===(t=null==w?void 0:w.onFocus)||void 0===t||t.call(w,e)}),[w.onFocus,h.readOnly]),A=u((e=>{var t;if(h.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=Wi.html.deserialize(h,r.body);if(e.length>0)return void h.insertBlocks(e,{at:h.selection,focus:!0})}}),[w.onPaste,h.readOnly]),T=u((e=>{var t;const n=[];if(h.readOnly)return n;const[r,o]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===g.meta.order;return b.selection&&i&&!S.isEditor(r)&&""===S.string(b,[o[0]])&&_.includes(b.selection,o)&&_.isCollapsed(b.selection)&&n.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),n}),[h.readOnly,null===(p=h.selection)||void 0===p?void 0:p[0],g.meta.order]);return e($i,{id:t,slate:b,initialValue:v,onChange:x,decorate:T,renderLeaf:O,renderElement:k,eventHandlers:w,onKeyDown:E,onKeyUp:D,onFocus:B,onClick:R,onBlur:j,customEditor:n,readOnly:h.readOnly,onPaste:A})},$i=p((({id:t,slate:n,initialValue:r,onChange:o,renderLeaf:i,renderElement:l,eventHandlers:a,onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,onBlur:f,onPaste:p,customEditor:h,decorate:g,readOnly:v})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:n,initialValue:r,onChange:o},{children:e(O,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:l,renderLeaf:i,className:"yoopta-slate",spellCheck:!0},a,{onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,decorate:g,onBlur:f,readOnly:v,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));$i.displayName="SlateEditorInstance";const Xi=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Te(Ct,{activationConstraint:{delay:100,tolerance:0}}),Te(bt,{coordinateGetter:Rn})),handleDragEnd:u((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:u((t=>{e.setBlockSelected(null)}),[])}),Zi=[],qi=({editor:t,marks:r,placeholder:o})=>{const i=K(),{sensors:l,handleDragEnd:a,handleDragStart:c}=Xi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?Zi:s.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[s]),f=[];for(let n=0;n<u.length;n++){const i=u[n],l=t.children[i],a=t.plugins[l.type];l&&a?f.push(e(mi,Object.assign({block:l,blockId:i},{children:e(Yi,{type:l.type,id:i,marks:r,customEditor:a.customEditor,events:a.events,elements:a.elements,options:a.options,placeholder:o},i)}),i)):console.error(`Plugin ${l.type} not found`)}return i?e(n,{children:f}):e(nn,Object.assign({sensors:l,collisionDetection:He,onDragStart:c,onDragEnd:a},{children:e(mn,Object.assign({disabled:i,items:u,strategy:gn},{children:f}))}))},Gi=({editor:e,yooptaEditorRef:t,root:n})=>{const[r,o]=f({origin:[0,0],coords:[0,0],selection:!1}),i=i=>{var l;if(e.readOnly||!1===n)return;const a=null===(l=t.current)||void 0===l?void 0:l.contains(i.target);if(!a&&!r.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();a||o({origin:[i.pageX,i.pageY-window.pageYOffset],coords:[i.pageX,i.pageY-window.pageYOffset],selection:!0})},l=t=>{if(!r.selection||e.readOnly||!1===n)return;o((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const i=((e,t,n)=>{const r=[];return document.querySelectorAll(`[data-yoopta-editor-id="${e}"] [data-yoopta-block]`).forEach(((e,o)=>{if(!e)return;const i=e.getBoundingClientRect(),l=Math.min(t[1],n[1]),a=Math.min(t[0],n[0]),c=Math.max(t[1],n[1]),s=Math.max(t[0],n[0]);l<i.bottom&&c>i.top&&a<i.right&&s>i.left&&r.push(o)})),r})(e.id,r.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},a=()=>{e.readOnly||c()};s((()=>{var r;if(e.readOnly||!1===n)return;const o=n&&"current"in n?n.current:n||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===(r=t.current)||void 0===r?void 0:r.contains(o))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return o.addEventListener("mousedown",i),o.addEventListener("mousemove",l),o.addEventListener("mouseup",a),()=>{o.removeEventListener("mousedown",i),o.removeEventListener("mousemove",l),o.removeEventListener("mouseup",a)}}),[e.selectedBlocks,r,n,e.readOnly]);const c=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},r),{onClose:c})},Ji=({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("div",{style:o})},Qi={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},el=({placeholder:n,marks:r,className:o,selectionBoxRoot:i,width:l,autoFocus:c=!0})=>{const d=z(),u=K(),f=a(null),p=Gi({editor:d,yooptaEditorRef:f,root:i});let h=a(Qi).current;s((()=>{if(!c||u)return;const e=L(d,{at:[0]});e&&d.focusBlock(e.id,{waitExecution:!0})}),[c,u]),s((()=>{if(!u)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)}),[d.selectedBlocks,u]);const g=()=>{u||Array.isArray(d.selectedBlocks)&&d.selectedBlocks.length>0&&d.setBlockSelected(null)},v=()=>{h.indexToSelect=null,h.startedIndexToSelect=null,h.selectionStarted=!1},y=e=>{var t,n,r,o,i;if(!u){if(Li.isSelect(e)){if((null===(t=d.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(h.selectionStarted)return e.preventDefault(),void d.setBlockSelected([],{allSelected:!0})}if(Li.isBackspace(e)){e.stopPropagation();if(Array.isArray(d.selectedBlocks)&&(null===(n=d.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(d.children).length)return e.preventDefault(),d.deleteBlock({deleteAll:!0}),d.setBlockSelected(null),void v();if(Array.isArray(d.selectedBlocks)&&(null===(r=d.selectedBlocks)||void 0===r?void 0:r.length)>0)return e.preventDefault(),d.deleteBlock({fromPaths:d.selectedBlocks}),d.setBlockSelected(null),void v()}if(Li.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(h.selectionStarted&&null!==h.startedIndexToSelect&&null!==h.indexToSelect){const e=h.indexToSelect,t=e-1;if(0===e)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t<h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(o=d.selectedBlocks)||void 0===o?void 0:o.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const r=R.parent(n.selection.anchor.path),i=S.isStart(n,n.selection.focus,r);if(_.isExpanded(n.selection)&&i){const r=d.selection?[d.selection[0]-1]:[0],o=L(d,{at:r});t&&o&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order-1,h.selectionStarted=!0)}}if(Li.isShiftArrowDown(e)){if(h.selectionStarted&&null!==h.indexToSelect&&null!==h.startedIndexToSelect){const e=h.indexToSelect,t=e+1;if(t===Object.keys(d.children).length)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t>h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(i=d.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const r=R.parent(n.selection.anchor.path),o=S.isEnd(n,n.selection.focus,r);if(_.isExpanded(n.selection)&&o){const r=d.selection?[d.selection[0]+1]:[0],o=L(d,{at:r});t&&o&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order+1,h.selectionStarted=!0)}}}},m=(b={userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:l},Object.assign({paddingBottom:150},b));var b;return t("div",Object.assign({"data-yoopta-editor-id":d.id,className:o?`yoopta-editor ${o}`:"yoopta-editor",style:m,ref:f,onClick:e=>{u||(v(),(e=>{var t;const n=f.current;if(!n)return;const{bottom:r}=n.getBoundingClientRect(),o=r-parseInt(getComputedStyle(n).paddingBottom,10),i=Q({id:G()});if(e.clientY>=o){const e=Object.keys(d.children).length-1,n=L(d,{at:[e]}),r=Ln(d,{at:[e]});if(n&&r&&r.selection){const e=S.string(r,r.selection.anchor.path),o=R.parent(r.selection.anchor.path),[l]=S.node(r,o);if(n.type===i.type&&B.isElement(l)&&"void"!==(null===(t=l.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(n.id,{slate:r})}const o=e+1;d.insertBlock(i,{at:[o],focus:!0})}})(e),g())},onBlur:e=>{var t;(null===(t=f.current)||void 0===t?void 0:t.contains(e.relatedTarget))||u||(v(),g())}},{children:[e(qi,{editor:d,marks:r,placeholder:n}),!1!==i&&e(Ji,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!u})]}))},tl=({children:e,fallback:t=null})=>{const[n,r]=f(!1);return s((()=>r(!0)),[]),n?e:t};
6
+ var Xr=["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(","),Zr="undefined"==typeof Element,qr=Zr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gr=!Zr&&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},Jr=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)},Qr=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!Jr(l,!1))if("SLOT"===l.tagName){var a=l.assignedElements(),c=e(a.length?a:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{qr.call(l,Xr)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),d=!Jr(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&d){var u=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else i.unshift.apply(i,l.children)}}return o},eo=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},to=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))&&!eo(e)?0:e.tabIndex},no=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ro=function(e){return"INPUT"===e.tagName},oo=function(e){return function(e){return ro(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Gr(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)},io=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},lo=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=qr.call(e,"details>summary:first-of-type")?e.parentElement:e;if(qr.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return io(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,a=Gr(e);if(l&&!l.shadowRoot&&!0===r(l))return io(e);e=e.assignedSlot?e.assignedSlot:l||a===e.ownerDocument?l:a.host}e=i}if(function(e){var t,n,r,o,i=e&&Gr(e),l=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&l;){var c,s,d;a=!(null===(s=l=null===(c=i=Gr(l))||void 0===c?void 0:c.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(l))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ao=function(e,t){return!(t.disabled||Jr(t)||function(e){return ro(e)&&"hidden"===e.type}(t)||lo(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!!qr.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},co=function(e,t){return!(oo(t)||to(t)<0||!ao(e,t))},so=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},uo=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,a=function(e,t){var n=to(e);return n<0&&t&&!eo(e)?0:n}(l,i),c=i?e(t.candidates):l;0===a?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:c})})),r.sort(no).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},fo=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Qr([e],t.includeContainer,{filter:co.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:so}):function(e,t,n){if(Jr(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Xr));return t&&qr.call(e,Xr)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,co.bind(null,t)),uo(n)};const po=r["useInsertionEffect".toString()]||(e=>e());var ho="undefined"!=typeof document?c:s;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)}let vo=!1,yo=0;const mo=()=>"floating-ui-"+yo++;const bo=r["useId".toString()]||function(){const[e,t]=r.useState((()=>vo?mo():void 0));return ho((()=>{null==e&&t(mo())}),[]),r.useEffect((()=>{vo||(vo=!0)}),[]),e};const wo=r.createContext(null),xo=r.createContext(null);function ko(e){return"data-floating-ui-"+e}function Oo(e){const t=a(e);return ho((()=>{t.current=e})),t}const Co=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Eo(e,t){const n=fo(e,Co());"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 So(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&&Vn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}(n,r)}function Do(e){fo(e,Co()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Ro(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 _o={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 jo(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Bo=r.forwardRef((function(e,t){const[n,o]=r.useState();ho((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",jo),()=>{document.removeEventListener("keydown",jo)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[ko("focus-guard")]:"",style:_o};return r.createElement("span",go({},e,i))})),Ao=r.createContext(null),To=ko("portal");function Mo(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const l=function(e){let{id:t,root:n}=void 0===e?{}:e;const[o,i]=r.useState(null),l=bo(),a=No(),c=r.useRef(null);return ho((()=>()=>{null==o||o.remove(),queueMicrotask((()=>{c.current=null}))}),[o]),ho((()=>{if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=l,n.setAttribute(To,""),e.appendChild(n),c.current=n,i(n)}),[t,l]),ho((()=>{if(c.current)return;let e=n||(null==a?void 0:a.portalNode);e&&!Hn(e)&&(e=e.current),e=e||document.body;let r=null;t&&(r=document.createElement("div"),r.id=t,e.appendChild(r));const o=document.createElement("div");o.id=l,o.setAttribute(To,""),e=r||e,e.appendChild(o),c.current=o,i(o)}),[t,n,l,a]),o}({id:n,root:o}),[a,c]=r.useState(null),s=r.useRef(null),d=r.useRef(null),u=r.useRef(null),f=r.useRef(null),p=!!a&&!a.modal&&a.open&&i&&!(!o&&!l);return r.useEffect((()=>{if(l&&i&&(null==a||!a.modal))return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&So(e)){("focusin"===e.type?Ro:Do)(l)}}}),[l,i,null==a?void 0:a.modal]),r.createElement(Ao.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:l,setFocusManagerState:c})),[i,l])},p&&l&&r.createElement(Bo,{"data-type":"outside",ref:s,onFocus:e=>{if(So(e,l)){var t;null==(t=u.current)||t.focus()}else{const e=Eo(document.body,"prev")||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),p&&l&&r.createElement("span",{"aria-owns":l.id,style:_o}),l&&b(t,l),p&&l&&r.createElement(Bo,{"data-type":"outside",ref:d,onFocus:e=>{if(So(e,l)){var t;null==(t=f.current)||t.focus()}else{const t=Eo(document.body,"next")||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent))}}}))}const No=()=>r.useContext(Ao),Lo=new Set,Po=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=bo();return ho((()=>{if(!n)return;Lo.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,a=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{Lo.delete(i),0===Lo.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,a)))}}),[i,n]),r.createElement("div",go({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Io(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e,[l,a]=r.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||l,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:a}={},transform:c=!0,whileElementsMounted:s,open:d}=e,[u,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);Kr(p,o)||h(o);const[g,v]=r.useState(null),[m,b]=r.useState(null),w=r.useCallback((e=>{e!==C.current&&(C.current=e,v(e))}),[]),x=r.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),k=l||g,O=a||m,C=r.useRef(null),E=r.useRef(null),S=r.useRef(u),D=null!=s,R=$r(s),_=$r(i),j=r.useCallback((()=>{if(!C.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};_.current&&(e.platform=_.current),Ur(C.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!Kr(S.current,t)&&(S.current=t,y.flushSync((()=>{f(t)})))}))}),[p,t,n,_]);Vr((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const B=r.useRef(!1);Vr((()=>(B.current=!0,()=>{B.current=!1})),[]),Vr((()=>{if(k&&(C.current=k),O&&(E.current=O),k&&O){if(R.current)return R.current(k,O,j);j()}}),[k,O,j,R,D]);const A=r.useMemo((()=>({reference:C,floating:E,setReference:w,setFloating:x})),[w,x]),T=r.useMemo((()=>({reference:k,floating:O})),[k,O]),M=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Yr(T.floating,u.x),r=Yr(T.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Wr(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,T.floating,u.x,u.y]);return r.useMemo((()=>({...u,update:j,refs:A,elements:T,floatingStyles:M})),[u,j,A,T,M])}(e),d=r.useContext(xo),u=null!=((null==(f=r.useContext(wo))?void 0:f.id)||null);var f;const p=function(e){const t=r.useRef((()=>{}));return po((()=>{t.current=e})),r.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&&(g.current.openEvent=t),v.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==o||o(e,t,n)})),h=r.useRef(null),g=r.useRef({}),v=r.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],m=bo(),b=r.useCallback((e=>{const t=Hn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=r.useCallback((e=>{(Hn(e)||null===e)&&(h.current=e,a(e)),(Hn(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Hn(e))&&s.refs.setReference(e)}),[s.refs]),x=r.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=r.useMemo((()=>({...s.elements,domReference:c})),[s.elements,c]),O=r.useMemo((()=>({...s,refs:x,elements:k,dataRef:g,nodeId:i,floatingId:m,events:v,open:n,onOpenChange:p})),[s,i,m,v,n,p,x,k]);return ho((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=O)})),r.useMemo((()=>({...s,context:O,refs:x,elements:k})),[s,x,k,O])}const Fo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zo(e,t){return"function"==typeof e?e(t):e}function Ho(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:i=250}=t,l=("number"==typeof i?i:i.close)||0,[a,c]=r.useState(!1),[s,d]=r.useState("unmounted"),u=function(e,t){const[n,o]=r.useState(e);return e&&!n&&o(!0),r.useEffect((()=>{if(!e){const e=setTimeout((()=>o(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,l);return ho((()=>{a&&!u&&d("unmounted")}),[a,u]),ho((()=>{if(o){if(n){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),d("close")}}),[n,o]),{isMounted:u,status:s}}function Uo(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:i,common:l,duration:a=250}=t,c=e.placement,s=c.split("-")[0],d=r.useMemo((()=>({side:s,placement:c})),[s,c]),u="number"==typeof a,f=(u?a:a.open)||0,p=(u?a:a.close)||0,[h,g]=r.useState((()=>({...zo(l,d),...zo(n,d)}))),{isMounted:v,status:y}=Ho(e,{duration:a}),m=Oo(n),b=Oo(o),w=Oo(i),x=Oo(l);return ho((()=>{const e=zo(m.current,d),t=zo(w.current,d),n=zo(x.current,d),r=zo(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(r).map(Fo).join(","),transitionDuration:f+"ms",...n,...r}),"close"===y){const r=t||e;g({transitionProperty:Object.keys(r).map(Fo).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,m,b,x,f,y,d]),{isMounted:v,styles:h}}var Vo;function Ko(){return Ko=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},Ko.apply(this,arguments)}var Wo=function(e){return r.createElement("svg",Ko({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Vo||(Vo=r.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 Yo(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 $o=["color"],Xo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,$o);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Zo=["color"],qo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Zo);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Go=["color"],Jo=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Go);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),Qo=["color"],ei=g((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,o=Yo(e,Qo);return v("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),v("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))})),ti=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()}},ni={"text/plain":"Text","text/html":"Url",default:"Text"};var ri=function(e,t){var n,r,o,i,l,a,c=!1;t||(t={}),n=t.debug||!1;try{if(o=ti(),i=document.createRange(),l=document.getSelection(),(a=document.createElement("span")).textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.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=ni[t.format]||ni.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(a),i.selectNodeContents(a),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!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),c=!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{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),a&&document.body.removeChild(a),o()}return c};function oi(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ii(e){if(!e)return;const t=oi(e);return t?e[t]:void 0}const li=i(void 0),ai=({children:r,tools:o})=>{const i=K(),l=d((()=>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=d((()=>!o||i?null:Object.keys(o).map((t=>{var n,r,i;const l=null===(n=null==o?void 0:o[t])||void 0===n?void 0:n.tool,a=null===(r=null==o?void 0:o[t])||void 0===r?void 0:r.render,c=null===(i=null==o?void 0:o[t])||void 0===i?void 0:i.props;return l?e(l,Object.assign({render:a},c),t):null}))),[o]);return e(li.Provider,Object.assign({value:l},{children:t(n,{children:[a,r]})}))},ci=()=>{const e=l(li);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e};function si({editor:e,view:t,onClose:n,mode:r="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===r&&(t=t.filter((t=>function(e,t){var n;const r=e.blocks[t];if(!r)return!1;const o=ii(r.elements);return"void"!==(null===(n=null==o?void 0:o.props)||void 0===n?void 0:n.nodeType)}(e,t)))),t.map((t=>{var n,r,o,i;return{type:t,title:(null===(r=null===(n=e.blocks[t].options)||void 0===n?void 0:n.display)||void 0===r?void 0:r.title)||t,description:null===(i=null===(o=e.blocks[t].options)||void 0===o?void 0:o.display)||void 0===i?void 0:i.description}}))})(),onClose:n,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===r&&e.blocks[t].toggle({focus:!0}),"create"===r&&e.blocks[t].create({deleteText:!0,focus:!0}),n()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}const di=t=>e(Po,Object.assign({lockScroll:!0,className:t.className,onClick:t.onClick},{children:t.children})),ui=t=>{const[n,r]=f(!1),o=z();return s((()=>{r(!0)}),[]),n?e(Mo,Object.assign({id:`${t.id}-${o.id}`,root:document.querySelector(`[data-yoopta-editor-id="${o.id}"]`)},{children:t.children})):null},fi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-group"},{children:t})),pi=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoopta-block-options-menu-content data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),hi=({children:t})=>e("div",Object.assign({className:"yoopta-block-options-item"},{children:t})),gi=({isOpen:n,onClose:r,refs:o,style:i,children:l})=>{var a,c;const s=z(),d=ci(),[u,p]=f(!1),{refs:h,floatingStyles:g,context:v}=Io({placement:"right",open:u,onOpenChange:p,middleware:[Hr(),zr(),Fr(),kr(10)],whileElementsMounted:Ir}),{isMounted:y,styles:m}=Uo(v,{duration:100});if(!n)return null;const b=L(s,{at:s.selection}),w=ii(s.blocks[(null==b?void 0:b.type)||""].elements),x="void"===(null===(a=null==w?void 0:w.props)||void 0===a?void 0:a.nodeType),k=d.ActionMenu,O=Object.assign(Object.assign({},g),m),C=si({editor:s,view:"small",onClose:()=>{p(!1),r()}});return e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:r},{children:e("div",Object.assign({style:i,ref:o.setFloating},{children:t(pi,{children:[t(fi,{children:[e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),r()}},{children:[e(ei,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),r()}},{children:[e(Xo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!k&&!x&&!(null===(c=s.blocks[(null==b?void 0:b.type)||""])||void 0===c?void 0:c.hasCustomEditor)&&t(hi,{children:[y&&e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>p(!1)},{children:e("div",Object.assign({style:O,ref:h.setFloating},{children:e(k,Object.assign({},C))}))}))})),t("button",Object.assign({type:"button",className:"yoopta-block-options-button",ref:h.setReference,onClick:()=>p((e=>!e))},{children:[e(Wo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(hi,{children:t("button",Object.assign({type:"button",className:"yoopta-block-options-button",onClick:()=>{const e=L(s);e&&(ri(`${window.location.origin}${window.location.pathname}#${e.id}`),s.emit("block:copy",e)),r()}},{children:[e(Jo,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),l]})}))}))}))};var vi=Object.freeze({__proto__:null,BlockOptions:gi,BlockOptionsMenuContent:pi,BlockOptionsMenuGroup:fi,BlockOptionsMenuItem:hi,BlockOptionsSeparator:({className:t=""})=>e("div",{className:`yoopta-block-options-separator ${t}`})});const yi=({block:n,editor:r,dragHandleProps:o,onChangeActiveBlock:i,showActions:l})=>{const[a,c]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:g,actionMenuRenderProps:v,ActionMenu:y}=(({editor:e})=>{const t=ci().ActionMenu,[n,r]=f(!1),{refs:o,floatingStyles:i,context:l}=Io({placement:"bottom-start",open:n,onOpenChange:r,middleware:[Hr(),zr(),Fr(),kr(10)],whileElementsMounted:Ir}),{isMounted:a,styles:c}=Uo(l,{duration:100}),s=Object.assign(Object.assign({},i),c),d=e=>r(e),u=()=>d(!1),p=si({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:a,actionMenuStyles:s,actionMenuRefs:o,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:r}),{refs:m,floatingStyles:b,context:x}=Io({placement:"right-start",open:a,onOpenChange:c,middleware:[Hr(),zr(),Fr(),kr()]}),{isMounted:k,styles:O}=Uo(x,{duration:100}),{setActivatorNodeRef:C,attributes:E,listeners:R}=o,_=Object.assign(Object.assign({},b),O);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":l,className:"yoopta-block-actions"},{children:[s&&u&&e(ui,Object.assign({id:"yoo-block-options-portal"},{children:e(di,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:g},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(y,Object.assign({},v))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=Ln(r,{at:[n.meta.order]}),o=r.blocks[n.type];if(!t)return;const i=document.querySelector(`[data-yoopta-block-id="${n.id}"]`),l=ii(o.elements);let a;o.hasCustomEditor||(a=S.string(t,[0]));const c="string"==typeof a&&0===a.trim().length;if(u&&c&&"void"!==(null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.nodeType))r.setSelection([n.meta.order]),r.focusBlock(n.id),d.setReference(i),h(!0);else{const e=Q({id:G()}),t=[n.meta.order+1];r.setSelection([n.meta.order]),r.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{i&&d.setReference(i.nextSibling),h(!0)}),0)}},className:"yoopta-block-actions-plus"},{children:e(Nn,{})})),e("button",Object.assign({type:"button",className:"yoopta-block-actions-drag",ref:e=>{C(e),m.setReference(e)}},E,R,{onClick:e=>{e.stopPropagation(),i(n.id);const t=Ln(r,{at:[n.meta.order]});r.focusBlock(n.id),t&&setTimeout((()=>{r.blocks[n.type].hasCustomEditor||(w.blur(t),w.deselect(t),D.deselect(t)),r.setBlockSelected([n.meta.order],{only:!0}),r.setSelection([n.meta.order]),c(!0)}),10)}},{children:e(Tn,{})})),e(gi,{isOpen:k,refs:m,style:_,onClose:()=>c(!1)})]}))},mi=({children:n,block:r,blockId:o})=>{var i;const l=z(),[a,c]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:g,isOver:v,isDragging:y}=En({id:o,disabled:l.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:g,opacity:y?.7:1,marginLeft:20*r.meta.depth+"px"},b=null===(i=l.selectedBlocks)||void 0===i?void 0:i.includes(r.meta.order),w=a===o,x={borderBottom:v&&!y?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:"yoopta-block",onMouseEnter:()=>{l.readOnly||c(o)},onMouseLeave:()=>{l.readOnly||c(null)},style:m,"data-hovered-block":w,"data-yoopta-block":!0,"data-yoopta-block-id":o,"data-yoopta-block-type":r.type},{children:[!l.readOnly&&e(yi,{block:r,editor:l,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:w,onChangeActiveBlock:e=>c(e)}),e("div",Object.assign({style:x},{children:n})),b&&!l.readOnly&&e("div",{className:"yoopta-selection-block"})]}))};function bi(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 wi={};Object.defineProperty(wi,"__esModule",{value:!0});for(var xi="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),ki={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},Oi={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:xi?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Ci={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},Ei=1;Ei<20;Ei++)Ci["f"+Ei]=111+Ei;function Si(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return Di(e,t)})),o=function(e){return r.some((function(t){return Ri(t,e)}))};return null==n?o:o(n)}function Di(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var l in ki)r[ki[l]]=!1;var a=!0,c=!1,s=void 0;try{for(var d,u=o[Symbol.iterator]();!(a=(d=u.next()).done);a=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=ji(f),g=ki[h];if(f.length>1&&!g&&!Oi[f]&&!Ci[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&g||(n?r.key=h:r.which=_i(f)),g&&(r[g]=!p||null)}}catch(e){c=!0,s=e}finally{try{!a&&u.return&&u.return()}finally{if(c)throw s}}return r}function Ri(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 _i(e){return e=ji(e),Ci[e]||e.toUpperCase().charCodeAt(0)}function ji(e){return e=e.toLowerCase(),e=Oi[e]||e}wi.default=Si,wi.isHotkey=Si,wi.isCodeHotkey=function(e,t){return Si(e,t)};var Bi=wi.isKeyHotkey=function(e,t){return Si(e,{byKey:!0},t)};wi.parseHotkey=Di,wi.compareHotkey=Ri,wi.toKeyCode=_i,wi.toKeyName=ji;const Ai={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"},Ti={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"},Mi={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ni=e=>{const t=Ai[e],n=Ti[e],r=Mi[e],o=t&&Bi(t),i=n&&Bi(n),l=r&&Bi(r);return e=>!(!o||!o(e))||(!(!i||!i(e))||!(!l||!l(e)))},Li={isBold:Ni("bold"),isCompose:Ni("compose"),isArrowLeft:Ni("arrowLeft"),isArrowRight:Ni("arrowRight"),isArrowUp:Ni("arrowUp"),isArrowDown:Ni("arrowDown"),isDeleteBackward:Ni("deleteBackward"),isDeleteForward:Ni("deleteForward"),isDeleteLineBackward:Ni("deleteLineBackward"),isDeleteLineForward:Ni("deleteLineForward"),isDeleteWordBackward:Ni("deleteWordBackward"),isDeleteWordForward:Ni("deleteWordForward"),isExtendBackward:Ni("extendBackward"),isExtendForward:Ni("extendForward"),isExtendLineBackward:Ni("extendLineBackward"),isExtendLineForward:Ni("extendLineForward"),isItalic:Ni("italic"),isMoveLineBackward:Ni("moveLineBackward"),isMoveLineForward:Ni("moveLineForward"),isCtrlLeft:Ni("ctrlLeft"),isCtrlRight:Ni("ctrlRight"),isRedo:Ni("redo"),isShiftEnter:Ni("shiftEnter"),isEnter:Ni("enter"),isTransposeCharacter:Ni("transposeCharacter"),isUndo:Ni("undo"),isSpace:Ni("space"),isSelect:Ni("select"),isTab:Ni("tab"),isShiftTab:Ni("shiftTab"),isBackspace:Ni("backspace"),isCmdEnter:Ni("cmdEnter"),isCmd:Ni("cmd"),isEscape:Ni("escape"),isSlashCommand:Ni("slashCommand"),isShiftArrowUp:Ni("shiftArrowUp"),isShiftArrowDown:Ni("shiftArrowDown"),isKekceburek:Ni("kekCeburek")};const Pi={onKeyDown:function(e){return t=>{const n=Ln(e,{at:e.selection});if(!n||!n.selection)return;const r=R.parent(n.selection.anchor.path);if(Li.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void n.insertText("\n")}if(Li.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const o=S.isStart(n,n.selection.anchor,r),i=S.isEnd(n,n.selection.anchor,r);if(!o&&!i)return void e.splitBlock({slate:n,focus:!0});const l=Q({id:G()}),a=e.selection?[e.selection[0]+1]:[0];e.insertBlock(l,{at:a,slate:n,focus:!0})}else if(Li.isBackspace(t)){if(t.isDefaultPrevented())return;const r=L(e,{at:e.selection});e.blocks[(null==r?void 0:r.type)||""];const o=R.parent(n.selection.anchor.path);if(S.isStart(n,n.selection.anchor,o)){t.preventDefault();const r=S.string(n,o),i=e.selection?e.selection[0]-1:0,l=Ln(e,{at:[i]}),a=L(e,{at:[i]}),c=e.blocks[(null==a?void 0:a.type)||""];let s;if(l&&!c.hasCustomEditor&&(s=function(e,t){const[,n]=S.last(e,t);return{path:n,offset:S.string(e,n).length}}(l,o)),0===r.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:s});{if(_.isExpanded(n.selection))return D.delete(n,{at:n.selection});const t=e.selection?e.selection[0]-1:0,r=L(e,{at:[t]});if(e.blocks[(null==r?void 0:r.type)||""].hasCustomEditor)return;if(!l)return;if(0===S.string(l,[0,0]).length)return e.deleteBlock({at:[t],focus:!0,focusAt:s});const o=Array.from(S.nodes(n,{at:[0],match:e=>!S.isEditor(e)&&(j.isText(e)||S.isInline(n,e)),mode:"highest"})).map((([e])=>e));return D.insertNodes(l,o,{at:S.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:s})}}}else{if(Li.isSelect(t)){if(t.isDefaultPrevented())return;const[,r]=S.first(n,[0]),[,o]=S.last(n,[n.children.length-1]),i=S.range(n,r,o),l=_.equals(n.selection,i);if(_.isExpanded(n.selection)&&l)return t.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),void e.setBlockSelected([],{allSelected:!0})}if(Li.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Li.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Li.isArrowUp(t)){if(t.isDefaultPrevented())return;const r=R.parent(n.selection.anchor.path);if(S.isStart(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]-1]:null,r=Ln(e,{at:n}),o=L(e,{at:n});if(r&&o){const[,n]=S.last(r,[0]),i={path:n,offset:S.string(r,n).length};return t.preventDefault(),void e.focusBlock(o.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Li.isArrowDown(t)){if(t.isDefaultPrevented())return;const r=R.parent(n.selection.anchor.path);if(S.isEnd(n,n.selection.anchor,r)){const n=e.selection?[e.selection[0]+1]:null,o=Ln(e,{at:n}),i=L(e,{at:n});if(o&&i){const n=function(e,t){const[,n]=S.first(e,t);return{path:n,offset:0}}(o,r);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:n,waitExecution:!1})}}}if(_.isExpanded(n.selection)){if(Object.values(e.formats).length>0)for(const n of Object.values(e.formats))if(n.hotkey&&Bi(n.hotkey)(t)){t.preventDefault(),e.formats[n.type].toggle();break}}}}}},Ii=({children:t,attributes:n,placeholder:r})=>{const o=x(),i=Object.assign({},n);return o&&r&&(i["data-placeholder"]=r,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Fi(e){try{return new URL(e),!0}catch(e){return!1}}const zi=(e,t)=>{(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{D.unwrapNodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type})})(e);const{selection:n}=e,r=n&&_.isCollapsed(n),o={type:"link",children:r?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noopener noreferrer"}};r?D.insertNodes(e,o):(D.wrapNodes(e,o,{split:!0}),D.collapse(e,{edge:"end"}))};function Hi(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const Ui={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function Vi(e,t,n){var r,o,i;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 l=n;let a=Array.from(l.childNodes).map((n=>Vi(e,t,n))).flat();if(Ui[n.nodeName]){return{[Ui[n.nodeName].type]:!0,text:null===(o=n.textContent)||void 0===o?void 0:o.replace(/[\t\n\r\f\v]+/g," ")}}if(t[n.nodeName]){const r=t[n.nodeName],o=e.blocks[r.type],l=oi(o.elements)||"",c=o.elements[l],s="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:G(),type:l,children:s&&!o.hasCustomEditor?[{text:""}]:a.map(Ki),props:Object.assign({nodeType:"block"},c.props)};if(r.parse){const e=r.parse(n);if(e)if(B.isElement(e))d=e;else if(Array.isArray(e)){return e}}0===d.children.length&&(d.children=[{text:""}]);return Q({id:G(),type:r.type,value:[d],meta:{order:0,depth:0}})}return a}function Ki(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Hi(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const Wi={html:{deserialize:function(e,t){console.log("pasted html",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);return Vi(e,n,t).filter(Hi)},serialize:function(){}},markdown:{}},Yi=({id:t,customEditor:n,elements:r,marks:o,events:i,options:l,placeholder:c="Type '/' for commands"})=>{var s,f,p;const h=z(),g=H(t),v=a(g.value).current;g.type;const y=d((()=>(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].render)),t})(r)),[r]),m=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(o)),[o]),b=d((()=>{let e=h.blockEditorsMap[t];return Object.keys(r).forEach((t=>{var n;const o=null===(n=r[t].props)||void 0===n?void 0:n.nodeType,i="inline"===o,l="void"===o,a="inlineVoid"===o;a&&(e.markableVoid=e=>e.type===t),(l||a)&&(e.isVoid=e=>e.type===t),(i||a)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:n}=e;return e.insertText=t=>{t&&Fi(t)?zi(e,t):n(t)},e.insertData=n=>{const r=n.getData("text/plain");r&&Fi(r)?zi(e,r):t(n)},e})(e))})),e}),[]),w=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Li,currentBlock:g,defaultBlock:Q({id:G()})},t={};return Object.keys(i).forEach((n=>{t[n]=function(t){if(i[n]){i[n](h,b,e)(t)}}})),t}),[i,h,g]),x=u((e=>h.updateBlock(t,{value:e})),[t]),k=u((n=>{const r=y[n.element.type];return r?e(r,Object.assign({},n,{blockId:t,HTMLAttributes:null==l?void 0:l.HTMLAttributes})):e(C,Object.assign({},n))}),[r]),O=u((t=>{var n,r,o,i,l;let{children:a,leaf:s,attributes:d}=t;const u=bi(s,["text"]),f=(null===(n=h.selection)||void 0===n?void 0:n[0])===g.meta.order;u&&Object.keys(u).forEach((e=>{const t=m[e];t&&(a=t.render({children:a,leaf:s}))}));const p=!("void"===(null===(l=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===l?void 0:l.nodeType))&&f&&s.withPlaceholder;return e(Ii,Object.assign({attributes:d,placeholder:p?c:void 0},{children:a}))}),[o]),E=u((e=>{var t;h.readOnly||(null===(t=w.onKeyDown)||void 0===t||t.call(w,e),Pi.onKeyDown(h)(e))}),[w.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],g.meta.order]),D=u((e=>{var t;h.readOnly||null===(t=null==w?void 0:w.onKeyUp)||void 0===t||t.call(w,e)}),[w.onKeyUp,h.readOnly]),R=u((e=>{var t,n;h.readOnly||((null===(t=h.selection)||void 0===t?void 0:t[0])!==g.meta.order&&h.setSelection([g.meta.order]),null===(n=null==w?void 0:w.onClick)||void 0===n||n.call(w,e))}),[w.onClick,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],g.meta.order]),j=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==w?void 0:w.onBlur)||void 0===t||t.call(w,e))}),[w.onBlur,h.readOnly]),B=u((e=>{var t;h.readOnly||null===(t=null==w?void 0:w.onFocus)||void 0===t||t.call(w,e)}),[w.onFocus,h.readOnly]),A=u((e=>{var t;if(h.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=Wi.html.deserialize(h,r.body);if(e.length>0)return void h.insertBlocks(e,{at:h.selection,focus:!0})}}),[w.onPaste,h.readOnly]),T=u((e=>{var t;const n=[];if(h.readOnly)return n;const[r,o]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===g.meta.order;return b.selection&&i&&!S.isEditor(r)&&""===S.string(b,[o[0]])&&_.includes(b.selection,o)&&_.isCollapsed(b.selection)&&n.push(Object.assign(Object.assign({},b.selection),{withPlaceholder:!0})),n}),[h.readOnly,null===(p=h.selection)||void 0===p?void 0:p[0],g.meta.order]);return e($i,{id:t,slate:b,initialValue:v,onChange:x,decorate:T,renderLeaf:O,renderElement:k,eventHandlers:w,onKeyDown:E,onKeyUp:D,onFocus:B,onClick:R,onBlur:j,customEditor:n,readOnly:h.readOnly,onPaste:A})},$i=p((({id:t,slate:n,initialValue:r,onChange:o,renderLeaf:i,renderElement:l,eventHandlers:a,onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,onBlur:f,onPaste:p,customEditor:h,decorate:g,readOnly:v})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:n,initialValue:r,onChange:o},{children:e(O,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:l,renderLeaf:i,className:"yoopta-slate",spellCheck:!0},a,{onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,decorate:g,onBlur:f,readOnly:v,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));$i.displayName="SlateEditorInstance";const Xi=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Te(Ct,{activationConstraint:{distance:20}}),Te(bt,{coordinateGetter:Rn})),handleDragEnd:u((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:u((t=>{e.setBlockSelected(null)}),[])}),Zi=[],qi=({editor:t,marks:r,placeholder:o})=>{const i=K(),{sensors:l,handleDragEnd:a,handleDragStart:c}=Xi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?Zi:s.sort(((e,n)=>t.children[e].meta.order-t.children[n].meta.order))),[s]),f=[];for(let n=0;n<u.length;n++){const i=u[n],l=t.children[i],a=t.plugins[l.type];l&&a?f.push(e(mi,Object.assign({block:l,blockId:i},{children:e(Yi,{type:l.type,id:i,marks:r,customEditor:a.customEditor,events:a.events,elements:a.elements,options:a.options,placeholder:o},i)}),i)):console.error(`Plugin ${l.type} not found`)}return i?e(n,{children:f}):e(nn,Object.assign({sensors:l,collisionDetection:He,onDragStart:c,onDragEnd:a},{children:e(mn,Object.assign({disabled:i,items:u,strategy:gn},{children:f}))}))},Gi=({editor:e,yooptaEditorRef:t,root:n})=>{const[r,o]=f({origin:[0,0],coords:[0,0],selection:!1}),i=i=>{var l;if(e.readOnly||!1===n)return;const a=null===(l=t.current)||void 0===l?void 0:l.contains(i.target);if(!a&&!r.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();a||o({origin:[i.pageX,i.pageY-window.pageYOffset],coords:[i.pageX,i.pageY-window.pageYOffset],selection:!0})},l=t=>{if(!r.selection||e.readOnly||!1===n)return;o((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const i=((e,t,n)=>{const r=[];return document.querySelectorAll(`[data-yoopta-editor-id="${e}"] [data-yoopta-block]`).forEach(((e,o)=>{if(!e)return;const i=e.getBoundingClientRect(),l=Math.min(t[1],n[1]),a=Math.min(t[0],n[0]),c=Math.max(t[1],n[1]),s=Math.max(t[0],n[0]);l<i.bottom&&c>i.top&&a<i.right&&s>i.left&&r.push(o)})),r})(e.id,r.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},a=()=>{e.readOnly||c()};s((()=>{var r;if(e.readOnly||!1===n)return;const o=n&&"current"in n?n.current:n||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===(r=t.current)||void 0===r?void 0:r.contains(o))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return o.addEventListener("mousedown",i),o.addEventListener("mousemove",l),o.addEventListener("mouseup",a),()=>{o.removeEventListener("mousedown",i),o.removeEventListener("mousemove",l),o.removeEventListener("mouseup",a)}}),[e.selectedBlocks,r,n,e.readOnly]);const c=()=>{o({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},r),{onClose:c})},Ji=({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("div",{style:o})},Qi={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},el=({placeholder:n,marks:r,className:o,selectionBoxRoot:i,width:l,autoFocus:c=!0})=>{const d=z(),u=K(),f=a(null),p=Gi({editor:d,yooptaEditorRef:f,root:i});let h=a(Qi).current;s((()=>{if(!c||u)return;const e=L(d,{at:[0]});e&&d.focusBlock(e.id,{waitExecution:!0})}),[c,u]),s((()=>{if(!u)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)}),[d.selectedBlocks,u]);const g=()=>{u||Array.isArray(d.selectedBlocks)&&d.selectedBlocks.length>0&&d.setBlockSelected(null)},v=()=>{h.indexToSelect=null,h.startedIndexToSelect=null,h.selectionStarted=!1},y=e=>{var t,n,r,o,i;if(!u){if(Li.isSelect(e)){if((null===(t=d.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(h.selectionStarted)return e.preventDefault(),void d.setBlockSelected([],{allSelected:!0})}if(Li.isBackspace(e)){e.stopPropagation();if(Array.isArray(d.selectedBlocks)&&(null===(n=d.selectedBlocks)||void 0===n?void 0:n.length)===Object.keys(d.children).length)return e.preventDefault(),d.deleteBlock({deleteAll:!0}),d.setBlockSelected(null),void v();if(Array.isArray(d.selectedBlocks)&&(null===(r=d.selectedBlocks)||void 0===r?void 0:r.length)>0)return e.preventDefault(),d.deleteBlock({fromPaths:d.selectedBlocks}),d.setBlockSelected(null),void v()}if(Li.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(h.selectionStarted&&null!==h.startedIndexToSelect&&null!==h.indexToSelect){const e=h.indexToSelect,t=e-1;if(0===e)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t<h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(o=d.selectedBlocks)||void 0===o?void 0:o.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const r=R.parent(n.selection.anchor.path),i=S.isStart(n,n.selection.focus,r);if(_.isExpanded(n.selection)&&i){const r=d.selection?[d.selection[0]-1]:[0],o=L(d,{at:r});t&&o&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order-1,h.selectionStarted=!0)}}if(Li.isShiftArrowDown(e)){if(h.selectionStarted&&null!==h.indexToSelect&&null!==h.startedIndexToSelect){const e=h.indexToSelect,t=e+1;if(t===Object.keys(d.children).length)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t>h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(i=d.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==h.startedIndexToSelect){const n=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(n,{only:!0}),void(h.indexToSelect=t)}return}const t=L(d),n=Ln(d);if(!n||!n.selection||!t)return;const r=R.parent(n.selection.anchor.path),o=S.isEnd(n,n.selection.focus,r);if(_.isExpanded(n.selection)&&o){const r=d.selection?[d.selection[0]+1]:[0],o=L(d,{at:r});t&&o&&(e.preventDefault(),w.blur(n),w.deselect(n),D.deselect(n),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order+1,h.selectionStarted=!0)}}}},m=(b={userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:l},Object.assign({paddingBottom:150},b));var b;return t("div",Object.assign({"data-yoopta-editor-id":d.id,className:o?`yoopta-editor ${o}`:"yoopta-editor",style:m,ref:f,onClick:e=>{u||(v(),(e=>{var t;const n=f.current;if(!n)return;const{bottom:r}=n.getBoundingClientRect(),o=r-parseInt(getComputedStyle(n).paddingBottom,10),i=Q({id:G()});if(e.clientY>=o){const e=Object.keys(d.children).length-1,n=L(d,{at:[e]}),r=Ln(d,{at:[e]});if(n&&r&&r.selection){const e=S.string(r,r.selection.anchor.path),o=R.parent(r.selection.anchor.path),[l]=S.node(r,o);if(n.type===i.type&&B.isElement(l)&&"void"!==(null===(t=l.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(n.id,{slate:r})}const o=e+1;d.insertBlock(i,{at:[o],focus:!0})}})(e),g())},onBlur:e=>{var t;(null===(t=f.current)||void 0===t?void 0:t.contains(e.relatedTarget))||u||(v(),g())}},{children:[e(qi,{editor:d,marks:r,placeholder:n}),!1!==i&&e(Ji,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!u})]}))},tl=({children:e,fallback:t=null})=>{const[n,r]=f(!1);return s((()=>r(!0)),[]),n?e:t};
7
7
  /*!
8
8
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
9
9
  *
10
10
  * Copyright (c) 2014-2017, Jon Schlinkert.
11
11
  * Released under the MIT License.
12
12
  */
13
- function nl(e){return"[object Object]"===Object.prototype.toString.call(e)}var rl={isHistory(e){return!1!==nl(t=e)&&(void 0===(n=t.constructor)||!1!==nl(r=n.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||A.isOperationList(e.redos[0].operations))&&(0===e.undos.length||A.isOperationList(e.undos[0].operations));var t,n,r}},ol=new WeakMap,il=new WeakMap,ll={isHistoryEditor:e=>rl.isHistory(e.history)&&S.isEditor(e),isMerging:e=>il.get(e),isSaving:e=>ol.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=ll.isMerging(e);il.set(e,!1),t(),il.set(e,n)},withoutSaving(e,t){var n=ll.isSaving(e);ol.set(e,!1),t(),ol.set(e,n)}},al=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];r.selectionBefore&&D.setSelection(t,r.selectionBefore),ll.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{for(var e of r.operations)t.apply(e)}))})),e.redos.pop(),t.writeHistory("undos",r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];ll.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{var e=r.operations.map(A.inverse).reverse();for(var n of e)t.apply(n);r.selectionBefore&&D.setSelection(t,r.selectionBefore)}))})),t.writeHistory("redos",r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:o}=t,{undos:i}=o,l=i[i.length-1],a=l&&l.operations[l.operations.length-1],c=ll.isSaving(t),s=ll.isMerging(t);if(null==c&&(c=sl(e)),c){if(null==s&&(s=null!=l&&(0!==r.length||cl(e,a))),l&&s)l.operations.push(e);else{var d={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;i.length>100;)i.shift();o.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t},cl=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!R.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!R.equals(e.path,t.path)),sl=(e,t)=>"set_selection"!==e.type,dl=Symbol.for("immer-nothing"),ul=Symbol.for("immer-draftable"),fl=Symbol.for("immer-state");function pl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var hl=Object.getPrototypeOf;function gl(e){return!!e&&!!e[fl]}function vl(e){return!!e&&(ml(e)||Array.isArray(e)||!!e[ul]||!!e.constructor?.[ul]||Ol(e)||Cl(e))}var yl=Object.prototype.constructor.toString();function ml(e){if(!e||"object"!=typeof e)return!1;const t=hl(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)===yl}function bl(e,t){0===wl(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function wl(e){const t=e[fl];return t?t.type_:Array.isArray(e)?1:Ol(e)?2:Cl(e)?3:0}function xl(e,t){return 2===wl(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function kl(e,t,n){const r=wl(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Ol(e){return e instanceof Map}function Cl(e){return e instanceof Set}function El(e){return e.copy_||e.base_}function Sl(e,t){if(Ol(e))return new Map(e);if(Cl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&ml(e)){if(!hl(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[fl];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(hl(e),n)}function Dl(e,t=!1){return _l(e)||gl(e)||!vl(e)||(wl(e)>1&&(e.set=e.add=e.clear=e.delete=Rl),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Dl(t,!0)))),e}function Rl(){pl(2)}function _l(e){return Object.isFrozen(e)}var jl,Bl={};function Al(e){const t=Bl[e];return t||pl(0),t}function Tl(){return jl}function Ml(e,t){t&&(Al("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Nl(e){Ll(e),e.drafts_.forEach(Il),e.drafts_=null}function Ll(e){e===jl&&(jl=e.parent_)}function Pl(e){return jl={drafts_:[],parent_:jl,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Il(e){const t=e[fl];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Fl(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[fl].modified_&&(Nl(t),pl(4)),vl(e)&&(e=zl(t,e),t.parent_||Ul(t,e)),t.patches_&&Al("Patches").generateReplacementPatches_(n[fl].base_,e,t.patches_,t.inversePatches_)):e=zl(t,n,[]),Nl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==dl?e:void 0}function zl(e,t,n){if(_l(t))return t;const r=t[fl];if(!r)return bl(t,((o,i)=>Hl(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Ul(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),bl(o,((o,l)=>Hl(e,r,t,o,l,n,i))),Ul(e,t,!1),n&&e.patches_&&Al("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Hl(e,t,n,r,o,i,l){if(gl(o)){const l=zl(e,o,i&&t&&3!==t.type_&&!xl(t.assigned_,r)?i.concat(r):void 0);if(kl(n,r,l),!gl(l))return;e.canAutoFreeze_=!1}else l&&n.add(o);if(vl(o)&&!_l(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;zl(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||Ul(e,o)}}function Ul(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Dl(t,n)}var Vl={get(e,t){if(t===fl)return e;const n=El(e);if(!xl(n,t))return function(e,t,n){const r=Yl(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_||!vl(r)?r:r===Wl(e.base_,t)?(Xl(e),e.copy_[t]=Zl(r,e)):r},has:(e,t)=>t in El(e),ownKeys:e=>Reflect.ownKeys(El(e)),set(e,t,n){const r=Yl(El(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Wl(El(e),t),l=r?.[fl];if(l&&l.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||xl(e.base_,t)))return!0;Xl(e),$l(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!==Wl(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Xl(e),$l(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=El(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){pl(11)},getPrototypeOf:e=>hl(e.base_),setPrototypeOf(){pl(12)}},Kl={};function Wl(e,t){const n=e[fl];return(n?El(n):e)[t]}function Yl(e,t){if(!(t in e))return;let n=hl(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=hl(n)}}function $l(e){e.modified_||(e.modified_=!0,e.parent_&&$l(e.parent_))}function Xl(e){e.copy_||(e.copy_=Sl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}bl(Vl,((e,t)=>{Kl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Kl.deleteProperty=function(e,t){return Kl.set.call(this,e,t,void 0)},Kl.set=function(e,t,n){return Vl.set.call(this,e[0],t,n,e[0])};function Zl(e,t){const n=Ol(e)?Al("MapSet").proxyMap_(e,t):Cl(e)?Al("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Tl(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Vl;n&&(o=[r],i=Kl);const{revoke:l,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=l,a}(e,t);return(t?t.scope_:Tl()).drafts_.push(n),n}function ql(e){if(!vl(e)||_l(e))return e;const t=e[fl];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Sl(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Sl(e,!0);return bl(n,((e,t)=>{kl(n,e,ql(t))})),t&&(t.finalized_=!1),n}var Gl=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&&pl(6),void 0!==n&&"function"!=typeof n&&pl(7),vl(e)){const o=Pl(this),i=Zl(e,void 0);let l=!0;try{r=t(i),l=!1}finally{l?Nl(o):Ll(o)}return Ml(o,n),Fl(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===dl&&(r=void 0),this.autoFreeze_&&Dl(r,!0),n){const t=[],o=[];Al("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}pl(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){vl(e)||pl(8),gl(e)&&(e=function(e){gl(e)||pl(10);return ql(e)}(e));const t=Pl(this),n=Zl(e,void 0);return n[fl].isManual_=!0,Ll(t),n}finishDraft(e,t){const n=e&&e[fl];n&&n.isManual_||pl(9);const{scope_:r}=n;return Ml(r,t),Fl(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=Al("Patches").applyPatches_;return gl(e)?r(e,t):this.produce(e,(e=>r(e,t)))}};Gl.produce,Gl.produceWithPatches.bind(Gl),Gl.setAutoFreeze.bind(Gl),Gl.setUseStrictShallowCopy.bind(Gl),Gl.applyPatches.bind(Gl);var Jl=Gl.createDraft.bind(Gl),Ql=Gl.finishDraft.bind(Gl);function ea(e,t){const n=Ln(e);if(!n)return!1;const r=S.marks(n);return!!(null==r?void 0:r[t])}const ta=(e,t)=>{const{insertText:n}=t;return t.insertText=r=>{var o;const{selection:i}=t;if(" "===r&&i&&_.isCollapsed(i)){const{anchor:l}=i,a=S.above(t,{match:e=>B.isElement(e)&&S.isBlock(t,e),mode:"lowest"});if(!a)return;const[,c]=a,s=S.parent(t,c),[d]=s;if(B.isElement(d)&&!j.isText(d.children[0]))return n(r);const u=a?c:[],f={anchor:l,focus:S.start(t,u)},p=S.string(t,f),h=null===(o=e.shortcuts)||void 0===o?void 0:o[p];if(!!h&&!h.isActive())return D.select(t,f),D.delete(t),void h.create({deleteText:!1})}n(r)},t};function na(e,t,n){e.children=Jl(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=Ql(e.children),r&&e.applyChanges(),e.emit("change",e.children)}const ra="Paragraph";function oa(e,t,n){e.children=Jl(e.children);const r=L(e,{at:(null==n?void 0:n.at)||e.selection});if(!r)throw new Error("Block from not found at current selection");let o=t;r.type===o&&(o=ra);const i=Ln(e,{at:[r.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${r.meta.order}`);const l=oi(e.blocks[o].elements);S.withoutNormalizing(i,(()=>{D.setNodes(i,{type:l},{at:[0],mode:"lowest",match:e=>B.isElement(e)&&!S.isInline(i,e)}),(null==n?void 0:n.deleteText)&&D.delete(i,{at:[0,0]});const t={id:r.id,type:o,meta:Object.assign(Object.assign({},r.meta),{order:r.meta.order}),value:i.children};e.blockEditorsMap[r.id]=i,e.children[r.id]=t,e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(t.id,{slate:i})}))}function ia(e,t={}){const{at:n=e.selection,deleteAll:r=!1,fromPaths:o,focus:i}=t;if(Array.isArray(o)&&o.length>0){e.children=Jl(e.children),o.forEach((t=>{const n=L(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=Ql(e.children),e.applyChanges(),void e.emit("change",e.children)}if(r||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=Q({id:G()}),n=sa(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=Jl(e.children);const[l]=n,a=Object.keys(e.children),c=a.find((t=>e.children[t].meta.order===l));if(a.forEach((t=>{const n=e.children[t];n.meta.order>l&&(n.meta.order-=1)})),c&&(delete e.children[c],delete e.blockEditorsMap[c]),e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),i){const n=e.selection?e.selection[0]-1:0,r=L(e,{at:[n]});r&&e.focusBlock(r.id,{focusAt:t.focusAt})}}function la(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=Ln(e);if(!n)return null;const r=S.marks(n);return null==r?void 0:r[t]}(e,r),isActive:()=>ea(e,r),toggle:()=>function(e,t){const n=Ln(e),r=ea(e,t);n&&(r?S.removeMark(n,t):S.addMark(n,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,r),update:t=>function(e,t,n){const r=Ln(e);r&&r.selection&&_.isExpanded(r.selection)&&(S.addMark(r,t,n),e.applyChanges(),e.emit("change",e.children))}(e,r,t)}})),n}function aa(e,t){const n={};return t.forEach(((t,r)=>{var o;const i=ii(t.elements),l=null===(o=null==i?void 0:i.props)||void 0===o?void 0:o.nodeType;if(!("inline"===l||"inlineVoid"===l)){const r={};Object.keys(t.elements).forEach((e=>{const n=bi(t.elements[e],["render"]);r[e]=n}));const{display:o,placeholder:i,align:l,shortcuts:a}=t.options||{};n[t.type]={type:t.type,elements:r,hasCustomEditor:!!t.customEditor,options:{display:o,placeholder:i,align:l,shortcuts:a},isActive:()=>{const n=L(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:n=>{oa(e,t.type,n)},create:n=>{!function(e,t,n){var r;e.children=Jl(e.children);const o=L(e);if(!o)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const i=(null==n?void 0:n.slate)||Ln(e,{at:[null==o?void 0:o.meta.order]});if(!i||!i.selection)return;const l=e.blocks[t],a=oi(l.elements),c=l.elements[a];if(!c)return;const s=Object.assign({nodeType:(null===(r=c.props)||void 0===r?void 0:r.nodeType)||"block"},c.props),d=J({id:G(),type:a,props:s});D.setNodes(i,d,{at:[0,0],match:e=>B.isElement(e),mode:"highest"}),(null==n?void 0:n.deleteText)&&D.delete(i,{at:[0,0]});const u=Q({id:o.id,type:l.type,meta:{order:o.meta.order,depth:o.meta.depth},value:[d]}),f=u.id;e.children[f]=u,e.blockEditorsMap[f]=i,e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(f,{slate:i,waitExecution:!0})}(e,t.type,n)},update:(t,n)=>{na(e,t,n)},updateElement:(t,n,r)=>{!function(e,t,n,r){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const i=Ln(e,{at:[o.meta.order]});i?S.withoutNormalizing(i,(()=>{const[t]=S.nodes(i,{at:[0],match:e=>B.isElement(e)&&e.type===n}),o=null==t?void 0:t[0],l=(null==o?void 0:o.props)||{},a={props:Object.assign(Object.assign({},l),r)};D.setNodes(i,a,{at:[0],match:e=>B.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=>{ia(e,t)}}}})),n}function ca(e){const t={};return Object.keys(e.children).forEach((n=>{const r=sa(e);t[n]=r})),t}function sa(e){return ta(e,al(E(T())))}function da({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}const ua=da({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),fa=(()=>{const e=G();return{[e]:Q({id:e})}})(),pa=new Z,ha=(e,t)=>pa.on(e,t),ga=(e,t)=>pa.once(e,t),va=(e,t)=>pa.off(e,t),ya=(e,t)=>pa.emit(e,t);const ma=({editor:n,value:r,marks:o,plugins:i,autoFocus:l,className:a,tools:c,selectionBoxRoot:s,children:u,placeholder:p,readOnly:h,width:g})=>{const v=()=>{w((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},y=d((()=>o?[ua,...o]:[ua]),[o]),m=d((()=>i.map((e=>e.getPlugin))),[i]),[b,w]=f((()=>{n.id||(n.id=G()),n.applyChanges=v,n.readOnly=h||!1,y&&(n.formats=la(n,y)),n.blocks=aa(n,m);const e=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(r);return e||void 0===r||console.error(`Initial value is not valid. Should be an object with blocks. You passed: ${JSON.stringify(r)}`),n.children=e?r:fa,n.blockEditorsMap=ca(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=ha,n.once=ga,n.off=va,n.emit=ya,{editor:n,version:0}}));return(e=>!!(Array.isArray(e)&&e.length>0)&&e.some((e=>{if(e.id||e.nodeType||e.type||e.children)return!0})))(r)?(console.error("Legacy version of Yoopta-Editor in use"),t("div",{children:[e("h1",{children:"Legacy version of the Yoopta-Editor is used"}),e("p",{children:"It looks like you are using a legacy version of the editor."}),t("p",{children:["The structure of value has changed in new ",e("b",{children:"@v4"})," version"]}),t("p",{children:["Please, check the migration guide to update your editor to the new ",e("b",{children:"@v4"})," version.",e("a",{href:""})]}),t("p",{children:["If you have specific case please"," ",e("a",Object.assign({href:"https://github.com/Darginec05/Yoopta-Editor/issues",target:"_blank",rel:"noopener noreferrer"},{children:"open the issue"}))," ","and we will solve your problem with migration"]})]})):e(tl,{children:e(F,Object.assign({editorState:b},{children:t(ai,Object.assign({tools:c},{children:[e(el,{placeholder:p,marks:y,autoFocus:l,className:a,selectionBoxRoot:s,width:g}),u]}))}))})},ba=Object.assign(Object.assign({},vi),{ExtendedBlockActions:({id:r,className:o,style:i,onClick:l,children:a})=>{const c=K(),[s,d]=f(!1),{refs:u,floatingStyles:p,context:h}=Io({placement:"bottom-start",open:s,onOpenChange:d,middleware:[Hr(),zr(),Fr(),kr(10)],whileElementsMounted:Ir}),{isMounted:g,styles:v}=Uo(h,{duration:100}),y=Object.assign(Object.assign({},v),p);return c?null:t(n,{children:[g&&e(gi,Object.assign({isOpen:!0,onClose:()=>d(!1),refs:u,style:y},{children:a})),e("button",Object.assign({type:"button",ref:u.setReference,id:r,className:`yoopta-button yoopta-extended-block-actions ${o||""}`,onClick:()=>{null==l||l(),d(!0)},style:s?Object.assign(Object.assign({},i),{opacity:1}):i},{children:e(qo,{})}))]})},Portal:ui,Overlay:di});function wa(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}function xa(e,t,n={}){try{const{focusAt:r,waitExecution:o=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:l=!0}=n,a=()=>{const o=n.slate||e.blockEditorsMap[t],i=e.children[t];if(!o||!i)return;if(!e.blocks[i.type].hasCustomEditor){const e=function(e,t){if(M.isPoint(t))return t;if(R.isPath(t))return{path:t,offset:0};const[,n]=S.first(e,[0]);return{path:n||[0,0],offset:0}}(o,r);D.select(o,e),w.focus(o)}l&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};o?setTimeout((()=>a()),i):a()}catch(e){}}function ka(e){return Array.from(new Set(e))}var Oa={};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Boolean]",l="[object Date]",a="[object Function]",c="[object GeneratorFunction]",s="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",g="[object String]",v="[object Symbol]",y="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",O="[object Int16Array]",C="[object Int32Array]",E="[object Uint8Array]",S="[object Uint8ClampedArray]",D="[object Uint16Array]",R="[object Uint32Array]",_=/\w*$/,j=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,A={};A[o]=A["[object Array]"]=A[m]=A[b]=A[i]=A[l]=A[w]=A[x]=A[k]=A[O]=A[C]=A[s]=A[d]=A[u]=A[p]=A[h]=A[g]=A[v]=A[E]=A[S]=A[D]=A[R]=!0,A["[object Error]"]=A[a]=A[y]=!1;var T="object"==typeof $&&$&&$.Object===Object&&$,M="object"==typeof self&&self&&self.Object===Object&&self,N=T||M||Function("return this")(),L=t&&!t.nodeType&&t,P=L&&e&&!e.nodeType&&e,I=P&&P.exports===L;function F(e,t){return e.set(t[0],t[1]),e}function z(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 U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function K(e,t){return function(n){return e(t(n))}}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Y,X=Array.prototype,Z=Function.prototype,q=Object.prototype,G=N["__core-js_shared__"],J=(Y=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"",Q=Z.toString,ee=q.hasOwnProperty,te=q.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=I?N.Buffer:void 0,oe=N.Symbol,ie=N.Uint8Array,le=K(Object.getPrototypeOf,Object),ae=Object.create,ce=q.propertyIsEnumerable,se=X.splice,de=Object.getOwnPropertySymbols,ue=re?re.isBuffer:void 0,fe=K(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),ke=Ve(ve),Oe=Ve(ye),Ce=oe?oe.prototype:void 0,Ee=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 De(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 De(e)}function je(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ye(e)}(e)&&ee.call(e,"callee")&&(!ce.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 l in e)!t&&!ee.call(e,l)||i&&("length"==l||He(l,r))||n.push(l);return n}function Be(e,t,n){var r=e[t];ee.call(e,t)&&Ke(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Ae(e,t){for(var n=e.length;n--;)if(Ke(e[n][0],t))return n;return-1}function Te(e,t,n,r,f,y,j){var B;if(r&&(B=y?r(e,f,y,j):r(e)),void 0!==B)return B;if(!Ze(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=ze(e),N=M==a||M==c;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||N&&!y){if(U(e))return y?e:{};if(B=function(e){return"function"!=typeof e.constructor||Ue(e)?{}:(t=le(e),Ze(t)?ae(t):{});var t}(N?{}:e),!t)return function(e,t){return Le(e,Fe(e),t)}(e,function(e,t){return e&&Le(t,qe(t),e)}(B,e))}else{if(!A[M])return y?e:{};B=function(e,t,n,r){var o=e.constructor;switch(t){case m:return Ne(e);case i:case l:return new o(+e);case b:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case w:case x:case k:case O:case C:case E:case S:case D:case R:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case s:return function(e,t,n){var r=t?n(V(e),!0):V(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,_.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var r=t?n(W(e),!0):W(e);return H(r,z,new e.constructor)}(e,r,n);case v:return a=e,Ee?Object(Ee.call(a)):{}}var a}(e,M,Te,t)}}j||(j=new _e);var L=j.get(e);if(L)return L;if(j.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,qe,Fe)}(e):qe(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,Te(o,t,n,r,i,e,j))})),B}function Me(e){return!(!Ze(e)||(t=e,J&&J in t))&&(Xe(e)||U(e)?ne:j).test(Ve(e));var t}function Ne(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Le(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var l=t[o],a=r?r(n[l],e[l],l,n,e):void 0;Be(n,l,void 0===a?e[l]:a)}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__=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 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 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},De.prototype.clear=function(){this.__data__=[]},De.prototype.delete=function(e){var t=this.__data__,n=Ae(t,e);return!(n<0)&&(n==t.length-1?t.pop():se.call(t,n,1),!0)},De.prototype.get=function(e){var t=this.__data__,n=Ae(t,e);return n<0?void 0:t[n][1]},De.prototype.has=function(e){return Ae(this.__data__,e)>-1},De.prototype.set=function(e,t){var n=this.__data__,r=Ae(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||De),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 De},_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 De){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 Fe=de?K(de,Object):function(){return[]},ze=function(e){return te.call(e)};function He(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||q)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ke(e,t){return e===t||e!=e&&t!=t}(pe&&ze(new pe(new ArrayBuffer(1)))!=b||he&&ze(new he)!=s||ge&&ze(ge.resolve())!=f||ve&&ze(new ve)!=h||ye&&ze(new ye)!=y)&&(ze=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 be:return b;case we:return s;case xe:return f;case ke:return h;case Oe:return y}return t});var We=Array.isArray;function Ye(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=Ze(e)?te.call(e):"";return t==a||t==c}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function qe(e){return Ye(e)?je(e):function(e){if(!Ue(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 Te(e,!0,!0)}}({get exports(){return Oa},set exports(e){Oa=e}},Oa);var Ca=Oa;function Ea(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=L(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=Jl(e.children);Object.values(e.children).forEach((e=>{e.meta.order>o.meta.order&&(e.meta.order+=1)}));const i=(l=o,"function"==typeof window.structuredClone?window.structuredClone(l):Ca(l));var l;const a=sa(e);i.id=G(),i.meta.order=o.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=a;const c=i.id;e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(c,{waitExecution:!0})}function Sa(e,t){w.blur(t),w.deselect(t),D.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const Da=()=>{const e={children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),setEditorValue:(...t)=>function(e,t){e.children=t,e.blockEditorsMap=ca(e),e.applyChanges()}(e,...t),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,n={}){e.children=Jl(e.children);const{at:r=null,focus:o=!1,slate:i=null}=n,l=L(e),a=r,c={id:G(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let s=!1;if(i&&i.selection){const e=S.string(i,i.selection.anchor.path);s=S.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(a){const[t]=a;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),c.meta.order=t}else{const t=Object.keys(e.children).length;c.meta.order=t}const d=sa(e);e.blockEditorsMap[c.id]=d,s&&l&&(c.meta.order=l.meta.order,l.meta.order+=1),e.children[c.id]=c;const u=null==l?void 0:l.id;e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(s&&u?u:c.id)}(e,...t),insertBlocks:(...t)=>function(e,t,n={}){e.children=Jl(e.children);const{at:r,focus:o}=n;let i=r||[0];const l=L(e),a=Ln(e);let c=!1,s=!1;if(a&&a.selection){const t=R.parent(a.selection.anchor.path),n=S.string(a,t).trim(),r=S.isStart(a,a.selection.anchor,t);c=""===n&&r,s=!r||n.length>0,w.blur(a),e.setSelection(null)}s&&(i=[i[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=i[0]&&(e.meta.order+=t.length)}));const d=[];if(t.forEach(((t,n)=>{const r={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:i[0]+n})};d.push(r.meta.order),e.children[r.id]=r;const o=sa(e);e.blockEditorsMap[r.id]=o})),l&&c){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=Ql(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.setBlockSelected(d)}(e,...t),deleteBlock:(...t)=>ia(e,...t),duplicateBlock:(...t)=>Ea(e,...t),toggleBlock:(...t)=>oa(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=Jl(e.children);const r=L(e);r&&(r.meta.depth=r.meta.depth+1,e.children=Ql(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=Jl(e.children);const r=L(e);r&&(r.meta.depth=0===r.meta.depth?0:r.meta.depth-1,e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),moveBlock:(...t)=>function(e,t,n){e.children=Jl(e.children);const[r]=n,o=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===r)),l=o.meta.order<i.meta.order,a=o.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{l?e.meta.order>o.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:a&&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.setSelection([r]),e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children)}(e,...t),focusBlock:(...t)=>xa(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>na(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:n,focus:r=!0}=t,o=L(e);n&&n.selection&&o&&S.withoutNormalizing(n,(()=>{e.children=Jl(e.children);const t=R.parent(n.selection.anchor.path);D.splitNodes(n,{at:n.selection,match:e=>B.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,l=n.children.slice()[i];D.removeNodes(n,{at:[i],match:e=>B.isElement(e),mode:"highest"});const a={id:G(),type:o.type,meta:{order:o.meta.order+1,depth:o.meta.depth},value:[l]};Object.values(e.children).forEach((e=>{e.meta.order>=a.meta.order&&(e.meta.order+=1)}));const c=sa(e);e.blockEditorsMap[a.id]=c,e.children[a.id]=a,e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(a.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=ka(t)}else e.selectedBlocks=ka(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var n;const r=null!==(n=t.slate)&&void 0!==n?n:Ln(e);if(!r)return;const{waitExecution:o,waitExecutionMs:i}=t;o?setTimeout((()=>Sa(e,r)),i):(Sa(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};!function(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))}}(".yoo-editor-z-\\[100\\]{z-index:100}.yoo-editor-mr-2{margin-right:.5rem}.yoo-editor-h-4{height:1rem}.yoo-editor-w-4{width:1rem}*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}button{background-color:transparent;border:none;cursor:pointer}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}::-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}.yoopta-button{background-color:transparent;border-style:none;cursor:pointer}.yoopta-block{border-radius:.25rem;margin-bottom:1px;margin-top:2px;padding:0 2px;position:relative}.yoopta-selection-block{background-color:#2383e224;border-radius:.25rem;height:100%;left:0;opacity:1;pointer-events:none;position:absolute;top:0;width:100%;z-index:90}.yoopta-block-actions{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoopta-block-actions[data-hovered-state-open=true]{opacity:1}.yoopta-block-actions-plus{align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;border-style:none;color:#37352f59;cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition-duration:.18s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);width:24px}.yoopta-block-actions-plus:active,.yoopta-block-actions-plus:focus,.yoopta-block-actions-plus:hover{background-color:#37362f14}.yoopta-block-actions-drag{align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;border-style:none;color:#37352f59;cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition-duration:.18s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);width:18px}.yoopta-block-actions-drag:active,.yoopta-block-actions-drag:focus,.yoopta-block-actions-drag:hover{background-color:#37362f14}.yoopta-slate:focus{outline:2px solid transparent;outline-offset:2px}.yoopta-slate:focus-visible{outline:2px solid transparent;outline-offset:2px}.yoopta-block-options-button{background-color:transparent;border-radius:.125rem;border-style:none;cursor:pointer;display:flex;justify-content:flex-start;line-height:120%;margin-left:4px;margin-right:4px;padding:.375rem .5rem;width:100%}.yoopta-block-options-button:hover{background-color:#37352f14}.yoopta-block-options-item{align-items:center;cursor:default;display:flex;font-size:.875rem;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;position:relative;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-block-options-item[data-disabled]{opacity:.5;pointer-events:none}.yoopta-extended-block-actions{--tw-bg-opacity:1;align-items:center;background-color:rgb(238 238 238/var(--tw-bg-opacity));border-radius:2px;border-style:none;cursor:pointer;display:flex;height:22px;justify-content:space-between;opacity:1;padding:0 4px;position:absolute;right:8px;top:8px;transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,1,1);width:22px;z-index:10}.yoopta-block-options-separator{background-color:#37352f14;height:1px;margin-bottom:4px;margin-top:4px;width:100%}.yoopta-block-options-menu-content{--tw-border-opacity:1;--tw-bg-opacity:1;--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);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-radius:.375rem;border-style:solid;border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);min-width:200px;overflow:hidden;padding:6px 0;position:relative;width:auto}.yoopta-block-options-group{display:flex;flex-direction:column}");export{Li as HOTKEYS,ba as UI,N as YooptaPlugin,Q as buildBlockData,J as buildBlockElement,Da as createYooptaEditor,da as createYooptaMark,ma as default,L as findPluginBlockBySelectionPath,wa as findPluginBlockByType,Ln as findSlateBySelectionPath,G as generateId,ii as getRootBlockElement,oi as getRootBlockElementType,H as useBlockData,Y as useBlockSelected,U as useYooptaBlock,z as useYooptaEditor,V as useYooptaPlugin,W as useYooptaPluginOptions,K as useYooptaReadOnly,ci as useYooptaTools};
13
+ function nl(e){return"[object Object]"===Object.prototype.toString.call(e)}var rl={isHistory(e){return!1!==nl(t=e)&&(void 0===(n=t.constructor)||!1!==nl(r=n.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||A.isOperationList(e.redos[0].operations))&&(0===e.undos.length||A.isOperationList(e.undos[0].operations));var t,n,r}},ol=new WeakMap,il=new WeakMap,ll={isHistoryEditor:e=>rl.isHistory(e.history)&&S.isEditor(e),isMerging:e=>il.get(e),isSaving:e=>ol.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=ll.isMerging(e);il.set(e,!1),t(),il.set(e,n)},withoutSaving(e,t){var n=ll.isSaving(e);ol.set(e,!1),t(),ol.set(e,n)}},al=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];r.selectionBefore&&D.setSelection(t,r.selectionBefore),ll.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{for(var e of r.operations)t.apply(e)}))})),e.redos.pop(),t.writeHistory("undos",r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];ll.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{var e=r.operations.map(A.inverse).reverse();for(var n of e)t.apply(n);r.selectionBefore&&D.setSelection(t,r.selectionBefore)}))})),t.writeHistory("redos",r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:o}=t,{undos:i}=o,l=i[i.length-1],a=l&&l.operations[l.operations.length-1],c=ll.isSaving(t),s=ll.isMerging(t);if(null==c&&(c=sl(e)),c){if(null==s&&(s=null!=l&&(0!==r.length||cl(e,a))),l&&s)l.operations.push(e);else{var d={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;i.length>100;)i.shift();o.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t},cl=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!R.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!R.equals(e.path,t.path)),sl=(e,t)=>"set_selection"!==e.type,dl=Symbol.for("immer-nothing"),ul=Symbol.for("immer-draftable"),fl=Symbol.for("immer-state");function pl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var hl=Object.getPrototypeOf;function gl(e){return!!e&&!!e[fl]}function vl(e){return!!e&&(ml(e)||Array.isArray(e)||!!e[ul]||!!e.constructor?.[ul]||Ol(e)||Cl(e))}var yl=Object.prototype.constructor.toString();function ml(e){if(!e||"object"!=typeof e)return!1;const t=hl(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)===yl}function bl(e,t){0===wl(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function wl(e){const t=e[fl];return t?t.type_:Array.isArray(e)?1:Ol(e)?2:Cl(e)?3:0}function xl(e,t){return 2===wl(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function kl(e,t,n){const r=wl(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Ol(e){return e instanceof Map}function Cl(e){return e instanceof Set}function El(e){return e.copy_||e.base_}function Sl(e,t){if(Ol(e))return new Map(e);if(Cl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&ml(e)){if(!hl(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[fl];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(hl(e),n)}function Dl(e,t=!1){return _l(e)||gl(e)||!vl(e)||(wl(e)>1&&(e.set=e.add=e.clear=e.delete=Rl),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Dl(t,!0)))),e}function Rl(){pl(2)}function _l(e){return Object.isFrozen(e)}var jl,Bl={};function Al(e){const t=Bl[e];return t||pl(0),t}function Tl(){return jl}function Ml(e,t){t&&(Al("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Nl(e){Ll(e),e.drafts_.forEach(Il),e.drafts_=null}function Ll(e){e===jl&&(jl=e.parent_)}function Pl(e){return jl={drafts_:[],parent_:jl,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Il(e){const t=e[fl];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Fl(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[fl].modified_&&(Nl(t),pl(4)),vl(e)&&(e=zl(t,e),t.parent_||Ul(t,e)),t.patches_&&Al("Patches").generateReplacementPatches_(n[fl].base_,e,t.patches_,t.inversePatches_)):e=zl(t,n,[]),Nl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==dl?e:void 0}function zl(e,t,n){if(_l(t))return t;const r=t[fl];if(!r)return bl(t,((o,i)=>Hl(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Ul(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),bl(o,((o,l)=>Hl(e,r,t,o,l,n,i))),Ul(e,t,!1),n&&e.patches_&&Al("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Hl(e,t,n,r,o,i,l){if(gl(o)){const l=zl(e,o,i&&t&&3!==t.type_&&!xl(t.assigned_,r)?i.concat(r):void 0);if(kl(n,r,l),!gl(l))return;e.canAutoFreeze_=!1}else l&&n.add(o);if(vl(o)&&!_l(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;zl(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||Ul(e,o)}}function Ul(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Dl(t,n)}var Vl={get(e,t){if(t===fl)return e;const n=El(e);if(!xl(n,t))return function(e,t,n){const r=Yl(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_||!vl(r)?r:r===Wl(e.base_,t)?(Xl(e),e.copy_[t]=Zl(r,e)):r},has:(e,t)=>t in El(e),ownKeys:e=>Reflect.ownKeys(El(e)),set(e,t,n){const r=Yl(El(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Wl(El(e),t),l=r?.[fl];if(l&&l.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||xl(e.base_,t)))return!0;Xl(e),$l(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!==Wl(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Xl(e),$l(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=El(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){pl(11)},getPrototypeOf:e=>hl(e.base_),setPrototypeOf(){pl(12)}},Kl={};function Wl(e,t){const n=e[fl];return(n?El(n):e)[t]}function Yl(e,t){if(!(t in e))return;let n=hl(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=hl(n)}}function $l(e){e.modified_||(e.modified_=!0,e.parent_&&$l(e.parent_))}function Xl(e){e.copy_||(e.copy_=Sl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}bl(Vl,((e,t)=>{Kl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Kl.deleteProperty=function(e,t){return Kl.set.call(this,e,t,void 0)},Kl.set=function(e,t,n){return Vl.set.call(this,e[0],t,n,e[0])};function Zl(e,t){const n=Ol(e)?Al("MapSet").proxyMap_(e,t):Cl(e)?Al("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Tl(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Vl;n&&(o=[r],i=Kl);const{revoke:l,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=l,a}(e,t);return(t?t.scope_:Tl()).drafts_.push(n),n}function ql(e){if(!vl(e)||_l(e))return e;const t=e[fl];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Sl(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Sl(e,!0);return bl(n,((e,t)=>{kl(n,e,ql(t))})),t&&(t.finalized_=!1),n}var Gl=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&&pl(6),void 0!==n&&"function"!=typeof n&&pl(7),vl(e)){const o=Pl(this),i=Zl(e,void 0);let l=!0;try{r=t(i),l=!1}finally{l?Nl(o):Ll(o)}return Ml(o,n),Fl(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===dl&&(r=void 0),this.autoFreeze_&&Dl(r,!0),n){const t=[],o=[];Al("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}pl(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){vl(e)||pl(8),gl(e)&&(e=function(e){gl(e)||pl(10);return ql(e)}(e));const t=Pl(this),n=Zl(e,void 0);return n[fl].isManual_=!0,Ll(t),n}finishDraft(e,t){const n=e&&e[fl];n&&n.isManual_||pl(9);const{scope_:r}=n;return Ml(r,t),Fl(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=Al("Patches").applyPatches_;return gl(e)?r(e,t):this.produce(e,(e=>r(e,t)))}};Gl.produce,Gl.produceWithPatches.bind(Gl),Gl.setAutoFreeze.bind(Gl),Gl.setUseStrictShallowCopy.bind(Gl),Gl.applyPatches.bind(Gl);var Jl=Gl.createDraft.bind(Gl),Ql=Gl.finishDraft.bind(Gl);function ea(e,t){const n=Ln(e);if(!n)return!1;const r=S.marks(n);return!!(null==r?void 0:r[t])}const ta=(e,t)=>{const{insertText:n}=t;return t.insertText=r=>{var o;const{selection:i}=t;if(" "===r&&i&&_.isCollapsed(i)){const{anchor:l}=i,a=S.above(t,{match:e=>B.isElement(e)&&S.isBlock(t,e),mode:"lowest"});if(!a)return;const[,c]=a,s=S.parent(t,c),[d]=s;if(B.isElement(d)&&!j.isText(d.children[0]))return n(r);const u=a?c:[],f={anchor:l,focus:S.start(t,u)},p=S.string(t,f),h=null===(o=e.shortcuts)||void 0===o?void 0:o[p];if(!!h&&!h.isActive())return D.select(t,f),D.delete(t),void h.create({deleteText:!1})}n(r)},t};function na(e,t,n){e.children=Jl(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=Ql(e.children),r&&e.applyChanges(),e.emit("change",e.children)}const ra="Paragraph";function oa(e,t,n){e.children=Jl(e.children);const r=L(e,{at:(null==n?void 0:n.at)||e.selection});if(!r)throw new Error("Block from not found at current selection");let o=t;r.type===o&&(o=ra);const i=Ln(e,{at:[r.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${r.meta.order}`);const l=oi(e.blocks[o].elements);S.withoutNormalizing(i,(()=>{D.setNodes(i,{type:l},{at:[0],mode:"lowest",match:e=>B.isElement(e)&&!S.isInline(i,e)}),(null==n?void 0:n.deleteText)&&D.delete(i,{at:[0,0]});const t={id:r.id,type:o,meta:Object.assign(Object.assign({},r.meta),{order:r.meta.order}),value:i.children};e.blockEditorsMap[r.id]=i,e.children[r.id]=t,e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(t.id,{slate:i})}))}function ia(e,t={}){const{at:n=e.selection,deleteAll:r=!1,fromPaths:o,focus:i}=t;if(Array.isArray(o)&&o.length>0){e.children=Jl(e.children),o.forEach((t=>{const n=L(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=Ql(e.children),e.applyChanges(),void e.emit("change",e.children)}if(r||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=Q({id:G()}),n=sa(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=Jl(e.children);const[l]=n,a=Object.keys(e.children),c=a.find((t=>e.children[t].meta.order===l));if(a.forEach((t=>{const n=e.children[t];n.meta.order>l&&(n.meta.order-=1)})),c&&(delete e.children[c],delete e.blockEditorsMap[c]),e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),i){const n=e.selection?e.selection[0]-1:0,r=L(e,{at:[n]});r&&e.focusBlock(r.id,{focusAt:t.focusAt})}}function la(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=Ln(e);if(!n)return null;const r=S.marks(n);return null==r?void 0:r[t]}(e,r),isActive:()=>ea(e,r),toggle:()=>function(e,t){const n=Ln(e),r=ea(e,t);n&&(r?S.removeMark(n,t):S.addMark(n,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,r),update:t=>function(e,t,n){const r=Ln(e);r&&r.selection&&_.isExpanded(r.selection)&&(S.addMark(r,t,n),e.applyChanges(),e.emit("change",e.children))}(e,r,t)}})),n}function aa(e,t){const n={};return t.forEach(((t,r)=>{var o;const i=ii(t.elements),l=null===(o=null==i?void 0:i.props)||void 0===o?void 0:o.nodeType;if(!("inline"===l||"inlineVoid"===l)){const r={};Object.keys(t.elements).forEach((e=>{const n=bi(t.elements[e],["render"]);r[e]=n}));const{display:o,placeholder:i,align:l,shortcuts:a}=t.options||{};n[t.type]={type:t.type,elements:r,hasCustomEditor:!!t.customEditor,options:{display:o,placeholder:i,align:l,shortcuts:a},isActive:()=>{const n=L(e,{at:e.selection});return(null==n?void 0:n.type)===t.type},toggle:n=>{oa(e,t.type,n)},create:n=>{!function(e,t,n){var r;e.children=Jl(e.children);const o=L(e);if(!o)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const i=(null==n?void 0:n.slate)||Ln(e,{at:[null==o?void 0:o.meta.order]});if(!i||!i.selection)return;const l=e.blocks[t],a=oi(l.elements),c=l.elements[a];if(!c)return;const s=Object.assign({nodeType:(null===(r=c.props)||void 0===r?void 0:r.nodeType)||"block"},c.props),d=J({id:G(),type:a,props:s});D.setNodes(i,d,{at:[0,0],match:e=>B.isElement(e),mode:"highest"}),(null==n?void 0:n.deleteText)&&D.delete(i,{at:[0,0]});const u=Q({id:o.id,type:l.type,meta:{order:o.meta.order,depth:o.meta.depth},value:[d]}),f=u.id;e.children[f]=u,e.blockEditorsMap[f]=i,e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),(null==n?void 0:n.focus)&&e.focusBlock(f,{slate:i,waitExecution:!0})}(e,t.type,n)},update:(t,n)=>{na(e,t,n)},updateElement:(t,n,r)=>{!function(e,t,n,r){const o=e.children[t];if(!o)throw new Error(`Block with id ${t} not found`);const i=Ln(e,{at:[o.meta.order]});i?S.withoutNormalizing(i,(()=>{const[t]=S.nodes(i,{at:[0],match:e=>B.isElement(e)&&e.type===n}),o=null==t?void 0:t[0],l=(null==o?void 0:o.props)||{},a={props:Object.assign(Object.assign({},l),r)};D.setNodes(i,a,{at:[0],match:e=>B.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=>{ia(e,t)}}}})),n}function ca(e){const t={};return Object.keys(e.children).forEach((n=>{const r=sa(e);t[n]=r})),t}function sa(e){return ta(e,al(E(T())))}function da({type:e,hotkey:t,render:n}){return{type:e,hotkey:t,render:n}}const ua=da({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),fa=(()=>{const e=G();return{[e]:Q({id:e})}})(),pa=new Z,ha=(e,t)=>pa.on(e,t),ga=(e,t)=>pa.once(e,t),va=(e,t)=>pa.off(e,t),ya=(e,t)=>pa.emit(e,t);const ma=({editor:n,value:r,marks:o,plugins:i,autoFocus:l,className:a,tools:c,selectionBoxRoot:s,children:u,placeholder:p,readOnly:h,width:g})=>{const v=()=>{w((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},y=d((()=>o?[ua,...o]:[ua]),[o]),m=d((()=>i.map((e=>e.getPlugin))),[i]),[b,w]=f((()=>{n.id||(n.id=G()),n.applyChanges=v,n.readOnly=h||!1,y&&(n.formats=la(n,y)),n.blocks=aa(n,m);const e=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(r);return e||void 0===r||console.error(`Initial value is not valid. Should be an object with blocks. You passed: ${JSON.stringify(r)}`),n.children=e?r:fa,n.blockEditorsMap=ca(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=ha,n.once=ga,n.off=va,n.emit=ya,{editor:n,version:0}}));return(e=>!!(Array.isArray(e)&&e.length>0)&&e.some((e=>{if(e.id||e.nodeType||e.type||e.children)return!0})))(r)?(console.error("Legacy version of Yoopta-Editor in use"),t("div",{children:[e("h1",{children:"Legacy version of the Yoopta-Editor is used"}),e("p",{children:"It looks like you are using a legacy version of the editor."}),t("p",{children:["The structure of value has changed in new ",e("b",{children:"@v4"})," version"]}),t("p",{children:["Please, check the migration guide to update your editor to the new ",e("b",{children:"@v4"})," version.",e("a",{href:""})]}),t("p",{children:["If you have specific case please"," ",e("a",Object.assign({href:"https://github.com/Darginec05/Yoopta-Editor/issues",target:"_blank",rel:"noopener noreferrer"},{children:"open the issue"}))," ","and we will solve your problem with migration"]})]})):e(tl,{children:e(F,Object.assign({editorState:b},{children:t(ai,Object.assign({tools:c},{children:[e(el,{placeholder:p,marks:y,autoFocus:l,className:a,selectionBoxRoot:s,width:g}),u]}))}))})},ba=Object.assign(Object.assign({},vi),{ExtendedBlockActions:({id:r,className:o,style:i,onClick:l,children:a})=>{const c=K(),[s,d]=f(!1),{refs:u,floatingStyles:p,context:h}=Io({placement:"bottom-start",open:s,onOpenChange:d,middleware:[Hr(),zr(),Fr(),kr(10)],whileElementsMounted:Ir}),{isMounted:g,styles:v}=Uo(h,{duration:100}),y=Object.assign(Object.assign({},v),p);return c?null:t(n,{children:[g&&e(gi,Object.assign({isOpen:!0,onClose:()=>d(!1),refs:u,style:y},{children:a})),e("button",Object.assign({type:"button",ref:u.setReference,id:r,className:`yoopta-button yoopta-extended-block-actions ${o||""}`,onClick:()=>{null==l||l(),d(!0)},style:s?Object.assign(Object.assign({},i),{opacity:1}):i},{children:e(qo,{})}))]})},Portal:ui,Overlay:di});function wa(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}function xa(e,t,n={}){try{const{focusAt:r,waitExecution:o=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:l=!0}=n,a=()=>{const o=n.slate||e.blockEditorsMap[t],i=e.children[t];if(!o||!i)return;if(!e.blocks[i.type].hasCustomEditor){const e=function(e,t){if(M.isPoint(t))return t;if(R.isPath(t))return{path:t,offset:0};const[,n]=S.first(e,[0]);return{path:n||[0,0],offset:0}}(o,r);D.select(o,e),w.focus(o)}l&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};o?setTimeout((()=>a()),i):a()}catch(e){}}function ka(e){return Array.from(new Set(e))}var Oa={};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Boolean]",l="[object Date]",a="[object Function]",c="[object GeneratorFunction]",s="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",g="[object String]",v="[object Symbol]",y="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",O="[object Int16Array]",C="[object Int32Array]",E="[object Uint8Array]",S="[object Uint8ClampedArray]",D="[object Uint16Array]",R="[object Uint32Array]",_=/\w*$/,j=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,A={};A[o]=A["[object Array]"]=A[m]=A[b]=A[i]=A[l]=A[w]=A[x]=A[k]=A[O]=A[C]=A[s]=A[d]=A[u]=A[p]=A[h]=A[g]=A[v]=A[E]=A[S]=A[D]=A[R]=!0,A["[object Error]"]=A[a]=A[y]=!1;var T="object"==typeof $&&$&&$.Object===Object&&$,M="object"==typeof self&&self&&self.Object===Object&&self,N=T||M||Function("return this")(),L=t&&!t.nodeType&&t,P=L&&e&&!e.nodeType&&e,I=P&&P.exports===L;function F(e,t){return e.set(t[0],t[1]),e}function z(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 U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function K(e,t){return function(n){return e(t(n))}}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Y,X=Array.prototype,Z=Function.prototype,q=Object.prototype,G=N["__core-js_shared__"],J=(Y=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"",Q=Z.toString,ee=q.hasOwnProperty,te=q.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=I?N.Buffer:void 0,oe=N.Symbol,ie=N.Uint8Array,le=K(Object.getPrototypeOf,Object),ae=Object.create,ce=q.propertyIsEnumerable,se=X.splice,de=Object.getOwnPropertySymbols,ue=re?re.isBuffer:void 0,fe=K(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),ke=Ve(ve),Oe=Ve(ye),Ce=oe?oe.prototype:void 0,Ee=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 De(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 De(e)}function je(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ye(e)}(e)&&ee.call(e,"callee")&&(!ce.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 l in e)!t&&!ee.call(e,l)||i&&("length"==l||He(l,r))||n.push(l);return n}function Be(e,t,n){var r=e[t];ee.call(e,t)&&Ke(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Ae(e,t){for(var n=e.length;n--;)if(Ke(e[n][0],t))return n;return-1}function Te(e,t,n,r,f,y,j){var B;if(r&&(B=y?r(e,f,y,j):r(e)),void 0!==B)return B;if(!Ze(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=ze(e),N=M==a||M==c;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||N&&!y){if(U(e))return y?e:{};if(B=function(e){return"function"!=typeof e.constructor||Ue(e)?{}:(t=le(e),Ze(t)?ae(t):{});var t}(N?{}:e),!t)return function(e,t){return Le(e,Fe(e),t)}(e,function(e,t){return e&&Le(t,qe(t),e)}(B,e))}else{if(!A[M])return y?e:{};B=function(e,t,n,r){var o=e.constructor;switch(t){case m:return Ne(e);case i:case l:return new o(+e);case b:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case w:case x:case k:case O:case C:case E:case S:case D:case R:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case s:return function(e,t,n){var r=t?n(V(e),!0):V(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,_.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var r=t?n(W(e),!0):W(e);return H(r,z,new e.constructor)}(e,r,n);case v:return a=e,Ee?Object(Ee.call(a)):{}}var a}(e,M,Te,t)}}j||(j=new _e);var L=j.get(e);if(L)return L;if(j.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,qe,Fe)}(e):qe(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,Te(o,t,n,r,i,e,j))})),B}function Me(e){return!(!Ze(e)||(t=e,J&&J in t))&&(Xe(e)||U(e)?ne:j).test(Ve(e));var t}function Ne(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Le(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var l=t[o],a=r?r(n[l],e[l],l,n,e):void 0;Be(n,l,void 0===a?e[l]:a)}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__=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 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 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},De.prototype.clear=function(){this.__data__=[]},De.prototype.delete=function(e){var t=this.__data__,n=Ae(t,e);return!(n<0)&&(n==t.length-1?t.pop():se.call(t,n,1),!0)},De.prototype.get=function(e){var t=this.__data__,n=Ae(t,e);return n<0?void 0:t[n][1]},De.prototype.has=function(e){return Ae(this.__data__,e)>-1},De.prototype.set=function(e,t){var n=this.__data__,r=Ae(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||De),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 De},_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 De){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 Fe=de?K(de,Object):function(){return[]},ze=function(e){return te.call(e)};function He(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||q)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ke(e,t){return e===t||e!=e&&t!=t}(pe&&ze(new pe(new ArrayBuffer(1)))!=b||he&&ze(new he)!=s||ge&&ze(ge.resolve())!=f||ve&&ze(new ve)!=h||ye&&ze(new ye)!=y)&&(ze=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 be:return b;case we:return s;case xe:return f;case ke:return h;case Oe:return y}return t});var We=Array.isArray;function Ye(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=Ze(e)?te.call(e):"";return t==a||t==c}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function qe(e){return Ye(e)?je(e):function(e){if(!Ue(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 Te(e,!0,!0)}}({get exports(){return Oa},set exports(e){Oa=e}},Oa);var Ca=Oa;function Ea(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=L(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=Jl(e.children);Object.values(e.children).forEach((e=>{e.meta.order>o.meta.order&&(e.meta.order+=1)}));const i=(l=o,"function"==typeof window.structuredClone?window.structuredClone(l):Ca(l));var l;const a=sa(e);i.id=G(),i.meta.order=o.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=a;const c=i.id;e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(c,{waitExecution:!0})}function Sa(e,t){w.blur(t),w.deselect(t),D.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const Da=()=>{const e={id:"",children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),setEditorValue:(...t)=>function(e,t){e.children=t,e.blockEditorsMap=ca(e),e.applyChanges()}(e,...t),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,n={}){e.children=Jl(e.children);const{at:r=null,focus:o=!1,slate:i=null}=n,l=L(e),a=r,c={id:G(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let s=!1;if(i&&i.selection){const e=S.string(i,i.selection.anchor.path);s=S.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(a){const[t]=a;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),c.meta.order=t}else{const t=Object.keys(e.children).length;c.meta.order=t}const d=sa(e);e.blockEditorsMap[c.id]=d,s&&l&&(c.meta.order=l.meta.order,l.meta.order+=1),e.children[c.id]=c;const u=null==l?void 0:l.id;e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.focusBlock(s&&u?u:c.id)}(e,...t),insertBlocks:(...t)=>function(e,t,n={}){e.children=Jl(e.children);const{at:r,focus:o}=n;let i=r||[0];const l=L(e),a=Ln(e);let c=!1,s=!1;if(a&&a.selection){const t=R.parent(a.selection.anchor.path),n=S.string(a,t).trim(),r=S.isStart(a,a.selection.anchor,t);c=""===n&&r,s=!r||n.length>0,w.blur(a),e.setSelection(null)}s&&(i=[i[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=i[0]&&(e.meta.order+=t.length)}));const d=[];if(t.forEach(((t,n)=>{const r={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:i[0]+n})};d.push(r.meta.order),e.children[r.id]=r;const o=sa(e);e.blockEditorsMap[r.id]=o})),l&&c){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=Ql(e.children),e.applyChanges(),e.emit("change",e.children),o&&e.setBlockSelected(d)}(e,...t),deleteBlock:(...t)=>ia(e,...t),duplicateBlock:(...t)=>Ea(e,...t),toggleBlock:(...t)=>oa(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:n=e.selection}=t;if(!n)return;e.children=Jl(e.children);const r=L(e);r&&(r.meta.depth=r.meta.depth+1,e.children=Ql(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=Jl(e.children);const r=L(e);r&&(r.meta.depth=0===r.meta.depth?0:r.meta.depth-1,e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),moveBlock:(...t)=>function(e,t,n){e.children=Jl(e.children);const[r]=n,o=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===r)),l=o.meta.order<i.meta.order,a=o.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{l?e.meta.order>o.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:a&&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.setSelection([r]),e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children)}(e,...t),focusBlock:(...t)=>xa(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>na(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:n,focus:r=!0}=t,o=L(e);n&&n.selection&&o&&S.withoutNormalizing(n,(()=>{e.children=Jl(e.children);const t=R.parent(n.selection.anchor.path);D.splitNodes(n,{at:n.selection,match:e=>B.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,l=n.children.slice()[i];D.removeNodes(n,{at:[i],match:e=>B.isElement(e),mode:"highest"});const a={id:G(),type:o.type,meta:{order:o.meta.order+1,depth:o.meta.depth},value:[l]};Object.values(e.children).forEach((e=>{e.meta.order>=a.meta.order&&(e.meta.order+=1)}));const c=sa(e);e.blockEditorsMap[a.id]=c,e.children[a.id]=a,e.children=Ql(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(a.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=ka(t)}else e.selectedBlocks=ka(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var n;const r=null!==(n=t.slate)&&void 0!==n?n:Ln(e);if(!r)return;const{waitExecution:o,waitExecutionMs:i}=t;o?setTimeout((()=>Sa(e,r)),i):(Sa(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};!function(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))}}(".yoo-editor-z-\\[100\\]{z-index:100}.yoo-editor-mr-2{margin-right:.5rem}.yoo-editor-h-4{height:1rem}.yoo-editor-w-4{width:1rem}*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}button{background-color:transparent;border:none;cursor:pointer}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}::-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}.yoopta-button{background-color:transparent;border-style:none;cursor:pointer}.yoopta-block{border-radius:.25rem;margin-bottom:1px;margin-top:2px;padding:0 2px;position:relative}.yoopta-selection-block{background-color:#2383e224;border-radius:.25rem;height:100%;left:0;opacity:1;pointer-events:none;position:absolute;top:0;width:100%;z-index:90}.yoopta-block-actions{display:flex;left:-50px;opacity:0;position:absolute;top:2px;transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoopta-block-actions[data-hovered-state-open=true]{opacity:1}.yoopta-block-actions-plus{align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;border-style:none;color:#37352f59;cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition-duration:.18s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);width:24px}.yoopta-block-actions-plus:active,.yoopta-block-actions-plus:focus,.yoopta-block-actions-plus:hover{background-color:#37362f14}.yoopta-block-actions-drag{align-items:center;background-color:inherit;background-color:transparent;border-radius:6px;border-style:none;color:#37352f59;cursor:pointer;display:flex;height:24px;justify-content:center;margin:0 1px;padding:0;position:relative;transition-duration:.18s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);width:18px}.yoopta-block-actions-drag:active,.yoopta-block-actions-drag:focus,.yoopta-block-actions-drag:hover{background-color:#37362f14}.yoopta-slate:focus{outline:2px solid transparent;outline-offset:2px}.yoopta-slate:focus-visible{outline:2px solid transparent;outline-offset:2px}.yoopta-block-options-button{background-color:transparent;border-radius:.125rem;border-style:none;cursor:pointer;display:flex;justify-content:flex-start;line-height:120%;margin-left:4px;margin-right:4px;padding:.375rem .5rem;width:100%}.yoopta-block-options-button:hover{background-color:#37352f14}.yoopta-block-options-item{align-items:center;cursor:default;display:flex;font-size:.875rem;line-height:1.25rem;outline:2px solid transparent;outline-offset:2px;position:relative;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-block-options-item[data-disabled]{opacity:.5;pointer-events:none}.yoopta-extended-block-actions{--tw-bg-opacity:1;align-items:center;background-color:rgb(238 238 238/var(--tw-bg-opacity));border-radius:2px;border-style:none;cursor:pointer;display:flex;height:22px;justify-content:space-between;opacity:1;padding:0 4px;position:absolute;right:8px;top:8px;transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,1,1);width:22px;z-index:10}.yoopta-block-options-separator{background-color:#37352f14;height:1px;margin-bottom:4px;margin-top:4px;width:100%}.yoopta-block-options-menu-content{--tw-border-opacity:1;--tw-bg-opacity:1;--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);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-radius:.375rem;border-style:solid;border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);min-width:200px;overflow:hidden;padding:6px 0;position:relative;width:auto}.yoopta-block-options-group{display:flex;flex-direction:column}");export{Li as HOTKEYS,ba as UI,N as YooptaPlugin,Q as buildBlockData,J as buildBlockElement,Da as createYooptaEditor,da as createYooptaMark,ma as default,L as findPluginBlockBySelectionPath,wa as findPluginBlockByType,Ln as findSlateBySelectionPath,G as generateId,ii as getRootBlockElement,oi as getRootBlockElementType,H as useBlockData,Y as useBlockSelected,U as useYooptaBlock,z as useYooptaEditor,V as useYooptaPlugin,W as useYooptaPluginOptions,K as useYooptaReadOnly,ci as useYooptaTools};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/editor",
3
- "version": "4.3.0",
3
+ "version": "4.3.2",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -67,5 +67,5 @@
67
67
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
68
68
  },
69
69
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
70
- "gitHead": "535e341651799f9a44d104b49c8a8ab89d105db9"
70
+ "gitHead": "228dd8503a28b29beac2f40786e148d710a3fc74"
71
71
  }