@yoopta/lists 4.9.5 → 4.9.7
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":"NumberedList.d.ts","sourceRoot":"","sources":["../../src/elements/NumberedList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,wBAAwB,EAA6D,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"NumberedList.d.ts","sourceRoot":"","sources":["../../src/elements/NumberedList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,wBAAwB,EAA6D,MAAM,gBAAgB,CAAC;AA4DrH,QAAA,MAAM,kBAAkB,+BAAgC,wBAAwB,gBAwB/E,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import{generateId as e,Blocks as t,Elements as r,useBlockData as n,findPluginBlockByPath as o,buildBlockData as i,buildBlockElement as a,deserializeTextNodes as s,YooptaPlugin as l,serializeTextNodes as c,serializeTextNodesIntoMarkdown as d,useYooptaEditor as p}from"@yoopta/editor";import{jsxs as f,jsx as u}from"react/jsx-runtime";import{
|
|
1
|
+
import{generateId as e,Blocks as t,Elements as r,useBlockData as n,findPluginBlockByPath as o,buildBlockData as i,buildBlockElement as a,deserializeTextNodes as s,YooptaPlugin as l,serializeTextNodes as c,serializeTextNodesIntoMarkdown as d,useYooptaEditor as p}from"@yoopta/editor";import{jsxs as f,jsx as u}from"react/jsx-runtime";import{useMemo as h,forwardRef as g,createElement as y}from"react";const m={buildBulletedListElements:(t,r)=>({id:e(),type:"bulleted-list",children:[{text:(null==r?void 0:r.text)||""}]}),insertBulletedList:(e,r={})=>{const{at:n,focus:o,text:i}=r,a=m.buildBulletedListElements(e,{text:i}),s=t.buildBlockData({value:[a],type:"BulletedList"});t.insertBlock(e,s.type,{at:n,focus:o,blockData:s})},deleteBulletedList:(e,r)=>{t.deleteBlock(e,{blockId:r})}},b={buildNumberedListElements:(t,r)=>({id:e(),type:"numbered-list",children:[{text:(null==r?void 0:r.text)||""}]}),insertNumberedList:(e,r={})=>{const{at:n,focus:o,text:i}=r,a=b.buildNumberedListElements(e,{text:i}),s=t.buildBlockData({value:[a],type:"NumberedList"});t.insertBlock(e,s.type,{at:n,focus:o,blockData:s})},deleteNumberedList:(e,r)=>{t.deleteBlock(e,{blockId:r})}},v={buildTodoListElements:(t,r)=>({id:e(),type:"todo-list",children:[{text:(null==r?void 0:r.text)||""}],props:(null==r?void 0:r.props)||{checked:!1}}),insertTodoList:(e,r={})=>{const{at:n,focus:o,text:i,props:a}=r,s=v.buildTodoListElements(e,{text:i,props:a}),l=t.buildBlockData({value:[s],type:"TodoList"});t.insertBlock(e,l.type,{at:n,focus:o,blockData:l})},deleteTodoList:(e,r)=>{t.deleteBlock(e,{blockId:r})},updateTodoList:(e,t,n)=>{"boolean"==typeof(null==n?void 0:n.checked)&&r.updateElement(e,t,{type:"todo-list",props:{checked:null==n?void 0:n.checked}})}};function w(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}"function"==typeof SuppressedError&&SuppressedError;
|
|
2
2
|
/*!
|
|
3
3
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
6
6
|
* Released under the MIT License.
|
|
7
7
|
*/
|
|
8
|
-
function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function x(e){var t,r;return!1!==w(e)&&(void 0===(t=e.constructor)||!1!==w(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}var O=Symbol.for("immer-nothing"),_=Symbol.for("immer-draftable"),k=Symbol.for("immer-state");function P(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var j=Object.getPrototypeOf;function N(e){return!!e&&!!e[k]}function E(e){return!!e&&(L(e)||Array.isArray(e)||!!e[_]||!!e.constructor?.[_]||C(e)||D(e))}var S=Object.prototype.constructor.toString();function L(e){if(!e||"object"!=typeof e)return!1;const t=j(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===S}function A(e,t){0===T(e)?Reflect.ownKeys(e).forEach((r=>{t(r,e[r],e)})):e.forEach(((r,n)=>t(n,r,e)))}function T(e){const t=e[k];return t?t.type_:Array.isArray(e)?1:C(e)?2:D(e)?3:0}function B(e,t){return 2===T(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function z(e,t,r){const n=T(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function C(e){return e instanceof Map}function D(e){return e instanceof Set}function $(e){return e.copy_||e.base_}function R(e,t){if(C(e))return new Map(e);if(D(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&L(e)){if(!j(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const r=Object.getOwnPropertyDescriptors(e);delete r[k];let n=Reflect.ownKeys(r);for(let t=0;t<n.length;t++){const o=n[t],i=r[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(r[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(j(e),r)}function q(e,t=!1){return M(e)||N(e)||!E(e)||(T(e)>1&&(e.set=e.add=e.clear=e.delete=F),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>q(t,!0)))),e}function F(){P(2)}function M(e){return Object.isFrozen(e)}var I,W={};function V(e){const t=W[e];return t||P(0),t}function U(){return I}function K(e,t){t&&(V("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function J(e){Z(e),e.drafts_.forEach(H),e.drafts_=null}function Z(e){e===I&&(I=e.parent_)}function X(e){return I={drafts_:[],parent_:I,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function H(e){const t=e[k];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function G(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[k].modified_&&(J(t),P(4)),E(e)&&(e=Q(t,e),t.parent_||ee(t,e)),t.patches_&&V("Patches").generateReplacementPatches_(r[k].base_,e,t.patches_,t.inversePatches_)):e=Q(t,r,[]),J(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==O?e:void 0}function Q(e,t,r){if(M(t))return t;const n=t[k];if(!n)return A(t,((o,i)=>Y(e,n,t,o,i,r))),t;if(n.scope_!==e)return t;if(!n.modified_)return ee(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let o=t,i=!1;3===n.type_&&(o=new Set(t),t.clear(),i=!0),A(o,((o,a)=>Y(e,n,t,o,a,r,i))),ee(e,t,!1),r&&e.patches_&&V("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Y(e,t,r,n,o,i,a){if(N(o)){const a=Q(e,o,i&&t&&3!==t.type_&&!B(t.assigned_,n)?i.concat(n):void 0);if(z(r,n,a),!N(a))return;e.canAutoFreeze_=!1}else a&&r.add(o);if(E(o)&&!M(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Q(e,o),t&&t.scope_.parent_||"symbol"==typeof n||!Object.prototype.propertyIsEnumerable.call(r,n)||ee(e,o)}}function ee(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&q(t,r)}var te={get(e,t){if(t===k)return e;const r=$(e);if(!B(r,t))return function(e,t,r){const n=oe(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);const n=r[t];return e.finalized_||!E(n)?n:n===ne(e.base_,t)?(ae(e),e.copy_[t]=se(n,e)):n},has:(e,t)=>t in $(e),ownKeys:e=>Reflect.ownKeys($(e)),set(e,t,r){const n=oe($(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=ne($(e),t),a=n?.[k];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(((o=r)===(i=n)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==r||B(e.base_,t)))return!0;ae(e),ie(e)}var o,i;return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==ne(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ae(e),ie(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=$(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){P(11)},getPrototypeOf:e=>j(e.base_),setPrototypeOf(){P(12)}},re={};function ne(e,t){const r=e[k];return(r?$(r):e)[t]}function oe(e,t){if(!(t in e))return;let r=j(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=j(r)}}function ie(e){e.modified_||(e.modified_=!0,e.parent_&&ie(e.parent_))}function ae(e){e.copy_||(e.copy_=R(e.base_,e.scope_.immer_.useStrictShallowCopy_))}A(te,((e,t)=>{re[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),re.deleteProperty=function(e,t){return re.set.call(this,e,t,void 0)},re.set=function(e,t,r){return te.set.call(this,e[0],t,r,e[0])};function se(e,t){const r=C(e)?V("MapSet").proxyMap_(e,t):D(e)?V("MapSet").proxySet_(e,t):function(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:U(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,i=te;r&&(o=[n],i=re);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,s}(e,t);return(t?t.scope_:U()).drafts_.push(r),r}function le(e){if(!E(e)||M(e))return e;const t=e[k];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=R(e,t.scope_.immer_.useStrictShallowCopy_)}else r=R(e,!0);return A(r,((e,t)=>{z(r,e,le(t))})),t&&(t.finalized_=!1),r}var ce=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...o){return n.produce(e,(e=>t.call(this,e,...o)))}}let n;if("function"!=typeof t&&P(6),void 0!==r&&"function"!=typeof r&&P(7),E(e)){const o=X(this),i=se(e,void 0);let a=!0;try{n=t(i),a=!1}finally{a?J(o):Z(o)}return K(o,r),G(n,o)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===O&&(n=void 0),this.autoFreeze_&&q(n,!0),r){const t=[],o=[];V("Patches").generateReplacementPatches_(e,n,t,o),r(t,o)}return n}P(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,n;return[this.produce(e,t,((e,t)=>{r=e,n=t})),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){E(e)||P(8),N(e)&&(e=function(e){N(e)||P(10);return le(e)}(e));const t=X(this),r=se(e,void 0);return r[k].isManual_=!0,Z(t),r}finishDraft(e,t){const r=e&&e[k];r&&r.isManual_||P(9);const{scope_:n}=r;return K(n,t),G(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=V("Patches").applyPatches_;return N(e)?n(e,t):this.produce(e,(e=>n(e,t)))}},de=ce.produce;ce.produceWithPatches.bind(ce),ce.setAutoFreeze.bind(ce),ce.setUseStrictShallowCopy.bind(ce),ce.applyPatches.bind(ce);var pe=ce.createDraft.bind(ce),fe=ce.finishDraft.bind(ce),ue={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=ue.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var o=e[n];if(o!==t[n])break;r.push(o)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return ue.equals(n,o)&&i>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),o=t.slice(0,r);return ue.equals(n,o)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return ue.equals(n,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r])),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===ue.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===ue.compare(e,t),isBefore:(e,t)=>-1===ue.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===ue.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===ue.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===ue.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===ue.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&ue.equals(r,n)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=[],o=0;o<=e.length;o++)n.push(e.slice(0,o));return r&&n.reverse(),n},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!ue.isAncestor(t,e)&&!ue.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var n=[...e],{affinity:o="forward"}=r;if(0===e.length)return n;switch(t.type){case"insert_node":var{path:i}=t;(ue.equals(i,n)||ue.endsBefore(i,n)||ue.isAncestor(i,n))&&(n[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(ue.equals(a,n)||ue.isAncestor(a,n))return null;ue.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:s,position:l}=t;ue.equals(s,n)||ue.endsBefore(s,n)?n[s.length-1]-=1:ue.isAncestor(s,n)&&(n[s.length-1]-=1,n[s.length]+=l);break;case"split_node":var{path:c,position:d}=t;if(ue.equals(c,n)){if("forward"===o)n[n.length-1]+=1;else if("backward"!==o)return null}else ue.endsBefore(c,n)?n[c.length-1]+=1:ue.isAncestor(c,n)&&e[c.length]>=d&&(n[c.length-1]+=1,n[c.length]-=d);break;case"move_node":var{path:p,newPath:f}=t;if(ue.equals(p,f))return n;if(ue.isAncestor(p,n)||ue.equals(p,n)){var u=f.slice();return ue.endsBefore(p,f)&&p.length<f.length&&(u[p.length-1]-=1),u.concat(n.slice(p.length))}ue.isSibling(p,f)&&(ue.isAncestor(f,n)||ue.equals(f,n))?ue.endsBefore(p,n)?n[p.length-1]-=1:n[p.length-1]+=1:ue.endsBefore(f,n)||ue.equals(f,n)||ue.isAncestor(f,n)?(ue.endsBefore(p,n)&&(n[p.length-1]-=1),n[f.length-1]+=1):ue.endsBefore(p,n)&&(ue.equals(f,n)&&(n[f.length-1]+=1),n[p.length-1]-=1)}return n}};function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function ge(e){var t=function(e,t){if("object"!==he(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==he(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===he(t)?t:String(t)}function ye(e,t,r){return(t=ge(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?me(Object(r),!0).forEach((function(t){ye(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ve={transform(e,t){e.children=pe(e.children);var r=e.selection&&pe(e.selection);try{r=((e,t,r)=>{switch(r.type){case"insert_node":var{path:n,node:o}=r,i=Te.parent(e,n),a=n[n.length-1];if(a>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n,"] because the destination is past the end of the node."));if(i.children.splice(a,0,o),t)for(var[s,l]of je.points(t))t[l]=Fe.transform(s,r);break;case"insert_text":var{path:c,offset:d,text:p}=r;if(0===p.length)break;var f=Te.leaf(e,c),u=f.text.slice(0,d),h=f.text.slice(d);if(f.text=u+p+h,t)for(var[g,y]of je.points(t))t[y]=Fe.transform(g,r);break;case"merge_node":var{path:m}=r,b=Te.get(e,m),v=ue.previous(m),w=Te.get(e,v),x=Te.parent(e,m),O=m[m.length-1];if(Ze.isText(b)&&Ze.isText(w))w.text+=b.text;else{if(Ze.isText(b)||Ze.isText(w))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(m,"] to nodes of different interfaces: ").concat(Ie.stringify(b)," ").concat(Ie.stringify(w)));w.children.push(...b.children)}if(x.children.splice(O,1),t)for(var[_,k]of je.points(t))t[k]=Fe.transform(_,r);break;case"move_node":var{path:P,newPath:j}=r;if(ue.isAncestor(P,j))throw new Error("Cannot move a path [".concat(P,"] to new path [").concat(j,"] because the destination is inside itself."));var N=Te.get(e,P),E=Te.parent(e,P),S=P[P.length-1];E.children.splice(S,1);var L=ue.transform(P,r),A=Te.get(e,ue.parent(L)),T=L[L.length-1];if(A.children.splice(T,0,N),t)for(var[B,z]of je.points(t))t[z]=Fe.transform(B,r);break;case"remove_node":var{path:C}=r,D=C[C.length-1];if(Te.parent(e,C).children.splice(D,1),t)for(var[$,R]of je.points(t)){var q=Fe.transform($,r);if(null!=t&&null!=q)t[R]=q;else{var F=void 0,M=void 0;for(var[I,W]of Te.texts(e)){if(-1!==ue.compare(W,C)){M=[I,W];break}F=[I,W]}var V=!1;F&&M&&(V=ue.equals(M[1],C)?!ue.hasPrevious(M[1]):ue.common(F[1],C).length<ue.common(M[1],C).length),F&&!V?($.path=F[1],$.offset=F[0].text.length):M?($.path=M[1],$.offset=0):t=null}}break;case"remove_text":var{path:U,offset:K,text:J}=r;if(0===J.length)break;var Z=Te.leaf(e,U),X=Z.text.slice(0,K),H=Z.text.slice(K+J.length);if(Z.text=X+H,t)for(var[G,Q]of je.points(t))t[Q]=Fe.transform(G,r);break;case"set_node":var{path:Y,properties:ee,newProperties:te}=r;if(0===Y.length)throw new Error("Cannot set properties on the root node!");var re=Te.get(e,Y);for(var ne in te){if("children"===ne||"text"===ne)throw new Error('Cannot set the "'.concat(ne,'" property of nodes!'));var oe=te[ne];null==oe?delete re[ne]:re[ne]=oe}for(var ie in ee)te.hasOwnProperty(ie)||delete re[ie];break;case"set_selection":var{newProperties:ae}=r;if(null==ae)t=ae;else{if(null==t){if(!je.isRange(ae))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Ie.stringify(ae)," when there is no current selection."));t=be({},ae)}for(var se in ae){var le=ae[se];if(null==le){if("anchor"===se||"focus"===se)throw new Error('Cannot remove the "'.concat(se,'" selection property'));delete t[se]}else t[se]=le}}break;case"split_node":var{path:ce,position:de,properties:pe}=r;if(0===ce.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(ce,"] because the root node cannot be split."));var fe,he=Te.get(e,ce),ge=Te.parent(e,ce),ye=ce[ce.length-1];if(Ze.isText(he)){var me=he.text.slice(0,de),ve=he.text.slice(de);he.text=me,fe=be(be({},pe),{},{text:ve})}else{var we=he.children.slice(0,de),xe=he.children.slice(de);he.children=we,fe=be(be({},pe),{},{children:xe})}if(ge.children.splice(ye+1,0,fe),t)for(var[Oe,_e]of je.points(t))t[_e]=Fe.transform(Oe,r)}return t})(e,r,t)}finally{e.children=fe(e.children),e.selection=r?N(r)?fe(r):r:null}}},we={insertNodes(e,t,r){e.insertNodes(t,r)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},xe={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},Oe=(e,t)=>{for(var r in e){var n=e[r],o=t[r];if(x(n)&&x(o)){if(!Oe(n,o))return!1}else if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var i=0;i<n.length;i++)if(n[i]!==o[i])return!1}else if(n!==o)return!1}for(var a in t)if(void 0===e[a]&&void 0!==t[a])return!1;return!0};function _e(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var ke=["anchor","focus"];function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var je={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:o}=e;return je.isBackward(e)===r?[n,o]:[o,n]},end(e){var[,t]=je.edges(e);return t},equals:(e,t)=>Fe.equals(e.anchor,t.anchor)&&Fe.equals(e.focus,t.focus),includes(e,t){if(je.isRange(t)){if(je.includes(e,t.anchor)||je.includes(e,t.focus))return!0;var[r,n]=je.edges(e),[o,i]=je.edges(t);return Fe.isBefore(r,o)&&Fe.isAfter(n,i)}var[a,s]=je.edges(e),l=!1,c=!1;return Fe.isPoint(t)?(l=Fe.compare(t,a)>=0,c=Fe.compare(t,s)<=0):(l=ue.compare(t,a.path)>=0,c=ue.compare(t,s.path)<=0),l&&c},intersection(e,t){var r=_e(e,ke),[n,o]=je.edges(e),[i,a]=je.edges(t),s=Fe.isBefore(n,i)?i:n,l=Fe.isBefore(o,a)?o:a;return Fe.isBefore(l,s)?null:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(r),!0).forEach((function(t){ye(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({anchor:s,focus:l},r)},isBackward(e){var{anchor:t,focus:r}=e;return Fe.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return Fe.equals(t,r)},isExpanded:e=>!je.isCollapsed(e),isForward:e=>!je.isBackward(e),isRange:e=>x(e)&&Fe.isPoint(e.anchor)&&Fe.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=je.edges(e);return t},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return de(e,(e=>{if(null===e)return null;var n,o,{affinity:i="inward"}=r;if("inward"===i){var a=je.isCollapsed(e);je.isForward(e)?(n="forward",o=a?n:"backward"):(n="backward",o=a?n:"forward")}else"outward"===i?je.isForward(e)?(n="backward",o="forward"):(n="forward",o="backward"):(n=i,o=i);var s=Fe.transform(e.anchor,t,{affinity:n}),l=Fe.transform(e.focus,t,{affinity:o});if(!s||!l)return null;e.anchor=s,e.focus=l}))}},Ne=e=>x(e)&&Te.isNodeList(e.children)&&!$e.isEditor(e),Ee={isAncestor:e=>x(e)&&Te.isNodeList(e.children),isElement:Ne,isElementList:e=>Array.isArray(e)&&e.every((e=>Ee.isElement(e))),isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return Ne(e)&&e[r]===t},matches(e,t){for(var r in t)if("children"!==r&&e[r]!==t[r])return!1;return!0}},Se=["children"],Le=["text"],Ae=new WeakMap,Te={ancestor(e,t){var r=Te.get(e,t);if(Ze.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Ie.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of ue.ancestors(t,r)){var o=[Te.ancestor(e,n),n];yield o}}()},child(e,t){if(Ze.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Ie.stringify(e)));var r=e.children[t];if(null==r)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Ie.stringify(e)));return r},children(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:n=!1}=r,o=Te.ancestor(e,t),{children:i}=o,a=n?i.length-1:0;n?a>=0:a<i.length;){var s=Te.child(o,a),l=t.concat(a);yield[s,l],a=n?a-1:a+1}}()},common(e,t,r){var n=ue.common(t,r);return[Te.get(e,n),n]},descendant(e,t){var r=Te.get(e,t);if($e.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Ie.stringify(r)));return r},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of Te.nodes(e,t))0!==n.length&&(yield[r,n])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of Te.nodes(e,t))Ee.isElement(r)&&(yield[r,n])}()},extractProps:e=>Ee.isAncestor(e)?_e(e,Se):_e(e,Le),first(e,t){for(var r=t.slice(),n=Te.get(e,r);n&&!Ze.isText(n)&&0!==n.children.length;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){if(Ze.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Ie.stringify(e)));return de({children:e.children},(e=>{var[r,n]=je.edges(t),o=Te.nodes(e,{reverse:!0,pass:e=>{var[,r]=e;return!je.includes(t,r)}});for(var[,i]of o){if(!je.includes(t,i)){var a=Te.parent(e,i),s=i[i.length-1];a.children.splice(s,1)}if(ue.equals(i,n.path)){var l=Te.leaf(e,i);l.text=l.text.slice(0,n.offset)}if(ue.equals(i,r.path)){var c=Te.leaf(e,i);c.text=c.text.slice(r.offset)}}$e.isEditor(e)&&(e.selection=null)})).children},get(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(Ze.isText(r)||!r.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Ie.stringify(e)));r=r.children[o]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(Ze.isText(r)||!r.children[o])return!1;r=r.children[o]}return!0},isNode:e=>Ze.isText(e)||Ee.isElement(e)||$e.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=Ae.get(e);if(void 0!==t)return t;var r=e.every((e=>Te.isNode(e)));return Ae.set(e,r),r},last(e,t){for(var r=t.slice(),n=Te.get(e,r);n&&!Ze.isText(n)&&0!==n.children.length;){var o=n.children.length-1;n=n.children[o],r.push(o)}return[n,r]},leaf(e,t){var r=Te.get(e,t);if(!Ze.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Ie.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of ue.levels(t,r)){var o=Te.get(e,n);yield[o,n]}}()},matches:(e,t)=>Ee.isElement(e)&&Ee.isElementProps(t)&&Ee.matches(e,t)||Ze.isText(e)&&Ze.isTextProps(t)&&Ze.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:r,reverse:n=!1}=t,{from:o=[],to:i}=t,a=new Set,s=[],l=e;!i||!(n?ue.isBefore(s,i):ue.isAfter(s,i));)if(a.has(l)||(yield[l,s]),a.has(l)||Ze.isText(l)||0===l.children.length||null!=r&&!1!==r([l,s])){if(0===s.length)break;if(!n){var c=ue.next(s);if(Te.has(e,c)){s=c,l=Te.get(e,s);continue}}if(n&&0!==s[s.length-1])s=ue.previous(s),l=Te.get(e,s);else s=ue.parent(s),l=Te.get(e,s),a.add(l)}else{a.add(l);var d=n?l.children.length-1:0;ue.isAncestor(s,o)&&(d=o[s.length]),s=s.concat(d),l=Te.get(e,s)}}()},parent(e,t){var r=ue.parent(t),n=Te.get(e,r);if(Ze.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>Ze.isText(e)?e.text:e.children.map(Te.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of Te.nodes(e,t))Ze.isText(r)&&(yield[r,n])}()}};function Be(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(r),!0).forEach((function(t){ye(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ce={isNodeOperation:e=>Ce.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!x(e))return!1;switch(e.type){case"insert_node":case"remove_node":return ue.isPath(e.path)&&Te.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&ue.isPath(e.path);case"merge_node":return"number"==typeof e.position&&ue.isPath(e.path)&&x(e.properties);case"move_node":return ue.isPath(e.path)&&ue.isPath(e.newPath);case"set_node":return ue.isPath(e.path)&&x(e.properties)&&x(e.newProperties);case"set_selection":return null===e.properties&&je.isRange(e.newProperties)||null===e.newProperties&&je.isRange(e.properties)||x(e.properties)&&x(e.newProperties);case"split_node":return ue.isPath(e.path)&&"number"==typeof e.position&&x(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>Ce.isOperation(e))),isSelectionOperation:e=>Ce.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>Ce.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return ze(ze({},e),{},{type:"remove_node"});case"insert_text":return ze(ze({},e),{},{type:"remove_text"});case"merge_node":return ze(ze({},e),{},{type:"split_node",path:ue.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(ue.equals(t,r))return e;if(ue.isSibling(r,t))return ze(ze({},e),{},{path:t,newPath:r});var n=ue.transform(r,e),o=ue.transform(ue.next(r),e);return ze(ze({},e),{},{path:n,newPath:o});case"remove_node":return ze(ze({},e),{},{type:"insert_node"});case"remove_text":return ze(ze({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return ze(ze({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:s,newProperties:l}=e;return ze(ze({},e),{},null==s?{properties:l,newProperties:null}:null==l?{properties:null,newProperties:s}:{properties:l,newProperties:s});case"split_node":return ze(ze({},e),{},{type:"merge_node",path:ue.next(e.path)})}}},De=new WeakMap,$e={above:(e,t)=>e.above(t),addMark(e,t,r){e.addMark(t,r)},after:(e,t,r)=>e.after(t,r),before:(e,t,r)=>e.before(t,r),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,r){e.insertFragment(t,r)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,r)=>e.isEdge(t,r),isEditor:e=>(e=>{var t=De.get(e);if(void 0!==t)return t;if(!x(e))return!1;var r="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||x(e.marks))&&(null===e.selection||je.isRange(e.selection))&&Te.isNodeList(e.children)&&Ce.isOperationList(e.operations);return De.set(e,r),r})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,r)=>e.isEnd(t,r),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,r)=>e.isStart(t,r),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,r)=>e.leaf(t,r),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,r)=>e.node(t,r),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,r)=>e.parent(t,r),path:(e,t,r)=>e.path(t,r),pathRef:(e,t,r)=>e.pathRef(t,r),pathRefs:e=>e.pathRefs(),point:(e,t,r)=>e.point(t,r),pointRef:(e,t,r)=>e.pointRef(t,r),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,r)=>e.range(t,r),rangeRef:(e,t,r)=>e.rangeRef(t,r),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,r)=>e.string(t,r),unhangRange:(e,t,r)=>e.unhangRange(t,r),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)}};function Re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(r),!0).forEach((function(t){ye(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fe={compare(e,t){var r=ue.compare(e.path,t.path);return 0===r?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter:(e,t)=>1===Fe.compare(e,t),isBefore:(e,t)=>-1===Fe.compare(e,t),equals:(e,t)=>e.offset===t.offset&&ue.equals(e.path,t.path),isPoint:e=>x(e)&&"number"==typeof e.offset&&ue.isPath(e.path),transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return de(e,(e=>{if(null===e)return null;var{affinity:n="forward"}=r,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":e.path=ue.transform(o,t,r);break;case"insert_text":ue.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===n)&&(e.offset+=t.text.length);break;case"merge_node":ue.equals(t.path,o)&&(e.offset+=t.position),e.path=ue.transform(o,t,r);break;case"remove_text":ue.equals(t.path,o)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(ue.equals(t.path,o)||ue.isAncestor(t.path,o))return null;e.path=ue.transform(o,t,r);break;case"split_node":if(ue.equals(t.path,o)){if(t.position===i&&null==n)return null;(t.position<i||t.position===i&&"forward"===n)&&(e.offset-=t.position,e.path=ue.transform(o,t,qe(qe({},r),{},{affinity:"forward"})))}else e.path=ue.transform(o,t,r)}}))}},Me=void 0,Ie={setScrubber(e){Me=e},stringify:e=>JSON.stringify(e,Me)},We=["text"],Ve=["anchor","focus"];function Ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(r),!0).forEach((function(t){ye(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Je,Ze={equals(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:n=!1}=r;function o(e){return _e(e,We)}return Oe(n?o(e):e,n?o(t):t)},isText:e=>x(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>Ze.isText(e))),isTextProps:e=>void 0!==e.text,matches(e,t){for(var r in t)if("text"!==r&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[Ke({},e)];for(var n of t){var o=_e(n,Ve),[i,a]=je.edges(n),s=[],l=0,c=i.offset,d=a.offset;for(var p of r){var{length:f}=p.text,u=l;if(l+=f,c<=u&&l<=d)Object.assign(p,o),s.push(p);else if(c!==d&&(c===l||d===u)||c>l||d<u||d===u&&0!==u)s.push(p);else{var h=p,g=void 0,y=void 0;if(d<l){var m=d-u;y=Ke(Ke({},h),{},{text:h.text.slice(m)}),h=Ke(Ke({},h),{},{text:h.text.slice(0,m)})}if(c>u){var b=c-u;g=Ke(Ke({},h),{},{text:h.text.slice(0,b)}),h=Ke(Ke({},h),{},{text:h.text.slice(b)})}Object.assign(h,o),g&&s.push(g),s.push(h),y&&s.push(y)}}r=s}return r}},Xe=e=>e.selection?e.selection:e.children.length>0?$e.end(e,[]):[0];!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(Je||(Je={})),Je.L,Je.L,Je.V,Je.LV,Je.LVT,Je.LV,Je.V,Je.V,Je.T,Je.LVT,Je.T,Je.T,Je.Any,Je.Extend,Je.ZWJ,Je.Any,Je.SpacingMark,Je.Prepend,Je.Any,Je.ZWJ,Je.ExtPict,Je.RI,Je.RI;var He={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};$e.withoutNormalizing(e,(()=>{var{voids:n=!1}=r,{at:o=Xe(e)}=r;if(ue.isPath(o)&&(o=$e.range(e,o)),je.isRange(o))if(je.isCollapsed(o))o=o.anchor;else{var i=je.end(o);if(!n&&$e.void(e,{at:i}))return;var a=je.start(o),s=$e.pointRef(e,a),l=$e.pointRef(e,i);Ye.delete(e,{at:o,voids:n});var c=s.unref(),d=l.unref();o=c||d,Ye.setSelection(e,{anchor:o,focus:o})}if(!(!n&&$e.void(e,{at:o})||$e.elementReadOnly(e,{at:o}))){var{path:p,offset:f}=o;t.length>0&&e.apply({type:"insert_text",path:p,offset:f,text:t})}}))}};function Ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(r),!0).forEach((function(t){ye(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ye=Qe(Qe(Qe(Qe({},ve),we),xe),He);function et(e,t,{hotkeys:n,defaultBlock:s}){return l=>{$e.withoutNormalizing(t,(()=>{var c;const d=o(e);if(!t.selection||!d)return;const p=t.selection,{anchor:f}=p;if(n.isCmdEnter(l)){const n=$e.above(t,{at:f,match:e=>!$e.isEditor(e)&&Ee.isElement(e)&&"todo-list"===e.type,mode:"highest"});if(!n)return;const[o]=n,i=(null===(c=o.props)||void 0===c?void 0:c.checked)||!1;r.updateElement(e,d.id,{type:"todo-list",props:{checked:!i}})}else if(n.isEnter(l)){l.preventDefault();const r=$e.above(t,{at:f,match:e=>!$e.isEditor(e)&&Ee.isElement(e)&&("numbered-list"===e.type||"bulleted-list"===e.type||"todo-list"===e.type),mode:"highest"});if(!r)return;const[n,o]=r,c=$e.isEnd(t,f,o),p=$e.isStart(t,f,o),u=$e.string(t,o),h=0===d.meta.depth,g=u.trim().length>0;if(!g){if(h){const t=d.meta.order;return void e.batchOperations((()=>{e.deleteBlock({blockId:d.id}),e.insertBlock(s.type,{at:t,focus:!0,blockData:s})}))}return void e.decreaseBlockDepth({blockId:d.id})}if(p){const t=i({type:d.type,meta:{order:d.meta.order,depth:d.meta.depth},value:[a({type:n.type,props:{nodeType:"block"}})]});return e.insertBlock(t.type,{at:d.meta.order,focus:!1,blockData:t}),void e.setPath({current:t.meta.order+1})}if(g&&!p&&!c)return void e.splitBlock({slate:t,focus:!0});const y=i({type:d.type,meta:{order:d.meta.order+1,depth:d.meta.depth},value:[a({type:n.type,props:{nodeType:"block"}})]});e.insertBlock(y.type,{at:d.meta.order+1,focus:!0,blockData:y})}else;}))}}function tt(t,r,n){const o=[],i="number"==typeof n.depth?n.depth:0;if("UL"===r.nodeName||"OL"===r.nodeName){const a=Array.from(r.children).filter((e=>"LI"===e.nodeName)),l=a.some((e=>{const t=e.querySelector('input[type="checkbox"]'),r=e.textContent||"",n=/\[\s*[xX\s]?\s*\]/.test(r);return t||n}));if(l&&"TodoList"!==n.type)return o;if(!l&&"TodoList"===n.type)return o;a.forEach((r=>{const a=r.textContent||"";let l=null;if("TodoList"===n.type){const o=r.querySelector('input[type="checkbox"]'),c=o?o.checked:/\[\s*[xX]\s*\]/.test(a);l={id:e(),type:"TodoList",value:[{id:e(),type:"todo-list",children:s(t,r.childNodes),props:{nodeType:"block",checked:c}}],meta:{order:0,depth:i,align:n.align}}}else{const o="NumberedList"===n.type?"numbered-list":"bulleted-list";l={id:e(),type:n.type,value:[{id:e(),type:o,children:s(t,r.childNodes),props:{nodeType:"block"}}],meta:{order:0,depth:i,align:n.align}}}if(l){const e=rt(l.value).map((e=>Ee.isElement(e)?e.children.length>0?e:Object.assign(Object.assign({},e),{children:[{text:""}]}):e)),t=Object.assign(Object.assign({},l),{value:e});o.push(t)}const c=Array.from(r.children).filter((e=>"UL"===e.nodeName||"OL"===e.nodeName));c.length>0&&c.forEach((e=>{const r=tt(t,e,Object.assign(Object.assign({},n),{depth:i+1}));o.push(...r)}))}))}return o}function rt(e){return e.map((e=>{if("children"in e)return Object.assign(Object.assign({},e),{children:rt(e.children)});if("text"in e){const t=e.text.replace(/\[\s*[xX\s]?\s*\]/,"").replace(/\u00a0/g," ");return t?Object.assign(Object.assign({},e),{text:t}):null}return e})).filter(Boolean)}const nt=new l({type:"BulletedList",elements:{"bulleted-list":{render:e=>{var t,r=v(e,["extendRender"]);const{blockId:o,HTMLAttributes:i={},attributes:a,children:s}=r,{className:l=""}=i,c=v(i,["className"]),d=n(o),p=`yoopta-align-${(null===(t=null==d?void 0:d.meta)||void 0===t?void 0:t.align)||"left"}`;return f("div",Object.assign({className:`yoopta-bulleted-list ${p} ${l}`},c,a,{children:[u("span",Object.assign({className:"yoopta-bulleted-list-bullet",contentEditable:!1},{children:"•"})),u("span",Object.assign({className:"yoopta-bulleted-list-content"},{children:s}))]}))}}},options:{display:{title:"Bulleted List",description:"Create bullet list"},shortcuts:["-"]},events:{onKeyDown:et},commands:y,parsers:{html:{deserialize:{nodeNames:["UL"],parse(e,t){if("UL"===e.nodeName){const r=e.getAttribute("data-meta-align")||"left",n=parseInt(e.getAttribute("data-meta-depth")||"0",10),o=tt(t,e,{type:"BulletedList",depth:n,align:r});if(o.length>0)return o}}},serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`<ul data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${20*o}px; text-align: ${n}"><li>${c(e.children)}</li></ul>`}},markdown:{serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`${" ".repeat(o)}- ${d(e.children)}`}},email:{serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n <ul data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${20*o}px; text-align: ${n}; \n font-size: 16px;\n line-height: 1.75rem;\n padding-bottom: 2px;\n padding-left: 1rem;\n padding-top: 2px;\n margin: 0;\n "><li style="margin: 0">${c(e.children)}</li></ul>\n </td>\n </tr>\n </tbody>\n </table>\n `}}}});const ot=new l({type:"NumberedList",elements:{"numbered-list":{render:e=>{var t,{extendRender:r}=e,o=v(e,["extendRender"]);const{attributes:i,children:a,blockId:s,HTMLAttributes:l={}}=o,{className:c=""}=l,d=v(l,["className"]),h=n(s),g=function(e,t){const r=Object.keys(e.children).sort(((t,r)=>{const n=e.children[t],o=e.children[r];return n.meta.order-o.meta.order}));let n=0,o=!0;for(let i of r){const r=e.children[i];if("NumberedList"===r.type){if(o&&(n=0,o=!1),r.meta.depth===t.meta.depth&&"NumberedList"===r.type&&(n++,i===t.id))break}else o=!0}return n}(p(),h),y=`yoopta-align-${(null===(t=null==h?void 0:h.meta)||void 0===t?void 0:t.align)||"left"}`;return r?r(Object.assign(Object.assign({},o),{count:g})):f("div",Object.assign({className:`yoopta-numbered-list ${y} ${c}`},d,i,{children:[f("span",Object.assign({className:"yoopta-numbered-list-count",contentEditable:!1},{children:[g,"."]})),u("span",Object.assign({className:"yoopta-numbered-list-content"},{children:a}))]}))},props:{nodeType:"block"}}},options:{display:{title:"Numbered List",description:"Create list with numbering"},shortcuts:["1."]},events:{onKeyDown:et},commands:m,parsers:{html:{deserialize:{nodeNames:["OL"],parse(e,t){if("OL"===e.nodeName){const r=e.getAttribute("data-meta-align")||"left",n=parseInt(e.getAttribute("data-meta-depth")||"0",10),o=tt(t,e,{type:"NumberedList",depth:n,align:r});if(o.length>0)return o}}},serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`<ol data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${20*o}px; text-align: ${n}"><li>${c(e.children)}</li></ol>`}},markdown:{serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`${" ".repeat(o)}- ${d(e.children)}`}},email:{serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n <ol data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${o}px; text-align: ${n}; font-size: 16px;\n line-height: 28px;\n padding-bottom: 2px;\n padding-left: 1rem;\n padding-top: 2px;\n margin: 0;\n "><li>${c(e.children)}</li></ol>\n </td>\n </tr>\n </tbody>\n </table>\n `}}}}),it=(...e)=>e.filter(((e,t,r)=>Boolean(e)&&r.indexOf(e)===t)).join(" ")
|
|
8
|
+
function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e){var t,r;return!1!==x(e)&&(void 0===(t=e.constructor)||!1!==x(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}var _=Symbol.for("immer-nothing"),k=Symbol.for("immer-draftable"),P=Symbol.for("immer-state");function j(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var N=Object.getPrototypeOf;function E(e){return!!e&&!!e[P]}function S(e){return!!e&&(A(e)||Array.isArray(e)||!!e[k]||!!e.constructor?.[k]||D(e)||$(e))}var L=Object.prototype.constructor.toString();function A(e){if(!e||"object"!=typeof e)return!1;const t=N(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===L}function T(e,t){0===B(e)?Reflect.ownKeys(e).forEach((r=>{t(r,e[r],e)})):e.forEach(((r,n)=>t(n,r,e)))}function B(e){const t=e[P];return t?t.type_:Array.isArray(e)?1:D(e)?2:$(e)?3:0}function z(e,t){return 2===B(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function C(e,t,r){const n=B(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function D(e){return e instanceof Map}function $(e){return e instanceof Set}function R(e){return e.copy_||e.base_}function q(e,t){if(D(e))return new Map(e);if($(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&A(e)){if(!N(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const r=Object.getOwnPropertyDescriptors(e);delete r[P];let n=Reflect.ownKeys(r);for(let t=0;t<n.length;t++){const o=n[t],i=r[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(r[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(N(e),r)}function F(e,t=!1){return I(e)||E(e)||!S(e)||(B(e)>1&&(e.set=e.add=e.clear=e.delete=M),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>F(t,!0)))),e}function M(){j(2)}function I(e){return Object.isFrozen(e)}var W,V={};function U(e){const t=V[e];return t||j(0),t}function K(){return W}function J(e,t){t&&(U("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Z(e){X(e),e.drafts_.forEach(G),e.drafts_=null}function X(e){e===W&&(W=e.parent_)}function H(e){return W={drafts_:[],parent_:W,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function G(e){const t=e[P];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Q(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[P].modified_&&(Z(t),j(4)),S(e)&&(e=Y(t,e),t.parent_||te(t,e)),t.patches_&&U("Patches").generateReplacementPatches_(r[P].base_,e,t.patches_,t.inversePatches_)):e=Y(t,r,[]),Z(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_?e:void 0}function Y(e,t,r){if(I(t))return t;const n=t[P];if(!n)return T(t,((o,i)=>ee(e,n,t,o,i,r))),t;if(n.scope_!==e)return t;if(!n.modified_)return te(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let o=t,i=!1;3===n.type_&&(o=new Set(t),t.clear(),i=!0),T(o,((o,a)=>ee(e,n,t,o,a,r,i))),te(e,t,!1),r&&e.patches_&&U("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function ee(e,t,r,n,o,i,a){if(E(o)){const a=Y(e,o,i&&t&&3!==t.type_&&!z(t.assigned_,n)?i.concat(n):void 0);if(C(r,n,a),!E(a))return;e.canAutoFreeze_=!1}else a&&r.add(o);if(S(o)&&!I(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Y(e,o),t&&t.scope_.parent_||"symbol"==typeof n||!Object.prototype.propertyIsEnumerable.call(r,n)||te(e,o)}}function te(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&F(t,r)}var re={get(e,t){if(t===P)return e;const r=R(e);if(!z(r,t))return function(e,t,r){const n=ie(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);const n=r[t];return e.finalized_||!S(n)?n:n===oe(e.base_,t)?(se(e),e.copy_[t]=le(n,e)):n},has:(e,t)=>t in R(e),ownKeys:e=>Reflect.ownKeys(R(e)),set(e,t,r){const n=ie(R(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=oe(R(e),t),a=n?.[P];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(((o=r)===(i=n)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==r||z(e.base_,t)))return!0;se(e),ae(e)}var o,i;return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==oe(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,se(e),ae(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=R(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){j(11)},getPrototypeOf:e=>N(e.base_),setPrototypeOf(){j(12)}},ne={};function oe(e,t){const r=e[P];return(r?R(r):e)[t]}function ie(e,t){if(!(t in e))return;let r=N(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=N(r)}}function ae(e){e.modified_||(e.modified_=!0,e.parent_&&ae(e.parent_))}function se(e){e.copy_||(e.copy_=q(e.base_,e.scope_.immer_.useStrictShallowCopy_))}T(re,((e,t)=>{ne[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),ne.deleteProperty=function(e,t){return ne.set.call(this,e,t,void 0)},ne.set=function(e,t,r){return re.set.call(this,e[0],t,r,e[0])};function le(e,t){const r=D(e)?U("MapSet").proxyMap_(e,t):$(e)?U("MapSet").proxySet_(e,t):function(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:K(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,i=re;r&&(o=[n],i=ne);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,s}(e,t);return(t?t.scope_:K()).drafts_.push(r),r}function ce(e){if(!S(e)||I(e))return e;const t=e[P];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=q(e,t.scope_.immer_.useStrictShallowCopy_)}else r=q(e,!0);return T(r,((e,t)=>{C(r,e,ce(t))})),t&&(t.finalized_=!1),r}var de=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...o){return n.produce(e,(e=>t.call(this,e,...o)))}}let n;if("function"!=typeof t&&j(6),void 0!==r&&"function"!=typeof r&&j(7),S(e)){const o=H(this),i=le(e,void 0);let a=!0;try{n=t(i),a=!1}finally{a?Z(o):X(o)}return J(o,r),Q(n,o)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===_&&(n=void 0),this.autoFreeze_&&F(n,!0),r){const t=[],o=[];U("Patches").generateReplacementPatches_(e,n,t,o),r(t,o)}return n}j(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,n;return[this.produce(e,t,((e,t)=>{r=e,n=t})),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){S(e)||j(8),E(e)&&(e=function(e){E(e)||j(10);return ce(e)}(e));const t=H(this),r=le(e,void 0);return r[P].isManual_=!0,X(t),r}finishDraft(e,t){const r=e&&e[P];r&&r.isManual_||j(9);const{scope_:n}=r;return J(n,t),Q(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=U("Patches").applyPatches_;return E(e)?n(e,t):this.produce(e,(e=>n(e,t)))}},pe=de.produce;de.produceWithPatches.bind(de),de.setAutoFreeze.bind(de),de.setUseStrictShallowCopy.bind(de),de.applyPatches.bind(de);var fe=de.createDraft.bind(de),ue=de.finishDraft.bind(de),he={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=he.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var o=e[n];if(o!==t[n])break;r.push(o)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return he.equals(n,o)&&i>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),o=t.slice(0,r);return he.equals(n,o)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return he.equals(n,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r])),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===he.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===he.compare(e,t),isBefore:(e,t)=>-1===he.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===he.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===he.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===he.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===he.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&he.equals(r,n)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=[],o=0;o<=e.length;o++)n.push(e.slice(0,o));return r&&n.reverse(),n},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!he.isAncestor(t,e)&&!he.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var n=[...e],{affinity:o="forward"}=r;if(0===e.length)return n;switch(t.type){case"insert_node":var{path:i}=t;(he.equals(i,n)||he.endsBefore(i,n)||he.isAncestor(i,n))&&(n[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(he.equals(a,n)||he.isAncestor(a,n))return null;he.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:s,position:l}=t;he.equals(s,n)||he.endsBefore(s,n)?n[s.length-1]-=1:he.isAncestor(s,n)&&(n[s.length-1]-=1,n[s.length]+=l);break;case"split_node":var{path:c,position:d}=t;if(he.equals(c,n)){if("forward"===o)n[n.length-1]+=1;else if("backward"!==o)return null}else he.endsBefore(c,n)?n[c.length-1]+=1:he.isAncestor(c,n)&&e[c.length]>=d&&(n[c.length-1]+=1,n[c.length]-=d);break;case"move_node":var{path:p,newPath:f}=t;if(he.equals(p,f))return n;if(he.isAncestor(p,n)||he.equals(p,n)){var u=f.slice();return he.endsBefore(p,f)&&p.length<f.length&&(u[p.length-1]-=1),u.concat(n.slice(p.length))}he.isSibling(p,f)&&(he.isAncestor(f,n)||he.equals(f,n))?he.endsBefore(p,n)?n[p.length-1]-=1:n[p.length-1]+=1:he.endsBefore(f,n)||he.equals(f,n)||he.isAncestor(f,n)?(he.endsBefore(p,n)&&(n[p.length-1]-=1),n[f.length-1]+=1):he.endsBefore(p,n)&&(he.equals(f,n)&&(n[f.length-1]+=1),n[p.length-1]-=1)}return n}};function ge(e){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(e)}function ye(e){var t=function(e,t){if("object"!==ge(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ge(t)?t:String(t)}function me(e,t,r){return(t=ye(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function be(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var we={transform(e,t){e.children=fe(e.children);var r=e.selection&&fe(e.selection);try{r=((e,t,r)=>{switch(r.type){case"insert_node":var{path:n,node:o}=r,i=Be.parent(e,n),a=n[n.length-1];if(a>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n,"] because the destination is past the end of the node."));if(i.children.splice(a,0,o),t)for(var[s,l]of Ne.points(t))t[l]=Me.transform(s,r);break;case"insert_text":var{path:c,offset:d,text:p}=r;if(0===p.length)break;var f=Be.leaf(e,c),u=f.text.slice(0,d),h=f.text.slice(d);if(f.text=u+p+h,t)for(var[g,y]of Ne.points(t))t[y]=Me.transform(g,r);break;case"merge_node":var{path:m}=r,b=Be.get(e,m),v=he.previous(m),w=Be.get(e,v),x=Be.parent(e,m),O=m[m.length-1];if(Xe.isText(b)&&Xe.isText(w))w.text+=b.text;else{if(Xe.isText(b)||Xe.isText(w))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(m,"] to nodes of different interfaces: ").concat(We.stringify(b)," ").concat(We.stringify(w)));w.children.push(...b.children)}if(x.children.splice(O,1),t)for(var[_,k]of Ne.points(t))t[k]=Me.transform(_,r);break;case"move_node":var{path:P,newPath:j}=r;if(he.isAncestor(P,j))throw new Error("Cannot move a path [".concat(P,"] to new path [").concat(j,"] because the destination is inside itself."));var N=Be.get(e,P),E=Be.parent(e,P),S=P[P.length-1];E.children.splice(S,1);var L=he.transform(P,r),A=Be.get(e,he.parent(L)),T=L[L.length-1];if(A.children.splice(T,0,N),t)for(var[B,z]of Ne.points(t))t[z]=Me.transform(B,r);break;case"remove_node":var{path:C}=r,D=C[C.length-1];if(Be.parent(e,C).children.splice(D,1),t)for(var[$,R]of Ne.points(t)){var q=Me.transform($,r);if(null!=t&&null!=q)t[R]=q;else{var F=void 0,M=void 0;for(var[I,W]of Be.texts(e)){if(-1!==he.compare(W,C)){M=[I,W];break}F=[I,W]}var V=!1;F&&M&&(V=he.equals(M[1],C)?!he.hasPrevious(M[1]):he.common(F[1],C).length<he.common(M[1],C).length),F&&!V?($.path=F[1],$.offset=F[0].text.length):M?($.path=M[1],$.offset=0):t=null}}break;case"remove_text":var{path:U,offset:K,text:J}=r;if(0===J.length)break;var Z=Be.leaf(e,U),X=Z.text.slice(0,K),H=Z.text.slice(K+J.length);if(Z.text=X+H,t)for(var[G,Q]of Ne.points(t))t[Q]=Me.transform(G,r);break;case"set_node":var{path:Y,properties:ee,newProperties:te}=r;if(0===Y.length)throw new Error("Cannot set properties on the root node!");var re=Be.get(e,Y);for(var ne in te){if("children"===ne||"text"===ne)throw new Error('Cannot set the "'.concat(ne,'" property of nodes!'));var oe=te[ne];null==oe?delete re[ne]:re[ne]=oe}for(var ie in ee)te.hasOwnProperty(ie)||delete re[ie];break;case"set_selection":var{newProperties:ae}=r;if(null==ae)t=ae;else{if(null==t){if(!Ne.isRange(ae))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(We.stringify(ae)," when there is no current selection."));t=ve({},ae)}for(var se in ae){var le=ae[se];if(null==le){if("anchor"===se||"focus"===se)throw new Error('Cannot remove the "'.concat(se,'" selection property'));delete t[se]}else t[se]=le}}break;case"split_node":var{path:ce,position:de,properties:pe}=r;if(0===ce.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(ce,"] because the root node cannot be split."));var fe,ue=Be.get(e,ce),ge=Be.parent(e,ce),ye=ce[ce.length-1];if(Xe.isText(ue)){var me=ue.text.slice(0,de),be=ue.text.slice(de);ue.text=me,fe=ve(ve({},pe),{},{text:be})}else{var we=ue.children.slice(0,de),xe=ue.children.slice(de);ue.children=we,fe=ve(ve({},pe),{},{children:xe})}if(ge.children.splice(ye+1,0,fe),t)for(var[Oe,_e]of Ne.points(t))t[_e]=Me.transform(Oe,r)}return t})(e,r,t)}finally{e.children=ue(e.children),e.selection=r?E(r)?ue(r):r:null}}},xe={insertNodes(e,t,r){e.insertNodes(t,r)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},Oe={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},_e=(e,t)=>{for(var r in e){var n=e[r],o=t[r];if(O(n)&&O(o)){if(!_e(n,o))return!1}else if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var i=0;i<n.length;i++)if(n[i]!==o[i])return!1}else if(n!==o)return!1}for(var a in t)if(void 0===e[a]&&void 0!==t[a])return!1;return!0};function ke(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Pe=["anchor","focus"];function je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Ne={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:o}=e;return Ne.isBackward(e)===r?[n,o]:[o,n]},end(e){var[,t]=Ne.edges(e);return t},equals:(e,t)=>Me.equals(e.anchor,t.anchor)&&Me.equals(e.focus,t.focus),includes(e,t){if(Ne.isRange(t)){if(Ne.includes(e,t.anchor)||Ne.includes(e,t.focus))return!0;var[r,n]=Ne.edges(e),[o,i]=Ne.edges(t);return Me.isBefore(r,o)&&Me.isAfter(n,i)}var[a,s]=Ne.edges(e),l=!1,c=!1;return Me.isPoint(t)?(l=Me.compare(t,a)>=0,c=Me.compare(t,s)<=0):(l=he.compare(t,a.path)>=0,c=he.compare(t,s.path)<=0),l&&c},intersection(e,t){var r=ke(e,Pe),[n,o]=Ne.edges(e),[i,a]=Ne.edges(t),s=Me.isBefore(n,i)?i:n,l=Me.isBefore(o,a)?o:a;return Me.isBefore(l,s)?null:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?je(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):je(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({anchor:s,focus:l},r)},isBackward(e){var{anchor:t,focus:r}=e;return Me.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return Me.equals(t,r)},isExpanded:e=>!Ne.isCollapsed(e),isForward:e=>!Ne.isBackward(e),isRange:e=>O(e)&&Me.isPoint(e.anchor)&&Me.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Ne.edges(e);return t},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return pe(e,(e=>{if(null===e)return null;var n,o,{affinity:i="inward"}=r;if("inward"===i){var a=Ne.isCollapsed(e);Ne.isForward(e)?(n="forward",o=a?n:"backward"):(n="backward",o=a?n:"forward")}else"outward"===i?Ne.isForward(e)?(n="backward",o="forward"):(n="forward",o="backward"):(n=i,o=i);var s=Me.transform(e.anchor,t,{affinity:n}),l=Me.transform(e.focus,t,{affinity:o});if(!s||!l)return null;e.anchor=s,e.focus=l}))}},Ee=e=>O(e)&&Be.isNodeList(e.children)&&!Re.isEditor(e),Se={isAncestor:e=>O(e)&&Be.isNodeList(e.children),isElement:Ee,isElementList:e=>Array.isArray(e)&&e.every((e=>Se.isElement(e))),isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return Ee(e)&&e[r]===t},matches(e,t){for(var r in t)if("children"!==r&&e[r]!==t[r])return!1;return!0}},Le=["children"],Ae=["text"],Te=new WeakMap,Be={ancestor(e,t){var r=Be.get(e,t);if(Xe.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(We.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of he.ancestors(t,r)){var o=[Be.ancestor(e,n),n];yield o}}()},child(e,t){if(Xe.isText(e))throw new Error("Cannot get the child of a text node: ".concat(We.stringify(e)));var r=e.children[t];if(null==r)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(We.stringify(e)));return r},children(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:n=!1}=r,o=Be.ancestor(e,t),{children:i}=o,a=n?i.length-1:0;n?a>=0:a<i.length;){var s=Be.child(o,a),l=t.concat(a);yield[s,l],a=n?a-1:a+1}}()},common(e,t,r){var n=he.common(t,r);return[Be.get(e,n),n]},descendant(e,t){var r=Be.get(e,t);if(Re.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(We.stringify(r)));return r},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of Be.nodes(e,t))0!==n.length&&(yield[r,n])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of Be.nodes(e,t))Se.isElement(r)&&(yield[r,n])}()},extractProps:e=>Se.isAncestor(e)?ke(e,Le):ke(e,Ae),first(e,t){for(var r=t.slice(),n=Be.get(e,r);n&&!Xe.isText(n)&&0!==n.children.length;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){if(Xe.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(We.stringify(e)));return pe({children:e.children},(e=>{var[r,n]=Ne.edges(t),o=Be.nodes(e,{reverse:!0,pass:e=>{var[,r]=e;return!Ne.includes(t,r)}});for(var[,i]of o){if(!Ne.includes(t,i)){var a=Be.parent(e,i),s=i[i.length-1];a.children.splice(s,1)}if(he.equals(i,n.path)){var l=Be.leaf(e,i);l.text=l.text.slice(0,n.offset)}if(he.equals(i,r.path)){var c=Be.leaf(e,i);c.text=c.text.slice(r.offset)}}Re.isEditor(e)&&(e.selection=null)})).children},get(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(Xe.isText(r)||!r.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(We.stringify(e)));r=r.children[o]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(Xe.isText(r)||!r.children[o])return!1;r=r.children[o]}return!0},isNode:e=>Xe.isText(e)||Se.isElement(e)||Re.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=Te.get(e);if(void 0!==t)return t;var r=e.every((e=>Be.isNode(e)));return Te.set(e,r),r},last(e,t){for(var r=t.slice(),n=Be.get(e,r);n&&!Xe.isText(n)&&0!==n.children.length;){var o=n.children.length-1;n=n.children[o],r.push(o)}return[n,r]},leaf(e,t){var r=Be.get(e,t);if(!Xe.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(We.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of he.levels(t,r)){var o=Be.get(e,n);yield[o,n]}}()},matches:(e,t)=>Se.isElement(e)&&Se.isElementProps(t)&&Se.matches(e,t)||Xe.isText(e)&&Xe.isTextProps(t)&&Xe.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:r,reverse:n=!1}=t,{from:o=[],to:i}=t,a=new Set,s=[],l=e;!i||!(n?he.isBefore(s,i):he.isAfter(s,i));)if(a.has(l)||(yield[l,s]),a.has(l)||Xe.isText(l)||0===l.children.length||null!=r&&!1!==r([l,s])){if(0===s.length)break;if(!n){var c=he.next(s);if(Be.has(e,c)){s=c,l=Be.get(e,s);continue}}if(n&&0!==s[s.length-1])s=he.previous(s),l=Be.get(e,s);else s=he.parent(s),l=Be.get(e,s),a.add(l)}else{a.add(l);var d=n?l.children.length-1:0;he.isAncestor(s,o)&&(d=o[s.length]),s=s.concat(d),l=Be.get(e,s)}}()},parent(e,t){var r=he.parent(t),n=Be.get(e,r);if(Xe.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>Xe.isText(e)?e.text:e.children.map(Be.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of Be.nodes(e,t))Xe.isText(r)&&(yield[r,n])}()}};function ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var De={isNodeOperation:e=>De.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!O(e))return!1;switch(e.type){case"insert_node":case"remove_node":return he.isPath(e.path)&&Be.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&he.isPath(e.path);case"merge_node":return"number"==typeof e.position&&he.isPath(e.path)&&O(e.properties);case"move_node":return he.isPath(e.path)&&he.isPath(e.newPath);case"set_node":return he.isPath(e.path)&&O(e.properties)&&O(e.newProperties);case"set_selection":return null===e.properties&&Ne.isRange(e.newProperties)||null===e.newProperties&&Ne.isRange(e.properties)||O(e.properties)&&O(e.newProperties);case"split_node":return he.isPath(e.path)&&"number"==typeof e.position&&O(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>De.isOperation(e))),isSelectionOperation:e=>De.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>De.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Ce(Ce({},e),{},{type:"remove_node"});case"insert_text":return Ce(Ce({},e),{},{type:"remove_text"});case"merge_node":return Ce(Ce({},e),{},{type:"split_node",path:he.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(he.equals(t,r))return e;if(he.isSibling(r,t))return Ce(Ce({},e),{},{path:t,newPath:r});var n=he.transform(r,e),o=he.transform(he.next(r),e);return Ce(Ce({},e),{},{path:n,newPath:o});case"remove_node":return Ce(Ce({},e),{},{type:"insert_node"});case"remove_text":return Ce(Ce({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return Ce(Ce({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:s,newProperties:l}=e;return Ce(Ce({},e),{},null==s?{properties:l,newProperties:null}:null==l?{properties:null,newProperties:s}:{properties:l,newProperties:s});case"split_node":return Ce(Ce({},e),{},{type:"merge_node",path:he.next(e.path)})}}},$e=new WeakMap,Re={above:(e,t)=>e.above(t),addMark(e,t,r){e.addMark(t,r)},after:(e,t,r)=>e.after(t,r),before:(e,t,r)=>e.before(t,r),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,r){e.insertFragment(t,r)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,r)=>e.isEdge(t,r),isEditor:e=>(e=>{var t=$e.get(e);if(void 0!==t)return t;if(!O(e))return!1;var r="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||O(e.marks))&&(null===e.selection||Ne.isRange(e.selection))&&Be.isNodeList(e.children)&&De.isOperationList(e.operations);return $e.set(e,r),r})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,r)=>e.isEnd(t,r),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,r)=>e.isStart(t,r),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,r)=>e.leaf(t,r),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,r)=>e.node(t,r),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,r)=>e.parent(t,r),path:(e,t,r)=>e.path(t,r),pathRef:(e,t,r)=>e.pathRef(t,r),pathRefs:e=>e.pathRefs(),point:(e,t,r)=>e.point(t,r),pointRef:(e,t,r)=>e.pointRef(t,r),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,r)=>e.range(t,r),rangeRef:(e,t,r)=>e.rangeRef(t,r),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,r)=>e.string(t,r),unhangRange:(e,t,r)=>e.unhangRange(t,r),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)}};function qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Me={compare(e,t){var r=he.compare(e.path,t.path);return 0===r?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter:(e,t)=>1===Me.compare(e,t),isBefore:(e,t)=>-1===Me.compare(e,t),equals:(e,t)=>e.offset===t.offset&&he.equals(e.path,t.path),isPoint:e=>O(e)&&"number"==typeof e.offset&&he.isPath(e.path),transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return pe(e,(e=>{if(null===e)return null;var{affinity:n="forward"}=r,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":e.path=he.transform(o,t,r);break;case"insert_text":he.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===n)&&(e.offset+=t.text.length);break;case"merge_node":he.equals(t.path,o)&&(e.offset+=t.position),e.path=he.transform(o,t,r);break;case"remove_text":he.equals(t.path,o)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(he.equals(t.path,o)||he.isAncestor(t.path,o))return null;e.path=he.transform(o,t,r);break;case"split_node":if(he.equals(t.path,o)){if(t.position===i&&null==n)return null;(t.position<i||t.position===i&&"forward"===n)&&(e.offset-=t.position,e.path=he.transform(o,t,Fe(Fe({},r),{},{affinity:"forward"})))}else e.path=he.transform(o,t,r)}}))}},Ie=void 0,We={setScrubber(e){Ie=e},stringify:e=>JSON.stringify(e,Ie)},Ve=["text"],Ue=["anchor","focus"];function Ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ze,Xe={equals(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:n=!1}=r;function o(e){return ke(e,Ve)}return _e(n?o(e):e,n?o(t):t)},isText:e=>O(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>Xe.isText(e))),isTextProps:e=>void 0!==e.text,matches(e,t){for(var r in t)if("text"!==r&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[Je({},e)];for(var n of t){var o=ke(n,Ue),[i,a]=Ne.edges(n),s=[],l=0,c=i.offset,d=a.offset;for(var p of r){var{length:f}=p.text,u=l;if(l+=f,c<=u&&l<=d)Object.assign(p,o),s.push(p);else if(c!==d&&(c===l||d===u)||c>l||d<u||d===u&&0!==u)s.push(p);else{var h=p,g=void 0,y=void 0;if(d<l){var m=d-u;y=Je(Je({},h),{},{text:h.text.slice(m)}),h=Je(Je({},h),{},{text:h.text.slice(0,m)})}if(c>u){var b=c-u;g=Je(Je({},h),{},{text:h.text.slice(0,b)}),h=Je(Je({},h),{},{text:h.text.slice(b)})}Object.assign(h,o),g&&s.push(g),s.push(h),y&&s.push(y)}}r=s}return r}},He=e=>e.selection?e.selection:e.children.length>0?Re.end(e,[]):[0];!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(Ze||(Ze={})),Ze.L,Ze.L,Ze.V,Ze.LV,Ze.LVT,Ze.LV,Ze.V,Ze.V,Ze.T,Ze.LVT,Ze.T,Ze.T,Ze.Any,Ze.Extend,Ze.ZWJ,Ze.Any,Ze.SpacingMark,Ze.Prepend,Ze.Any,Ze.ZWJ,Ze.ExtPict,Ze.RI,Ze.RI;var Ge={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Re.withoutNormalizing(e,(()=>{var{voids:n=!1}=r,{at:o=He(e)}=r;if(he.isPath(o)&&(o=Re.range(e,o)),Ne.isRange(o))if(Ne.isCollapsed(o))o=o.anchor;else{var i=Ne.end(o);if(!n&&Re.void(e,{at:i}))return;var a=Ne.start(o),s=Re.pointRef(e,a),l=Re.pointRef(e,i);et.delete(e,{at:o,voids:n});var c=s.unref(),d=l.unref();o=c||d,et.setSelection(e,{anchor:o,focus:o})}if(!(!n&&Re.void(e,{at:o})||Re.elementReadOnly(e,{at:o}))){var{path:p,offset:f}=o;t.length>0&&e.apply({type:"insert_text",path:p,offset:f,text:t})}}))}};function Qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var et=Ye(Ye(Ye(Ye({},we),xe),Oe),Ge);function tt(e,t,{hotkeys:n,defaultBlock:s}){return l=>{Re.withoutNormalizing(t,(()=>{var c;const d=o(e);if(!t.selection||!d)return;const p=t.selection,{anchor:f}=p;if(n.isCmdEnter(l)){const n=Re.above(t,{at:f,match:e=>!Re.isEditor(e)&&Se.isElement(e)&&"todo-list"===e.type,mode:"highest"});if(!n)return;const[o]=n,i=(null===(c=o.props)||void 0===c?void 0:c.checked)||!1;r.updateElement(e,d.id,{type:"todo-list",props:{checked:!i}})}else if(n.isEnter(l)){l.preventDefault();const r=Re.above(t,{at:f,match:e=>!Re.isEditor(e)&&Se.isElement(e)&&("numbered-list"===e.type||"bulleted-list"===e.type||"todo-list"===e.type),mode:"highest"});if(!r)return;const[n,o]=r,c=Re.isEnd(t,f,o),p=Re.isStart(t,f,o),u=Re.string(t,o),h=0===d.meta.depth,g=u.trim().length>0;if(!g){if(h){const t=d.meta.order;return void e.batchOperations((()=>{e.deleteBlock({blockId:d.id}),e.insertBlock(s.type,{at:t,focus:!0,blockData:s})}))}return void e.decreaseBlockDepth({blockId:d.id})}if(p){const t=i({type:d.type,meta:{order:d.meta.order,depth:d.meta.depth},value:[a({type:n.type,props:{nodeType:"block"}})]});return e.insertBlock(t.type,{at:d.meta.order,focus:!1,blockData:t}),void e.setPath({current:t.meta.order+1})}if(g&&!p&&!c)return void e.splitBlock({slate:t,focus:!0});const y=i({type:d.type,meta:{order:d.meta.order+1,depth:d.meta.depth},value:[a({type:n.type,props:{nodeType:"block"}})]});e.insertBlock(y.type,{at:d.meta.order+1,focus:!0,blockData:y})}else;}))}}function rt(t,r,n){const o=[],i="number"==typeof n.depth?n.depth:0;if("UL"===r.nodeName||"OL"===r.nodeName){const a=Array.from(r.children).filter((e=>"LI"===e.nodeName)),l=a.some((e=>{const t=e.querySelector('input[type="checkbox"]'),r=e.textContent||"",n=/\[\s*[xX\s]?\s*\]/.test(r);return t||n}));if(l&&"TodoList"!==n.type)return o;if(!l&&"TodoList"===n.type)return o;a.forEach((r=>{const a=r.textContent||"";let l=null;if("TodoList"===n.type){const o=r.querySelector('input[type="checkbox"]'),c=o?o.checked:/\[\s*[xX]\s*\]/.test(a);l={id:e(),type:"TodoList",value:[{id:e(),type:"todo-list",children:s(t,r.childNodes),props:{nodeType:"block",checked:c}}],meta:{order:0,depth:i,align:n.align}}}else{const o="NumberedList"===n.type?"numbered-list":"bulleted-list";l={id:e(),type:n.type,value:[{id:e(),type:o,children:s(t,r.childNodes),props:{nodeType:"block"}}],meta:{order:0,depth:i,align:n.align}}}if(l){const e=nt(l.value).map((e=>Se.isElement(e)?e.children.length>0?e:Object.assign(Object.assign({},e),{children:[{text:""}]}):e)),t=Object.assign(Object.assign({},l),{value:e});o.push(t)}const c=Array.from(r.children).filter((e=>"UL"===e.nodeName||"OL"===e.nodeName));c.length>0&&c.forEach((e=>{const r=rt(t,e,Object.assign(Object.assign({},n),{depth:i+1}));o.push(...r)}))}))}return o}function nt(e){return e.map((e=>{if("children"in e)return Object.assign(Object.assign({},e),{children:nt(e.children)});if("text"in e){const t=e.text.replace(/\[\s*[xX\s]?\s*\]/,"").replace(/\u00a0/g," ");return t?Object.assign(Object.assign({},e),{text:t}):null}return e})).filter(Boolean)}const ot=new l({type:"BulletedList",elements:{"bulleted-list":{render:e=>{var t,r=w(e,["extendRender"]);const{blockId:o,HTMLAttributes:i={},attributes:a,children:s}=r,{className:l=""}=i,c=w(i,["className"]),d=n(o),p=`yoopta-align-${(null===(t=null==d?void 0:d.meta)||void 0===t?void 0:t.align)||"left"}`;return f("div",Object.assign({className:`yoopta-bulleted-list ${p} ${l}`},c,a,{children:[u("span",Object.assign({className:"yoopta-bulleted-list-bullet",contentEditable:!1},{children:"•"})),u("span",Object.assign({className:"yoopta-bulleted-list-content"},{children:s}))]}))}}},options:{display:{title:"Bulleted List",description:"Create bullet list"},shortcuts:["-"]},events:{onKeyDown:tt},commands:m,parsers:{html:{deserialize:{nodeNames:["UL"],parse(e,t){if("UL"===e.nodeName){const r=e.getAttribute("data-meta-align")||"left",n=parseInt(e.getAttribute("data-meta-depth")||"0",10),o=rt(t,e,{type:"BulletedList",depth:n,align:r});if(o.length>0)return o}}},serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`<ul data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${20*o}px; text-align: ${n}"><li>${c(e.children)}</li></ul>`}},markdown:{serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`${" ".repeat(o)}- ${d(e.children)}`}},email:{serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n <ul data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${20*o}px; text-align: ${n}; \n font-size: 16px;\n line-height: 1.75rem;\n padding-bottom: 2px;\n padding-left: 1rem;\n padding-top: 2px;\n margin: 0;\n "><li style="margin: 0">${c(e.children)}</li></ul>\n </td>\n </tr>\n </tbody>\n </table>\n `}}}});const it=new l({type:"NumberedList",elements:{"numbered-list":{render:e=>{var t,{extendRender:r}=e,o=w(e,["extendRender"]);const{attributes:i,children:a,blockId:s,HTMLAttributes:l={}}=o,{className:c=""}=l,d=w(l,["className"]),g=n(s),y=p(),m=h((()=>function(e,t){const r=Object.keys(e.children).sort(((t,r)=>{const n=e.children[t],o=e.children[r];return n.meta.order-o.meta.order})),n={},o={},i=t.meta.depth;for(let a of r){const r=e.children[a],s=r.meta.depth,l=r.type;if(a===t.id)break;if("NumberedList"===l&&(void 0===n[s]&&(n[s]=0),"NumberedList"!==o[s]&&(n[s]=0),n[s]++),o[s]=l,s<i)for(let e in n)Number(e)>s&&(n[e]=0,o[e]="")}return void 0===n[i]&&(n[i]=0),"NumberedList"!==o[i]&&(n[i]=0),n[i]++,n[i]}(y,g)),[g,y.children]),b=`yoopta-align-${(null===(t=null==g?void 0:g.meta)||void 0===t?void 0:t.align)||"left"}`;return r?r(Object.assign(Object.assign({},o),{count:m})):f("div",Object.assign({className:`yoopta-numbered-list ${b} ${c}`},d,i,{children:[f("span",Object.assign({className:"yoopta-numbered-list-count",contentEditable:!1},{children:[m,"."]})),u("span",Object.assign({className:"yoopta-numbered-list-content"},{children:a}))]}))},props:{nodeType:"block"}}},options:{display:{title:"Numbered List",description:"Create list with numbering"},shortcuts:["1."]},events:{onKeyDown:tt},commands:b,parsers:{html:{deserialize:{nodeNames:["OL"],parse(e,t){if("OL"===e.nodeName){const r=e.getAttribute("data-meta-align")||"left",n=parseInt(e.getAttribute("data-meta-depth")||"0",10),o=rt(t,e,{type:"NumberedList",depth:n,align:r});if(o.length>0)return o}}},serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`<ol data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${20*o}px; text-align: ${n}"><li>${c(e.children)}</li></ol>`}},markdown:{serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`${" ".repeat(o)}- ${d(e.children)}`}},email:{serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n <ol data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${o}px; text-align: ${n}; font-size: 16px;\n line-height: 28px;\n padding-bottom: 2px;\n padding-left: 1rem;\n padding-top: 2px;\n margin: 0;\n "><li>${c(e.children)}</li></ol>\n </td>\n </tr>\n </tbody>\n </table>\n `}}}}),at=(...e)=>e.filter(((e,t,r)=>Boolean(e)&&r.indexOf(e)===t)).join(" ")
|
|
9
9
|
/**
|
|
10
10
|
* @license lucide-react v0.453.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
13
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/;var
|
|
14
|
+
*/;var st={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
|
|
15
15
|
/**
|
|
16
16
|
* @license lucide-react v0.453.0 - ISC
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the ISC license.
|
|
19
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/const
|
|
20
|
+
*/const lt=g((({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:a,...s},l)=>y("svg",{ref:l,...st,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:at("lucide",o),...s},[...a.map((([e,t])=>y(e,t))),...Array.isArray(i)?i:[i]]))),ct=((e,t)=>{const r=g((({className:r,...n},o)=>{return y(lt,{ref:o,iconNode:t,className:at(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...n});var i}));return r.displayName=`${e}`,r})("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);
|
|
21
21
|
/**
|
|
22
22
|
* @license lucide-react v0.453.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/function
|
|
26
|
+
*/function dt(...e){return e.filter(Boolean).join(" ")}const pt={BulletedList:ot,NumberedList:it,TodoList:new l({type:"TodoList",elements:{"todo-list":{render:e=>{var t,{extendRender:o}=e,i=w(e,["extendRender"]);const{attributes:a,element:s,children:l,blockId:c,HTMLAttributes:d={}}=i,h=p(),g=n(c),{className:y=""}=d,m=w(d,["className"]),{checked:b=!1}=s.props||{},v=(null===(t=null==g?void 0:g.meta)||void 0===t?void 0:t.align)||"left";return o?o(i):f("div",Object.assign({className:dt("yoopta-todo-list yoo-lists-group",`yoo-lists-text-${v}`,y),"data-checked":b},m,a,{children:[f("button",Object.assign({type:"button",onClick:()=>r.updateElement(h,c,{type:"todo-list",props:{checked:!b}}),className:dt("yoopta-todo-list-checkbox",b?"yoopta-todo-list-checkbox--checked":"yoopta-todo-list-checkbox--unchecked"),contentEditable:!1},{children:[u(ct,{className:dt("yoopta-todo-list-checkbox-icon",b?"yoopta-todo-list-checkbox-icon--checked":"yoopta-todo-list-checkbox-icon--unchecked")}),u("input",{type:"checkbox",className:"yoopta-todo-list-checkbox-input",checked:b,disabled:h.readOnly,onChange:()=>{}})]})),u("div",Object.assign({className:dt("yoopta-todo-list-content",b&&"yoopta-todo-list-content--checked"),style:{textDecoration:b?"line-through":"none"}},{children:l}))]}))},props:{checked:!1}}},options:{display:{title:"Todo List",description:"Track tasks"},shortcuts:["[]"]},events:{onKeyDown:tt},commands:v,parsers:{html:{deserialize:{nodeNames:["OL","UL"],parse(e,t){if("OL"===e.nodeName||"UL"===e.nodeName){const r=e.getAttribute("data-meta-align")||"left",n=parseInt(e.getAttribute("data-meta-depth")||"0",10),o=rt(t,e,{type:"TodoList",depth:n,align:r});if(o.length>0)return o}}},serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`<ul data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${20*o}px; text-align: ${n}"><li>[${e.props.checked?"x":" "}] ${c(e.children)}</li></ul>`}},markdown:{serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`${" ".repeat(o)}- ${e.props.checked?"[x]":"[ ]"} ${d(e.children)}`}},email:{serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n <ul data-meta-align="${n}" data-meta-depth="${o}" style="margin-left: ${20*o}px; text-align: ${n}; font-size: 16px;\n line-height: 28px;\n padding-bottom: 2px;\n padding-left: 1rem;\n padding-top: 2px;\n margin: 0;\n "><li>[${e.props.checked?"x":" "}] ${c(e.children)}</li></ul>\n </td>\n </tr>\n </tbody>\n </table>\n `}}}})};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".yoopta-numbered-list{align-items:center;margin-left:10px;position:relative}.yoopta-numbered-list>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.yoopta-numbered-list{font-size:16px;line-height:28px;padding-bottom:2px;padding-left:1rem;padding-top:2px}.yoopta-numbered-list-count{left:0;min-width:10px;position:absolute;top:2px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto}.yoopta-bulleted-list{align-items:center;margin-left:10px;position:relative}.yoopta-bulleted-list>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.yoopta-bulleted-list{font-size:16px;line-height:1.75rem;padding-bottom:2px;padding-left:1rem;padding-top:2px}.yoopta-bulleted-list-bullet{font-weight:700;left:0;min-width:10px;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto}.yoopta-bulleted-list-content{margin-left:0}.yoopta-todo-list{align-items:flex-start;display:flex;gap:.75rem;padding-bottom:.25rem;padding-top:.25rem;position:relative}.yoopta-todo-list-checkbox{align-items:center;border-radius:.25rem;border-width:1px;cursor:pointer;display:flex;flex-shrink:0;height:1rem;justify-content:center;margin-top:.25rem;position:relative;transition-duration:.2s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:1rem}.yoopta-todo-list-checkbox:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity));--tw-ring-offset-width:2px;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000);outline:2px solid transparent;outline-offset:2px}.yoopta-todo-list-checkbox--checked{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity));border-color:rgb(59 130 246/var(--tw-border-opacity))}.yoopta-todo-list-checkbox--checked:hover{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity));border-color:rgb(37 99 235/var(--tw-border-opacity))}.yoopta-todo-list-checkbox--unchecked{--tw-border-opacity:1;background-color:transparent;border-color:rgb(209 213 219/var(--tw-border-opacity))}.yoopta-todo-list-checkbox--unchecked:hover{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.yoo-lists-group:hover .yoopta-todo-list-checkbox--unchecked{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.yoopta-todo-list-checkbox-icon{stroke-width:3;height:.75rem;width:.75rem}.yoopta-todo-list-checkbox-icon--checked{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.yoopta-todo-list-checkbox-icon--unchecked{color:transparent}.yoopta-todo-list-checkbox-input{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.yoopta-todo-list-content{flex:1 1 0%;transition-duration:.2s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoopta-todo-list-content--checked{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}");const ft=pt.NumberedList,ut=pt.BulletedList,ht=pt.TodoList;export{ut as BulletedList,m as BulletedListCommands,ft as NumberedList,b as NumberedListCommands,ht as TodoList,v as TodoListCommands,pt as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/lists",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.7",
|
|
4
4
|
"description": "Lists plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/Darginec05/Yoopta-Editor/issues"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "64c31820942608637d52766e09c741a8634519dc"
|
|
38
38
|
}
|