@siliconoid/xssml-editor 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function t(e,t,n,i,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(i,r)}function n(e,t,n){return t=l(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,v(i.key),i)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){return a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},a.apply(null,arguments)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
- var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var l=i&&i.prototype instanceof a?i:a,c=Object.create(l.prototype);return f(c,"_invoke",function(n,i,r){var o,a,l,c=0,h=r||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function p(n,i){for(a=n,l=i,t=0;!u&&c&&!r&&t<h.length;t++){var r,o=h[t],p=d.p,f=o[2];n>3?(r=f===i)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=p&&((r=n<2&&p<o[1])?(a=0,d.v=i,d.n=o[1]):p<f&&(r=n<3||o[0]>i||i>f)&&(o[4]=n,o[5]=i,d.n=f,a=0))}if(r||n>1)return s;throw u=!0,i}return function(r,h,f){if(c>1)throw TypeError("Generator is already running");for(u&&1===h&&p(h,f),a=h,l=f;(t=a<2?e:l)||!u;){o||(a?a<3?(a>1&&(d.n=-1),p(a,l)):d.n=l:d.v=l);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(u=d.n<0)?l:n.call(i,d))!==s)break}catch(t){o=e,a=1,l=t}finally{c=1}}return{value:t,done:u}}}(n,r,o),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(f(t={},i,function(){return this}),t),u=c.prototype=a.prototype=Object.create(h);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,r,"GeneratorFunction")),e.prototype=Object.create(u),e}return l.prototype=c,f(u,"constructor",c),f(c,"constructor",l),l.displayName="GeneratorFunction",f(c,r,"GeneratorFunction"),f(u),f(u,r,"Generator"),f(u,i,function(){return this}),f(u,"toString",function(){return"[object Generator]"}),(p=function(){return{w:o,m:d}})()}function f(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}f=function(e,t,n,i){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,i)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||b(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function x(e){return x="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},x(e)}function b(t,n){if(t){if("string"==typeof t)return e(t,n);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?e(t,n):void 0}}var w=function(e){return e.phoneme_mark="phoneme_mark",e.highlight="highlight",e.textmedia="textmedia",e.tts_speed="tts_speed",e.tts_pitch="tts_pitch",e.tts_volume="tts_volume",e.word_mark="word_mark",e}({}),k=function(e){return e.Word="word",e.Breath="breath",e.Break="break",e.Phoneme="phoneme",e.SayAs="say-as",e.Number="say-as",e.Sub="sub",e.Alias="sub",e.Speaker="speaker",e.SpeechRate="speed",e.SpeechPitch="pitch",e.SpeechVolume="volume",e.SpeechLanguage="lang",e.Action="action",e.Avatar="avatar",e.Emotion="emotion",e.Command="command",e.Data="data",e.Wait="wait",e.PptControl="ppt_control",e.SoundEvent="soundEvent",e.RangeAnchor="range_anchor",e}({}),S=function(e){return e.auto="auto",e.cardinal="cardinal",e.digits="digits",e}({}),z=function(e){return e[e.auto=0]="auto",e[e.digits=1]="digits",e[e.cardinal=2]="cardinal",e}({}),C=function(e){return e.insertAction="insertAction",e.clearAction="clearAction",e}({}),M=function(e){return e.setSpeechRate="setSpeechRate",e}({}),N=function(e){return e.setSpeechPitch="setSpeechPitch",e}({}),T=function(e){return e.setSpeechVolume="setSpeechVolume",e}({}),O=function(e){return e.setSpeechLanguage="setSpeechLanguage",e}({}),E=function(e){return e[e.ERROR=0]="ERROR",e[e.WARN=1]="WARN",e[e.INFO=2]="INFO",e[e.DEBUG=3]="DEBUG",e}({}),A=new(function(){return o(function e(){i(this,e),s(this,"level",E.WARN),s(this,"prefix","[XSSML Editor]")},[{key:"setLevel",value:function(e){this.level=e}},{key:"getLevel",value:function(){return this.level}},{key:"error",value:function(e){if(this.level>=E.ERROR){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=console).error.apply(t,[this.prefix,e].concat(i))}}},{key:"warn",value:function(e){if(this.level>=E.WARN){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=console).warn.apply(t,[this.prefix,e].concat(i))}}},{key:"info",value:function(e){if(this.level>=E.INFO){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=console).info.apply(t,[this.prefix,e].concat(i))}}},{key:"debug",value:function(e){if(this.level>=E.DEBUG){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=console).log.apply(t,[this.prefix,"[DEBUG]",e].concat(i))}}}])}()),j=new(function(){function e(){i(this,e),s(this,"commands",new Map)}return o(e,[{key:"register",value:function(e){var t=e.name;this.commands.has(t)&&A.warn("Command ".concat(t," already registered, overwriting...")),this.commands.set(t,e)}},{key:"unregister",value:function(e){this.commands.delete(e)}},{key:"get",value:function(e){return this.commands.get(e)}},{key:"getAll",value:function(){return Object.fromEntries(this.commands)}},{key:"execute",value:function(e,t){var n=this.commands.get(e);if(!n)return{success:!1,error:"Command ".concat(e," not found")};for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];if(n.validate){var s=n.validate.apply(n,[t].concat(r)),a=s.reason;if(!s.available)return{success:!1,error:a}}try{return n.execute.apply(n,[t].concat(r))}catch(e){return{success:!1,error:e instanceof Error?e.message:"Unknown error"}}}},{key:"clone",value:function(){var t=new e;return this.commands.forEach(function(e,n){return t.register(e)}),t}}])}());function D(e){j.register(e)}var R=function(e){return e.all="all",e.selection="selection",e.cursorRight="cursor_right",e}({}),I=function(e){return e[e.Success=0]="Success",e[e.ParamsMissing=1e5]="ParamsMissing",e[e.ParamsInvalid=100001]="ParamsInvalid",e[e.SelectionInvalid=100002]="SelectionInvalid",e[e.CursorInvalid=100003]="CursorInvalid",e[e.StateError=100004]="StateError",e[e.CommandNotFound=100005]="CommandNotFound",e[e.ExecutionError=999999]="ExecutionError",e}({});function q(e){this.content=e}function P(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let r=e.child(i),o=t.child(i);if(r!=o){if(!r.sameMarkup(o))return n;if(r.isText&&r.text!=o.text){for(let e=0;r.text[e]==o.text[e];e++)n++;return n}if(r.content.size||o.content.size){let e=P(r.content,o.content,n+1);if(null!=e)return e}n+=r.nodeSize}else n+=r.nodeSize}}function _(e,t,n,i){for(let r=e.childCount,o=t.childCount;;){if(0==r||0==o)return r==o?null:{a:n,b:i};let s=e.child(--r),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:i};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,i--;return{a:n,b:i}}if(s.content.size||a.content.size){let e=_(s.content,a.content,n-1,i-1);if(e)return e}n-=l,i-=l}else n-=l,i-=l}}D({name:C.insertAction,description:"插入动作",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Action].create(d(d({},n),{},{type:k.Action}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Action])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"光标处插入设置动作"}}}),D({name:C.clearAction,description:"清空动作",execute:function(e){var t=e.state,n=e.dispatch;if(n){var i=t.tr,r=t.doc,o=t.schema,s=[];r.descendants(function(e,t){e.type===o.nodes[k.Action]&&s.push({node:e,pos:t})});for(var a=s.length-1;a>=0;a-=1){var l=s[a],c=l.node,h=l.pos;i.delete(h,h+c.nodeSize)}n(i.scrollIntoView())}return{success:!0}},validate:function(e){return{available:!0}}}),q.prototype={constructor:q,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,r=i.find(e),o=i.content.slice();return-1==r?o.push(n||e,t):(o[r+1]=t,n&&(o[r]=n)),new q(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new q(n)},addToStart:function(e,t){return new q([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new q(n)},addBefore:function(e,t,n){var i=this.remove(t),r=i.content.slice(),o=i.find(e);return r.splice(-1==o?r.length:o,0,t,n),new q(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=q.from(e)).size?new q(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=q.from(e)).size?new q(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=q.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},q.from=function(e){if(e instanceof q)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new q(t)};class L{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,i=0,r){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,i+s,r||null,o)&&a.content.size){let r=s+1;a.nodesBetween(Math.max(0,e-r),Math.min(a.content.size,t-r),n,i+r)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let r="",o=!0;return this.nodesBetween(e,t,(s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?i?"function"==typeof i?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!1:r+=n),r+=l},0),r}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),r=1);r<e.content.length;r++)i.push(e.content[r]);return new L(i,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],i=0;if(t>e)for(let r=0,o=0;o<t;r++){let s=this.content[r],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),i+=s.nodeSize),o=a}return new L(n,i)}cutByIndex(e,t){return e==t?L.empty:0==e&&t==this.content.length?this:new L(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),r=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new L(i,r)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return P(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return _(this,e,t,n)}findIndex(e){if(0==e)return F(0,e);if(e==this.size)return F(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=n+this.child(t).nodeSize;if(i>=e)return i==e?F(t+1,i):F(t,n);n=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return L.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.empty;let t,n=0;for(let i=0;i<e.length;i++){let r=e[i];n+=r.nodeSize,i&&r.isText&&e[i-1].sameMarkup(r)?(t||(t=e.slice(0,i)),t[t.length-1]=r.withText(t[t.length-1].text+r.text)):t&&t.push(r)}return new L(t||e,n)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const B={index:0,offset:0};function F(e,t){return B.index=e,B.offset=t,B}function V(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!V(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!V(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class W{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let r=e[i];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,i));else{if(r.type.excludes(this.type))return e;!n&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(r)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&V(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return W.none;if(e instanceof W)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}W.none=[];class $ extends Error{}class J{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=H(this.content,e+this.openStart,t);return n&&new J(n,this.openStart,this.openEnd)}removeBetween(e,t){return new J(U(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return J.empty;let n=t.openStart||0,i=t.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new J(L.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)i++;return new J(e,n,i)}}function U(e,t,n){let{index:i,offset:r}=e.findIndex(t),o=e.maybeChild(i),{index:s,offset:a}=e.findIndex(n);if(r==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(i,o.copy(U(o.content,t-r-1,n-r-1)))}function H(e,t,n,i){let{index:r,offset:o}=e.findIndex(t),s=e.maybeChild(r);if(o==t||s.isText)return i&&!i.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=H(s.content,t-o-1,n,s);return a&&e.replaceChild(r,s.copy(a))}function K(e,t,n){if(n.openStart>e.depth)throw new $("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new $("Inconsistent open depths");return G(e,t,n,0)}function G(e,t,n,i){let r=e.index(i),o=e.node(i);if(r==t.index(i)&&i<e.depth-n.openStart){let s=G(e,t,n,i+1);return o.copy(o.content.replaceChild(r,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=i||t.depth!=i){let{start:r,end:s}=function(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)i=t.node(e).copy(L.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(n,e);return ee(o,te(e,r,s,t,i))}{let i=e.parent,r=i.content;return ee(i,r.cut(0,e.parentOffset).append(n.content).append(r.cut(t.parentOffset)))}}return ee(o,ne(e,t,i))}function Y(e,t){if(!t.type.compatibleContent(e.type))throw new $("Cannot join "+t.type.name+" onto "+e.type.name)}function X(e,t,n){let i=e.node(n);return Y(i,t.node(n)),i}function Z(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Q(e,t,n,i){let r=(t||e).node(n),o=0,s=t?t.index(n):r.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Z(e.nodeAfter,i),o++));for(let e=o;e<s;e++)Z(r.child(e),i);t&&t.depth==n&&t.textOffset&&Z(t.nodeBefore,i)}function ee(e,t){return e.type.checkContent(t),e.copy(t)}function te(e,t,n,i,r){let o=e.depth>r&&X(e,t,r+1),s=i.depth>r&&X(n,i,r+1),a=[];return Q(null,e,r,a),o&&s&&t.index(r)==n.index(r)?(Y(o,s),Z(ee(o,te(e,t,n,i,r+1)),a)):(o&&Z(ee(o,ne(e,t,r+1)),a),Q(t,n,r,a),s&&Z(ee(s,ne(n,i,r+1)),a)),Q(i,null,r,a),new L(a)}function ne(e,t,n){let i=[];if(Q(null,e,n,i),e.depth>n){Z(ee(X(e,t,n+1),ne(e,t,n+1)),i)}return Q(t,null,n,i),new L(i)}J.empty=new J(L.empty,0,0);class ie{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],i=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)i+=n.child(t).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return W.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let e=n;n=i,i=e}let r=n.marks;for(var o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||i&&r[o].isInSet(i.marks)||(r=r[o--].removeFromSet(r));return r}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var r=0;r<n.length;r++)!1!==n[r].type.spec.inclusive||i&&n[r].isInSet(i.marks)||(n=n[r--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ae(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,r=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(r),s=r-o;if(n.push(t,e,i+o),!s)break;if(t=t.child(e),t.isText)break;r=s-1,i+=o+1}return new ie(t,n,r)}static resolveCached(e,t){let n=se.get(e);if(n)for(let e=0;e<n.elts.length;e++){let i=n.elts[e];if(i.pos==t)return i}else se.set(e,n=new re);let i=n.elts[n.i]=ie.resolve(e,t);return n.i=(n.i+1)%oe,i}}class re{constructor(){this.elts=[],this.i=0}}const oe=12,se=new WeakMap;class ae{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const le=Object.create(null);let ce=class e{constructor(e,t,n,i=W.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||L.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&V(this.attrs,t||e.defaultAttrs||le)&&W.sameSet(this.marks,n||W.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return J.empty;let i=this.resolve(e),r=this.resolve(t),o=n?0:i.sharedDepth(t),s=i.start(o),a=i.node(o).content.cut(i.pos-s,r.pos-s);return new J(a,i.depth-o,r.depth-o)}replace(e,t,n){return K(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return ie.resolveCached(this,e)}resolveNoCache(e){return ie.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ue(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=L.empty,i=0,r=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,r),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=i;e<r;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let r=this.contentMatchAt(e).matchType(n),o=r&&r.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=W.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!W.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=L.fromJSON(e,t.content),r=e.nodeType(t.type).create(t.attrs,i,n);return r.type.checkAttrs(r.attrs),r}};ce.prototype.text=void 0;class he extends ce{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ue(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new he(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new he(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ue(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class de{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new pe(e,t);if(null==n.next)return de.empty;let i=fe(n);n.next&&n.err("Unexpected trailing text");let r=function(e){let t=Object.create(null);return n(be(e,0));function n(i){let r=[];i.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let i;for(let e=0;e<r.length;e++)r[e][0]==t&&(i=r[e][1]);be(e,n).forEach(e=>{i||r.push([t,i=[]]),-1==i.indexOf(e)&&i.push(e)})})});let o=t[i.join(",")]=new de(i.indexOf(e.length-1)>-1);for(let e=0;e<r.length;e++){let i=r[e][1].sort(xe);o.next.push({type:r[e][0],next:t[i.join(",")]||n(i)})}return o}}(function(e){let t=[[]];return r(o(e,0),n()),t;function n(){return t.push([])-1}function i(e,n,i){let r={term:i,to:n};return t[e].push(r),r}function r(e,t){e.forEach(e=>e.to=t)}function o(e,t){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(o(n,t)),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return i(t,s),r(o(e.expr,s),s),[i(s)]}if("plus"==e.type){let s=n();return r(o(e.expr,t),s),r(o(e.expr,s),s),[i(s)]}if("opt"==e.type)return[i(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();r(o(e.expr,s),t),s=t}if(-1==e.max)r(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();i(s,t),r(o(e.expr,s),t),s=t}return[i(s)]}if("name"==e.type)return[i(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let i=0;;i++){let s=o(e.exprs[i],t);if(i==e.exprs.length-1)return s;r(s,t=n())}}}(i));return function(e,t){for(let n=0,i=[e];n<i.length;n++){let e=i[n],r=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!r||n.isText||n.hasRequiredAttrs()||(r=!1),-1==i.indexOf(s)&&i.push(s)}r&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(r,n),r}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let r=t;i&&r<n;r++)i=i.matchType(e.child(r).type);return i}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];return function r(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return L.from(s.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==i.indexOf(n)){i.push(n);let e=r(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),r=i.match;if(r.matchType(e)){let e=[];for(let t=i;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<r.next.length;e++){let{type:o,next:s}=r.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||i.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:i}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let i=0;i<n.next.length;i++)-1==e.indexOf(n.next[i].next)&&t(n.next[i].next)}(this),e.map((t,n)=>{let i=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)i+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return i}).join("\n")}}de.empty=new de(!0);class pe{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function fe(e){let t=[];do{t.push(me(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function me(e){let t=[];do{t.push(ge(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function ge(e){let t=function(e){if(e.eat("(")){let t=fe(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let r=[];for(let e in n){let i=n[e];i.isInGroup(t)&&r.push(i)}0==r.length&&e.err("No node type or group '"+t+"' found");return r}(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=ve(e,t)}return t}function ye(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function ve(e,t){let n=ye(e),i=n;return e.eat(",")&&(i="}"!=e.next?ye(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function xe(e,t){return t-e}function be(e,t){let n=[];return function t(i){let r=e[i];if(1==r.length&&!r[0].term)return t(r[0].to);n.push(i);for(let e=0;e<r.length;e++){let{term:i,to:o}=r[e];i||-1!=n.indexOf(o)||t(o)}}(t),n.sort(xe)}function we(e){let t=Object.create(null);for(let n in e){let i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function ke(e,t){let n=Object.create(null);for(let i in e){let r=t&&t[i];if(void 0===r){let t=e[i];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+i);r=t.default}n[i]=r}return n}function Se(e,t,n,i){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let n in e){let i=e[n];i.validate&&i.validate(t[n])}}function ze(e,t){let n=Object.create(null);if(t)for(let i in t)n[i]=new Me(e,i,t[i]);return n}let Ce=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=ze(e,n.attrs),this.defaultAttrs=we(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==de.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ke(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ce(this,this.computeAttrs(e),L.from(t),W.setFrom(n))}createChecked(e=null,t,n){return t=L.from(t),this.checkContent(t),new ce(this,this.computeAttrs(e),t,W.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=L.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let i=this.contentMatch.matchFragment(t),r=i&&i.fillBefore(L.empty,!0);return r?new ce(this,e,t.append(r),W.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Se(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:W.none:e}static compile(t,n){let i=Object.create(null);t.forEach((t,r)=>i[t]=new e(t,n,r));let r=n.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let e in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};class Me{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let i=n.split("|");return n=>{let r=null===n?"null":typeof n;if(i.indexOf(r)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${r}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Ne{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=ze(e,i.attrs),this.excluded=null;let r=we(this.attrs);this.instance=r?new W(this,r):null}create(e=null){return!e&&this.instance?this.instance:new W(this,ke(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((e,r)=>n[e]=new Ne(e,i++,t,r)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Se(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Te{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=q.from(e.nodes),t.marks=q.from(e.marks||{}),this.nodes=Ce.compile(this.spec.nodes,this),this.marks=Ne.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],i=t.spec.content||"",r=t.spec.marks;if(t.contentMatch=n[i]||(n[i]=de.parse(i,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==r?null:r?Oe(this,r.split(" ")):""!=r&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Oe(this,n.split(" "))}this.nodeFromJSON=e=>ce.fromJSON(this,e),this.markFromJSON=e=>W.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Ce))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new he(n,n.defaultAttrs,e,W.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Oe(e,t){let n=[];for(let i=0;i<t.length;i++){let r=t[i],o=e.marks[r],s=o;if(o)n.push(o);else for(let t in e.marks){let i=e.marks[t];("_"==r||i.spec.group&&i.spec.group.split(" ").indexOf(r)>-1)&&n.push(s=i)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}let Ee=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new qe(this,t,!1);return n.addAll(e,W.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new qe(this,t,!0);return n.addAll(e,W.none,t.from,t.to),J.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let n=this.tags[i];if(Pe(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,i){for(let r=i?this.styles.indexOf(i)+1:0;r<this.styles.length;r++){let i=this.styles[r],o=i.style;if(!(0!=o.indexOf(e)||i.context&&!n.matchesContext(i.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(i.getAttrs){let e=i.getAttrs(t);if(!1===e)continue;i.attrs=e||void 0}return i}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,i=0;for(;i<t.length;i++){let e=t[i];if((null==e.priority?50:e.priority)<n)break}t.splice(i,0,e)}for(let t in e.marks){let i=e.marks[t].spec.parseDOM;i&&i.forEach(e=>{n(e=_e(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let i=e.nodes[t].spec.parseDOM;i&&i.forEach(e=>{n(e=_e(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}};const Ae={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},je={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},De={ol:!0,ul:!0};function Re(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Ie{constructor(e,t,n,i,r,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=W.none,this.match=r||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(L.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=L.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ae.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class qe{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i,r=t.topNode,o=Re(null,t.preserveWhitespace,0)|(n?4:0);i=r?new Ie(r.type,r.attrs,W.none,!0,t.topMatch||r.type.contentMatch,o):new Ie(n?null:e.schema.topNodeType,null,W.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,r=2&i.options?"full":this.localPreserveWS||(1&i.options)>0,{schema:o}=this.parser;if("full"===r||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r)if("full"===r)n=n.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=i.content[i.content.length-1],r=e.previousSibling;(!t||r&&"BR"==r.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,r=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o,s=e.nodeName.toLowerCase();De.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&De.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));e:if(a?a.ignore:je.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let n,i=this.needsBlock;if(Ae.hasOwnProperty(s))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),n=!0,r.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let o=a&&a.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(r),this.needsBlock=i}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,a,n,!1===a.consuming?o:void 0)}this.localPreserveWS=i}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let i=this.parser.matchedStyles[e],r=n.getPropertyValue(i);if(r)for(let e;;){let n=this.parser.matchStyle(i,r,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1!==n.consuming)break;e=n}}return t}addElementByRule(e,t,n,i){let r,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(r=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let i=e;"string"==typeof t.contentElement?i=e.querySelector(t.contentElement):"function"==typeof t.contentElement?i=t.contentElement(e):t.contentElement&&(i=t.contentElement),this.findAround(e,i,!0),this.addAll(i,n),this.findAround(e,i,!1)}r&&this.sync(s)&&this.open--}addAll(e,t,n,i){let r=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==i?null:e.childNodes[i];o!=s;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o,t);this.findAtPoint(e,r)}findPlace(e,t,n){let i,r;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],a=s.findWrapping(e);if(a&&(!i||i.length>a.length+o)&&(i=a,r=s,!a.length))break;if(s.solid){if(n)break;o+=2}}if(!i)return null;this.sync(r);for(let e=0;e<i.length;e++)t=this.enterInner(i[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=W.none;for(let r of i.concat(e.marks))(t.type?t.type.allowsMarkType(r.type):Le(r.type,e.type))&&(n=r.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,i){let r=this.findPlace(e.create(t),n,!1);return r&&(r=this.enterInner(e,t,n,!0,i)),r}enterInner(e,t,n,i=!1,r){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=Re(e,r,o.options);4&o.options&&0==o.content.length&&(s|=4);let a=W.none;return n=n.filter(t=>!(o.type?o.type.allowsMarkType(t.type):Le(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new Ie(e,t,a,i,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)if(null==this.find[i].pos&&1==e.nodeType&&e.contains(this.find[i].node)){t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),r=-(n?n.depth+1:0)+(i?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=r;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&i?this.nodes[s].type:n&&s>=r?n.node(s-r).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function Pe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function _e(e){let t={};for(let n in e)t[n]=e[n];return t}function Le(e,t){let n=t.schema.nodes;for(let i in n){let r=n[i];if(!r.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:i,next:r}=e.edge(n);if(i==t)return!0;if(o.indexOf(r)<0&&s(r))return!0}};if(s(r.contentMatch))return!0}}class Be{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Ve(t).createDocumentFragment());let i=n,r=[];return e.forEach(e=>{if(r.length||e.marks.length){let n=0,o=0;for(;n<r.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(r[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<r.length;)i=r.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(r.push([n,i]),i.appendChild(s.dom),i=s.contentDOM||s.dom)}}i.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=Je(Ve(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let r=this.serializeMark(e.marks[i],e.isInline,t);r&&((r.contentDOM||r.dom).appendChild(n),n=r.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Je(Ve(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return Je(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Be(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Fe(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Fe(e.marks)}}function Fe(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Ve(e){return e.document||window.document}const We=new WeakMap;function $e(e){let t=We.get(e);return void 0===t&&We.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}(e)),t}function Je(e,t,n,i){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,o=t[0];if("string"!=typeof o)throw new RangeError("Invalid array passed to renderSpec");if(i&&(r=$e(i))&&r.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,a=o.indexOf(" ");a>0&&(n=o.slice(0,a),o=o.slice(a+1));let l=n?e.createElementNS(n,o):e.createElement(o),c=t[1],h=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){h=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?l.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&l.style?l.style.cssText=c[e]:l.setAttribute(e,c[e])}}for(let r=h;r<t.length;r++){let o=t[r];if(0===o){if(r<t.length-1||r>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}{let{dom:t,contentDOM:r}=Je(e,o,n,i);if(l.appendChild(t),r){if(s)throw new RangeError("Multiple content holes");s=r}}}return{dom:l,contentDOM:s}}const Ue=Math.pow(2,16);function He(e,t){return e+t*Ue}function Ke(e){return 65535&e}class Ge{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Ye{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ye.empty)return Ye.empty}recover(e){let t=0,n=Ke(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Ue}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,r=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?i:0);if(a>e)break;let l=this.ranges[s+r],c=this.ranges[s+o],h=a+l;if(e<=h){let r=a+i+((l?e==a?-1:e==h?1:t:t)<0?0:c);if(n)return r;let o=e==(t<0?a:h)?null:He(s/3,e-a),u=e==a?2:e==h?1:4;return(t<0?e!=a:e!=h)&&(u|=8),new Ge(r,u,o)}i+=c-l}return n?e+i:new Ge(e+i,0,null)}touches(e,t){let n=0,i=Ke(t),r=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+r];if(e<=s+a&&t==3*i)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,r=0;i<this.ranges.length;i+=3){let o=this.ranges[i],s=o-(this.inverted?r:0),a=o+(this.inverted?0:r),l=this.ranges[i+t],c=this.ranges[i+n];e(s,s+l,a,a+c),r+=c-l}}invert(){return new Ye(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Ye.empty:new Ye(e<0?[0,-e,0]:[0,0,e])}}Ye.empty=new Ye([]);class Xe{constructor(e,t,n=0,i=(e?e.length:0)){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Xe(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],null!=i&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=i&&i>t?n-i-1:void 0)}}invert(){let e=new Xe;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let n=this.from;n<this.to;n++){let r=this._maps[n].mapResult(e,t);if(null!=r.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(r.recover);continue}}i|=r.delInfo,e=r.pos}return n?e:new Ge(e,i,null)}}const Ze=Object.create(null);class Qe{getMap(){return Ye.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Ze[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ze)throw new RangeError("Duplicate use of step JSON ID "+e);return Ze[e]=t,t.prototype.jsonID=e,t}}class et{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new et(e,null)}static fail(e){return new et(null,e)}static fromReplace(e,t,n,i){try{return et.ok(e.replace(t,n,i))}catch(e){if(e instanceof $)return et.fail(e.message);throw e}}}function tt(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let o=e.child(r);o.content.size&&(o=o.copy(tt(o.content,t,o))),o.isInline&&(o=t(o,n,r)),i.push(o)}return L.fromArray(i)}class nt extends Qe{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),r=new J(tt(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,i),t.openStart,t.openEnd);return et.fromReplace(e,this.from,this.to,r)}invert(){return new it(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new nt(t.pos,n.pos,this.mark)}merge(e){return e instanceof nt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new nt(t.from,t.to,e.markFromJSON(t.mark))}}Qe.jsonID("addMark",nt);class it extends Qe{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new J(tt(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return et.fromReplace(e,this.from,this.to,n)}invert(){return new nt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new it(t.pos,n.pos,this.mark)}merge(e){return e instanceof it&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new it(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new it(t.from,t.to,e.markFromJSON(t.mark))}}Qe.jsonID("removeMark",it);class rt extends Qe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return et.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return et.fromReplace(e,this.pos,this.pos+1,new J(L.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new rt(this.pos,t.marks[n]);return new rt(this.pos,this.mark)}}return new ot(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rt(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new rt(t.pos,e.markFromJSON(t.mark))}}Qe.jsonID("addNodeMark",rt);class ot extends Qe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return et.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return et.fromReplace(e,this.pos,this.pos+1,new J(L.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new rt(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ot(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ot(t.pos,e.markFromJSON(t.mark))}}Qe.jsonID("removeNodeMark",ot);class st extends Qe{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&lt(e,this.from,this.to)?et.fail("Structure replace would overwrite content"):et.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ye([this.from,this.to-this.from,this.slice.size])}invert(e){return new st(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new st(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof st)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?J.empty:new J(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new st(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?J.empty:new J(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new st(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new st(t.from,t.to,J.fromJSON(e,t.slice),!!t.structure)}}Qe.jsonID("replace",st);class at extends Qe{constructor(e,t,n,i,r,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=r,this.insert=o,this.structure=s}apply(e){if(this.structure&&(lt(e,this.from,this.gapFrom)||lt(e,this.gapTo,this.to)))return et.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return et.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?et.fromReplace(e,this.from,this.to,n):et.fail("Content does not fit in gap")}getMap(){return new Ye([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new at(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),r=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||r>n.pos?null:new at(t.pos,n.pos,i,r,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new at(t.from,t.to,t.gapFrom,t.gapTo,J.fromJSON(e,t.slice),t.insert,!!t.structure)}}function lt(e,t,n){let i=e.resolve(t),r=n-t,o=i.depth;for(;r>0&&o>0&&i.indexAfter(o)==i.node(o).childCount;)o--,r--;if(r>0){let e=i.node(o).maybeChild(i.indexAfter(o));for(;r>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,r--}}return!1}function ct(e,t,n,i=n.contentMatch,r=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<o.childCount;t++){let l=o.child(t),c=a+l.nodeSize,h=i.matchType(l.type);if(h){i=h;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new it(a,c,l.marks[t]));if(r&&l.isText&&"pre"!=n.whitespace){let e,t,i=/\r?\n|\r/g;for(;e=i.exec(l.text);)t||(t=new J(L.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new st(a+e.index,a+e.index+e[0].length,t))}}else s.push(new st(a,c,J.empty));a=c}if(!i.validEnd){let t=i.fillBefore(L.empty,!0);e.replace(a,a,new J(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function ht(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ut(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,i=0,r=0;;--n){let o=e.$from.node(n),s=e.$from.index(n)+i,a=e.$to.indexAfter(n)-r;if(n<e.depth&&o.canReplace(s,a,t))return n;if(0==n||o.type.spec.isolating||!ht(o,s,a))break;s&&(i=1),a<o.childCount&&(r=1)}return null}function dt(e,t,n,i){t.forEach((r,o)=>{if(r.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(r.text);){let r=e.mapping.slice(i).map(n+1+o+s.index);e.replaceWith(r,r+1,t.type.schema.linebreakReplacement.create())}}})}function pt(e,t,n,i){t.forEach((r,o)=>{if(r.type==r.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+o);e.replaceWith(r,r+1,t.type.schema.text("\n"))}})}function ft(e,t,n=1,i){let r=e.resolve(t),o=r.depth-n,s=i&&i[i.length-1]||r.parent;if(o<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!s.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let e=r.depth-1,t=n-2;e>o;e--,t--){let n=r.node(e),o=r.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=i&&i[t+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=i&&i[t]||n;if(!n.canReplace(o+1,n.childCount)||!l.type.validContent(s))return!1}let a=r.indexAfter(o),l=i&&i[0];return r.node(o).canReplaceWith(a,a,l?l.type:r.node(o+1).type)}function mt(e,t){let n=e.resolve(t),i=n.index();return r=n.nodeBefore,o=n.nodeAfter,!(!r||!o||r.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let r=0;r<t.childCount;r++){let o=t.child(r),s=o.type==i?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n)return!1;if(!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(r,o))&&n.parent.canReplace(i,i+1);var r,o}function gt(e,t,n=t,i=J.empty){if(t==n&&!i.size)return null;let r=e.resolve(t),o=e.resolve(n);return yt(r,o,i)?new st(t,n,i):new vt(r,o,i).fit()}function yt(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Qe.jsonID("replaceAround",at);class vt{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=L.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=L.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let r=this.placed,o=n.depth,s=i.depth;for(;o&&s&&1==r.childCount;)r=r.firstChild.content,o--,s--;let a=new J(r,o,s);return e>-1?new at(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new st(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let r=t.firstChild;if(t.childCount>1&&(i=0),r.type.spec.isolating&&i<=n){e=n;break}t=r.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,i=null;n?(i=wt(this.unplaced.content,n-1).firstChild,e=i.content):e=this.unplaced.content;let r=e.firstChild;for(let e=this.depth;e>=0;e--){let o,{type:s,match:a}=this.frontier[e],l=null;if(1==t&&(r?a.matchType(r.type)||(l=a.fillBefore(L.from(r),!1)):i&&s.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:e,parent:i,inject:l};if(2==t&&r&&(o=a.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:e,parent:i,wrap:o};if(i&&a.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=wt(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new J(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=wt(e,t);if(i.childCount<=1&&t>0){let r=e.size-t<=t+i.size;this.unplaced=new J(xt(e,t-1,1),t-1,r?t-1:n)}else this.unplaced=new J(xt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:r}){for(;this.depth>t;)this.closeFrontierNode();if(r)for(let e=0;e<r.length;e++)this.openFrontierNode(r[e]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,c=[],{match:h,type:u}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)c.push(i.child(e));h=h.matchFragment(i)}let d=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=h.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(h=t,c.push(kt(e.mark(u.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?d:-1)))}let p=l==s.childCount;p||(d=-1),this.placed=bt(this.placed,t,L.from(c)),this.frontier[t].match=h,p&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<d;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?0==e?J.empty:new J(xt(o.content,e-1,1),e-1,d<0?o.openEnd:e-1):new J(xt(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!St(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=St(e,t,i,n,r);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:i}=this.frontier[n],r=St(e,n,i,t,!0);if(!r||r.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=bt(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),i=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,i)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=bt(this.placed,this.depth,L.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(L.empty,!0);e.childCount&&(this.placed=bt(this.placed,this.frontier.length,e))}}function xt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(xt(e.firstChild.content,t-1,n)))}function bt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(bt(e.lastChild.content,t-1,n)))}function wt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function kt(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,kt(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(L.empty,!0)))),e.copy(i)}function St(e,t,n,i,r){let o=e.node(t),s=r?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=i.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}(n,o.content,s)?a:null}function zt(e){return e.spec.defining||e.spec.definingForContent}function Ct(e,t,n,i,r){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(Ct(r.content,t+1,n,i,r)))}if(t>i){let t=r.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(L.empty,!0))}return e}function Mt(e,t){let n=[];for(let i=Math.min(e.depth,t.depth);i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}class Nt extends Qe{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return et.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return et.fromReplace(e,this.pos,this.pos+1,new J(L.from(i),0,t.isLeaf?0:1))}getMap(){return Ye.empty}invert(e){return new Nt(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Nt(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Nt(t.pos,t.attr,t.value)}}Qe.jsonID("attr",Nt);class Tt extends Qe{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return et.ok(n)}getMap(){return Ye.empty}invert(e){return new Tt(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Tt(t.attr,t.value)}}Qe.jsonID("docAttr",Tt);let Ot=class extends Error{};Ot=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Ot.prototype=Object.create(Error.prototype)).constructor=Ot,Ot.prototype.name="TransformError";class Et{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Xe}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ot(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let i=this.mapping.maps[n];n&&(e=i.map(e,1),t=i.map(t,-1)),i.forEach((n,i,r,o)=>{e=Math.min(e,r),t=Math.max(t,o)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=J.empty){let i=gt(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new J(L.from(n),0,0))}delete(e,t){return this.replace(e,t,J.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let r=e.doc.resolve(t),o=e.doc.resolve(n);if(yt(r,o,i))return e.step(new st(t,n,i));let s=Mt(r,o);0==s[s.length-1]&&s.pop();let a=-(r.depth+1);s.unshift(a);for(let e=r.depth,t=r.pos-1;e>0;e--,t--){let n=r.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:r.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],h=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==i.openStart)break;e=n.content}for(let e=h-1;e>=0;e--){let t=c[e],n=zt(t.type);if(n&&!t.sameMarkup(r.node(Math.abs(a)-1)))h=e;else if(n||!t.type.isTextblock)break}for(let t=i.openStart;t>=0;t--){let a=(t+h+1)%(i.openStart+1),u=c[a];if(u)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],h=!0;c<0&&(h=!1,c=-c);let d=r.node(c-1),p=r.index(c-1);if(d.canReplaceWith(p,p,u.type,u.marks))return e.replace(r.before(c),h?o.after(c):n,new J(Ct(i.content,0,i.openStart,a),a,i.openEnd))}}let u=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,i),!(e.steps.length>u));a--){let e=s[a];e<0||(t=r.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=function(e,t,n){let i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(0==i.parentOffset)for(let e=i.depth-1;e>=0;e--){let t=i.index(e);if(i.node(e).canReplaceWith(t,t,n))return i.before(e+1);if(t>0)return null}if(i.parentOffset==i.parent.content.size)for(let e=i.depth-1;e>=0;e--){let t=i.indexAfter(e);if(i.node(e).canReplaceWith(t,t,n))return i.after(e+1);if(t<i.node(e).childCount)return null}return null}(e.doc,t,i.type);null!=r&&(t=n=r)}e.replaceRange(t,n,new J(L.from(i),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let i=e.doc.resolve(t),r=e.doc.resolve(n),o=Mt(i,r);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||i.node(n).type.contentMatch.validEnd)return e.delete(i.start(n),r.end(n));if(n>0&&(s||i.node(n-1).canReplace(i.index(n-1),r.indexAfter(n-1))))return e.delete(i.before(n),r.after(n))}for(let o=1;o<=i.depth&&o<=r.depth;o++)if(t-i.start(o)==i.depth-o&&n>i.end(o)&&r.end(o)-n!=r.depth-o&&i.start(o-1)==r.start(o-1)&&i.node(o-1).canReplace(i.index(o-1),r.index(o-1)))return e.delete(i.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:i,$to:r,depth:o}=t,s=i.before(o+1),a=r.after(o+1),l=s,c=a,h=L.empty,u=0;for(let e=o,t=!1;e>n;e--)t||i.index(e)>0?(t=!0,h=L.from(i.node(e).copy(h)),u++):l--;let d=L.empty,p=0;for(let e=o,t=!1;e>n;e--)t||r.after(e+1)<r.end(e)?(t=!0,d=L.from(r.node(e).copy(d)),p++):c++;e.step(new at(l,c,s,a,new J(h.append(d),u,p),h.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let i=null,{linebreakReplacement:r}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(r&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(r);e&&!t?i=!1:!e&&t&&(i=!0)}let a=e.steps.length;if(!1===i){let i=e.doc.resolve(t+n);pt(e,i.node(),i.before(),a)}s.inlineContent&&ct(e,t+n-1,s,o.node().contentMatchAt(o.index()),null==i);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new st(c,l.map(t+n,-1),J.empty,!0)),!0===i){let t=e.doc.resolve(c);dt(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let i=L.empty;for(let e=n.length-1;e>=0;e--){if(i.size){let t=n[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=L.from(n[e].type.create(n[e].attrs,i))}let r=t.start,o=t.end;e.step(new at(r,o,r,o,new J(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){return function(e,t,n,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let s="function"==typeof r?r(t):r;if(t.isTextblock&&!t.hasMarkup(i,s)&&function(e,t,n){let i=e.resolve(t),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}(e.doc,e.mapping.slice(o).map(n),i)){let r=null;if(i.schema.linebreakReplacement){let e="pre"==i.whitespace,t=!!i.contentMatch.matchType(i.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0)}!1===r&&pt(e,t,n,o),ct(e,e.mapping.slice(o).map(n,1),i,void 0,null===r);let a=e.mapping.slice(o),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new at(l,c,l+1,c-1,new J(L.from(i.create(s,null,t.marks)),0,0),1,!0)),!0===r&&dt(e,t,n,o),!1}})}(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return function(e,t,n,i,r){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(i,null,r||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new at(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new J(L.from(s),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Nt(e,t,n)),this}setDocAttribute(e,t){return this.step(new Tt(e,t)),this}addNodeMark(e,t){return this.step(new rt(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof W)t.isInSet(n.marks)&&this.step(new ot(e,t));else{let i,r=n.marks,o=[];for(;i=t.isInSet(r);)o.push(new ot(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,n){return function(e,t,n=1,i){let r=e.doc.resolve(t),o=L.empty,s=L.empty;for(let e=r.depth,t=r.depth-n,a=n-1;e>t;e--,a--){o=L.from(r.node(e).copy(o));let t=i&&i[a];s=L.from(t?t.type.create(t.attrs,s):r.node(e).copy(s))}e.step(new st(t,t,new J(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,i){let r,o,s=[],a=[];e.doc.nodesBetween(t,n,(e,l,c)=>{if(!e.isInline)return;let h=e.marks;if(!i.isInSet(h)&&c.type.allowsMarkType(i.type)){let c=Math.max(l,t),u=Math.min(l+e.nodeSize,n),d=i.addToSet(h);for(let e=0;e<h.length;e++)h[e].isInSet(d)||(r&&r.to==c&&r.mark.eq(h[e])?r.to=u:s.push(r=new it(c,u,h[e])));o&&o.to==c?o.to=u:a.push(o=new nt(c,u,i))}}),s.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,i){let r=[],o=0;e.doc.nodesBetween(t,n,(e,s)=>{if(!e.isInline)return;o++;let a=null;if(i instanceof Ne){let t,n=e.marks;for(;t=i.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else i?i.isInSet(e.marks)&&(a=[i]):a=e.marks;if(a&&a.length){let i=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<r.length;e++){let t=r[e];t.step==o-1&&l.eq(r[e].style)&&(n=t)}n?(n.to=i,n.step=o):r.push({style:l,from:Math.max(s,t),to:i,step:o})}}}),r.forEach(t=>e.step(new it(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return ct(this,e,t,n),this}}const At=Object.create(null);class jt{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Dt(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=J.empty){let n=t.content.lastChild,i=null;for(let e=0;e<t.openEnd;e++)i=n,n=n.lastChild;let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=e.mapping.slice(r);e.replaceRange(c.map(a.pos),c.map(l.pos),s?J.empty:t),0==s&&Wt(e,r,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let r=0;r<i.length;r++){let{$from:o,$to:s}=i[r],a=e.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);r?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),Wt(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new qt(e):Vt(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let i=e.depth-1;i>=0;i--){let r=t<0?Vt(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):Vt(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Bt(e.node(0))}static atStart(e){return Vt(e,e,0,0,1)||new Bt(e)}static atEnd(e){return Vt(e,e,e.content.size,e.childCount,-1)||new Bt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=At[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in At)throw new RangeError("Duplicate use of selection JSON ID "+e);return At[e]=t,t.prototype.jsonID=e,t}getBookmark(){return qt.between(this.$anchor,this.$head).getBookmark()}}jt.prototype.visible=!0;class Dt{constructor(e,t){this.$from=e,this.$to=t}}let Rt=!1;function It(e){Rt||e.parent.inlineContent||(Rt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class qt extends jt{constructor(e,t=e){It(e),It(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return jt.near(n);let i=e.resolve(t.map(this.anchor));return new qt(i.parent.inlineContent?i:n,n)}replace(e,t=J.empty){if(super.replace(e,t),t==J.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof qt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Pt(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new qt(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if(n&&!i||(n=i>=0?1:-1),!t.parent.inlineContent){let e=jt.findFrom(t,n,!0)||jt.findFrom(t,-n,!0);if(!e)return jt.near(t,n);t=e.$head}return e.parent.inlineContent||(0==i||(e=(jt.findFrom(e,-n,!0)||jt.findFrom(e,n,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new qt(e,t)}}jt.jsonID("text",qt);class Pt{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Pt(e.map(this.anchor),e.map(this.head))}resolve(e){return qt.between(e.resolve(this.anchor),e.resolve(this.head))}}class _t extends jt{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:i}=t.mapResult(this.anchor),r=e.resolve(i);return n?jt.near(r):new _t(r)}content(){return new J(L.from(this.node),0,0)}eq(e){return e instanceof _t&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Lt(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new _t(e.resolve(t.anchor))}static create(e,t){return new _t(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}_t.prototype.visible=!1,jt.jsonID("node",_t);class Lt{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Pt(n,n):new Lt(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&_t.isSelectable(n)?new _t(t):jt.near(t)}}class Bt extends jt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=J.empty){if(t==J.empty){e.delete(0,e.doc.content.size);let t=jt.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Bt(e)}map(e){return new Bt(e)}eq(e){return e instanceof Bt}getBookmark(){return Ft}}jt.jsonID("all",Bt);const Ft={map(){return this},resolve:e=>new Bt(e)};function Vt(e,t,n,i,r,o=!1){if(t.inlineContent)return qt.create(e,n);for(let s=i-(r>0?0:1);r>0?s<t.childCount:s>=0;s+=r){let i=t.child(s);if(i.isAtom){if(!o&&_t.isSelectable(i))return _t.create(e,n-(r<0?i.nodeSize:0))}else{let t=Vt(e,i,n+r,r<0?i.childCount:0,r,o);if(t)return t}n+=i.nodeSize*r}return null}function Wt(e,t,n){let i=e.steps.length-1;if(i<t)return;let r,o=e.steps[i];(o instanceof st||o instanceof at)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(jt.near(e.doc.resolve(r),n)))}class $t extends Et{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return W.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||W.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let r=this.storedMarks;if(!r){let e=this.doc.resolve(t);r=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,r)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(jt.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Jt(e,t){return t&&e?e.bind(t):e}class Ut{constructor(e,t,n){this.name=e,this.init=Jt(t.init,n),this.apply=Jt(t.apply,n)}}const Ht=[new Ut("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Ut("selection",{init:(e,t)=>e.selection||jt.atStart(t.doc),apply:e=>e.selection}),new Ut("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,i)=>i.selection.$cursor?e.storedMarks:null}),new Ut("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Kt{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ht.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Ut(e.key,e.spec.state,e))})}}class Gt{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),i=null;for(;;){let r=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=i?i[o].n:0,l=i?i[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let e=0;e<this.config.plugins.length;e++)i.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),r=!0}i&&(i[o]={state:n,n:t.length})}}if(!r)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Gt(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let r=n[i];t[r.name]=r.apply(e,this[r.name],this,t)}return t}get tr(){return new $t(this)}static create(e){let t=new Kt(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Gt(t);for(let i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n}reconfigure(e){let t=new Kt(this.schema,e.plugins),n=t.fields,i=new Gt(t);for(let t=0;t<n.length;t++){let r=n[t].name;i[r]=this.hasOwnProperty(r)?this[r]:n[t].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],r=i.spec.state;r&&r.toJSON&&(t[n]=r.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Kt(e.schema,e.plugins),r=new Gt(i);return i.fields.forEach(i=>{if("doc"==i.name)r.doc=ce.fromJSON(e.schema,t.doc);else if("selection"==i.name)r.selection=jt.fromJSON(r.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(r.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==i.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(r[i.name]=a.fromJSON.call(s,e,t[o],r))}r[i.name]=i.init(e,r)}}),r}}function Yt(e,t,n){for(let i in e){let r=e[i];r instanceof Function?r=r.bind(t):"handleDOMEvents"==i&&(r=Yt(r,t,{})),n[i]=r}return n}class Xt{constructor(e){this.spec=e,this.props={},e.props&&Yt(e.props,this,this.props),this.key=e.key?e.key.key:Qt("plugin")}getState(e){return e[this.key]}}const Zt=Object.create(null);function Qt(e){return e in Zt?e+"$"+ ++Zt[e]:(Zt[e]=0,e+"$")}class en{constructor(e="key"){this.key=Qt(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const tn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},nn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let rn=null;const on=function(e,t,n){let i=rn||(rn=document.createRange());return i.setEnd(e,null==n?e.nodeValue.length:n),i.setStart(e,t||0),i},sn=function(e,t,n,i){return n&&(ln(e,t,n,i,-1)||ln(e,t,n,i,1))},an=/^(img|br|input|textarea|hr)$/i;function ln(e,t,n,i,r){for(var o;;){if(e==n&&t==i)return!0;if(t==(r<0?0:cn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||hn(e)||an.test(e.nodeName)||"false"==e.contentEditable)return!1;t=tn(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(r<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(o=n.pmViewDesc)||void 0===o?void 0:o.ignoreForSelection))return!1;t+=r}else e=n,t=r<0?cn(e):0}}}}function cn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function hn(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const un=function(e){return e.focusNode&&sn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function dn(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const pn="undefined"!=typeof navigator?navigator:null,fn="undefined"!=typeof document?document:null,mn=pn&&pn.userAgent||"",gn=/Edge\/(\d+)/.exec(mn),yn=/MSIE \d/.exec(mn),vn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mn),xn=!!(yn||vn||gn),bn=yn?document.documentMode:vn?+vn[1]:gn?+gn[1]:0,wn=!xn&&/gecko\/(\d+)/i.test(mn);wn&&(/Firefox\/(\d+)/.exec(mn)||[0,0])[1];const kn=!xn&&/Chrome\/(\d+)/.exec(mn),Sn=!!kn,zn=kn?+kn[1]:0,Cn=!xn&&!!pn&&/Apple Computer/.test(pn.vendor),Mn=Cn&&(/Mobile\/\w+/.test(mn)||!!pn&&pn.maxTouchPoints>2),Nn=Mn||!!pn&&/Mac/.test(pn.platform),Tn=!!pn&&/Win/.test(pn.platform),On=/Android \d/.test(mn),En=!!fn&&"webkitFontSmoothing"in fn.documentElement.style,An=En?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function jn(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Dn(e,t){return"number"==typeof e?e:e[t]}function Rn(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,i=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*i}}function In(e,t,n){let i=e.someProp("scrollThreshold")||0,r=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=nn(s);continue}let e=s,n=e==o.body,a=n?jn(o):Rn(e),l=0,c=0;if(t.top<a.top+Dn(i,"top")?c=-(a.top-t.top+Dn(r,"top")):t.bottom>a.bottom-Dn(i,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+Dn(r,"top")-a.top:t.bottom-a.bottom+Dn(r,"bottom")),t.left<a.left+Dn(i,"left")?l=-(a.left-t.left+Dn(r,"left")):t.right>a.right-Dn(i,"right")&&(l=t.right-a.right+Dn(r,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,i=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let r=e.scrollLeft-n,o=e.scrollTop-i;t={left:t.left-r,top:t.top-o,right:t.right-r,bottom:t.bottom-o}}let h=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(h))break;s="absolute"==h?s.offsetParent:nn(s)}}function qn(e){let t=[],n=e.ownerDocument;for(let i=e;i&&(t.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),e!=n);i=nn(i));return t}function Pn(e,t){for(let n=0;n<e.length;n++){let{dom:i,top:r,left:o}=e[n];i.scrollTop!=r+t&&(i.scrollTop=r+t),i.scrollLeft!=o&&(i.scrollLeft=o)}}let _n=null;function Ln(e,t){let n,i,r,o,s=2e8,a=0,l=t.top,c=t.top;for(let h=e.firstChild,u=0;h;h=h.nextSibling,u++){let e;if(1==h.nodeType)e=h.getClientRects();else{if(3!=h.nodeType)continue;e=on(h).getClientRects()}for(let d=0;d<e.length;d++){let p=e[d];if(p.top<=l&&p.bottom>=c){l=Math.max(p.bottom,l),c=Math.min(p.top,c);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<s){n=h,s=e,i=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==h.nodeType&&e&&(a=u+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!r&&p.left<=t.left&&p.right>=t.left&&(r=h,o={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=u+1)}}return!n&&r&&(n=r,i=o,s=0),n&&3==n.nodeType?function(e,t){let n,i=e.nodeValue.length,r=document.createRange();for(let o=0;o<i;o++){r.setEnd(e,o+1),r.setStart(e,o);let i=$n(r,1);if(i.top!=i.bottom&&Bn(t,i)){n={node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)};break}}return r.detach(),n||{node:e,offset:0}}(n,i):!n||s&&1==n.nodeType?{node:e,offset:a}:Ln(n,i)}function Bn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Fn(e,t,n){let i=e.childNodes.length;if(i&&n.top<n.bottom)for(let r=Math.max(0,Math.min(i-1,Math.floor(i*(t.top-n.top)/(n.bottom-n.top))-2)),o=r;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let i=0;i<e.length;i++){let r=e[i];if(Bn(t,r))return Fn(n,t,r)}}if((o=(o+1)%i)==r)break}return e}function Vn(e,t){let n,i=e.dom.ownerDocument,r=0,o=function(e,t,n){if(e.caretPositionFromPoint)try{let i=e.caretPositionFromPoint(t,n);if(i)return{node:i.offsetNode,offset:Math.min(cn(i.offsetNode),i.offset)}}catch(e){}if(e.caretRangeFromPoint){let i=e.caretRangeFromPoint(t,n);if(i)return{node:i.startContainer,offset:Math.min(cn(i.startContainer),i.startOffset)}}}(i,t.left,t.top);o&&({node:n,offset:r}=o);let s,a=(e.root.elementFromPoint?e.root:i).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!Bn(t,n))return null;if(a=Fn(e.dom,t,n),!a)return null}if(Cn)for(let e=a;n&&e;e=nn(e))e.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(wn&&1==n.nodeType&&(r=Math.min(r,n.childNodes.length),r<n.childNodes.length)){let e,i=n.childNodes[r];"IMG"==i.nodeName&&(e=i.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&r++}let i;En&&r&&1==n.nodeType&&1==(i=n.childNodes[r-1]).nodeType&&"false"==i.contentEditable&&i.getBoundingClientRect().top>=t.top&&r--,n==e.dom&&r==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=r&&1==n.nodeType&&"BR"==n.childNodes[r-1].nodeName||(s=function(e,t,n,i){let r=-1;for(let n=t,o=!1;n!=e.dom;){let t,s=e.docView.nearestDesc(n,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((t=s.dom.getBoundingClientRect()).width||t.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!o&&t.left>i.left||t.top>i.top?r=s.posBefore:(!o&&t.right<i.left||t.bottom<i.top)&&(r=s.posAfter),o=!0),!s.contentDOM&&r<0&&!s.node.isText))return(s.node.isBlock?i.top<(t.top+t.bottom)/2:i.left<(t.left+t.right)/2)?s.posBefore:s.posAfter;n=s.dom.parentNode}return r>-1?r:e.docView.posFromDOM(t,n,-1)}(e,n,r,t))}null==s&&(s=function(e,t,n){let{node:i,offset:r}=Ln(t,n),o=-1;if(1==i.nodeType&&!i.firstChild){let e=i.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(i,r,o)}(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function Wn(e){return e.top<e.bottom||e.left<e.right}function $n(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Wn(e))return e}return Array.prototype.find.call(n,Wn)||e.getBoundingClientRect()}const Jn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Un(e,t,n){let{node:i,offset:r,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=En||wn;if(3==i.nodeType){if(!s||!Jn.test(i.nodeValue)&&(n<0?r:r!=i.nodeValue.length)){let e=r,t=r,o=n<0?1:-1;return n<0&&!r?(t++,o=-1):n>=0&&r==i.nodeValue.length?(e--,o=1):n<0?e--:t++,Hn($n(on(i,e,t),o),o<0)}{let e=$n(on(i,r,r),n);if(wn&&r&&/\s/.test(i.nodeValue[r-1])&&r<i.nodeValue.length){let t=$n(on(i,r-1,r-1),-1);if(t.top==e.top){let n=$n(on(i,r,r+1),-1);if(n.top!=e.top)return Hn(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&r&&(n<0||r==cn(i))){let e=i.childNodes[r-1];if(1==e.nodeType)return Kn(e.getBoundingClientRect(),!1)}if(null==o&&r<cn(i)){let e=i.childNodes[r];if(1==e.nodeType)return Kn(e.getBoundingClientRect(),!0)}return Kn(i.getBoundingClientRect(),n>=0)}if(null==o&&r&&(n<0||r==cn(i))){let e=i.childNodes[r-1],t=3==e.nodeType?on(e,cn(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Hn($n(t,1),!1)}if(null==o&&r<cn(i)){let e=i.childNodes[r];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?on(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Hn($n(t,-1),!0)}return Hn($n(3==i.nodeType?on(i):i,-n),n>=0)}function Hn(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Kn(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Gn(e,t,n){let i=e.state,r=e.root.activeElement;i!=t&&e.updateState(t),r!=e.dom&&e.focus();try{return n()}finally{i!=t&&e.updateState(i),r!=e.dom&&r&&r.focus()}}const Yn=/[\u0590-\u08ac]/;let Xn=null,Zn=null,Qn=!1;function ei(e,t,n){return Xn==t&&Zn==n?Qn:(Xn=t,Zn=n,Qn="up"==n||"down"==n?function(e,t,n){let i=t.selection,r="up"==n?i.$from:i.$to;return Gn(e,t,()=>{let{node:t}=e.docView.domFromPos(r.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let i=Un(e,r.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=on(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let r=t[e];if(r.bottom>r.top+1&&("up"==n?i.top-r.top>2*(r.bottom-i.top):r.bottom-i.bottom>2*(i.bottom-r.top)))return!1}}return!0})}(e,t,n):function(e,t,n){let{$head:i}=t.selection;if(!i.parent.isTextblock)return!1;let r=i.parentOffset,o=!r,s=r==i.parent.content.size,a=e.domSelection();return a?Yn.test(i.parent.textContent)&&a.modify?Gn(e,t,()=>{let{focusNode:t,focusOffset:r,anchorNode:o,anchorOffset:s}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=i.depth?e.docView.domAfterPos(i.before()):e.dom,{focusNode:h,focusOffset:u}=e.domSelectionRange(),d=h&&!c.contains(1==h.nodeType?h:h.parentNode)||t==h&&r==u;try{a.collapse(o,s),t&&(t!=o||r!=s)&&a.extend&&a.extend(t,r)}catch(e){}return null!=l&&(a.caretBidiLevel=l),d}):"left"==n||"backward"==n?o:s:i.pos==i.start()||i.pos==i.end()}(e,t,n))}class ti{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let i=this.children[t];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,i;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(i=n.pmViewDesc)||i.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(i)+i.size:this.posAtStart}{let n,i;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(i=n.pmViewDesc)||i.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(i):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=t>tn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){i=!1;break}if(t.previousSibling)break}if(null==i&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){i=!0;break}if(t.nextSibling)break}}return(null==i?n>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let r,o=this.getDesc(i);if(o&&(!t||o.node)){if(!n||!(r=o.nodeDOM)||(1==r.nodeType?r.contains(1==e.nodeType?e:e.parentNode):r==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let r=this.getDesc(i);if(r)return r.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],r=n+i.size;if(n==e&&r!=n){for(;!i.border&&i.children.length;)for(let e=0;e<i.children.length;e++){let t=i.children[e];if(t.size){i=t;break}}return i}if(e<r)return i.descAt(e-n-i.border);n=r}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let t=0;n<this.children.length;n++){let r=this.children[n],o=t+r.size;if(o>e||r instanceof li){i=e-t;break}t=o}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof ni&&e.side>=0;n--);if(t<=0){let e,i=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,i=!1);return e&&t&&i&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?tn(e.dom)+1:0}}{let e,i=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,i=!1);return e&&i&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?tn(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,r=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==i&&e<=a){let r=o+n.border;if(e>=r&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,r);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){i=tn(n.dom)+1;break}e-=n.size}-1==i&&(i=0)}if(i>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){r=tn(n.dom);break}t+=n.size}-1==r&&(r=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:r}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,i=!1){let r=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(r>a&&o<c)return l.setSelection(e-a-l.border,t-a-l.border,n,i);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),h=!1;if((wn||Cn)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(h=!(!t||"\n"!=e.nodeValue[t-1]),h&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:tn(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];h=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(wn&&c.focusNode&&c.focusNode!=a.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(i=!0)}if(!(i||h&&Cn)&&sn(s.node,s.offset,c.anchorNode,c.anchorOffset)&&sn(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((l.extend||e==t)&&(!h||!wn)){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),u=!0}catch(e){}}if(!u){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let r=this.children[i],o=n+r.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let i=n+r.border,s=o-r.border;if(e>=i&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=i||t!=s||!r.contentLost&&r.dom.parentNode==this.contentDOM?r.markDirty(e-i,t-i):r.dirty=3);r.dirty=r.dom!=r.contentDOM||r.dom.parentNode!=this.contentDOM||r.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class ni extends ti{constructor(e,t,n,i){let r,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,()=>r?r.parent?r.parent.posBeforeChild(r):void 0:i)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,r=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ii extends ti{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class ri extends ti{constructor(e,t,n,i,r){super(e,[],n,i),this.mark=t,this.spec=r}static create(e,t,n,i){let r=i.nodeViews[t.type.name],o=r&&r(t,i,n);return o&&o.dom||(o=Be.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new ri(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let i=ri.create(this.parent,this.mark,!0,n),r=this.children,o=this.size;t<o&&(r=wi(r,t,o,n)),e>0&&(r=wi(r,0,e,n));for(let e=0;e<r.length;e++)r[e].parent=i;return i.children=r,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class oi extends ti{constructor(e,t,n,i,r,o,s,a,l){super(e,[],r,o),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=s}static create(e,t,n,i,r,o){let s,a=r.nodeViews[t.type.name],l=a&&a(t,r,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o,n,i),c=l&&l.dom,h=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=Be.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:h}=e)}h||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return c=gi(c,n,t),l?s=new ci(e,t,n,i,c,h||null,u,l,r,o+1):t.isText?new ai(e,t,n,i,c,u,r):new oi(e,t,n,i,c,h||null,u,r,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>L.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&yi(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,r=e.composing?this.localCompositionInfo(e,t):null,o=r&&r.pos>-1?r:null,s=r&&r.pos<0,a=new xi(this,o&&o.node,e);!function(e,t,n,i){let r=t.locals(e),o=0;if(0==r.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);i(s,r,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let h,u,d,p;for(;s<r.length&&r[s].to==o;){let e=r[s++];e.widget&&(h?(u||(u=[h])).push(e):h=e)}if(h)if(u){u.sort(bi);for(let e=0;e<u.length;e++)n(u[e],c,!!l)}else n(h,c,!!l);if(l)p=-1,d=l,l=null;else{if(!(c<e.childCount))break;p=c,d=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<r.length&&r[s].from<=o&&r[s].to>o;)a.push(r[s++]);let f=o+d.nodeSize;if(d.isText){let e=f;s<r.length&&r[s].from<e&&(e=r[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=d.cut(e-o),d=d.cut(0,e-o),f=e,p=-1)}else for(;s<r.length&&r[s].to<f;)s++;i(d,d.isInline&&!d.isLeaf?a.filter(e=>!e.inline):a.slice(),t.forChild(o,d),p),o=f}}(this.node,this.innerDeco,(t,r,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,r):t.type.side>=0&&!o&&a.syncToMarks(r==this.node.childCount?W.none:this.node.child(r).marks,n,e,r),a.placeWidget(t,e,i)},(t,o,l,c)=>{let h;a.syncToMarks(t.marks,n,e,c),a.findNodeMatch(t,o,l,c)||s&&e.state.selection.from>i&&e.state.selection.to<i+t.nodeSize&&(h=a.findIndexWithChild(r.node))>-1&&a.updateNodeAt(t,o,l,h,e)||a.updateNextNode(t,o,l,e,c,i)||a.addNode(t,o,l,e,i),i+=t.nodeSize}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),hi(this.contentDOM,this.children,e),Mn&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof qt)||n<t||i>t+this.node.content.size)return null;let r=e.input.compositionNode;if(!r||!this.dom.contains(r.parentNode))return null;if(this.node.inlineContent){let e=r.nodeValue,o=function(e,t,n,i){for(let r=0,o=0;r<e.childCount&&o<=i;){let s=e.child(r++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;r<e.childCount;){let t=e.child(r++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){if(o>=i&&l.slice(i-t.length-a,i-a)==t)return i-t.length;let e=a<i?l.lastIndexOf(t,i-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==i&&l.length>=i+t.length-a&&l.slice(i-a,i-a+t.length)==t)return i}}return-1}(this.node.content,e,n-t,i-t);return o<0?null:{node:r,pos:o,text:e}}return{node:r,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let r=t;for(;r.parentNode!=this.contentDOM;r=r.parentNode){for(;r.previousSibling;)r.parentNode.removeChild(r.previousSibling);for(;r.nextSibling;)r.parentNode.removeChild(r.nextSibling);r.pmViewDesc&&(r.pmViewDesc=void 0)}let o=new ii(this,r,t,i);e.input.compositionNodes.push(o),this.children=wi(this.children,n,n+i.length,e,o)}update(e,t,n,i){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(yi(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=fi(this.dom,this.nodeDOM,pi(this.outerDeco,this.node,t),pi(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function si(e,t,n,i,r){gi(i,t,e);let o=new oi(void 0,e,t,n,i,i,i,r,0);return o.contentDOM&&o.updateChildren(r,0),o}class ai extends oi{constructor(e,t,n,i,r,o,s){super(e,t,n,i,r,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let i=this.node.cut(e,t),r=document.createTextNode(i.text);return new ai(this.parent,i,this.outerDeco,this.innerDeco,r,r,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class li extends ti{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ci extends oi{constructor(e,t,n,i,r,o,s,a,l,c){super(e,t,n,i,r,o,s,l,c),this.spec=a}update(e,t,n,i){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let r=this.spec.update(e,t,n);return r&&this.updateInner(e,t,n,i),r}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function hi(e,t,n){let i=e.firstChild,r=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=i;)i=vi(i),r=!0;i=i.nextSibling}else r=!0,e.insertBefore(a,i);if(s instanceof ri){let t=i?i.previousSibling:e.lastChild;hi(s.contentDOM,s.children,n),i=t?t.nextSibling:e.firstChild}}for(;i;)i=vi(i),r=!0;r&&n.trackWrites==e&&(n.trackWrites=null)}const ui=function(e){e&&(this.nodeName=e)};ui.prototype=Object.create(null);const di=[new ui];function pi(e,t,n){if(0==e.length)return di;let i=n?di[0]:new ui,r=[i];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&r.push(i=new ui(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==r.length&&r.push(i=new ui(t.isInline?"span":"div")),"class"==e?i.class=(i.class?i.class+" ":"")+o:"style"==e?i.style=(i.style?i.style+";":"")+o:"nodeName"!=e&&(i[e]=o))}}}return r}function fi(e,t,n,i){if(n==di&&i==di)return t;let r=t;for(let t=0;t<i.length;t++){let o=i[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&r!=e&&(t=r.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||(t=document.createElement(o.nodeName),t.pmIsDeco=!0,t.appendChild(r),s=di[0]),r=t}mi(r,s||di[0],o)}return r}function mi(e,t,n){for(let i in t)"class"==i||"style"==i||"nodeName"==i||i in n||e.removeAttribute(i);for(let i in n)"class"!=i&&"style"!=i&&"nodeName"!=i&&n[i]!=t[i]&&e.setAttribute(i,n[i]);if(t.class!=n.class){let i=t.class?t.class.split(" ").filter(Boolean):[],r=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.remove(i[t]);for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.add(r[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=i.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function gi(e,t,n){return fi(e,e,di,pi(t,n,1!=e.nodeType))}function yi(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function vi(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class xi{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,i=n.children.length,r=e.childCount,o=new Map,s=[];e:for(;r>0;){let a;for(;;)if(i){let e=n.children[i-1];if(!(e instanceof ri)){a=e,i--;break}n=e,i=e.children.length}else{if(n==t)break e;i=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(r-1))break;--r,o.set(a,r),s.push(a)}}return{index:r,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,i){let r=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;r<s&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let r=-1,s=this.top.children.length;i<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let i=ri.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,i),this.top=i,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,i){let r,o=-1;if(i>=this.preMatch.index&&(r=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&r.matchesNode(e,t,n))o=this.top.children.indexOf(r,this.index);else for(let i=this.index,r=Math.min(this.top.children.length,i+5);i<r;i++){let r=this.top.children[i];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){o=i;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,i,r){let o=this.top.children[i];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,r)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,i,r,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof oi){let l=this.preMatch.matched.get(a);if(null!=l&&l!=r)return!1;let c,h=a.dom,u=this.isLocked(h)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&yi(t,a.outerDeco));if(!u&&a.update(e,t,n,i))return this.destroyBetween(this.index,s),a.dom!=h&&(this.changed=!0),this.index++,!0;if(!u&&(c=this.recreateWrapper(a,e,t,n,i,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(i,o+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,i,r,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!yi(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let s=oi.create(this.top,t,n,i,r,o);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,i,r){let o=oi.create(this.top,e,t,n,i,r);o.contentDOM&&o.updateChildren(i,r+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let i=new ni(this.top,e,t,n);this.top.children.splice(this.index++,0,i),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof ri;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ai)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Cn||Sn)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let i=new li(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function bi(e,t){return e.type.side-t.type.side}function wi(e,t,n,i,r){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,h=a+=l.size;c>=n||h<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,i)),r&&(o.push(r),r=void 0),h>n&&o.push(l.slice(n-c,l.size,i)))}return o}function ki(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let r=e.docView.nearestDesc(n.focusNode),o=r&&0==r.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=i.resolve(s);if(un(n)){for(a=s;r&&!r.node;)r=r.parent;let e=r.node;if(r&&e.isAtom&&_t.isSelectable(e)&&r.parent&&(!e.isInline||!function(e,t,n){for(let i=0==t,r=t==cn(e);i||r;){if(e==n)return!0;let t=tn(e);if(!(e=e.parentNode))return!1;i=i&&0==t,r=r&&t==cn(e)}}(n.focusNode,n.focusOffset,r.dom))){let e=r.posBefore;l=new _t(s==e?c:i.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,r=s;for(let i=0;i<n.rangeCount;i++){let o=n.getRangeAt(i);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),r=Math.max(r,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[a,s]=r==e.state.selection.anchor?[r,t]:[t,r],c=i.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let h=i.resolve(a);if(!l){l=Ai(e,h,c,"pointer"==t||e.state.selection.head<c.pos&&!o?1:-1)}return l}function Si(e){return e.editable?e.hasFocus():Di(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function zi(e,t=!1){let n=e.state.selection;if(Oi(e,n),Si(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Sn){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&sn(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,i="IMG"==n.nodeName;i?t.collapse(n.parentNode,tn(n)+1):t.collapse(n,0);!i&&!e.state.selection.visible&&xn&&bn<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let i,r,{anchor:o,head:s}=n;!Ci||n instanceof qt||(n.$from.parent.inlineContent||(i=Mi(e,n.from)),n.empty||n.$from.parent.inlineContent||(r=Mi(e,n.to))),e.docView.setSelection(o,s,e,t),Ci&&(i&&Ti(i),r&&Ti(r)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),i=n.anchorNode,r=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==i&&n.anchorOffset==r||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{Si(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ci=Cn||Sn&&zn<63;function Mi(e,t){let{node:n,offset:i}=e.docView.domFromPos(t,0),r=i<n.childNodes.length?n.childNodes[i]:null,o=i?n.childNodes[i-1]:null;if(Cn&&r&&"false"==r.contentEditable)return Ni(r);if(!(r&&"false"!=r.contentEditable||o&&"false"!=o.contentEditable)){if(r)return Ni(r);if(o)return Ni(o)}}function Ni(e){return e.contentEditable="true",Cn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ti(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Oi(e,t){if(t instanceof _t){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Ei(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Ei(e)}function Ei(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Ai(e,t,n,i){return e.someProp("createSelectionBetween",i=>i(e,t,n))||qt.between(t,n,i)}function ji(e){return!(e.editable&&!e.hasFocus())&&Di(e)}function Di(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Ri(e,t){let{$anchor:n,$head:i}=e.selection,r=t>0?n.max(i):n.min(i),o=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return o&&jt.findFrom(o,t)}function Ii(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function qi(e,t,n){let i=e.state.selection;if(!(i instanceof qt)){if(i instanceof _t&&i.node.isInline)return Ii(e,new qt(t>0?i.$to:i.$from));{let n=Ri(e.state,t);return!!n&&Ii(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=i,r=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!r||r.isText||!r.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+r.nodeSize*(t<0?-1:1));return Ii(e,new qt(i.$anchor,o))}if(!i.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Ri(e.state,t);return!!(n&&n instanceof _t)&&Ii(e,n)}if(!(Nn&&n.indexOf("m")>-1)){let n,r=i.$head,o=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!o||o.isText)return!1;let s=t<0?r.pos-o.nodeSize:r.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(_t.isSelectable(o)?Ii(e,new _t(t<0?e.state.doc.resolve(r.pos-o.nodeSize):r)):!!En&&Ii(e,new qt(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function Pi(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function _i(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function Li(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,o,s=!1;wn&&1==n.nodeType&&i<Pi(n)&&_i(n.childNodes[i],-1)&&(s=!0);for(;;)if(i>0){if(1!=n.nodeType)break;{let e=n.childNodes[i-1];if(_i(e,-1))r=n,o=--i;else{if(3!=e.nodeType)break;n=e,i=n.nodeValue.length}}}else{if(Bi(n))break;{let t=n.previousSibling;for(;t&&_i(t,-1);)r=n.parentNode,o=tn(t),t=t.previousSibling;if(t)n=t,i=Pi(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}s?Fi(e,n,i):r&&Fi(e,r,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,o,s=Pi(n);for(;;)if(i<s){if(1!=n.nodeType)break;if(!_i(n.childNodes[i],1))break;r=n,o=++i}else{if(Bi(n))break;{let t=n.nextSibling;for(;t&&_i(t,1);)r=t.parentNode,o=tn(t)+1,t=t.nextSibling;if(t)n=t,i=0,s=Pi(n);else{if(n=n.parentNode,n==e.dom)break;i=s=0}}}r&&Fi(e,r,o)}(e)}function Bi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Fi(e,t,n){if(3!=t.nodeType){let e,i;(i=function(e,t){for(;e&&t==e.childNodes.length&&!hn(e);)t=tn(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=i,n=0):(e=function(e,t){for(;e&&!t&&!hn(e);)t=tn(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let i=e.domSelection();if(!i)return;if(un(i)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),i.removeAllRanges(),i.addRange(e)}else i.extend&&i.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&zi(e)},50)}function Vi(e,t){let n=e.state.doc.resolve(t);if(!Sn&&!Tn&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),r=(n.top+n.bottom)/2;if(r>i.top&&r<i.bottom&&Math.abs(n.left-i.left)>1)return n.left<i.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),r=(n.top+n.bottom)/2;if(r>i.top&&r<i.bottom&&Math.abs(n.left-i.left)>1)return n.left>i.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Wi(e,t,n){let i=e.state.selection;if(i instanceof qt&&!i.empty||n.indexOf("s")>-1)return!1;if(Nn&&n.indexOf("m")>-1)return!1;let{$from:r,$to:o}=i;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Ri(e.state,t);if(n&&n instanceof _t)return Ii(e,n)}if(!r.parent.inlineContent){let n=t<0?r:o,s=i instanceof Bt?jt.near(n,t):jt.findFrom(n,t);return!!s&&Ii(e,s)}return!1}function $i(e,t){if(!(e.state.selection instanceof qt))return!0;let{$head:n,$anchor:i,empty:r}=e.state.selection;if(!n.sameParent(i))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let i=e.state.tr;return t<0?i.delete(n.pos-o.nodeSize,n.pos):i.delete(n.pos,n.pos+o.nodeSize),e.dispatch(i),!0}return!1}function Ji(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ui(e,t){let n=t.keyCode,i=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||Nn&&72==n&&"c"==i)return $i(e,-1)||Li(e,-1);if(46==n&&!t.shiftKey||Nn&&68==n&&"c"==i)return $i(e,1)||Li(e,1);if(13==n||27==n)return!0;if(37==n||Nn&&66==n&&"c"==i){let t=37==n?"ltr"==Vi(e,e.state.selection.from)?-1:1:-1;return qi(e,t,i)||Li(e,t)}if(39==n||Nn&&70==n&&"c"==i){let t=39==n?"ltr"==Vi(e,e.state.selection.from)?1:-1:1;return qi(e,t,i)||Li(e,t)}return 38==n||Nn&&80==n&&"c"==i?Wi(e,-1,i)||Li(e,-1):40==n||Nn&&78==n&&"c"==i?function(e){if(!Cn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Ji(e,n,"true"),setTimeout(()=>Ji(e,n,"false"),20)}return!1}(e)||Wi(e,1,i)||Li(e,1):i==(Nn?"m":"c")&&(66==n||73==n||89==n||90==n)}function Hi(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:i,openStart:r,openEnd:o}=t;for(;r>1&&o>1&&1==i.childCount&&1==i.firstChild.childCount;){r--,o--;let e=i.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),i=e.content}let s=e.someProp("clipboardSerializer")||Be.fromSchema(e.state.schema),a=ir(),l=a.createElement("div");l.appendChild(s.serializeFragment(i,{document:a}));let c,h=l.firstChild,u=0;for(;h&&1==h.nodeType&&(c=tr[h.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),u++}h=l.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${r} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function Ki(e,t,n,i,r){let o,s,a=r.parent.type.spec.code;if(!n&&!t)return null;let l=!!t&&(i||a||!n);if(l){if(e.someProp("transformPastedText",n=>{t=n(t,a||i,e)}),a)return s=new J(L.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0)}),s;let n=e.someProp("clipboardTextParser",n=>n(t,r,i,e));if(n)s=n;else{let n=r.marks(),{schema:i}=e.state,s=Be.fromSchema(i);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(i.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,i=ir().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e);(n=r&&tr[r[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join(""));if(i.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;rr||(rr=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return rr.createHTML(e)}(e),n)for(let e=0;e<n.length;e++)i=i.querySelector(n[e])||i;return i}(n),En&&function(e){let t=e.querySelectorAll(Sn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let i=t[n];1==i.childNodes.length&&" "==i.textContent&&i.parentNode&&i.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),i)}}(o);let c=o&&o.querySelector("[data-pm-slice]"),h=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let e=+h[3];e>0;e--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Ee.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!h),context:r,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Gi.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(h)s=function(e,t){if(!e.size)return e;let n,i=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:r,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=i.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;r=L.from(t.create(n[e+1],r)),o++,s++}return new J(r,o,s)}(er(s,+h[1],+h[2]),h[4]);else if(s=J.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i,r=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach(e=>{if(!o)return;let t,n=r.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&i.length&&Xi(n,i,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Zi(o[o.length-1],i.length));let t=Yi(e,n);o.push(t),r=r.matchType(t.type),i=n}}),o)return L.from(o)}return e}(s.content,r),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=er(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,l)}),s}const Gi=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Yi(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,L.from(e));return e}function Xi(e,t,n,i,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let o=Xi(e,t,n,i.lastChild,r+1);if(o)return i.copy(i.content.replaceChild(i.childCount-1,o));if(i.contentMatchAt(i.childCount).matchType(r==e.length-1?n.type:e[r+1]))return i.copy(i.content.append(L.from(Yi(n,e,r+1))))}}function Zi(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Zi(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(L.empty,!0);return e.copy(n.append(i))}function Qi(e,t,n,i,r,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),r<i-1&&(a=Qi(a,t,n,i,r+1,o)),r>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=r).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(L.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function er(e,t,n){return t<e.openStart&&(e=new J(Qi(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new J(Qi(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const tr={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let nr=null;function ir(){return nr||(nr=document.implementation.createHTMLDocument("title"))}let rr=null;const or={},sr={},ar={touchstart:!0,touchmove:!0};class lr{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function cr(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function hr(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>ur(e,t))})}function ur(e,t){return e.someProp("handleDOMEvents",n=>{let i=n[t.type];return!!i&&(i(e,t)||t.defaultPrevented)})}function dr(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function pr(e){return{left:e.clientX,top:e.clientY}}function fr(e,t,n,i,r){if(-1==i)return!1;let o=e.state.doc.resolve(i);for(let i=o.depth+1;i>0;i--)if(e.someProp(t,t=>i>o.depth?t(e,n,o.nodeAfter,o.before(i),r,!0):t(e,n,o.node(i),o.before(i),r,!1)))return!0;return!1}function mr(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let i=e.state.tr.setSelection(t);i.setMeta("pointer",!0),e.dispatch(i)}function gr(e,t,n,i,r){return fr(e,"handleClickOn",t,n,i)||e.someProp("handleClick",n=>n(e,t,i))||(r?function(e,t){if(-1==t)return!1;let n,i,r=e.state.selection;r instanceof _t&&(n=r.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(_t.isSelectable(t)){i=n&&r.$from.depth>0&&e>=r.$from.depth&&o.before(r.$from.depth+1)==r.$from.pos?o.before(r.$from.depth):o.before(e);break}}return null!=i&&(mr(e,_t.create(e.state.doc,i)),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&_t.isSelectable(i))&&(mr(e,new _t(n)),!0)}(e,n))}function yr(e,t,n,i){return fr(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",n=>n(e,t,i))}function vr(e,t,n,i){return fr(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",n=>n(e,t,i))||function(e,t,n){if(0!=n.button)return!1;let i=e.state.doc;if(-1==t)return!!i.inlineContent&&(mr(e,qt.create(i,0,i.content.size)),!0);let r=i.resolve(t);for(let t=r.depth+1;t>0;t--){let n=t>r.depth?r.nodeAfter:r.node(t),o=r.before(t);if(n.inlineContent)mr(e,qt.create(i,o+1,o+1+n.content.size));else{if(!_t.isSelectable(n))continue;mr(e,_t.create(i,o))}return!0}}(e,n,i)}function xr(e){return Nr(e)}sr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!kr(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!On||!Sn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Mn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||Ui(e,n)?n.preventDefault():cr(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,dn(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},sr.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},sr.keypress=(e,t)=>{let n=t;if(kr(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Nn&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof qt&&i.$from.sameParent(i.$to))){let t=String.fromCharCode(n.charCode),r=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",n=>n(e,i.$from.pos,i.$to.pos,t,r))||e.dispatch(r()),n.preventDefault()}};const br=Nn?"metaKey":"ctrlKey";or.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=xr(e),r=Date.now(),o="singleClick";r-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}(n,e.input.lastClick)&&!n[br]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:o,button:n.button};let s=e.posAtCoords(pr(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new wr(e,s,n,!!i)):("doubleClick"==o?yr:vr)(e,s.pos,s.inside,n)?n.preventDefault():cr(e,"pointer"))};class wr{constructor(e,t,n,i){let r,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[br],this.allowDefault=n.shiftKey,t.inside>-1)r=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);r=n.parent,o=n.depth?n.before():0}const s=i?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:l}=e.state;(0==n.button&&r.type.spec.draggable&&!1!==r.type.spec.selectable||l instanceof _t&&l.from<=o&&l.to>o)&&(this.mightDrag={node:r,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!wn||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),cr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>zi(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(pr(e))),this.updateAllowDefault(e),this.allowDefault||!t?cr(this.view,"pointer"):gr(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Cn&&this.mightDrag&&!this.mightDrag.node.isAtom||Sn&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(mr(this.view,jt.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):cr(this.view,"pointer")}move(e){this.updateAllowDefault(e),cr(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function kr(e,t){return!!e.composing||!!(Cn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}or.touchstart=e=>{e.input.lastTouch=Date.now(),xr(e),cr(e,"pointer")},or.touchmove=e=>{e.input.lastTouch=Date.now(),cr(e,"pointer")},or.contextmenu=e=>xr(e);const Sr=On?5e3:-1;function zr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Nr(e),t))}function Cr(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Mr(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=cn(e=e.childNodes[t-1])}else{if(!e.parentNode||hn(e))return null;t=tn(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),i=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||hn(e))return null;t=tn(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&i&&n!=i){let t=i.pmViewDesc,r=e.domObserver.lastChangedTextNode;if(n==r||i==r)return r;if(!t||!t.isText(i.nodeValue))return i;if(e.input.compositionNode==i){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return i}}return n||i}function Nr(e,t=!1){if(!(On&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Cr(e),t||e.docView&&e.docView.dirty){let n=ki(e),i=e.state.selection;return n&&!n.eq(i)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}sr.compositionstart=sr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof qt&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||Sn&&Tn&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let i=t.childNodes[n];return 1==i.nodeType&&"false"==i.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),Nr(e,!0),e.markCursor=null;else if(Nr(e,!t.selection.empty),wn&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,i=t.focusOffset;n&&1==n.nodeType&&0!=i;){let t=i<0?n.lastChild:n.childNodes[i-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,i=-1}}e.input.composing=!0}zr(e,Sr)},sr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,zr(e,20))};const Tr=xn&&bn<15||Mn&&An<604;function Or(e,t,n,i,r){let o=Ki(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,r,o||J.empty)))return!0;if(!o)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=s?e.state.tr.replaceSelectionWith(s,i):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Er(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}or.copy=sr.cut=(e,t)=>{let n=t,i=e.state.selection,r="cut"==n.type;if(i.empty)return;let o=Tr?null:n.clipboardData,s=i.content(),{dom:a,text:l}=Hi(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,a),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},sr.paste=(e,t)=>{let n=t;if(e.composing&&!On)return;let i=Tr?null:n.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;i&&Or(e,Er(i),i.getData("text/html"),r,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?Or(e,i.value,null,r,t):Or(e,i.textContent,i.innerHTML,r,t)},50)}(e,n)};class Ar{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const jr=Nn?"altKey":"ctrlKey";function Dr(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[jr]}or.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r,o=e.state.selection,s=o.empty?null:e.posAtCoords(pr(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof _t?o.to-1:o.to));else if(i&&i.mightDrag)r=_t.create(e.state.doc,i.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(r=_t.create(e.state.doc,t.posBefore))}let a=(r||e.state.selection).content(),{dom:l,text:c,slice:h}=Hi(e,a);(!n.dataTransfer.files.length||!Sn||zn>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Tr?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Tr||n.dataTransfer.setData("text/plain",c),e.dragging=new Ar(h,Dr(e,n),r)},or.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},sr.dragover=sr.dragenter=(e,t)=>t.preventDefault(),sr.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(pr(t));if(!i)return;let r=e.state.doc.resolve(i.pos),o=n&&n.slice;o?e.someProp("transformPasted",t=>{o=t(o,e,!1)}):o=Ki(e,Er(t.dataTransfer),Tr?null:t.dataTransfer.getData("text/html"),!1,r);let s=!(!n||!Dr(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||J.empty,s)))return void t.preventDefault();if(!o)return;t.preventDefault();let a=o?function(e,t,n){let i=e.resolve(t);if(!n.content.size)return t;let r=n.content;for(let e=0;e<n.openStart;e++)r=r.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=i.depth;t>=0;t--){let n=t==i.depth?0:i.pos<=(i.start(t+1)+i.end(t+1))/2?-1:1,o=i.index(t)+(n>0?1:0),s=i.node(t),a=!1;if(1==e)a=s.canReplace(o,o,r);else{let e=s.contentMatchAt(o).findWrapping(r.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?i.pos:n<0?i.before(t+1):i.after(t+1)}return null}(e.state.doc,r.pos,o):r.pos;null==a&&(a=r.pos);let l=e.state.tr;if(s){let{node:e}=n;e?e.replace(l):l.deleteSelection()}let c=l.mapping.map(a),h=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,u=l.doc;h?l.replaceRangeWith(c,c,o.content.firstChild):l.replaceRange(c,c,o);if(l.doc.eq(u))return;let d=l.doc.resolve(c);if(h&&_t.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new _t(d));else{let t=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((e,n,i,r)=>t=r),l.setSelection(Ai(e,d,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},or.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&zi(e)},20))},or.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},or.beforeinput=(e,t)=>{if(Sn&&On&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,dn(8,"Backspace"))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in sr)or[e]=sr[e];function Rr(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Ir{constructor(e,t){this.toDOM=e,this.spec=t||Br,this.side=this.spec.side||0}map(e,t,n,i){let{pos:r,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new _r(r-n,r-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Ir&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Rr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class qr{constructor(e,t){this.attrs=e,this.spec=t||Br}map(e,t,n,i){let r=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return r>=o?null:new _r(r,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof qr&&Rr(this.attrs,e.attrs)&&Rr(this.spec,e.spec)}static is(e){return e.type instanceof qr}destroy(){}}class Pr{constructor(e,t){this.attrs=e,this.spec=t||Br}map(e,t,n,i){let r=e.mapResult(t.from+i,1);if(r.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=r.pos?null:new _r(r.pos-n,o.pos-n,this)}valid(e,t){let n,{index:i,offset:r}=e.content.findIndex(t.from);return r==t.from&&!(n=e.child(i)).isText&&r+n.nodeSize==t.to}eq(e){return this==e||e instanceof Pr&&Rr(this.attrs,e.attrs)&&Rr(this.spec,e.spec)}destroy(){}}class _r{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new _r(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new _r(e,e,new Ir(t,n))}static inline(e,t,n,i){return new _r(e,t,new qr(n,i))}static node(e,t,n,i){return new _r(e,t,new Pr(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof qr}get widget(){return this.type instanceof Ir}}const Lr=[],Br={};class Fr{constructor(e,t){this.local=e.length?e:Lr,this.children=t.length?t:Lr}static create(e,t){return t.length?Hr(t,e,0,Br):Vr}find(e,t,n){let i=[];return this.findInner(null==e?0:e,null==t?1e9:t,i,0,n),i}findInner(e,t,n,i,r){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!r||r(s.spec))&&n.push(s.copy(s.from+i,s.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,i+s,r)}}map(e,t,n){return this==Vr||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Br)}mapInner(e,t,n,i,r){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,i);a&&a.type.valid(t,a)?(o||(o=[])).push(a):r.onRemove&&r.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,i,r,o,s){let a=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let i=0;n.maps[e].forEach((e,n,r,o)=>{let s=o-r-(n-e);for(let r=0;r<a.length;r+=3){let o=a[r+1];if(o<0||e>o+t-i)continue;let l=a[r]+t-i;n>=l?a[r+1]=e<=l?-2:-1:e>=t&&s&&(a[r]+=s,a[r+1]+=s)}i+=s}),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+o),h=c-r;if(h<0||h>=i.content.size){l=!0;continue}let u=n.map(e[t+1]+o,-1)-r,{index:d,offset:p}=i.content.findIndex(h),f=i.maybeChild(d);if(f&&p==h&&p+f.nodeSize==u){let i=a[t+2].mapInner(n,f,c+1,e[t]+o+1,s);i!=Vr?(a[t]=h,a[t+1]=u,a[t+2]=i):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,i,r,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(i,r,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,r,o,s),c=Hr(l,i,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Fr(t.sort(Kr),a)}(this.children,o||[],e,t,n,i,r):o?new Fr(o.sort(Kr),Lr):Vr}add(e,t){return t.length?this==Vr?Fr.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,r=0;e.forEach((e,o)=>{let s,a=o+n;if(s=Jr(t,e,a)){for(i||(i=this.children.slice());r<i.length&&i[r]<o;)r+=3;i[r]==o?i[r+2]=i[r+2].addInner(e,s,a+1):i.splice(r,0,o,o+e.nodeSize,Hr(s,e,a+1,Br)),r+=3}});let o=$r(r?Ur(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new Fr(o.length?this.local.concat(o).sort(Kr):this.local,i||this.children)}remove(e){return 0==e.length||this==Vr?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let i=0;i<n.length;i+=3){let r,o=n[i]+t,s=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(r||(r=[])).push(t));if(!r)continue;n==this.children&&(n=this.children.slice());let a=n[i+2].removeInner(r,o+1);a!=Vr?n[i+2]=a:(n.splice(i,3),i-=3)}if(i.length)for(let n,r=0;r<e.length;r++)if(n=e[r])for(let e=0;e<i.length;e++)i[e].eq(n,t)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1));return n==this.children&&i==this.local?this:i.length||n.length?new Fr(i,n):Vr}forChild(e,t){if(this==Vr)return this;if(t.isLeaf)return Fr.empty;let n,i;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let r=e+1,o=r+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>r&&t.type instanceof qr){let e=Math.max(r,t.from)-r,n=Math.min(o,t.to)-r;e<n&&(i||(i=[])).push(t.copy(e,n))}}if(i){let e=new Fr(i.sort(Kr),Lr);return n?new Wr([e,n]):e}return n||Vr}eq(e){if(this==e)return!0;if(!(e instanceof Fr)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Gr(this.localsInner(e))}localsInner(e){if(this==Vr)return Lr;if(e.inlineContent||!this.local.some(qr.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof qr||t.push(this.local[e]);return t}forEachSet(e){e(this)}}Fr.empty=new Fr([],[]),Fr.removeOverlap=Gr;const Vr=Fr.empty;class Wr{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,Br));return Wr.from(n)}forChild(e,t){if(t.isLeaf)return Fr.empty;let n=[];for(let i=0;i<this.members.length;i++){let r=this.members[i].forChild(e,t);r!=Vr&&(r instanceof Wr?n=n.concat(r.members):n.push(r))}return Wr.from(n)}eq(e){if(!(e instanceof Wr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let i=0;i<this.members.length;i++){let r=this.members[i].localsInner(e);if(r.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<r.length;e++)t.push(r[e])}else t=r}return t?Gr(n?t:t.sort(Kr)):Lr}static from(e){switch(e.length){case 0:return Vr;case 1:return e[0];default:return new Wr(e.every(e=>e instanceof Fr)?e:e.reduce((e,t)=>e.concat(t instanceof Fr?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function $r(e,t){if(!t||!e.length)return e;let n=[];for(let i=0;i<e.length;i++){let r=e[i];n.push(new _r(r.from+t,r.to+t,r.type))}return n}function Jr(e,t,n){if(t.isLeaf)return null;let i=n+t.nodeSize,r=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<i&&((r||(r=[])).push(t),e[o]=null);return r}function Ur(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Hr(e,t,n,i){let r=[],o=!1;t.forEach((t,s)=>{let a=Jr(e,t,s+n);if(a){o=!0;let e=Hr(a,t,n+s+1,i);e!=Vr&&r.push(s,s+t.nodeSize,e)}});let s=$r(o?Ur(e):e,-n).sort(Kr);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(i.onRemove&&i.onRemove(s[e].spec),s.splice(e--,1));return s.length||r.length?new Fr(s,r):Vr}function Kr(e,t){return e.from-t.from||e.to-t.to}function Gr(e){let t=e;for(let n=0;n<t.length-1;n++){let i=t[n];if(i.from!=i.to)for(let r=n+1;r<t.length;r++){let o=t[r];if(o.from!=i.from){o.from<i.to&&(t==e&&(t=e.slice()),t[n]=i.copy(i.from,o.from),Yr(t,r,i.copy(o.from,i.to)));break}o.to!=i.to&&(t==e&&(t=e.slice()),t[r]=o.copy(o.from,i.to),Yr(t,r+1,o.copy(i.to,o.to)))}}return t}function Yr(e,t,n){for(;t<e.length&&Kr(n,e[t])>0;)t++;e.splice(t,0,n)}function Xr(e){let t=[];return e.someProp("decorations",n=>{let i=n(e.state);i&&i!=Vr&&t.push(i)}),e.cursorWrapper&&t.push(Fr.create(e.state.doc,[e.cursorWrapper.deco])),Wr.from(t)}const Zr={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Qr=xn&&bn<=11;class eo{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class to{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eo,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);xn&&bn<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Cn&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Qr&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Zr)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ji(this.view)){if(this.suppressingSelectionUpdates)return zi(this.view);if(xn&&bn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&sn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let t=e.focusNode;t;t=nn(t))n.add(t);for(let i=e.anchorNode;i;i=nn(i))if(n.has(i)){t=i;break}let i=t&&this.view.docView.nearestDesc(t);return i&&i.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&ji(e)&&!this.ignoreSelectionChange(n),r=-1,o=-1,s=!1,a=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],a);n&&(r=r<0?n.from:Math.min(n.from,r),o=o<0?n.to:Math.max(n.to,o),n.typeOver&&(s=!0))}if(wn&&a.length){let t=a.filter(e=>"BR"==e.nodeName);if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let i of t){let t=i.parentNode;!t||"LI"!=t.nodeName||n&&oo(e,n)==t||i.remove()}}}else if((Sn||Cn)&&a.some(e=>"BR"==e.nodeName)&&(8==e.input.lastKeyCode||46==e.input.lastKeyCode))for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;t&&1==t.nodeType&&"false"==t.contentEditable&&e.parentNode.removeChild(e)}let l=null;r<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&un(n)&&(l=ki(e))&&l.eq(jt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,zi(e),this.currentSelection.set(n),e.scrollToSelection()):(r>-1||i)&&(r>-1&&(e.docView.markDirty(r,o),function(e){if(no.has(e))return;if(no.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=wn,io)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),io=!0}}(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:i,focusOffset:r}=e.domSelectionRange();for(let o of t)if("TR"==(null===(n=o.parentNode)||void 0===n?void 0:n.nodeName)){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(o,n.firstChild),i==o&&e.domSelection().collapse(o,r)}else o.parentNode.removeChild(o)}}(e,a)),this.handleDOMChange(r,o,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||zi(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let i=e.addedNodes[n];t.push(i),3==i.nodeType&&(this.lastChangedTextNode=i)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,r=e.nextSibling;if(xn&&bn<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(i=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(r=o)}let o=i&&i.parentNode==e.target?tn(i)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=r&&r.parentNode==e.target?tn(r):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let no=new WeakMap,io=!1;function ro(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return sn(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}function oo(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function so(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Cn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Cn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const ao=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function lo(e,t,n,i,r){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=ki(e,t);if(n&&!e.state.selection.eq(n)){if(Sn&&On&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,dn(13,"Enter"))))return;let i=e.state.tr.setSelection(n);"pointer"==t?i.setMeta("pointer",!0):"key"==t&&i.scrollIntoView(),o&&i.setMeta("composition",o),e.dispatch(i)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l,c,h=e.state.selection,u=function(e,t,n){let i,{node:r,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),h=c.anchorNode;if(h&&e.dom.contains(1==h.nodeType?h:h.parentNode)&&(i=[{node:h,offset:c.anchorOffset}],un(c)||i.push({node:c.focusNode,offset:c.focusOffset})),Sn&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let u=e.state.doc,d=e.someProp("domParser")||Ee.fromSchema(e.state.schema),p=u.resolve(a),f=null,m=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:i,ruleFromNode:so,context:p});if(i&&null!=i[0].pos){let e=i[0].pos,t=i[1]&&i[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),d=e.state.doc,p=d.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,c="end"):(l=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let f=function(e,t,n,i,r){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==r){i-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){let e=i<=o&&i>=s?o-i:0;o-=e,o&&o<t.size&&uo(t.textBetween(o-1,o+1))&&(o+=e?1:-1),a=o+(a-s),s=o}else if(a<o){let t=i<=o&&i>=a?o-i:0;o-=t,o&&o<e.size&&uo(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,u.doc.content,u.from,l,c);if(f&&e.input.domChangeCount++,(Mn&&e.input.lastIOSEnter>Date.now()-225||On)&&r.some(e=>1==e.nodeType&&!ao.test(e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",t=>t(e,dn(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!f){if(!(i&&h instanceof qt&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=co(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);o&&n.setMeta("composition",o),e.dispatch(n)}}return}f={start:h.from,endA:h.to,endB:h.to}}e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof qt&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),xn&&bn<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>u.from&&"  "==u.doc.textBetween(f.start-u.from-1,f.start-u.from+1)&&(f.start--,f.endA--,f.endB--);let m=u.doc.resolveNoCache(f.start-u.from),g=u.doc.resolveNoCache(f.endB-u.from),y=d.resolve(f.start),v=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((Mn&&e.input.lastIOSEnter>Date.now()-225&&(!v||r.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!v&&m.pos<u.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(u.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,dn(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,i,r){if(n-t<=r.pos-i.pos||ho(i,!0,!1)<r.pos)return!1;let o=e.resolve(t);if(!i.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(ho(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||ho(s,!0,!1)<n)&&i.parent.content.cut(i.parentOffset).eq(s.parent.content)}(d,f.start,f.endA,m,g)&&e.someProp("handleKeyDown",t=>t(e,dn(8,"Backspace"))))return void(On&&Sn&&e.domObserver.suppressSelectionUpdates());Sn&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),On&&!v&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==f.endA&&(f.endB-=2,g=u.doc.resolveNoCache(f.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,dn(13,"Enter"))})},20));let x,b=f.start,w=f.endA,k=t=>{let n=t||e.state.tr.replace(b,w,u.doc.slice(f.start-u.from,f.endB-u.from));if(u.sel){let t=co(e,n.doc,u.sel);t&&!(Sn&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==b||t.head==n.mapping.map(w)-1)||xn&&t.empty&&t.head==b)&&n.setSelection(t)}return o&&n.setMeta("composition",o),n.scrollIntoView()};if(v)if(m.pos==g.pos){xn&&bn<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>zi(e),20));let t=k(e.state.tr.delete(b,w)),n=d.resolve(f.start).marksAcross(d.resolve(f.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(f.endA==f.endB&&(x=function(e,t){let n,i,r,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<o.length;e++)l=o[e].removeFromSet(l);if(1==a.length&&0==l.length)i=a[0],n="add",r=e=>e.mark(i.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;i=l[0],n="remove",r=e=>e.mark(i.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(r(t.child(e)));if(L.from(c).eq(e))return{mark:i,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start())))){let t=k(e.state.tr);"add"==x.type?t.addMark(b,w,x.mark):t.removeMark(b,w,x.mark),e.dispatch(t)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset),n=()=>k(e.state.tr.insertText(t,b,w));e.someProp("handleTextInput",i=>i(e,b,w,t,n))||e.dispatch(n())}else e.dispatch(k());else e.dispatch(k())}function co(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Ai(e,t.resolve(n.anchor),t.resolve(n.head))}function ho(e,t,n){let i=e.depth,r=t?e.end():e.pos;for(;i>0&&(t||e.indexAfter(i)==e.node(i).childCount);)i--,r++,t=!1;if(n){let t=e.node(i).maybeChild(e.indexAfter(i));for(;t&&!t.isLeaf;)t=t.firstChild,r++}return r}function uo(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class po{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new lr,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(vo),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=go(this),mo(this),this.nodeViews=yo(this),this.docView=si(this.state.doc,fo(this),Xr(this),this.dom,this),this.domObserver=new to(this,(e,t,n,i)=>lo(this,e,t,n,i)),this.domObserver.start(),function(e){for(let t in or){let n=or[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!dr(e,t)||ur(e,t)||!e.editable&&t.type in sr||n(e,t)},ar[t]?{passive:!0}:void 0)}Cn&&e.dom.addEventListener("input",()=>null),hr(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&hr(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(vo),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let i=this.state,r=!1,o=!1;e.storedMarks&&this.composing&&(Cr(this),o=!0),this.state=e;let s=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=yo(this);(function(e,t){let n=0,i=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let e in t)i++;return n!=i})(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&hr(this),this.editable=go(this),mo(this);let a=Xr(this),l=fo(this),c=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",h=r||!this.docView.matchesNode(e.doc,l,a);!h&&e.selection.eq(i.selection)||(o=!0);let u="preserve"==c&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,i=e.dom.getBoundingClientRect(),r=Math.max(0,i.top);for(let o=(i.left+i.right)/2,s=r+1;s<Math.min(innerHeight,i.bottom);s+=5){let i=e.root.elementFromPoint(o,s);if(!i||i==e.dom||!e.dom.contains(i))continue;let a=i.getBoundingClientRect();if(a.top>=r-20){t=i,n=a.top;break}}return{refDOM:t,refTop:n,stack:qn(e.dom)}}(this);if(o){this.domObserver.stop();let t=h&&(xn||Sn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(i.selection,e.selection);if(h){let n=Sn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Mr(this)),!r&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=si(e.doc,l,a,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return sn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?zi(this,t):(Oi(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let i=e?e.getBoundingClientRect().top:0;Pn(n,0==i?0:i-t)}(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof _t){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&In(this,t.getBoundingClientRect(),e)}else In(this,this.coordsAtPos(this.state.selection.head,1),e);else;}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(i=e)}this.dragging=new Ar(e.slice,e.move,i<0?void 0:_t.create(this.state.doc,i))}someProp(e,t){let n,i=this._props&&this._props[e];if(null!=i&&(n=t?t(i):i))return n;for(let i=0;i<this.directPlugins.length;i++){let r=this.directPlugins[i].props[e];if(null!=r&&(n=t?t(r):r))return n}let r=this.state.plugins;if(r)for(let i=0;i<r.length;i++){let o=r[i].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){if(xn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(_n)return e.focus(_n);let t=qn(e);e.focus(null==_n?{get preventScroll(){return _n={preventScroll:!0},!0}}:void 0),_n||(_n=!1,Pn(t,0))}(this.dom),zi(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}updateRoot(){this._root=null}posAtCoords(e){return Vn(this,e)}coordsAtPos(e,t=1){return Un(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(null==i)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return ei(this,t||this.state,e)}pasteHTML(e,t){return Or(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Or(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Hi(this,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Xr(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,rn=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){ur(e,t)||!or[t.type]||!e.editable&&t.type in sr||or[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?Cn&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return ro(e,n)}let n;function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",i,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",i,!0),n?ro(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function fo(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[_r.node(0,e.state.doc.content.size,t)]}function mo(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:_r.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function go(e){return!e.someProp("editable",t=>!1===t(e.state))}function yo(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function vo(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var xo;po.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};var bo="ssml-editor-focused",wo="ssml-tag",ko="ssml-text-mark",So="ssml-editor-phoneme__char",zo="ssml-editor-number-tip__char",Co="ssml-editor-text-media__mark",Mo="preventFloatingMenu",No=(s(s(s(s(s(s(s(s(s(s(xo={},k.Word,"连读"),k.Breath,"换气"),k.Break,"停顿"),k.Phoneme,"多音字"),k.Speaker,"发音人"),k.SpeechRate,"语速"),k.SpeechPitch,"语调"),k.SpeechVolume,"音量"),k.SpeechLanguage,"语种"),k.Action,"动作"),s(s(s(s(s(s(s(xo,k.Avatar,"主播"),k.Emotion,"表情"),k.SayAs,s(s(s(s(s(s({},S.auto,"自动"),S.digits,"读数字"),S.cardinal,"读数值"),0,"自动"),1,"读数字"),2,"读数值")),k.Command,"指令"),k.Wait,"等待"),k.PptControl,"PPT控制"),k.SoundEvent,"音效")),To=s(s(s({},k.Word,"[w0]"),k.Breath,"[w3]"),k.SayAs,s(s(s({},S.auto,"[n0]"),S.digits,"[n1]"),S.cardinal,"[n2]")),Oo=function(){function e(){i(this,e),s(this,"nodes",{}),s(this,"marks",{}),s(this,"plugins",{})}return o(e,[{key:"registerNode",value:function(e,t){this.nodes[e]=t}},{key:"registerMark",value:function(e,t){this.marks[e]=t}},{key:"registerPlugin",value:function(e,t){this.plugins[e]=t}},{key:"getNodes",value:function(){return d({},this.nodes)}},{key:"getMarks",value:function(){return d({},this.marks)}},{key:"getPlugins",value:function(e){var t;return null===(t=Object.values(this.plugins))||void 0===t?void 0:t.map(function(t){return t instanceof Xt?t:t(e)})}},{key:"clone",value:function(){var t=new e;return Object.entries(this.nodes).forEach(function(e){var n=g(e,2),i=n[0],r=n[1];return t.registerNode(i,r)}),Object.entries(this.marks).forEach(function(e){var n=g(e,2),i=n[0],r=n[1];return t.registerMark(i,r)}),Object.entries(this.plugins).forEach(function(e){var n=g(e,2),i=n[0],r=n[1];return t.registerPlugin(i,r)}),t}}])}(),Eo=new Oo,Ao="highlight";var jo=new Xt({key:new en(Ao),state:{init:function(){return Fr.empty},apply:function(e,t,n,i){var r=e.getMeta(Ao);return null!=r&&r.active?function(e,t,n){var i=[];return i.push(_r.inline(t,n,{class:"ssml-text-highlight"})),Fr.create(e,i)}(i.doc,r.from,r.to):!1===(null==r?void 0:r.active)?Fr.empty:t.map(e.mapping,e.doc)}},props:{decorations:function(e){return this.getState(e)}}});Eo.registerPlugin(Ao,jo);var Do={highlight:"highlight",clearHighlight:"clearHighlight"};D({name:Do.highlight,description:"高亮",execute:function(e,t){var n=e.state,i=e.dispatch;return i&&i(n.tr.setMeta(Ao,t)),{success:!0}},validate:function(e){return{available:!0}}}),D({name:Do.clearHighlight,description:"清除高亮",execute:function(e){var t=e.state,n=e.dispatch;return n&&n(t.tr.setMeta(Ao,{from:0,to:0,active:!1})),{success:!0}},validate:function(e){return{available:!0}}});var Ro=200,Io=function(){};Io.prototype.append=function(e){return e.length?(e=Io.from(e),!this.length&&e||e.length<Ro&&this.leafAppend(e)||this.length<Ro&&e.leafPrepend(this)||this.appendInner(e)):this},Io.prototype.prepend=function(e){return e.length?Io.from(e).append(this):this},Io.prototype.appendInner=function(e){return new Po(this,e)},Io.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Io.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Io.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Io.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Io.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var i=[];return this.forEach(function(t,n){return i.push(e(t,n))},t,n),i},Io.from=function(e){return e instanceof Io?e:e&&e.length?new qo(e):Io.empty};var qo=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,i){for(var r=t;r<n;r++)if(!1===e(this.values[r],i+r))return!1},t.prototype.forEachInvertedInner=function(e,t,n,i){for(var r=t-1;r>=n;r--)if(!1===e(this.values[r],i+r))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Ro)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Ro)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Io);Io.empty=new qo([]);var Po=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,i){var r=this.left.length;return!(t<r&&!1===this.left.forEachInner(e,t,Math.min(n,r),i))&&(!(n>r&&!1===this.right.forEachInner(e,Math.max(t-r,0),Math.min(this.length,n)-r,i+r))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,i){var r=this.left.length;return!(t>r&&!1===this.right.forEachInvertedInner(e,t-r,Math.max(n,r)-r,i+r))&&(!(n<r&&!1===this.left.forEachInvertedInner(e,Math.min(t,r),n,i))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Io);class _o{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,i,r=this.items.length;for(;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(n=this.remapping(r,this.items.length),i=n.maps.length);let o,s,a=e.tr,l=[],c=[];return this.items.forEach((e,t)=>{if(!e.step)return n||(n=this.remapping(r,t+1),i=n.maps.length),i--,void c.push(e);if(n){c.push(new Lo(e.map));let t,r=e.step.map(n.slice(i));r&&a.maybeStep(r).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new Lo(t,void 0,void 0,l.length+c.length))),i--,t&&n.appendMap(t,i)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(i)):e.selection,s=new _o(this.items.slice(0,r).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,i){let r=[],o=this.eventCount,s=this.items,a=!i&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),h=new Lo(e.mapping.maps[n],c,t);(l=a&&a.merge(h))&&(h=l,n?r.pop():s=s.slice(0,s.length-1)),r.push(h),t&&(o++,t=void 0),i||(a=h)}let l=o-n.depth;return l>Fo&&(s=function(e,t){let n;return e.forEach((e,i)=>{if(e.selection&&0==t--)return n=i,!1}),e.slice(n)}(s,l),o-=l),new _o(s.append(r),o)}remapping(e,t){let n=new Xe;return this.items.forEach((t,i)=>{let r=null!=t.mirrorOffset&&i-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,r)},e,t),n}addMaps(e){return 0==this.eventCount?this:new _o(this.items.append(e.map(e=>new Lo(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),r=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let a=t;this.items.forEach(t=>{let i=r.getMirror(--a);if(null==i)return;o=Math.min(o,i);let l=r.maps[i];if(t.step){let o=e.steps[i].invert(e.docs[i]),c=t.selection&&t.selection.map(r.slice(a+1,i));c&&s++,n.push(new Lo(l,o,c))}else n.push(new Lo(l))},i);let l=[];for(let e=t;e<o;e++)l.push(new Lo(r.maps[e]));let c=this.items.slice(0,i).append(l).append(n),h=new _o(c,s);return h.emptyItemCount()>500&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],r=0;return this.items.forEach((o,s)=>{if(s>=e)i.push(o),o.selection&&r++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&r++;let l,c=new Lo(s.invert(),e,a),h=i.length-1;(l=i.length&&i[h].merge(c))?i[h]=l:i.push(c)}}else o.map&&n--},this.items.length,0),new _o(Io.from(i.reverse()),r)}}_o.empty=new _o(Io.empty,0);class Lo{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Lo(t.getMap().invert(),t,this.selection)}}}class Bo{constructor(e,t,n,i,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=r}}const Fo=20;function Vo(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,i,r)=>t.push(i,r));return t}function Wo(e,t){if(!e)return null;let n=[];for(let i=0;i<e.length;i+=2){let r=t.map(e[i],1),o=t.map(e[i+1],-1);r<=o&&n.push(r,o)}return n}let $o=!1,Jo=null;function Uo(e){let t=e.plugins;if(Jo!=t){$o=!1,Jo=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){$o=!0;break}}return $o}const Ho=new en("history"),Ko=new en("closeHistory");function Go(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Xt({key:Ho,state:{init:()=>new Bo(_o.empty,_o.empty,null,0,-1),apply:(t,n,i)=>function(e,t,n,i){let r,o=n.getMeta(Ho);if(o)return o.historyState;n.getMeta(Ko)&&(e=new Bo(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Ho))return s.getMeta(Ho).redo?new Bo(e.done.addTransform(n,void 0,i,Uo(t)),e.undone,Vo(n.mapping.maps),e.prevTime,e.prevComposition):new Bo(e.done,e.undone.addTransform(n,void 0,i,Uo(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new Bo(e.done.rebased(n,r),e.undone.rebased(n,r),Wo(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Bo(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Wo(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let r=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=r&&(e.prevTime<(n.time||0)-i.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,i)=>{for(let r=0;r<t.length;r+=2)e<=t[r+1]&&i>=t[r]&&(n=!0)}),n}(n,e.prevRanges)),a=s?Wo(e.prevRanges,n.mapping):Vo(n.mapping.maps);return new Bo(e.done.addTransform(n,o?t.selection.getBookmark():void 0,i,Uo(t)),_o.empty,a,n.time,null==r?e.prevComposition:r)}}(n,i,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i="historyUndo"==n?Xo:"historyRedo"==n?Zo:null;return!(!i||!e.editable)&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}function Yo(e,t){return(n,i)=>{let r=Ho.getState(n);if(!r||0==(e?r.undone:r.done).eventCount)return!1;if(i){let o=function(e,t,n){let i=Uo(t),r=Ho.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,i);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),r,i),l=new Bo(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Ho,{redo:n,historyState:l})}(r,n,e);o&&i(t?o.scrollIntoView():o)}return!0}}const Xo=Yo(!1,!0),Zo=Yo(!0,!0);var Qo={undo:"undo",redo:"redo",clear:"clear"};D({name:Qo.undo,description:"撤销",execute:function(e){var t=e.state,n=e.dispatch;return n&&Xo(t,n),{success:!0}},validate:function(e){return function(e){let t=Ho.getState(e);return t?t.done.eventCount:0}(e.state)<=0?{available:!1,reason:"历史栈为空"}:{available:!0}}}),D({name:Qo.clear,description:"清空历史栈",execute:function(e){var t=e.state,n=e.view,i=e.editor,r=Go(),o=Gt.create({doc:t.doc,schema:t.schema,plugins:t.plugins.map(function(e){return e.spec.key===r.spec.key?r:e})});if(n.updateState(o),i){var s=i.getCurrentState();i.emit("stateChange",{commands:s})}return{success:!0}},validate:function(e){return{available:!0}}}),D({name:Qo.redo,description:"重做",execute:function(e){var t=e.state,n=e.dispatch;return n&&Zo(t,n),{success:!0}},validate:function(e){return function(e){let t=Ho.getState(e);return t?t.undone.eventCount:0}(e.state)<=0?{available:!1,reason:"重做栈为空"}:{available:!0}}});var es={inputText:"inputText",replaceRange:"replaceRange"};D({name:es.inputText,description:"文本编辑",execute:function(e,t){var n=e.state,i=e.dispatch,r=t,o=r.content,s=r.cursorFollow;if(i&&void 0!==o){var a,l=n.selection,c=n.schema,h=n.tr;a=l.from!==l.to?(h=h.deleteSelection()).selection.from:s?l.from:Math.max(0,n.doc.content.size-1);var u=o.split("\n").map(function(e){return c.nodes.paragraph.create(null,e?c.text(e):void 0)}),d=new J(L.from(u),1,1),p=(h=h.replace(a,a,d)).mapping.map(a,1);return h.setSelection(qt.near(h.doc.resolve(p))),i(h.scrollIntoView()),{success:!0}}return{success:!1,code:I.ParamsMissing,reason:"缺少内容"}},validate:function(e){return{available:!0}}}),D({name:es.replaceRange,description:"替换指定范围文本",execute:function(e,t){var n=e.state,i=e.dispatch,r=t,o=r.content,s=r.from,a=r.to;if(i&&void 0!==o){var l=n.selection,c=n.schema,h=void 0!==s?s:l.from,u=void 0!==a?a:l.to,d=o.split("\n"),p=new J(L.from(d.map(function(e){return c.nodes.paragraph.create(null,e?c.text(e):void 0)})),1,1),f=n.tr,m=(f=f.replace(h,u,p)).mapping.map(u,-1);return f.setSelection(qt.near(f.doc.resolve(m))),i(f.scrollIntoView()),{success:!0}}return{success:!1,code:I.ParamsMissing,reason:"参数缺失"}},validate:function(e){return{available:!0}}});var ts={insertPptControl:"insertPptControl"};D({name:ts.insertPptControl,description:"插入PPT控制",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.PptControl].create(d(d({},n),{},{type:k.PptControl}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.PptControl])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"文本光标处插入Ppt控制"}}});var ns={insertSoundEvent:"insertSoundEvent"};D({name:ns.insertSoundEvent,description:"插入音效节点 (soundEvent)",execute:function(e,t){var n,i=t,r=e.state,o=e.dispatch;o&&o(r.tr.replaceSelectionWith(r.schema.nodes[k.SoundEvent].create(d(d({},i),{},{type:k.SoundEvent,volume:null!==(n=i.volume)&&void 0!==n?n:100}))).scrollIntoView());return{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.SoundEvent])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"当前位置无法插入音效节点"}}});var is={insertCommand:"insertCommand"};D({name:is.insertCommand,description:"插入指令",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Command].create(d(d({},n),{},{type:k.Command}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Command])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"文本光标处插入指令"}}});var rs={insertData:"insertData"};D({name:rs.insertData,description:"插入数据",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Data].create(d(d({},n),{},{type:k.Data}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Data])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"文本光标处插入数据槽位"}}});var ss={insertWait:"insertWait"};D({name:ss.insertWait,description:"插入等待",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Wait].create(d(d({},n),{},{type:k.Wait}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Wait])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"文本光标处插入等待"}}});var as={insertBreak:"insertBreak"};D({name:as.insertBreak,description:"插入停顿节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Break].create(d(d({},n),{},{type:k.Break}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Break])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"光标插入文本设置停顿时长"}}});var ls={insertBreath:"insertBreath"};D({name:ls.insertBreath,description:"插入换气节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Breath].create(d(d({},n),{},{type:k.Breath}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Breath])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"光标插入文本设置换气"}}});var cs={"的":["dí","dì","de"],"不":["bù","fǒu"],"了":["liǎo","le"],"有":["yǒu","yòu"],"这":["zhè","zhèi"],"个":["gè","gě"],"上":["shàng","shǎng"],"她":["tā","jiě"],"大":["dà","dài","tài"],"中":["zhōng","zhòng"],"说":["shuō","shuì","yuè"],"为":["wéi","wèi"],"着":["zhuó","zháo","zhāo","zhe"],"得":["dé","děi","de"],"要":["yào","yāo"],"地":["dì","de"],"那":["nà","nǎ","nèi","nā"],"和":["hé","hè","huó","huò","hú"],"可":["kě","kè"],"会":["huì","kuài"],"过":["guò","guo","guō"],"么":["mó","ma","me","yāo"],"好":["hǎo","hào"],"看":["kàn","kān"],"家":["jiā","jia","jie"],"能":["néng","nài"],"没":["méi","mò"],"只":["zhī","zhǐ"],"还":["huán","hái"],"发":["fā","fà"],"行":["háng","xíng"],"见":["jiàn","xiàn"],"都":["dū","dōu"],"知":["zhī","zhì"],"头":["tóu","tou"],"分":["fēn","fèn"],"把":["bǎ","bà"],"当":["dāng","dàng"],"同":["tóng","tòng"],"其":["qí","jī"],"与":["yǔ","yù","yú"],"从":["cóng","zòng"],"什":["shí","shén"],"些":["xiē","suò"],"将":["jiāng","jiàng"],"长":["cháng","zhǎng"],"女":["nǚ","rǔ"],"间":["jiān","jiàn"],"种":["zhǒng","zhòng","chóng"],"相":["xiāng","xiàng"],"正":["zhèng","zhēng"],"数":["shù","shǔ","shuò"],"信":["xìn","shēn"],"系":["xì","jì"],"应":["yīng","yìng"],"何":["hé","hē","hè"],"便":["biàn","pián"],"重":["zhòng","chóng"],"给":["gěi","jǐ"],"并":["bìng","bīng"],"打":["dǎ","dá"],"处":["chǔ","chù"],"几":["jī","jǐ"],"别":["bié","biè"],"被":["bèi","pī"],"结":["jié","jiē"],"少":["shǎo","shào"],"合":["hé","gě"],"内":["nèi","nà"],"体":["tǐ","tī"],"夫":["fū","fú"],"王":["wáng","wàng"],"化":["huà","huā"],"据":["jù","jū"],"觉":["jué","jiào"],"提":["tí","dī","dǐ"],"解":["jiě","jiè","xiè"],"难":["nán","nàn","nuó"],"更":["gēng","gèng"],"亲":["qīn","qìng"],"风":["fēng","fěng"],"教":["jiào","jiāo"],"度":["dù","duó"],"任":["rèn","rén"],"各":["gè","gě"],"语":["yǔ","yù"],"许":["xǔ","hǔ"],"思":["sī","sāi"],"呢":["ní","ne"],"且":["qiě","jū"],"服":["fú","fù"],"场":["cháng","chǎng"],"万":["wàn","mò"],"若":["ruò","rě"],"量":["liáng","liàng"],"转":["zhuǎn","zhuàn","zhuǎi"],"吗":["má","mǎ","ma"],"似":["sì","shì"],"车":["chē","jū"],"强":["qiáng","qiǎng","jiàng"],"论":["lùn","lún"],"传":["chuán","zhuàn"],"干":["gān","gàn"],"条":["tiáo","tiāo"],"员":["yuán","yún","yùn"],"吧":["bā","ba"],"南":["nán","nā"],"北":["běi","bèi"],"模":["mó","mú"],"空":["kōng","kòng","kǒng"],"远":["yuǎn","yuàn"],"令":["líng","lǐng","lìng"],"术":["shù","shú","zhú"],"拉":["lā","lá"],"华":["huá","huà","huā"],"父":["fù","fǔ"],"红":["hóng","gōng"],"识":["shí","zhì"],"期":["qī","jī"],"倒":["dǎo","dào"],"区":["qū","ōu"],"切":["qiē","qiè"],"落":["là","luò","lào"],"单":["dān","shàn","chán"],"调":["tiáo","diào","zhōu"],"石":["shí","dàn"],"弟":["dì","tì","tuí"],"济":["jì","jǐ"],"句":["jù","gōu"],"尽":["jìn","jǐn"],"答":["dá","dā"],"奇":["qí","jī"],"台":["tái","tāi"],"兴":["xīng","xìng"],"共":["gòng","gōng"],"乐":["lè","yuè","yào","lào"],"曾":["zēng","céng"],"约":["yuē","yāo"],"甚":["shèn","shén"],"待":["dài","dāi"],"观":["guān","guàn"],"六":["liù","lù"],"片":["piàn","piān"],"研":["yán","yàn"],"节":["jié","jiē"],"阿":["ā","ē"],"哪":["nǎ","něi","na","né"],"查":["chá","zhā"],"委":["wěi","wēi"],"广":["guǎng","ān"],"参":["cān","shēn","cēn","sān"],"朝":["zhāo","cháo"],"称":["chēng","chèn","chèng"],"底":["dǐ","de"],"号":["hào","háo"],"啊":["ā","á","ǎ","à","a"],"采":["cǎi","cài"],"差":["chà","chā","chāi","cī"],"省":["shěng","xǐng"],"假":["jiǎ","jià"],"喝":["hē","hè","yè"],"莫":["mò","mù"],"纪":["jì","jǐ"],"丽":["lì","lí"],"角":["jiǎo","jué"],"否":["fǒu","pǐ"],"冲":["chōng","chòng"],"背":["bèi","bēi"],"血":["xiě","xuè"],"旁":["páng","bàng"],"齐":["qí","jì","zī","zhāi"],"罢":["bà","ba","pí"],"疑":["yí","nǐ"],"供":["gōng","gòng"],"县":["xiàn","xuán"],"率":["shuài","lǜ"],"恶":["è","wù","ě","wū"],"读":["dú","dòu"],"价":["jià","jiè","jie"],"雨":["yǔ","yù"],"属":["shǔ","zhǔ"],"络":["luò","lào"],"露":["lòu","lù"],"助":["zhù","chú"],"景":["jǐng","yǐng"],"责":["zé","zhài"],"伯":["bó","bǎi","bà"],"呀":["yā","ya"],"跑":["pǎo","páo"],"哈":["hā","hǎ","hà"],"划":["huá","huà"],"仅":["jǐn","jìn"],"适":["shì","kuò"],"追":["zhuī","duī"],"校":["xiào","jiào"],"孙":["sūn","xùn"],"氏":["shì","zhī"],"散":["sàn","sǎn"],"排":["pái","pǎi"],"副":["fù","pì"],"食":["shí","sì","yì"],"佛":["fó","fú","bì","bó"],"跳":["tiào","táo"],"创":["chuàng","chuāng"],"斗":["dǒu","dòu"],"沙":["shā","shà"],"妻":["qī","qì"],"渐":["jiàn","jiān"],"藏":["cáng","zàng"],"弄":["nòng","lòng"],"咱":["zán","zá","zǎ"],"织":["zhī","zhì"],"苏":["sū","sù"],"朱":["zhū","shú"],"隐":["yǐn","yìn"],"毒":["dú","dài"],"担":["dān","dàn","dǎn"],"著":["zhù","zhuó","zhe"],"曲":["qū","qǔ"],"禁":["jīn","jìn"],"叶":["yè","xié"],"份":["fèn","bīn"],"戏":["xì","hū"],"射":["shè","yè","yì"],"燕":["yàn","yān"],"卡":["qiǎ","kǎ"],"啦":["lā","la"],"压":["yā","yà"],"盖":["gài","gě","hé"],"监":["jiān","jiàn"],"刺":["cì","cī"],"宁":["níng","nìng","zhù"],"休":["xiū","xǔ"],"郎":["láng","làng"],"占":["zhān","zhàn"],"秘":["mì","bì"],"绿":["lǜ","lù"],"骨":["gǔ","gū"],"奔":["bēn","bèn"],"舍":["shě","shè"],"蒙":["mēng","méng","měng"],"熟":["shú","shóu"],"卷":["juàn","juǎn"],"吾":["wú","yù"],"择":["zé","zhái"],"奥":["ào","yù"],"沈":["shěn","chén"],"港":["gǎng","jiǎng"],"厂":["chǎng","ān","hàn"],"趣":["qù","cù"],"岂":["qǐ","kǎi"],"娜":["nà","nuó"],"折":["zhē","zhé","shé"],"载":["zǎi","zài"],"塞":["sāi","sài","sè"],"亡":["wáng","wú"],"降":["jiàng","xiáng"],"盛":["shèng","chéng"],"弹":["dàn","tán"],"番":["fān","pān"],"吓":["xià","hè"],"泽":["zé","shì"],"劲":["jìn","jìng"],"仇":["chóu","qiú"],"洗":["xǐ","xiǎn"],"挑":["tiāo","tiǎo"],"括":["kuò","guā"],"混":["hùn","hún"],"乘":["chéng","shèng"],"横":["héng","hèng"],"侯":["hóu","hòu"],"鲜":["xiān","xiǎn"],"纵":["zòng","zǒng"],"糊":["hū","hú","hù"],"邪":["xié","yá","yé","yú","xú"],"臂":["bì","bei"],"勒":["lè","lēi"],"累":["léi","lěi","lèi"],"冒":["mào","mò"],"抢":["qiāng","qiǎng","chēng"],"迫":["pò","pǎi"],"悄":["qiǎo","qiāo"],"尺":["chǐ","chě"],"侧":["cè","zè","zhāi"],"缩":["suō","sù"],"票":["piào","piāo"],"瓦":["wǎ","wà"],"稍":["shāo","shào"],"核":["hé","hú"],"净":["jìng","chēng"],"枝":["zhī","qí"],"凉":["liáng","liàng"],"仆":["pū","pú"],"贾":["gǔ","jiǎ"],"薄":["báo","bó","bò"],"扫":["sǎo","sào"],"召":["zhào","shào"],"予":["yú","yǔ"],"扎":["zā","zhā","zhá"],"吐":["tǔ","tù"],"仰":["yǎng","áng"],"哼":["hēng","hng"],"椅":["yǐ","yī"],"频":["pín","bīn"],"铺":["pū","pù"],"圈":["quān","juàn","juān"],"嘛":["má","ma"],"丧":["sāng","sàng"],"汤":["tāng","shāng"],"呵":["hē","a","kē"],"汗":["hàn","hán"],"旋":["xuán","xuàn"],"闷":["mèn","mēn"],"尾":["wěi","yǐ"],"羊":["yáng","xiáng"],"拾":["shí","shè"],"冠":["guān","guàn"],"宿":["sù","xiǔ","xiù"],"艾":["ài","yì"],"详":["xiáng","yáng"],"埋":["mái","mán"],"俩":["liǎng","liǎ"],"颤":["chàn","zhàn"],"耶":["yé","yē"],"磨":["mó","mò"],"肚":["dù","dǔ"],"繁":["fán","pó"],"哦":["ó","ò","é"],"漂":["piāo","piǎo","piào"],"蛇":["shé","yí"],"筑":["zhù","zhú"],"泥":["ní","nì"],"摩":["mó","mā"],"堡":["bǎo","bǔ","pù"],"仔":["zī","zǐ","zǎi"],"丁":["dīng","zhēng"],"综":["zōng","zèng"],"夹":["jiā","jiá","gā"],"菲":["fēi","fěi"],"哩":["li","lǐ","lī"],"扇":["shàn","shān"],"钢":["gāng","gàng"],"溜":["liū","liù"],"涌":["yǒng","chōng"],"挣":["zhèng","zhēng"],"勾":["gōu","gòu"],"裂":["liè","liě"],"晃":["huǎng","huàng"],"莎":["suō","shā"],"柏":["bǎi","bó","bò"],"抹":["mǒ","mò","mā"],"卜":["bǔ","bo"],"葛":["gé","gě"],"撒":["sā","sǎ"],"屏":["píng","bǐng"],"尉":["wèi","yù"],"冯":["féng","píng"],"摄":["shè","niè"],"挡":["dǎng","dàng"],"浅":["qiǎn","jiān"],"殷":["yīn","yān","yǐn"],"唉":["āi","ài"],"勃":["bó","bèi"],"估":["gū","gù"],"钻":["zuān","zuàn"],"趋":["qū","cù"],"拓":["tuò","tà","zhí"],"倘":["tǎng","cháng"],"猫":["māo","máo"],"嚷":["rǎng","rāng"],"胖":["pàng","pán","pàn"],"祭":["jì","zhài"],"炸":["zhà","zhá"],"炮":["páo","bāo","pào"],"柜":["guì","jǔ"],"挨":["āi","ái"],"吵":["chǎo","chāo"],"脉":["mài","mò"],"缝":["féng","fèng"],"笼":["lóng","lǒng"],"嘿":["hēi","mò"],"嗯":["ǹg","ńg","ňg","ǹ","ń","ň"],"叉":["chā","chá","chǎ"],"膀":["bǎng","páng"],"臭":["chòu","xiù"],"纤":["xiān","qiàn"],"洒":["sǎ","xǐ"],"愉":["yú","tōu"],"弥":["mí","mǐ"],"咽":["yān","yàn","yè"],"敦":["dūn","duì"],"颈":["jǐng","gěng"],"泄":["xiè","yì"],"揭":["jiē","qì"],"喷":["pēn","pèn"],"乾":["qián","gān"],"纹":["wén","wèn"],"卒":["zú","cù"],"劈":["pī","pǐ"],"禅":["chán","shàn"],"瞒":["mán","mén"],"煞":["shā","shà"],"岭":["lǐng","líng"],"夸":["kuā","kuà"],"刹":["chà","shā"],"拆":["chāi","cā"],"彭":["péng","bāng"],"妃":["fēi","pèi"],"嘲":["cháo","zhāo"],"哑":["yǎ","yā"],"裳":["cháng","shang"],"宛":["wǎn","yuān"],"刷":["shuā","shuà"],"衰":["shuāi","cuī"],"晕":["yùn","yūn"],"削":["xiāo","xuē"],"棍":["gùn","hùn"],"拂":["fú","bì"],"哄":["hōng","hǒng","hòng"],"钉":["dīng","dìng"],"朴":["pǔ","pò","pō","piáo"],"吁":["xū","yù"],"兹":["zī","cí"],"暴":["bào","pù"],"搂":["lǒu","lōu"],"巷":["xiàng","hàng"],"契":["qì","qiè","xiè"],"填":["tián","zhèn"],"囊":["náng","nāng"],"咳":["ké","hāi"],"咖":["kā","gā"],"钥":["yuè","yào"],"搁":["gē","gé"],"俞":["yú","yù","shù"],"趟":["tàng","tāng"],"爪":["zhǎo","zhuǎ"],"涨":["zhǎng","zhàng"],"辟":["bì","pì"],"疆":["jiāng","qiáng"],"畜":["xù","chù"],"泊":["bó","pō"],"拘":["jū","gōu"],"哇":["wā","wa"],"肖":["xiāo","xiào"],"症":["zhèng","zhēng"],"泡":["pào","pāo"],"杆":["gān","gǎn"],"伺":["sì","cì"],"麽":["mó","me","ma"],"雀":["què","qiāo","qiǎo"],"腊":["là","xī"],"稽":["jī","qǐ"],"澄":["chéng","dèng"],"淋":["lín","lìn"],"帖":["tiè","tiě","tiē"],"嵌":["qiàn","kàn"],"坊":["fāng","fáng"],"剥":["bāo","bō"],"哟":["yō","yo"],"券":["quàn","xuàn"],"俏":["qiào","xiào"],"骚":["sāo","sǎo"],"榜":["bǎng","bàng"],"拚":["pàn","pīn","fān"],"姥":["mǔ","lǎo"],"於":["yú","wū"],"撇":["piē","piě"],"匙":["chí","shi"],"龟":["guī","jūn","qiū"],"胳":["gē","gé"],"硕":["shuò","shí"],"渠":["qú","jù"],"倡":["chàng","chāng"],"苹":["píng","pēng"],"殖":["zhí","shi"],"喔":["ō","wō"],"佣":["yōng","yòng"],"藉":["jiè","jí"],"荫":["yīn","yìn"],"碌":["lù","liù"],"壳":["ké","qiào"],"堕":["duò","huī"],"哗":["huá","huā"],"咧":["liě","liē","lié","lie"],"厦":["shà","xià"],"阙":["quē","què"],"斐":["fěi","fēi"],"挟":["xié","jiā"],"扁":["biǎn","piān"],"呐":["nà","nè"],"亨":["hēng","pēng"],"熬":["āo","áo"],"幢":["chuáng","zhuàng"],"逮":["dài","dǎi"],"绰":["chuò","chāo"],"簿":["bù","bó"],"眯":["mī","mí"],"梢":["shāo","sào"],"叨":["tāo","dāo"],"轴":["zhóu","zhòu"],"褚":["zhǔ","chǔ"],"缴":["jiǎo","zhuó"],"粘":["nián","zhān"],"溃":["kuì","huì"],"淳":["chún","zhūn"],"彷":["páng","fǎng"],"绷":["bēng","běng","bèng"],"浆":["jiāng","jiàng"],"栖":["qī","xī"],"嚼":["jiáo","jué","jiào"],"咯":["kǎ","luò","lo","gē"],"呕":["ǒu","ōu","òu"],"觑":["qù","qū"],"膏":["gāo","gào"],"缪":["móu","miù","miào","mù","liáo"],"筠":["yún","jūn"],"牟":["móu","mù"],"熏":["xūn","xùn"],"溅":["jiàn","jiān"],"撩":["liāo","liáo"],"屯":["tún","zhūn"],"喽":["lóu","lou"],"唬":["hǔ","xià"],"粥":["zhōu","yù"],"溺":["nì","niào"],"栅":["zhà","shān","shi","cè"],"揣":["chuǎi","chuài","chuāi","tuán","zhuī"],"扛":["káng","gāng"],"嘘":["xū","shī"],"唔":["wù","wú","ńg","ń"],"吱":["zhī","zī"],"兑":["duì","ruì","yuè"],"豁":["huō","huò","huá"],"芯":["xīn","xìn"],"竺":["zhú","dǔ"],"尿":["niào","suī"],"媛":["yuàn","yuán"],"鞘":["qiào","shāo"],"隋":["suí","duò"],"铅":["qiān","yán"],"踉":["liáng","liàng"],"跄":["qiāng","qiàng"],"蔓":["màn","wàn"],"苔":["tái","tāi"],"翘":["qiáo","qiào"],"缉":["jī","qī"],"矫":["jiǎo","jiáo"],"甸":["diàn","tián","shèng"],"沮":["jǔ","jù"],"拧":["níng","nǐng","nìng"],"嘎":["gā","gá","gǎ"],"凹":["āo","wā"],"虾":["xiā","hā"],"琢":["zhuó","zuó"],"浚":["jùn","xùn"],"恁":["nèn","nín"],"姗":["shān","shàn"],"俟":["sì","qí"],"褪":["tuì","tùn"],"菌":["jūn","jùn"],"砌":["qì","qiè"],"淌":["tǎng","chǎng"],"槛":["jiàn","kǎn"],"攒":["zǎn","cuán"],"擂":["léi","lèi"],"忒":["tè","tuī"],"嗳":["ǎi","ài","āi"],"吭":["háng","kēng"],"吒":["zhà","zhā"],"倔":["jué","juè"],"苛":["kē","hē"],"肋":["lèi","lē"],"矜":["jīn","qín","guān"],"瞿":["qú","jù"],"皋":["gāo","háo"],"瀑":["pù","bào"],"氓":["méng","máng"],"棱":["léng","lēng","líng"],"杠":["gàng","gāng"],"杉":["shān","shā"],"撮":["cuō","zuǒ"],"拽":["zhuài","zhuāi","yè"],"拗":["ǎo","ào","niù"],"扒":["bā","pá"],"奄":["yǎn","yān"],"囗":["wéi","guó"],"嗨":["hāi","hēi"],"喳":["zhā","chā"],"啜":["chuò","chuài"],"呛":["qiāng","qiàng"],"伽":["qié","jiā","gā"],"隽":["jùn","juàn"],"诘":["jié","jí"],"蟒":["mǎng","měng"],"蚂":["mǎ","mā","mà"],"翟":["dí","zhái"],"烙":["lào","luò"],"涡":["wō","guō"],"楷":["kǎi","jiē"],"捻":["niǎn","niē"],"抡":["lūn","lún"],"惮":["dàn","dá"],"崭":["zhǎn","chán"],"喏":["nuò","rě"],"啰":["luō","luó","luo"],"唠":["lào","láo"],"侥":["jiǎo","yáo"],"辗":["zhǎn","niǎn"],"蛾":["é","yǐ"],"莞":["guān","guǎn","wǎn"],"疙":["gē","yì"],"渎":["dú","dòu"],"泌":["mì","bì"],"棣":["dì","dài","tì"],"桔":["jié","jú"],"拌":["bàn","pàn"],"峙":["zhì","shì"],"埔":["pǔ","bù"],"啐":["cuì","qi"],"呱":["guā","gū","guǎ"],"剿":["jiǎo","chāo"],"剌":["là","lá"],"僮":["tóng","zhuàng"],"亟":["jí","qì"],"靓":["jìng","liàng"],"蹊":["qī","xī"],"臧":["zāng","zàng","cáng"],"臊":["sāo","sào"],"簸":["bò","bǒ"],"磅":["bàng","páng"],"瘪":["biē","biě"],"瘩":["dá","da"],"槟":["bīn","bīng"],"椎":["zhuī","chuí"],"掺":["chān","xiān","càn","shǎn"],"捎":["shāo","shào"],"嫖":["piáo","piāo"],"咋":["zǎ","zé","zhā"],"咀":["jǔ","zuǐ"],"伎":["jì","qí"],"铛":["dāng","chēng"],"袊":["lǐng","líng"],"蛤":["gé","há"],"芥":["jiè","gài"],"缥":["piǎo","piāo"],"纶":["lún","guān"],"糜":["mí","méi"],"燎":["liáo","liǎo"],"潦":["lǎo","lào","liáo"],"沓":["tà","dá"],"汶":["wèn","mén"],"桧":["guì","huì"],"曝":["pù","bào"],"掖":["yè","yē"],"峒":["tóng","dòng"],"宓":["mì","fú"],"姣":["jiāo","xiáo"],"嚓":["cā","chā"],"嗒":["tà","dā"],"喋":["dié","zhá"],"倭":["wō","wēi"],"颉":["jié","xié","jiá"],"韫":["yùn","wēn"],"镐":["gǎo","hào"],"钿":["diàn","tián"],"迤":["yǐ","yí"],"贲":["bì","bēn"],"覃":["tán","qín"],"蟆":["má","mò"],"蚣":["gōng","zhōng"],"蚌":["bàng","bèng"],"腌":["ā","yān"],"耆":["qí","shì"],"繇":["yáo","yóu","zhòu"],"窕":["tiǎo","yáo"],"禺":["yú","yù","ǒu"],"碴":["chá","chā"],"熨":["yùn","yù"],"濯":["zhuó","zhào"],"澹":["dàn","tán"],"浒":["hǔ","xǔ"],"汩":["gǔ","yù"],"棹":["zhào","zhuō"],"撅":["juē","jué"],"掸":["dǎn","shàn"],"捋":["luō","lǚ"],"挝":["zhuā","wō"],"徵":["zhǐ","zhēng"],"坷":["kē","kě"],"吶":["nà","nè"],"匮":["kuì","guì"],"刨":["páo","bào"],"傀":["kuǐ","guī"],"佚":["yì","dié"],"佃":["diàn","tián"],"骠":["piào","biāo"],"陂":["bēi","pí","pō"],"钯":["bǎ","pá"],"酊":["dīng","dǐng"],"蹶":["jué","juě"],"裨":["bì","pí"],"螫":["shì","zhē"],"莘":["shēn","xīn"],"耙":["bà","pá"],"睢":["huī","suī"],"疟":["nüè","yào"],"町":["tǐng","dīng"],"甯":["níng","nìng"],"玟":["mín","wén"],"潢":["huáng","guāng"],"湮":["yān","yīn"],"泷":["lóng","shuāng"],"晟":["shèng","chéng"],"斡":["wò","guǎn"],"擞":["sòu","sǒu"],"挲":["suō","shā"],"幷":["bìng","bīng"],"峤":["jiào","qiáo"],"垛":["duǒ","duò"],"圜":["huán","yuán"],"嗄":["shà","á"],"咭":["jī","xī","qià"],"呗":["bei","bài"],"偻":["lǚ","lóu"],"偈":["jì","jié"],"侗":["dòng","tóng","tǒng"],"龈":["yín","kěn"],"鹘":["gǔ","hú"],"鲑":["guī","xié"],"鬲":["gé","lì"],"颌":["hé","gé"],"鞅":["yāng","yàng"],"隳":["huī","duò"],"隗":["wěi","kuí"],"铤":["tǐng","dìng"],"铣":["xiǎn","xǐ"],"钲":["zhēng","zhèng"],"郦":["lì","zhí"],"郄":["qiè","xì"],"趄":["qiè","jū"],"貉":["hé","háo","mò"],"谌":["chén","shèn"],"诒":["yí","dài"],"褔":["fù","fú"],"虺":["huǐ","huī"],"蓼":["liǎo","lù"],"菟":["tù","tú"],"菑":["zī","zì","zāi"],"莩":["fú","piǎo"],"荥":["xíng","yíng"],"荠":["jì","qí"],"荑":["yí","tí"],"苴":["jū","chá"],"苫":["shān","shàn"],"苕":["tiáo","sháo"],"膻":["shān","dàn"],"缯":["zēng","zèng"],"纰":["pī","pí","bǐ"],"纥":["hé","gē"],"綄":["huán","huàn","wàn"],"磻":["pán","bō"],"碣":["jié","yà"],"砉":["xū","huā"],"矞":["yù","xù","jué"],"睥":["bì","pì"],"疋":["pǐ","yǎ","shū"],"畤":["zhì","chóu","shì"],"玢":["bīn","fēn"],"猗":["yī","yǐ"],"焯":["zhuō","chāo"],"烊":["yáng","yàng"],"湫":["qiū","jiǎo"],"渑":["miǎn","shéng"],"淖":["nào","chuò","zhuō"],"沤":["òu","ōu"],"歙":["xī","shè"],"楂":["zhā","chá"],"桡":["ráo","náo"],"桁":["héng","háng"],"栎":["lì","yuè"],"柢":["dǐ","chí"],"柚":["yòu","yóu"],"枞":["cōng","zōng"],"杓":["sháo","biāo"],"杈":["chā","chà"],"旄":["máo","mào"],"擘":["bò","bāi"],"挎":["kuà","kū"],"拶":["zā","zǎn"],"拮":["jié","jiá"],"戆":["gàng","zhuàng"],"慊":["qiàn","qiè"],"怍":["zuò","zhà"],"忾":["kài","xì"],"忪":["sōng","zhōng"],"徼":["jiǎo","jiào"],"徕":["lài","lái"],"帑":["tǎng","nú"],"崴":["wǎi","wēi"],"孱":["chán","càn"],"嬛":["huán","xuān","qióng"],"婠":["wān","wà"],"娆":["ráo","rǎo"],"妳":["nǐ","nǎi"],"奘":["zàng","zhuǎng"],"夯":["hāng","bèn"],"埽":["sào","sǎo"],"埶":["yì","shì"],"垸":["yuàn","huán"],"圻":["qí","yín"],"圩":["wéi","xū"],"囤":["dùn","tún"],"囝":["jiǎn","nān"],"噱":["jué","xué"],"嗑":["kē","kè"],"啁":["zhōu","zhāo","tiào"],"哏":["gén","hěn"],"吋":["dòu","cùn"],"剡":["yǎn","shàn"],"儋":["dān","dàn"],"傕":["què","jué"],"佝":["gōu","kòu"],"伧":["cāng","chen"],"仡":["yì","gē"],"亶":["dǎn","dàn"],"乜":["miē","niè"],"龜":["guī","jūn","qiū"],"龓":["lóng","lǒng"],"龏":["gōng","wò"],"龍":["lóng","lǒng"],"龂":["yín","kěn"],"齊":["qí","zhāi"],"黾":["mǐn","miǎn","měng"],"黽":["mǐn","miǎn","měng"],"黵":["dǎn","zhǎn"],"黰":["zhěn","yān"],"黮":["dàn","shèn"],"麼":["mó","me"],"麗":["lí","lì"],"麇":["jūn","qún"],"麆":["zhù","cū"],"麃":["páo","biāo"],"鷜":["lóu","lǚ"],"鶽":["sǔn","xùn"],"鶻":["gǔ","hú"],"鶮":["hè","hú"],"鶬":["cāng","qiāng"],"鶨":["chuàn","zhì"],"鶣":["piān","biǎn"],"鶡":["hé","jiè"],"鶝":["fú","bì"],"鶙":["tí","chí"],"鶗":["tí","chí"],"鳽":["jiān","qiān","zhān"],"鳻":["bān","fén"],"鳺":["fū","guī"],"鳱":["gān","hàn","yàn"],"鳭":["diāo","zhāo"],"鳥":["niǎo","diǎo"],"鳣":["zhān","shàn"],"鳜":["guì","jué"],"鳃":["sāi","xǐ"],"鲌":["bó","bà"],"鲊":["zhǎ","zhà"],"鲄":["hé","gě"],"鲃":["bā","bà"],"鰓":["sāi","xǐ"],"鯣":["yì","sī"],"鯆":["pū","bū"],"鮮":["xiān","xiǎn"],"鮭":["guī","xié"],"鮥":["luò","gé"],"鮘":["chou","dài"],"鮓":["zhǎ","zhà"],"鮊":["bó","bà"],"鮆":["cǐ","jì"],"魞":["bā","bà"],"髺":["kuò","yuè"],"髳":["máo","méng"],"髲":["bì","pǒ"],"體":["tǐ","tī"],"髉":["bó","jué"],"骹":["qiāo","xiāo"],"骳":["bèi","mó"],"駺":["liáng","láng"],"駨":["xún","xuān"],"駘":["tái","dài"],"駄":["tuó","duò"],"駃":["jué","kuài"],"馾":["dǎn","dàn"],"馸":["xìn","jìn"],"馶":["zhī","shì"],"馲":["tuō","zhé"],"馱":["tuó","duò"],"馯":["hàn","hán"],"馮":["féng","píng"],"馧":["yūn","wò"],"馕":["náng","nǎng"],"馏":["liù","liú"],"饹":["gē","le"],"饟":["xiǎng","náng"],"飵":["zuò","zé","zhā"],"飴":["yí","sì"],"飳":["zhù","tǒu"],"飲":["yǐn","yìn"],"飮":["yǐn","yìn"],"飬":["yǎng","juàn"],"飂":["liù","liáo"],"颾":["sāo","sōu"],"颰":["bá","fú"],"颩":["biāo","diū"],"風":["fēng","fěng"],"韘":["shè","xiè"],"韎":["mèi","wà"],"鞸":["bì","bǐng"],"鞰":["wēn","yùn"],"鞬":["jiàn","jiān"],"鞪":["mù","móu"],"鞢":["xiè","dié"],"鞞":["bǐng","pí","bì","bēi"],"鞝":["shàng","zhǎng"],"鞙":["xuān","juān"],"鞕":["biān","yìng"],"鞔":["mán","mèn"],"鞊":["jié","jí"],"鞈":["gé","tà","sǎ"],"雽":["hū","hù"],"雺":["wù","méng"],"雭":["sè","xí"],"難":["nán","nàn","nuó"],"雟":["guī","xī"],"雚":["guàn","huán"],"雋":["jùn","juàn"],"隺":["hú","hè"],"隹":["zhuī","cuī","wéi"],"隱":["yǐn","yìn"],"隩":["ào","yù"],"隠":["yǐn","yìn"],"隓":["huī","duò"],"隑":["qí","gāi","ái"],"隊":["duì","zhuì"],"隃":["yú","yáo","shù"],"隁":["yàn","yǎn"],"阇":["dū","shé"],"闶":["kàng","kāng"],"闬":["hàn","bì"],"闣":["dāng","dàng"],"闟":["xì","sè","tà"],"闞":["kàn","hǎn"],"闛":["táng","tāng","chāng"],"闕":["què","quē"],"闍":["dū","shé"],"闆":["bǎn","pàn"],"闂":["hòng","juǎn","xiàng"],"閼":["è","yān"],"閮":["tíng","tǐng"],"閪":["sē","xī"],"閧":["hòng","xiàng"],"閤":["hé","gé"],"閞":["biàn","guān"],"閜":["xiǎ","kě"],"閛":["pēng","pèng"],"閕":["xiā","xiǎ"],"間":["jiān","jiàn"],"閒":["xián","jiān","jiàn"],"閌":["kāng","kàng"],"閈":["hàn","bì"],"閄":["huò","shǎn"],"長":["cháng","zhǎng"],"镉":["gé","lì"],"铴":["tàng","tāng"],"铫":["diào","tiáo","yáo"],"铪":["hā","kē"],"铦":["xiān","kuò","tiǎn","guā"],"铔":["yā","yà"],"铍":["pí","pī"],"铊":["tā","tuó"],"铇":["bào","páo"],"钑":["sà","xì"],"钐":["shān","shàn"],"钌":["liǎo","liào"],"鐺":["dāng","chēng"],"鏾":["sǎn","xiàn","sà"],"鏹":["qiǎng","qiāng"],"鏸":["huì","suì","ruì"],"鏩":["jiàn","zàn"],"鏜":["tāng","táng"],"鏕":["lù","áo"],"鏒":["sǎn","qiāo","càn"],"鏑":["dí","dī"],"鏉":["shòu","sōu"],"鏅":["xiū","xiù"],"鏃":["zú","chuò"],"鎬":["gǎo","hào"],"鎫":["wàn","jiǎn"],"鎦":["liú","liù"],"鎞":["bī","bì","pī"],"鎘":["gé","lì"],"鎗":["qiāng","chēng"],"鎑":["yè","tà","gé"],"鎐":["yáo","zú"],"鎍":["suǒ","sè"],"鎉":["dā","tà"],"鎈":["cuō","chā"],"鋼":["gāng","gàng"],"鋻":["jiān","jiàn"],"鋺":["yuǎn","yuān","wǎn","wān"],"鋸":["jù","jū"],"鋷":["zuì","niè"],"鋪":["pū","pù"],"鋦":["jū","jú"],"鋞":["xíng","xìng","jīng"],"鋜":["zhuó","chuò"],"鋘":["huá","wú","wū"],"鋗":["xuān","juān","juàn"],"鋖":["sī","tuó"],"鋑":["juān","jiān","cuān"],"鋌":["tǐng","dìng"],"鋄":["wàn","jiǎn"],"鋂":["méi","méng"],"鋀":["tōu","tù","dòu"],"銿":["zhōng","yōng"],"銾":["hòng","gǒng"],"銽":["xiān","kuò","tiǎn","guā"],"銸":["zhé","niè"],"銴":["shì","zhì"],"銛":["xiān","kuò","tiǎn","guā"],"銚":["diào","tiáo","yáo"],"銗":["hóu","xiàng"],"銑":["xiǎn","xǐ"],"銐":["chì","lì"],"銏":["shàn","shuò"],"銋":["rén","rěn"],"銊":["xù","huì"],"銉":["yù","sì"],"銄":["xiǎng","jiōng"],"鉿":["hā","kē"],"鉼":["bǐng","píng"],"鉋":["bào","páo"],"鉈":["tā","tuó"],"釾":["yé","yá"],"釽":["pī","zhāo"],"釼":["rì","rèn","jiàn"],"釶":["shī","yí"],"釱":["dì","dài"],"釰":["rì","rèn","jiàn"],"釫":["huá","wū"],"釪":["huá","yú"],"釥":["qiǎo","jiǎo"],"釤":["shān","shàn"],"釘":["dīng","dìng"],"釕":["liǎo","liào"],"釐":["lí","xǐ","xī"],"釀":["niàng","niáng"],"醶":["yàn","liǎn","xiān"],"醳":["yì","shì"],"醱":["pō","fā"],"醦":["chǎn","chěn"],"醗":["pō","fā"],"醔":["qiú","chōu"],"醍":["tí","tǐ"],"醈":["tán","dàn"],"酇":["cuó","zàn"],"酂":["cuó","zàn"],"郩":["xiáo","ǎo"],"郇":["xún","huán"],"郂":["gāi","hái"],"邟":["kàng","háng"],"邌":["lí","chí"],"還":["huán","hái"],"遆":["dì","tí"],"迱":["yǐ","yí"],"迬":["zhù","wǎng"],"迣":["zhì","lì"],"迋":["wàng","kuāng"],"迆":["yǐ","yí"],"辺":["dào","biān"],"軼":["yì","dié"],"軻":["kē","kě"],"軸":["zhóu","zhòu"],"軪":["āo","ào"],"転":["zhuàn","zhuǎn"],"軓":["fàn","guǐ"],"軐":["xìn","xiàn"],"軋":["yà","zhá","gá"],"車":["chē","jū"],"躠":["sǎ","xiè"],"躘":["lóng","lǒng"],"躒":["lì","luò"],"跾":["shū","chōu"],"跰":["pián","bèng"],"跢":["dài","duò","duō","chí"],"跞":["lì","luò"],"跙":["jū","jù","qiè"],"跘":["pán","bàn"],"跕":["diǎn","tiē","dié"],"跐":["cī","cǐ"],"跈":["jiàn","chén"],"跂":["qí","qǐ"],"跁":["bà","páo"],"趽":["fāng","fàng","páng"],"趹":["jué","guì"],"趶":["kuà","wù"],"趵":["bào","bō"],"趯":["tì","yuè"],"趨":["qū","cù"],"趠":["chuō","zhuó"],"趞":["què","qì","jí"],"趏":["guā","huó"],"趌":["jí","jié"],"趃":["dié","tú"],"贠":["yuán","yùn"],"贃":["wàn","zhuàn"],"賺":["zhuàn","zuàn"],"賯":["xiōng","mín"],"賈":["jiǎ","gǔ","jià"],"賁":["bì","bēn"],"責":["zé","zhài"],"貤":["yì","yí"],"貟":["yuán","yún","yùn"],"貗":["jù","lóu"],"貓":["māo","máo"],"貒":["tuān","tuàn"],"貈":["hé","mò"],"貇":["kěn","kūn"],"貆":["huán","huān"],"豣":["jiān","yàn"],"豈":["qǐ","kǎi"],"诶":["ēi","éi","ěi","èi","xī"],"诪":["zhōu","chóu"],"讉":["yí","tuī"],"讂":["juàn","xuān"],"諵":["nán","nàn"],"諰":["xǐ","shāi","āi"],"諣":["huà","guā"],"諟":["shì","dì"],"論":["lùn","lún"],"諕":["xià","háo"],"諔":["chù","jí"],"諎":["zé","zuò","zhǎ","cuò"],"諅":["jì","jī"],"諀":["pǐ","bēi"],"調":["diào","tiáo"],"誽":["nì","ná"],"誺":["chī","lài"],"誳":["qū","juè"],"誰":["shuí","shéi"],"説":["shuō","shuì","yuè"],"說":["shuō","shuì","yuè"],"語":["yǔ","yù"],"誖":["bèi","bó"],"誒":["ēi","éi","ěi","èi","xī"],"誏":["lǎng","làng"],"誇":["kuā","kuà"],"誃":["yí","chǐ","chì"],"誂":["tiǎo","diào"],"詒":["yí","dài"],"觻":["lì","lù"],"觷":["xué","hù"],"觭":["jī","qí"],"觧":["jiě","jiè","xiè"],"觟":["huà","xiè"],"觜":["zī","zuǐ"],"觀":["guān","guàn"],"覻":["qù","qū"],"覺":["jué","jiào"],"覷":["qù","qū"],"覶":["luó","luǎn"],"覵":["jiàn","biǎn"],"観":["guān","guàn"],"覱":["zhàn","zhān"],"覰":["qū","qù"],"覮":["yíng","yǐng"],"親":["qīn","qìng"],"覚":["jué","jiào"],"覕":["piē","miè"],"覐":["jué","jiào"],"覌":["guān","guàn"],"見":["jiàn","xiàn"],"裼":["xī","tì"],"裺":["yǎn","ān"],"裷":["yuān","gǔn"],"裯":["chóu","dāo"],"裓":["gé","jiē"],"裎":["chéng","chěng"],"袿":["guī","guà"],"袹":["bó","mò"],"袸":["jiàn","zùn"],"袷":["jiá","jié","qiā"],"袳":["chǐ","qǐ","duǒ","nuǒ"],"袲":["chǐ","nuǒ"],"袦":["nà","jué"],"袘":["yí","yì"],"袔":["hè","kè"],"袓":["jù","jiē"],"袌":["bào","páo","pào"],"袉":["tuó","tuō"],"蟫":["yín","xún"],"蟧":["láo","liáo"],"蟦":["fèi","bēn"],"蟞":["biē","bié"],"螹":["chán","jiàn"],"螶":["qú","jù"],"螲":["dié","zhì"],"螞":["mǎ","mā","mà"],"螝":["guì","huǐ"],"螛":["hé","xiá"],"螚":["nài","něng"],"螕":["bī","pí"],"螇":["xī","qī"],"蝦":["xiā","hā"],"蛪":["qiè","ní"],"蛡":["yì","xǔ"],"蛖":["máng","bàng"],"蛒":["gé","luò"],"蚾":["pí","bǒ"],"蚼":["gǒu","qú","xù"],"蚮":["dài","dé"],"蚥":["fù","fǔ"],"蚙":["qín","qián"],"蚗":["jué","quē"],"蚖":["yuán","wán"],"蚔":["qí","zhǐ"],"蚄":["fāng","bàng"],"號":["hào","háo"],"蘋":["pín","píng"],"藸":["zhū","chú"],"藱":["huì","huí"],"藰":["liú","liǔ"],"藨":["biāo","pāo"],"藋":["diào","zhuó"],"藇":["xù","yù","xū"],"藃":["xiāo","hào"],"薺":["jì","qí"],"薶":["mái","wō"],"薵":["chóu","zhòu"],"薳":["yuǎn","wěi"],"薧":["hāo","kǎo"],"薟":["xiān","liǎn"],"薔":["qiáng","sè"],"薍":["wàn","luàn"],"薋":["cí","zī"],"薂":["xí","xiào"],"蕁":["qián","xún"],"蓻":["zí","jú"],"蓲":["qiū","xū","fū"],"蓧":["diào","tiáo","dí"],"蓔":["yǎo","zhuó"],"蓋":["gài","gě","hé"],"蓃":["sōu","sǒu"],"蒵":["xí","xì"],"蒩":["zū","jù"],"蒣":["xú","shú"],"蒝":["yuán","huán"],"蒘":["rú","ná"],"蒔":["shì","shí"],"蒉":["kuì","kuài"],"菾":["tián","tiàn"],"菻":["lǐn","má"],"菳":["qín","qīn","jīn"],"華":["huá","huà","huā"],"菭":["tái","zhī","chí"],"菬":["qiáo","zhǎo"],"菨":["jiē","shà"],"菍":["niè","rěn"],"菆":["zōu","chù"],"菀":["wǎn","yùn"],"莶":["xiān","liǎn"],"莵":["tù","tú"],"莳":["shì","shí"],"莬":["wèn","wǎn","miǎn"],"莨":["làng","liáng"],"莦":["shāo","xiāo"],"莤":["sù","yóu"],"莑":["péng","fēng"],"荨":["qián","xún"],"苼":["shēng","ruí"],"苲":["zuó","zhǎ"],"苩":["pā","bó"],"苧":["zhù","níng"],"苣":["jù","qǔ"],"苙":["lì","jī"],"苐":["dì","tí"],"苂":["chán","yín"],"芾":["fèi","fú"],"芼":["máo","mào"],"芶":["gōu","gǒu"],"芴":["wù","hū"],"芲":["lún","huā"],"芫":["yuán","yán"],"芧":["xù","zhù"],"芚":["tún","chūn"],"芘":["bì","pí"],"芔":["huì","hū"],"芓":["zì","zǐ"],"芐":["hù","xià"],"芆":["chāi","chā"],"艽":["jiāo","qiú"],"臸":["zhī","jìn"],"臷":["dié","zhí"],"臱":["mián","biān"],"臩":["guǎng","jiǒng"],"臦":["guàng","jiǒng"],"臤":["qiān","xián"],"臡":["ní","luán"],"臒":["wò","yuè"],"臈":["là","gé"],"膴":["hū","wǔ"],"膰":["fán","pán"],"膞":["zhuān","chuán","chún","zhuǎn"],"膔":["lù","biāo"],"胿":["guī","kuì"],"胕":["fū","fú","zhǒu"],"胓":["píng","pēng"],"胐":["fěi","kū"],"胏":["zǐ","fèi"],"胇":["fèi","bì"],"肶":["pí","bǐ","bì"],"肫":["zhūn","chún"],"肨":["pàng","pán","pàn"],"肣":["qín","hán","hàn"],"肜":["róng","chēn"],"肑":["bó","dí"],"聻":["nǐ","jiàn"],"聜":["dǐ","zhì"],"聑":["tiē","zhé"],"聏":["ér","nǜ"],"聉":["wà","tuǐ","zhuó"],"耺":["yún","yíng"],"耫":["zhá","zé"],"耤":["jí","jiè"],"耣":["lún","lǔn"],"耝":["qù","chú"],"耛":["sì","chí"],"耑":["duān","zhuān"],"耏":["ér","nài"],"耎":["ruǎn","nuò"],"翹":["qiáo","qiào"],"翵":["hóu","qú"],"翢":["dào","zhōu"],"翑":["qú","yù"],"翍":["pī","bì","pō"],"羾":["hóng","gòng"],"羬":["qián","xián","yán"],"羫":["qiāng","kòng"],"羛":["yì","xī"],"羙":["měi","gāo"],"羏":["yáng","xiáng"],"罷":["bà","ba","pí"],"罫":["guǎi","guà"],"徿":["lòng","lǒng"],"忂":["qú","jù"],"忊":["dìng","tìng"],"忓":["gān","hàn"],"忔":["yì","qì"],"忕":["shì","tài"],"忚":["xī","liě"],"応":["yīng","yìng"],"忞":["mǐn","wěn","mín"],"忟":["mǐn","wěn","mín"],"忬":["yù","shū"],"忯":["qí","shì"],"忳":["tún","zhūn","dùn"],"忴":["qián","qín"],"忹":["kuáng","wǎng"],"忼":["kāng","hàng"],"怉":["bǎo","bào"],"怋":["mín","mén"],"怐":["kòu","jù"],"怓":["náo","niú"],"怗":["tiē","zhān"],"怘":["hù","gù"],"怚":["cū","jù","zū"],"怞":["yóu","chóu"],"怢":["tū","dié"],"怮":["yōu","yào"],"怴":["xù","xuè"],"怶":["bì","pī"],"怸":["xī","shù"],"恌":["tiāo","yáo"],"恓":["xī","qī","xù"],"恔":["xiào","jiǎo"],"恗":["hū","kuā"],"恮":["quán","zhuān"],"悁":["yuān","juàn"],"悂":["pī","pǐ"],"悆":["yù","shū"],"悈":["jiè","kè"],"悎":["hào","jiào"],"悗":["mán","mèn"],"悘":["yī","yì"],"悙":["hēng","hèng"],"悝":["kuī","lǐ"],"悥":["yì","niàn"],"悶":["mèn","mēn"],"悾":["kōng","kǒng"],"惀":["lǔn","lùn"],"惌":["yuān","wǎn"],"惏":["lán","lín"],"惐":["yù","xù"],"惒":["hé","hè"],"惓":["juàn","quán"],"惔":["tán","dàn"],"惙":["chuò","chuì"],"惛":["hūn","mèn"],"惡":["è","wù","ě","wū"],"惢":["suǒ","ruǐ"],"惿":["tí","shì"],"愒":["qì","kài"],"愓":["dàng","shāng","táng","yáng"],"愖":["chén","xìn","dān"],"愘":["kè","qià"],"愡":["còng","sōng"],"愢":["sāi","sī","sǐ"],"愩":["gōng","gòng","hǒng"],"愬":["sù","shuò"],"愮":["yáo","yào"],"愾":["kài","xì"],"慀":["xì","xié"],"慅":["cǎo","sāo"],"慉":["xù","chù"],"慐":["gōng","gòng","hǒng"],"慒":["cáo","cóng"],"慠":["ào","áo"],"慩":["lián","liǎn"],"慬":["qín","jìn","jǐn"],"慸":["dì","chì"],"慹":["zhí","zhé"],"慺":["lóu","lǚ"],"憄":["zhī","zhì"],"憕":["chéng","dèng","zhèng"],"憘":["xǐ","xī"],"憚":["dàn","dá"],"憞":["duì","dùn","tūn"],"憢":["xiāo","jiāo"],"憦":["lào","láo"],"憪":["xián","xiàn"],"憭":["liǎo","liáo"],"憹":["náo","nǎo","náng"],"憼":["jǐng","jìng"],"憿":["jiǎo","jǐ"],"懁":["xuān","huān"],"懆":["cǎo","sāo","sào"],"應":["yīng","yìng"],"懙":["yǔ","yú"],"懜":["mèng","méng","měng"],"懝":["ài","yì","nǐ"],"懞":["méng","měng"],"懠":["qí","jī","jì"],"懢":["lán","xiàn"],"懮":["yōu","yǒu"],"懰":["liú","liǔ"],"戂":["mí","mó"],"戅":["gàng","zhuàng"],"戇":["gàng","zhuàng"],"戗":["qiāng","qiàng"],"戧":["qiāng","qiàng"],"戯":["xì","hū"],"戱":["xì","hū"],"戲":["xì","hū"],"扄":["shǎng","jiōng"],"扐":["lè","lì","cái"],"払":["fǎn","fú"],"扚":["diǎo","dí","yuē","lì"],"扜":["yū","wū"],"扝":["yū","wū","kū"],"扡":["tuō","chǐ","yǐ"],"扢":["gǔ","xì","gē","jié"],"扱":["xī","chā","qì"],"扲":["qián","qín"],"扷":["bā","ào"],"扸":["xī","zhé"],"扻":["zhì","sǔn","kǎn"],"抂":["kuáng","wǎng","zài"],"抇":["hú","gǔ"],"抌":["dǎn","shěn"],"抐":["nè","nì","ruì","nà"],"抙":["póu","pōu","fū"],"抝":["ǎo","ào","niù"],"抧":["zhǐ","zhǎi"],"抪":["bù","pū"],"抭":["yǎo","tāo"],"抲":["hē","hè","qiā"],"抳":["nǐ","ní"],"抷":["pī","pēi"],"拁":["jiā","yá"],"拵":["cún","zùn"],"拸":["yí","chǐ","hài"],"拺":["cè","sè","chuò"],"挄":["kuò","guāng"],"挆":["duǒ","duò"],"挐":["rú","ná"],"挕":["dié","shè"],"挜":["yà","yǎ"],"挩":["tuō","shuì"],"挮":["tǐ","tì"],"挱":["suō","shā"],"挳":["kēng","qiān"],"挷":["bàng","péng"],"挾":["xié","jiā"],"捁":["jiǎo","kù"],"捇":["huò","chì"],"捈":["tú","shū","chá"],"捊":["póu","pōu","fū"],"捒":["shù","sǒng","sōu"],"捓":["yé","yú"],"捔":["jué","zhuó"],"捗":["bù","pú","zhì"],"捝":["tuō","shuì"],"捥":["wàn","wǎn","wān","yù"],"捬":["fǔ","fù","bǔ"],"捰":["wǒ","luò","luǒ"],"捲":["juǎn","quán"],"捼":["ruó","wěi","ré"],"捾":["wò","xiá"],"掃":["sǎo","sào"],"掄":["lūn","lún"],"掅":["qìng","qiàn"],"掊":["pǒu","póu"],"掔":["qiān","wàn"],"掗":["yà","yǎ"],"掙":["zhēng","zhèng"],"掜":["nǐ","niè","yì"],"掝":["huò","xù"],"掞":["shàn","yàn","yǎn"],"掟":["zhěng","dìng"],"掫":["zōu","zhōu","chōu"],"揁":["zhēng","kēng"],"揂":["jiū","yóu"],"揃":["jiǎn","jiān"],"揊":["pì","chè"],"揔":["zǒng","sōng"],"揕":["zhèn","zhēn"],"揘":["huáng","yóng"],"揝":["zǎn","zuàn"],"揟":["xū","jū"],"揢":["ké","qiā"],"揥":["tì","dì"],"揦":["là","lá"],"揰":["chòng","dǒng"],"揲":["shé","dié","yè"],"揵":["qián","jiàn","jiǎn"],"搊":["chōu","zǒu"],"搑":["róng","náng","nǎng"],"搒":["bàng","péng"],"搕":["kē","è"],"搙":["nù","nuò","nòu"],"搚":["lā","xié","xiàn"],"搟":["xiǎn","xiān"],"搩":["jié","zhé"],"搫":["pán","bān","pó"],"搱":["zhì","nái"],"搲":["wā","wǎ","wà"],"搶":["qiāng","qiǎng","chēng"],"搷":["tián","shēn"],"搻":["ná","nuò"],"摋":["sà","shā","shǎi"],"摌":["chǎn","sùn"],"摎":["jiū","liú","liáo","jiǎo","náo"],"摓":["féng","pěng"],"摕":["dì","tú","zhí"],"摖":["qì","jì","chá"],"摗":["sōu","sǒng"],"摙":["liǎn","liàn"],"摟":["lǒu","lōu"],"摡":["gài","xì"],"摢":["hù","chū"],"摨":["zhì","nái"],"摪":["jiāng","qiàng"],"摮":["áo","qiáo"],"摰":["niè","chè"],"摱":["mán","màn"],"摲":["chàn","cán"],"摵":["sè","mí","sù"],"摷":["jiǎo","chāo"],"摻":["chān","xiān","càn","shǎn"],"摼":["kēng","qiān"],"摽":["biào","biāo"],"撍":["zǎn","zān","zēn","qián"],"撗":["héng","guàng"],"撜":["zhěng","chéng"],"撝":["huī","wéi"],"撣":["dǎn","shàn"],"撨":["xiāo","sōu"],"撱":["wěi","tuǒ"],"撽":["qiào","yāo","jī"],"撾":["zhuā","wō"],"擇":["zé","zhái"],"擋":["dǎng","dàng"],"擏":["qíng","jǐng"],"擔":["dān","dàn"],"擖":["qiā","jiā","yè"],"擗":["pǐ","bò"],"據":["jù","jū"],"擰":["níng","nǐng","nìng"],"擱":["gē","gé"],"擳":["zhì","jié"],"擸":["liè","là"],"擻":["sòu","sǒu"],"擽":["lì","luò","yuè"],"擿":["tī","zhì","zhāi"],"攂":["léi","lèi"],"攃":["cā","sǎ"],"攈":["jùn","pèi"],"攊":["lì","luò"],"攋":["là","lài"],"攎":["lú","luó"],"攕":["xiān","jiān"],"攝":["shè","niè"],"攠":["mí","mǐ","mó"],"攢":["zǎn","cuán"],"攦":["lì","shài"],"攭":["lì","luǒ"],"攱":["guǐ","guì"],"攲":["qī","yǐ","jī"],"攼":["gān","hàn"],"敄":["wù","móu"],"敊":["chù","shōu"],"敋":["gé","guó","è"],"敎":["jiào","jiāo"],"敓":["duó","duì"],"敚":["duó","duì"],"敠":["duō","què"],"敧":["qī","yǐ","jī"],"敩":["xiào","xué"],"敪":["duō","què"],"敱":["ái","zhú"],"數":["shù","shǔ","shuò"],"敻":["xiòng","xuàn"],"斀":["zhuó","zhú"],"斁":["yì","dù"],"斄":["lí","tái"],"斍":["jué","jiào"],"斔":["yǔ","zhōng"],"斖":["wěi","mén"],"斢":["tǒu","tiǎo"],"斦":["yín","zhì"],"斺":["chǎn","jiè"],"斿":["liú","yóu"],"旇":["pī","bì"],"旰":["gàn","hàn"],"旲":["tái","yīng"],"旳":["dì","dí","de"],"旴":["xù","xū"],"旽":["tūn","zhùn"],"旿":["wù","wǔ"],"昢":["pò","pèi"],"昳":["dié","yì"],"晇":["xù","kuā"],"晵":["qǐ","dù"],"晻":["àn","ǎn","yǎn"],"暀":["wǎng","wàng"],"暈":["yùn","yūn"],"暋":["mǐn","mín"],"暏":["shǔ","dǔ"],"暕":["jiǎn","lán"],"暿":["xī","xǐ"],"曶":["hū","hù"],"曽":["zēng","céng"],"朁":["cǎn","qián","jiàn"],"會":["huì","kuài"],"朅":["qiè","hé"],"朇":["bì","pí"],"朌":["fén","bān"],"朏":["fěi","kū"],"朐":["qú","xù","chǔn"],"朒":["nǜ","gǎ"],"朘":["juān","zuī"],"朚":["huāng","máng","wáng"],"朣":["tóng","chuáng"],"朮":["shù","shú","zhú"],"朷":["dāo","tiáo","mù"],"朹":["qiú","guǐ"],"朾":["chéng","chēng"],"杅":["yú","wū"],"杒":["rèn","ér"],"杔":["tuō","zhé"],"杕":["dì","duò"],"杚":["gū","gài"],"杝":["yí","lì","lí","duò","tuò"],"杩":["mà","mǎ"],"杫":["sì","zhǐ","xǐ"],"杬":["yuán","wán"],"杮":["fèi","bèi"],"杸":["shū","duì"],"杻":["niǔ","chǒu"],"枂":["wò","yuè"],"枈":["pī","mì"],"枋":["fāng","bìng"],"枎":["fú","fū"],"枑":["hù","dǐ"],"枖":["yǎo","yāo"],"枙":["ě","è"],"枤":["dì","duò"],"枮":["xiān","zhēn"],"枱":["sì","tái"],"枸":["jǔ","gǒu"],"枹":["bāo","fú"],"枻":["yì","xiè"],"柁":["tuó","duò"],"柂":["yí","duò","lí"],"柅":["nǐ","chì"],"柈":["pán","bàn"],"柍":["yǎng","yàng","yāng","yīng"],"柎":["fū","fǔ","fù"],"柖":["sháo","shào"],"柞":["zuò","zhà"],"柣":["zhì","dié"],"柤":["zhā","zǔ","zū"],"柨":["bù","pū"],"柪":["āo","ào"],"柭":["bā","fú","pèi","bó","biē"],"柮":["duò","zuó","wù"],"柲":["bì","bié"],"柸":["bēi","pēi"],"柹":["shì","fèi"],"査":["chá","zhā"],"栔":["qì","qiè"],"栝":["guā","tiǎn"],"栟":["bēn","bīng"],"栧":["yì","xiè"],"栫":["jiàn","zùn"],"栯":["yǒu","yù"],"栺":["zhī","yì"],"桄":["guāng","guàng"],"桋":["yí","tí"],"桙":["yú","móu"],"桚":["zā","zǎn"],"桭":["chén","zhèn"],"桯":["tīng","yíng"],"桳":["bèn","fàn"],"桻":["fēng","fèng"],"梀":["sù","yìn"],"梃":["tǐng","tìng"],"梋":["xuān","juān","xié"],"梌":["tú","chá"],"梎":["āo","yòu"],"梕":["rèn","ér"],"條":["tiáo","tiāo"],"梩":["sì","qǐ"],"梴":["chān","yán"],"梹":["bīn","bīng"],"梼":["chóu","táo","dào"],"梿":["lián","liǎn"],"棇":["cōng","sōng"],"棏":["dé","zhé"],"棑":["pái","bèi","pèi"],"棓":["bàng","pǒu","bèi","bēi"],"棙":["lì","liè"],"棪":["yǎn","yàn"],"棬":["quān","juàn"],"棯":["rěn","shěn"],"棴":["fú","sù"],"棷":["zōu","sǒu"],"棽":["chēn","shēn"],"棿":["ní","nǐ"],"椄":["jiē","qiè"],"椆":["chóu","zhòu","diāo"],"椉":["chéng","shèng"],"椊":["zú","cuì"],"椌":["qiāng","kōng"],"椦":["quān","juàn","quán"],"椯":["duǒ","chuán"],"椲":["wěi","huī"],"椵":["jiǎ","jiā"],"椷":["jiān","hán"],"椹":["zhēn","shèn"],"椻":["yàn","yà"],"楇":["guō","kuǎ"],"楖":["jí","zhì"],"楛":["kǔ","hù"],"楢":["yóu","yǒu"],"楤":["sǒng","cōng"],"楥":["xuàn","yuán"],"楧":["yǎng","yàng","yīng"],"楪":["dié","yè"],"楯":["shǔn","dùn"],"楱":["còu","zòu"],"楴":["dì","dǐ","shì"],"楺":["róu","ròu"],"楽":["lè","yuè"],"榅":["wēn","yùn"],"榌":["bī","pi"],"榐":["zhǎn","niǎn","zhèn"],"榑":["fú","fù","bó"],"榗":["jiàn","jìn"],"榝":["shā","xiè"],"榪":["mà","mā"],"槏":["qiǎn","lián","xiàn"],"槙":["diān","zhěn","zhēn"],"槢":["xí","dié"],"槣":["jī","guī"],"槤":["lián","liǎn"],"槦":["róng","yōng"],"槫":["tuán","shuàn","quán"],"槭":["qì","sè"],"槯":["cuī","zhǐ"],"槱":["yǒu","chǎo"],"槾":["màn","wàn"],"樂":["lè","yuè","yào","lào"],"樅":["cōng","zōng"],"樆":["lí","chī"],"樏":["léi","lěi"],"樔":["cháo","jiǎo","chāo"],"樛":["jiū","liáo"],"樢":["niǎo","mù"],"樧":["shā","xiè"],"橃":["fá","fèi"],"橈":["ráo","náo"],"橏":["zhǎn","jiǎn"],"橔":["tuí","dūn"],"橖":["táng","chēng"],"橚":["sù","qiū"],"橝":["tán","diàn"],"橦":["tóng","chuáng"],"橧":["zēng","céng"],"橨":["fén","fèn","fèi"],"橪":["rǎn","yān"],"橫":["héng","hèng"],"橻":["cū","chu"],"橾":["shū","qiāo"],"檘":["píng","bò"],"檜":["guì","huì"],"檡":["zhái","shì","tú"],"檦":["biāo","biǎo"],"檮":["chóu","táo","dǎo"],"檳":["bīn","bīng"],"檶":["qiān","lián"],"檷":["nǐ","mí"],"檻":["jiàn","kǎn"],"檽":["nòu","ruǎn","rú"],"櫅":["jī","jì"],"櫎":["huǎng","guǒ","gǔ"],"櫑":["léi","lěi"],"櫖":["lǜ","chū"],"櫗":["miè","mèi"],"櫟":["lì","yuè"],"櫡":["zhuó","zhù"],"櫣":["lián","liǎn"],"櫭":["jué","jì"],"櫰":["huái","guī"],"櫴":["là","lài"],"櫾":["yòu","yóu"],"欃":["chán","zhàn"],"欈":["wéi","zuì"],"欥":["yù","yì"],"欦":["qiān","xiān"],"欪":["chù","qù","xì"],"欬":["kài","ài"],"欭":["yì","yīn"],"欯":["xì","kài"],"欶":["shuò","sòu"],"欸":["ǎi","ēi","éi","ěi","èi"],"欻":["xū","chuā"],"欼":["chǐ","chuài"],"欿":["kǎn","qiàn"],"歁":["kǎn","kè"],"歂":["chuǎn","chuán"],"歅":["yān","yīn"],"歏":["jìn","qūn"],"歛":["liǎn","hān"],"歭":["zhì","chí"],"歰":["sè","shà"],"歾":["mò","wěn"],"殑":["qíng","jìng"],"殕":["fǒu","bó"],"殗":["yè","yān","yàn"],"殙":["hūn","mèi"],"殨":["kuì","huì"],"殸":["qìng","kēng","shēng"],"殻":["ké","qiào"],"殼":["ké","qiào"],"殽":["xiáo","yáo","xiào"],"毌":["guàn","wān"],"毥":["xún","xùn"],"毭":["dòu","nuò"],"毸":["sāi","suī"],"氐":["dī","dǐ"],"氜":["yáng","rì"],"氶":["zhěng","chéng","zhèng"],"氿":["guǐ","jiǔ"],"汃":["bīn","pà","pā"],"汋":["zhuó","què"],"汏":["tài","dà"],"汥":["zhī","jì"],"汵":["gàn","hán","cén"],"汸":["fāng","pāng"],"汻":["hǔ","huǎng"],"汼":["niú","yóu"],"沑":["nǜ","niǔ"],"沒":["méi","mò"],"沕":["mì","wù"],"沗":["hóng","pāng"],"沝":["zhuǐ","zǐ"],"沰":["tuō","duó"],"沲":["tuó","duò"],"沵":["mǐ","lì"],"沶":["yí","chí"],"泆":["yì","dié"],"泍":["bēn","bèn"],"泏":["chù","shè"],"泑":["yōu","yòu","āo"],"泙":["pēng","píng"],"泧":["yuè","sà"],"泬":["jué","xuè"],"泺":["luò","pō"],"洑":["fú","fù"],"洓":["sè","qì","zì"],"洘":["kǎo","kào"],"洝":["àn","yàn","è"],"洡":["lěi","lèi"],"洬":["sù","shuò"],"洯":["qiè","jié"],"浍":["kuài","huì"],"浟":["yōu","dí"],"浧":["yǐng","chéng","yíng"],"浲":["féng","hóng"],"浻":["jiǒng","jiōng"],"浽":["suī","něi"],"涒":["tūn","yūn"],"涭":["shòu","tāo"],"涳":["kōng","náng"],"涴":["wǎn","wò","yuān"],"涶":["tuō","tuò"],"涼":["liáng","liàng"],"淁":["qiè","jí"],"淉":["guǒ","guàn"],"淜":["píng","péng"],"淠":["pì","pèi"],"淢":["yù","xù"],"淨":["jìng","chēng"],"淰":["niǎn","shěn"],"淲":["biāo","hǔ"],"渂":["wèn","mín"],"渃":["ruò","rè","luò"],"済":["jì","jǐ"],"渜":["nuǎn","nuán"],"渞":["qiú","wù"],"渟":["tíng","tīng"],"渦":["wō","guō"],"渧":["tí","dī","dì"],"渰":["yān","yǎn"],"渹":["hōng","qìng"],"湏":["huì","mǐn","xū"],"湑":["xǔ","xū"],"湣":["mǐn","hūn"],"湪":["tuàn","nuǎn"],"湬":["qiū","jiǎo"],"湯":["tāng","shāng"],"湴":["bàn","pán"],"湷":["zhuāng","hún"],"溄":["féng","hóng"],"溎":["yàn","guì"],"溓":["lián","liǎn","nián","xián","xiàn"],"溚":["dá","tǎ"],"溱":["zhēn","qín"],"滀":["chù","xù"],"滃":["wěng","wēng"],"滈":["hào","xuè"],"滊":["qì","xì","xiē"],"滎":["xíng","yíng"],"滜":["zé","hào"],"滸":["hǔ","xǔ"],"漎":["cóng","sǒng"],"漙":["tuán","zhuān"],"漚":["òu","ōu"],"漨":["féng","péng"],"漯":["luò","tà"],"漰":["bēn","pēng"],"漲":["zhǎng","zhàng"],"漴":["chóng","zhuàng"],"漷":["huǒ","huò","kuò"],"漸":["jiàn","jiān"],"漻":["liáo","liú"],"漼":["cuǐ","cuī"],"漿":["jiāng","jiàng"],"潀":["cóng","zǒng"],"潈":["cóng","zōng"],"潎":["pì","piē"],"潐":["jiào","qiáo"],"潒":["dàng","xiàng"],"潝":["xī","yà"],"潨":["cōng","zòng"],"潪":["zhí","zhì"],"潬":["tān","shàn"],"潰":["kuì","huì"],"潳":["tú","zhā"],"潵":["sàn","sǎ"],"澊":["cūn","cún"],"澍":["shù","zhù"],"澑":["liū","liù"],"澒":["hòng","gǒng"],"澚":["ào","yù"],"澠":["miǎn","shéng"],"澤":["zé","shì"],"澫":["wàn","màn"],"澭":["yōng","yǒng"],"澮":["kuài","huì"],"濄":["guō","wō"],"濆":["fén","pēn"],"濈":["jí","shà"],"濊":["huì","huò"],"濎":["dǐng","tìng"],"濔":["mǐ","nǐ"],"濞":["bì","pì"],"濟":["jì","jǐ"],"濢":["cuì","zuǐ"],"濩":["huò","hù"],"濬":["jùn","xùn"],"濭":["ǎi","kài","kè"],"濺":["jiàn","jiān"],"濻":["wěi","duì"],"濼":["luò","pō"],"濽":["zàn","cuán"],"瀁":["yǎng","yàng"],"瀆":["dú","dòu"],"瀇":["wǎng","wāng"],"瀎":["miè","mò"],"瀓":["chéng","dèng"],"瀢":["wěi","duì"],"瀤":["huái","wāi"],"瀧":["lóng","shuāng"],"瀳":["jiàn","zùn"],"瀴":["yīng","yǐng","yìng"],"瀼":["ráng","nǎng"],"灂":["zhuó","jiào","zé"],"灒":["zàn","cuán"],"灓":["luán","luàn"],"灙":["dǎng","tǎng"],"灥":["xún","quán","quàn"],"灬":["huǒ","biāo"],"灹":["zhà","yù"],"炃":["fén","bèn"],"炅":["jiǒng","guì"],"炐":["pàng","fēng"],"炤":["zhào","zhāo"],"炪":["zhuō","chù"],"炰":["páo","fǒu"],"炶":["shǎn","qián","shān"],"為":["wéi","wèi"],"烄":["jiǎo","yào"],"烋":["xiū","xiāo"],"烔":["tóng","dòng"],"烠":["huí","huǐ"],"烰":["fú","páo"],"烲":["xiè","chè"],"焄":["xūn","hūn"],"焆":["juān","yè"],"焌":["qū","jùn"],"焎":["xiè","chè"],"焏":["jí","qì"],"焣":["chǎo","jù"],"焥":["wò","ài"],"焧":["zǒng","cōng"],"焬":["xī","yì"],"焸":["xiǒng","yīng"],"焽":["xiǒng","yīng"],"煇":["huī","yùn","xūn"],"煍":["jiǎo","qiāo"],"煔":["shǎn","qián","shān"],"煕":["xī","yí"],"煠":["yè","zhá"],"煬":["yáng","yàng"],"煴":["yūn","yǔn"],"煾":["ēn","yūn"],"熅":["yūn","yǔn"],"熇":["hè","xiāo"],"熜":["cōng","zǒng"],"熝":["lù","āo"],"熢":["péng","fēng"],"熣":["suī","cuǐ"],"熯":["hàn","rǎn"],"熰":["ōu","ǒu"],"熿":["huáng","huǎng"],"燀":["chǎn","dǎn","chàn"],"燋":["jiāo","qiáo","jué","zhuó"],"燑":["tóng","dòng"],"燤":["tài","liè"],"爃":["róng","yíng"],"爄":["lì","liè"],"爉":["là","liè"],"爋":["xūn","xùn"],"爌":["kuàng","huǎng"],"爎":["liáo","liǎo"],"爒":["liáo","liǎo"],"爓":["yàn","xún"],"爦":["lǎn","làn"],"爫":["zhǎo","zhuǎ"],"爯":["chēng","chèn"],"爲":["wéi","wèi"],"牑":["biān","miàn"],"牗":["yǒu","yōng"],"牚":["chēng","chèng"],"牞":["jiū","lè"],"牫":["gē","qiú"],"牰":["yòu","chōu"],"犆":["zhí","tè"],"犍":["jiān","qián"],"犛":["máo","lí"],"犮":["quǎn","bá"],"犳":["zhuó","bào"],"犴":["hān","àn"],"犺":["kàng","gǎng"],"犻":["pèi","fèi"],"犿":["huān","fān"],"狋":["yí","quán","chí"],"狌":["shēng","xīng"],"狏":["tuó","yí"],"狟":["huán","huān"],"狢":["hé","mò"],"狧":["tà","shì"],"狪":["tóng","dòng"],"狵":["máng","dòu"],"狶":["xī","shǐ"],"猈":["bài","pí"],"猏":["jiān","yàn"],"猚":["yá","wèi"],"猭":["chuàn","chuān"],"猯":["tuān","tuàn"],"猰":["yà","jiá","qiè"],"猲":["xiē","hè","gé","hài"],"猵":["biān","piàn"],"猼":["bó","pò"],"獋":["háo","gāo"],"獖":["fén","fèn"],"獜":["lín","lìn"],"獟":["yào","xiāo"],"獡":["shuò","xī"],"獦":["gé","liè","xiē"],"獱":["biān","piàn"],"獳":["nòu","rú"],"獶":["náo","nǎo","yōu"],"獿":["náo","yōu"],"玚":["chàng","yáng"],"玧":["mén","yǔn"],"玪":["jiān","qián"],"玱":["qiāng","cāng"],"玵":["án","gān"],"玹":["xuán","xián"],"玼":["cī","cǐ"],"珆":["yí","tāi"],"珇":["zǔ","jù"],"珢":["yín","kèn"],"珲":["hún","huī"],"珶":["dì","tí"],"琁":["xuán","qióng"],"琈":["fú","fū"],"琕":["pín","bǐng"],"琗":["cuì","sè"],"琟":["wéi","yù"],"琠":["tiǎn","tiàn"],"琣":["běng","pěi"],"琿":["hún","huī"],"瑎":["xié","jiē"],"瑒":["chàng","yáng"],"瑱":["tiàn","tián","zhèn"],"瑲":["qiāng","cāng"],"瑸":["bīn","pián"],"瑹":["tú","shū"],"璅":["zǎo","suǒ"],"璚":["qióng","jué"],"璯":["huì","kuài"],"璷":["lú","fū"],"璸":["bīn","pián"],"璾":["jì","zī"],"瓕":["mí","xǐ"],"瓗":["qióng","wěi","wèi"],"瓛":["huán","yè","yà"],"瓟":["bó","páo"],"瓡":["zhí","hú"],"瓨":["xiáng","hóng"],"瓸":["bǎi","wǎ"],"瓹":["juàn","juān"],"甴":["yóu","zhá"],"甼":["tǐng","dīng"],"甾":["zāi","zī"],"畁":["bì","qí"],"畐":["fú","bì"],"畗":["dá","fú"],"畟":["cè","jì"],"畠":["zāi","zī"],"畨":["fān","pān"],"畬":["shē","yú"],"當":["dāng","dàng","dǎng"],"畺":["jiāng","jiàng"],"疄":["lín","lìn"],"疌":["jié","qiè"],"疐":["zhì","dì"],"疠":["lì","lài"],"疦":["jué","xuè"],"疨":["yǎ","xiā"],"疺":["fá","biǎn"],"疿":["fèi","féi"],"痁":["shān","diàn"],"痋":["téng","chóng"],"痌":["tōng","tóng"],"痏":["wěi","yòu","yù"],"痑":["tān","shǐ"],"痡":["pū","pù"],"痭":["bēng","péng"],"痱":["fèi","féi"],"痳":["má","lìn"],"痶":["tiǎn","diàn"],"痷":["ān","yè","è"],"痾":["kē","ē"],"瘅":["dàn","dān"],"瘈":["zhì","chì"],"瘕":["jiǎ","xiá","xiā"],"瘣":["huì","lěi"],"瘥":["chài","cuó"],"瘧":["nüè","yào"],"瘨":["diān","chēn"],"癄":["qiáo","jiào"],"癉":["dàn","dān"],"癐":["guì","wēi"],"癑":["nòng","nóng"],"癘":["lì","lài"],"癟":["biē","biě"],"癷":["bō","bǒ"],"皀":["jí","bī"],"皅":["pā","bà"],"皐":["gāo","yáo"],"皪":["lì","luò","bō"],"皻":["zhā","cǔ"],"皽":["zhāo","zhǎn","dǎn"],"監":["jiān","jiàn"],"盩":["zhōu","chóu"],"盳":["máng","wàng"],"盷":["xián","tián"],"盻":["xì","pǎn"],"眃":["yún","hùn"],"眏":["yāng","yǎng","yìng"],"眑":["yǎo","āo","ǎo"],"眗":["jū","xū","kōu"],"眙":["yí","chì"],"眜":["mò","miè"],"眣":["dié","tì"],"眪":["bǐng","fǎng"],"眫":["pàng","pán"],"眭":["guì","suī"],"眰":["dié","zhì"],"眴":["xuàn","shùn","xún"],"睄":["qiáo","shào","xiāo"],"睉":["cuó","zhuài"],"睟":["suì","zuì"],"睪":["yì","zé","gāo"],"睲":["xǐng","xìng"],"瞆":["guì","wèi","kuì"],"瞇":["mī","mí"],"瞉":["kòu","jì"],"瞏":["qióng","huán"],"瞗":["diāo","dōu"],"瞜":["lóu","lǘ","lou"],"瞞":["mán","mén"],"瞢":["méng","měng"],"瞤":["rún","shùn"],"瞭":["liǎo","liào"],"瞯":["xián","jiàn"],"瞴":["wǔ","mí"],"瞶":["guì","kuì"],"矃":["nǐng","chēng"],"矆":["huò","yuè"],"矌":["kuàng","guō"],"矒":["méng","měng"],"矔":["guàn","quán"],"矕":["mǎn","mán"],"矝":["jīn","qín","guān"],"矦":["hóu","hòu"],"矯":["jiǎo","jiáo"],"矼":["gāng","qiāng","kòng"],"砏":["pīn","bīn","fēn"],"砢":["kē","luǒ"],"砩":["fú","fèi"],"砫":["zhù","zhǔ"],"砬":["lì","lā","lá"],"硄":["kuāng","guāng"],"硊":["wěi","guì"],"硌":["luò","gè"],"硍":["kèn","xiàn","gǔn","yǐn"],"硏":["yán","yàn"],"硑":["pēng","píng"],"硙":["wéi","wèi"],"硞":["què","kè","kù"],"硥":["mǎng","bàng"],"硦":["luò","lòng"],"硧":["yǒng","tóng"],"硻":["kēng","kěng"],"硽":["yān","yǎn"],"硾":["zhuì","chuí","duǒ"],"碂":["zòng","cóng"],"碊":["jiān","zhàn"],"碏":["què","xī"],"碖":["lún","lǔn","lùn"],"碙":["náo","gāng"],"碨":["wěi","wèi"],"碩":["shuò","shí"],"碮":["tí","dī"],"碻":["què","qiāo"],"碿":["sù","xiè"],"磂":["liú","liù"],"磃":["sī","tí"],"磆":["huá","kě","gū"],"磈":["kuǐ","wěi"],"磍":["xiá","qià","yà"],"磏":["lián","qiān"],"磑":["ái","wèi"],"磖":["lá","lā"],"磝":["áo","qiāo"],"磞":["pēng","pèng"],"磤":["yīn","yǐn"],"磥":["lěi","léi"],"磩":["qì","zhú"],"磱":["láo","luò"],"磼":["jí","shé"],"礉":["hé","qiāo","qiào"],"礊":["kè","huò"],"礌":["léi","lěi"],"礐":["què","hú"],"礘":["è","qì"],"礥":["xián","xín"],"礧":["léi","lěi","lèi"],"礹":["yán","yǎn"],"祇":["zhǐ","qí"],"祊":["bēng","fāng"],"祕":["mì","bì"],"祱":["shuì","lèi"],"禆":["bì","pí"],"禓":["shāng","yáng"],"禔":["tí","zhǐ"],"禨":["jī","jì"],"禪":["shàn","chán"],"秄":["zǐ","zì"],"秅":["chá","ná"],"秇":["yì","zhí"],"秏":["hào","mào"],"秙":["kù","kū"],"秜":["ní","nì"],"秮":["huó","kuò"],"秲":["shì","zhì"],"秳":["huó","kuò"],"秿":["fù","pū"],"稄":["xùn","zè"],"稌":["tú","shǔ"],"稕":["zhùn","zhǔn"],"稘":["jī","qí"],"稜":["léng","lēng","líng"],"稡":["zuì","zú","sū"],"稧":["xì","qiè"],"稫":["pì","bì"],"種":["zhǒng","zhòng"],"稯":["zōng","zǒng"],"稰":["xǔ","xū"],"稱":["chēng","chèn","chèng"],"稴":["xián","jiān","liàn"],"稵":["zī","jiū"],"穇":["cǎn","shān","cēn"],"穈":["mén","méi"],"穖":["jǐ","jì"],"穘":["xiāo","rào"],"穛":["zhuō","bó"],"穜":["tóng","zhǒng"],"穪":["chēng","chèn","chèng"],"穮":["biāo","pāo"],"穱":["zhuō","jué"],"穳":["cuán","zàn"],"穻":["yū","yǔ"],"窋":["zhú","kū"],"窌":["jiào","liáo","liù"],"窐":["wā","guī"],"窨":["yìn","xūn"],"窫":["yà","yē"],"窴":["tián","diān","yǎn"],"窼":["chāo","kē"],"窽":["kuǎn","cuàn"],"窾":["kuǎn","cuàn"],"竀":["chēng","chèng"],"竐":["chù","qì"],"竘":["qǔ","kǒu"],"竧":["jìng","zhěn"],"竲":["céng","zēng"],"竷":["kǎn","kàn"],"竻":["lè","jīn"],"笅":["jiǎo","jiào"],"笍":["zhuì","ruì"],"笐":["háng","hàng"],"笒":["cén","jìn","hán"],"笓":["pí","bì"],"笚":["dā","xiá","nà"],"笮":["zuó","zé"],"笰":["fú","fèi"],"筊":["jiǎo","jiào"],"筤":["láng","làng"],"筫":["zhì","zhǐ"],"箁":["póu","bù","fú","pú"],"箄":["pái","bēi"],"箈":["tái","chí"],"箉":["guǎi","dài"],"箌":["zhào","dào"],"箐":["qìng","jīng"],"箖":["lín","lǐn"],"箘":["jùn","qūn"],"箢":["wǎn","yuān"],"箷":["shī","yí"],"箹":["yuē","yào","chuò"],"箾":["shuò","xiāo","qiào"],"築":["zhù","zhú"],"篢":["gōng","gǎn","lǒng"],"篣":["péng","páng"],"篧":["zhuó","huò"],"篬":["qiāng","cāng"],"篭":["lóng","lǒng"],"篯":["jiǎn","jiān"],"篴":["zhú","dí"],"篸":["cēn","zān","cǎn"],"篹":["zhuàn","zuàn","suǎn"],"篻":["piǎo","biāo"],"篿":["tuán","zhuān"],"簂":["guó","guì"],"簎":["cè","jí"],"簚":["mì","miè"],"簨":["sǔn","zhuàn"],"簳":["gǎn","gàn"],"籈":["zhēn","jiān"],"籓":["fān","pān","biān"],"籔":["sǒu","shǔ"],"籛":["jiǎn","jiān"],"籠":["lóng","lǒng"],"粆":["shā","chǎo"],"粇":["kāng","jīng"],"粢":["zī","cí"],"粣":["cè","sè"],"粰":["fū","fú"],"糁":["sǎn","shēn"],"糄":["biān","biǎn"],"糓":["gǔ","gòu"],"糝":["sǎn","shēn"],"糣":["sǎn","shēn"],"糸":["mì","sī"],"糺":["jiū","jiǔ"],"糽":["zhēng","zhěng"],"紁":["chà","chǎ"],"約":["yuē","yāo"],"紅":["hóng","gōng"],"紇":["hé","gē"],"紋":["wén","wèn"],"紒":["jì","jié","jiè"],"紕":["pī","pí","bǐ"],"紟":["jīn","jìn"],"紥":["zhā","zā"],"紨":["fū","fù"],"紬":["chōu","chóu"],"紮":["zhā","zā"],"紴":["bō","bì"],"紶":["qū","qǔ"],"紾":["zhěn","tiǎn"],"絅":["jiōng","jiǒng"],"結":["jié","jiē"],"絓":["guà","kuā"],"絔":["bǎi","mò"],"絙":["huán","gēng"],"絜":["xié","jié"],"絟":["quán","shuān"],"絠":["gǎi","ǎi"],"絡":["luò","lào"],"絣":["bēng","bīng","pēng"],"給":["gěi","jǐ"],"絧":["tōng","tóng","dòng"],"絩":["tiào","diào","dào"],"絫":["lěi","lèi","léi"],"絯":["gāi","hài"],"絺":["chī","zhǐ"],"絻":["miǎn","wèn","mán","wàn"],"綅":["qīn","xiān"],"綈":["tí","tì"],"綖":["yán","xiàn"],"綜":["zōng","zèng"],"綝":["lín","chēn"],"綟":["lì","liè"],"綧":["zhǔn","zhùn"],"綨":["jī","qí"],"綪":["qiàn","qīng","zhēng"],"綮":["qìng","qǐ"],"綳":["bēng","běng","bèng"],"綸":["lún","guān"],"綽":["chuò","chāo"],"緂":["tián","tǎn","chān"],"緑":["lǜ","lù"],"緛":["ruǎn","ruàn"],"緝":["jī","qī"],"緟":["chóng","zhòng"],"緢":["miáo","máo"],"緤":["xiè","yè"],"緪":["gēng","gèng"],"緰":["tōu","xū","shū"],"緵":["zōng","zòng"],"緶":["biàn","pián"],"緷":["gǔn","yùn"],"緺":["guā","wō"],"緼":["yùn","yūn","wēn"],"縆":["gēng","gèng"],"縍":["bāng","bàng"],"縎":["gǔ","hú"],"縒":["cī","cuò","suǒ"],"縕":["yùn","yūn","wēn"],"縗":["cuī","suī","shuāi"],"縙":["róng","rǒng","ròng"],"縡":["zài","zēng"],"縣":["xiàn","xuán"],"縫":["féng","fèng"],"縮":["suō","sù"],"縯":["yǎn","yǐn"],"縱":["zòng","zǒng"],"縳":["zhuàn","juàn"],"縸":["mù","mò"],"縹":["piǎo","piāo"],"繃":["bēng","běng","bèng"],"繆":["móu","miù","miào","mù","liǎo"],"繌":["zōng","zòng"],"繒":["zēng","zèng"],"織":["zhī","zhì"],"繘":["jú","jué"],"繛":["chuō","chuò"],"繜":["zūn","zǔn"],"繟":["chǎn","chán"],"繢":["huì","huí"],"繫":["xì","jì"],"繰":["qiāo","sāo"],"繳":["jiǎo","zhuó"],"繵":["dàn","tán","chán"],"纀":["pú","fú"],"纅":["yào","lì"],"纕":["xiāng","rǎng"],"纚":["lí","xǐ","lǐ","sǎ"],"绨":["tí","tì"],"缊":["yùn","yūn","wēn"],"缋":["huì","huí"],"缏":["biàn","pián"],"缞":["cuī","suī","shuāi"],"缲":["qiāo","sāo"],"罖":["wǎng","ra"],"㐁":["tiǎn","tiàn"],"㐆":["yǐn","yī"],"㐌":["sì","yí"],"㐲":["dài","fú"],"㐷":["mǎ","mà","mián"],"㐺":["zhòng","yín"],"㐼":["chèng","zhěng"],"㐾":["ruǎn","yuàn"],"㑂":["fǎng","páng"],"㑋":["jiòng","kǒng","qióng"],"㑍":["lěi","lèi"],"㑑":["lǎn","jì"],"㑙":["dié","yǒng"],"㑜":["yì","chì"],"㑟":["běng","bó","pěng"],"㑮":["hún","wén"],"㑵":["hàn","jí","jié","zhǎ","zí"],"㑸":["ǎi","yáo","yóu"],"㑾":["xiáo","yáo"],"㒁":["yǔ","yùn"],"㒂":["kù","zhuó"],"㒄":["nàng","nèn","rǎn"],"㒆":["chì","kè","xì","xiào","yàn"],"㒇":["mù","wǔ"],"㒍":["léi","lěi"],"㒎":["sǎ","sà","tàn"],"㒑":["huì","kuǐ"],"㒜":["yú","yǔ"],"㒝":["miè","wà"],"㒞":["jùn","kě"],"㒤":["shè","chè"],"㒷":["guǎ","xìng","xǔ"],"㒸":["suì","xuán"],"㓃":["chuí","dù","zhà"],"㓈":["bèi","bìng","fèi","yè"],"㓉":["huàn","huó","huò"],"㓎":["qīn","qǐn","qìn"],"㓖":["bì","bié"],"㓗":["jié","qǐ"],"㓞":["qì","qià","yáo"],"㓡":["fǔ","fǒu"],"㓤":["jié","qià"],"㓨":["cí","cì"],"㓴":["jùn","ruǎn"],"㓸":["jué","zhuó"],"㓼":["chì","chòng"],"㔀":["lüè","qíng"],"㔃":["jué","pì"],"㔋":["jiàn","lán","làn"],"㔍":["duǒ","zhá"],"㔎":["xiè","yì"],"㔑":["chì","dào","qì","shuì"],"㔓":["jiǎn","xiàn"],"㔕":["jí","yì"],"㔙":["bǎng","péng"],"㔜":["bá","bó"],"㔞":["kuài","kuàng","wàng"],"㔠":["hé","jiá"],"㔣":["léi","lèi"],"㔭":["chè","chí","yí"],"㔯":["suǎn","xuán"],"㔳":["guǐ","gùn","huán","jué"],"㔵":["xiàn","xuǎn"],"㔽":["yào","yǒu"],"㕇":["lá","lā"],"㕈":["hòu","yǐ"],"㕋":["jìng","qín"],"㕎":["è","kè","kǔn"],"㕒":["wéi","wěi","wēi"],"㕙":["jùn","ruì"],"㕛":["xù","yǒu","yòu"],"㕡":["hé","hè","huò"],"㕢":["gài","hài","jù","lǔn","nǒu"],"㕣":["yǎn","yàn"],"㕭":["ào","bì"],"㕲":["huá","yíng"],"㕵":["guó","hún","luǒ"],"㕶":["ň","ňg"],"㖀":["lè","luò"],"㖃":["hǒu","hòu"],"㖆":["qú","qǔ"],"㖕":["bò","niè"],"㖠":["bà","nuò"],"㖢":["jí","qí"],"㖷":["shí","tí"],"㖼":["duǒ","lín","móu"],"㖽":["zé","zéi"],"㗃":["wěn","yìn"],"㗄":["mán","màn"],"㗆":["gé","kài"],"㗇":["xiá","ya"],"㗉":["bì","è","lüè"],"㗊":["jí","qì","bī","léi"],"㗘":["bó","fù"],"㗙":["nà","chú","zhōu"],"㗢":["dòng","hóng"],"㗰":["chù","cóng"],"㗲":["huò","xì"],"㗿":["hé","xià","xiā"],"㘈":["yī","yì"],"㘍":["jí","qì"],"㘎":["hǎn","hàn"],"㘐":["pào","pěng"],"㘔":["cǎn","sǎi"],"㘕":["hǎn","lán"],"㘙":["yán","yǎn"],"㘜":["chǐ","chóu","chù"],"㘝":["niǎn","niè","nà","lǎn"],"㘠":["bì","mì"],"㘣":["xuán","yuán"],"㙁":["mǎng","méi","mèi","mù","nà"],"㙈":["hán","xià"],"㙊":["cháng","zhàng"],"㙜":["chí","tái"],"㙠":["yì","yī"],"㙢":["mán","mén"],"㙨":["jì","qí"],"㙪":["yè","yì"],"㙮":["dā","da"],"㙳":["hǎn","hé","kǎn"],"㙴":["chàn","zhàn"],"㙸":["bào","bó","pú"],"㙺":["guì","kuí"],"㙻":["chán","qiè","zàn"],"㙾":["xì","xué"],"㚁":["qiáo","qiào","qù"],"㚃":["yún","yùn","yūn"],"㚌":["huà","huǒ"],"㚍":["guó","kuǐ","kuì"],"㚓":["lái","lǎi"],"㚕":["fú","bì"],"㚗":["qié","xié"],"㚜":["xù","yù"],"㚞":["měng","shěn","yìng","yùn"],"㚣":["jiāo","xiáo"],"㚫":["shà","zhà"],"㚯":["xín","xún"],"㚲":["diǎn","shàn","chān"],"㚷":["ěr","nǎi"],"㛆":["duǒ","duò"],"㛏":["òu","qiú"],"㛗":["zuò","qiē"],"㛙":["qiè","qín","shěn","shèn"],"㛛":["xìn","zhèn"],"㛝":["bèi","bèng"],"㛪":["yàn","yuán"],"㛱":["ruì","wěi"],"㛳":["chà","yì"],"㛶":["chóu","tán","tàn"],"㛼":["shà","chā"],"㜃":["liàn","liáo","máng"],"㜇":["huì","yè"],"㜊":["pàng","zhǎn"],"㜎":["xī","xì"],"㜑":["fú","pó"],"㜗":["cǎn","chú","xuàn"],"㜛":["nèn","ruǎn"],"㜝":["ǎn","àn"],"㜣":["rán","niàn"],"㜤":["shěn","niǎn"],"㜥":["mái","mó"],"㜦":["hàn","niè","sì","xié","xín"],"㜨":["ér","nái"],"㜫":["mà","méi","měi"],"㜱":["dòng","zhì"],"㜲":["wěng","yíng"],"㜷":["mí","nǎi","xiǎn"],"㜼":["zhí","zhì"],"㝃":["fàn","miǎn","wǎn"],"㝄":["chún","qì","rùn"],"㝋":["liáo","liǎo","liú"],"㝌":["jié","jiù","zhòu"],"㝑":["máng","páng"],"㝓":["gé","kè"],"㝖":["yí","yín"],"㝟":["máo","mào","kuān"],"㝣":["yè","yì"],"㝦":["jùn","yá"],"㝪":["diàn","dǐng"],"㝶":["ài","dé"],"㝺":["lián","lín"],"㝽":["chuí","shuǐ","zhuǐ"],"㝿":["bó","bǒ","fù","qiàn"],"㞎":["bǎ","fú","pá"],"㞒":["xì","xiè"],"㞓":["qǐ","qì"],"㞚":["qì","zhǎ"],"㞠":["láo","liáo"],"㞨":["zǎi","zǐ"],"㞫":["jù","zǒu"],"㞼":["chéng","shèng","zhé"],"㞾":["ní","yì"],"㞿":["chì","qí"],"㟂":["chǐ","mǔ"],"㟇":["cuó","cuǒ"],"㟙":["lǎo","zé","zhái"],"㟝":["péi","pǒu"],"㟧":["è","niè","xùn"],"㟩":["mín","mǐn","wěn"],"㟬":["shǔ","sǒu"],"㟲":["jué","yuán"],"㟴":["kuài","kuǐ","wěi"],"㟿":["máng","mǎng"],"㠅":["fú","fù"],"㠍":["jí","jié","qì"],"㠖":["jì","yǐ"],"㠗":["ào","wò"],"㠚":["duì","zhuó"],"㠣":["lài","lì"],"㠧":["mí","mǐ"],"㠭":["zhǎn","zhàn"],"㠱":["jì","qǐ"],"㡁":["kǎi","kuà"],"㡄":["sǔn","xún"],"㡇":["jí","zhé"],"㡈":["mén","wèn"],"㡉":["xián","yán"],"㡊":["qià","qiǎn"],"㡋":["è","yé"],"㡌":["mào","mèi"],"㡏":["tóu","shū"],"㡔":["wù","mù"],"㡙":["bī","pí"],"㡝":["fèng","fú"],"㡞":["lěi","lóu"],"㡨":["qiān","jiān"],"㡯":["zhái","dù"],"㡳":["dǐ","zhé","zhǐ"],"㡸":["zhǎ","zhà"],"㡹":["cì","jū"],"㢀":["cì","zì"],"㢍":["yíng","yǐng"],"㢎":["chà","zé","zhái","zhé"],"㢓":["yǎo","zhàng"],"㢟":["chǎn","chān"],"㢠":["jiǒng","jùn"],"㢣":["jìng","qíng"],"㢰":["bì","huán"],"㢵":["shè","xié"],"㣃":["yǔ","yù"],"㣆":["mí","mí","pèi"],"㣇":["nǐ","yì"],"㣚":["tóng","tǒng"],"㣞":["duó","duò"],"㣣":["shǎn","shàn"],"㣧":["yìn","yǒng"],"㣪":["huǎn","kuò"],"㣱":["zé","zuò"],"㤁":["miǎn","tiǎn"],"㤇":["ǎo","fó","wù"],"㤉":["qiā","yá"],"㤊":["xiào","yáo"],"㤔":["fú","fù"],"㤘":["chù","cù","zhòu"],"㤛":["nín","rèn"],"㤜":["jué","yù"],"㤟":["kǒng","tòu"],"㤢":["xù","yù"],"㤤":["yú","yǔ"],"㤧":["hóu","hòu"],"㤨":["gǒng","qióng"],"㤬":["huì","kuì"],"㤮":["kuáng","guàng"],"㤯":["jiǒng","jùn"],"㤰":["zǎn","zuò"],"㤲":["qiè","qù"],"㥁":["dé","zhí","zhòu"],"㥆":["diàn","tuì"],"㥇":["cán","càn"],"㥉":["chè","chì"],"㥎":["lái","lí"],"㥔":["yú","yù"],"㥛":["jí","kè","sù"],"㥝":["mǐ","miǎn"],"㥞":["cuì","qiàn","suì"],"㥦":["qiè","xiá","xiǎn"],"㥨":["chuí","shuì","wěi"],"㥲":["shèn","yín"],"㥴":["yí","yǐ"],"㥷":["yè","yì"],"㥺":["hé","hè"],"㥽":["cè","zé"],"㦂":["cháng","tàng"],"㦄":["má","mì"],"㦅":["diē","dì"],"㦌":["tuì","xù","hū"],"㦏":["sǔn","xuàn"],"㦑":["liǎn","xiàn"],"㦗":["jiàn","jìn"],"㦛":["yú","yǔ"],"㦜":["huò","xuè"],"㦟":["hài","mái"],"㦢":["jié","qì"],"㦥":["huán","xiǎn"],"㦨":["lán","làn"],"㦴":["gé","qià"],"㦹":["àng","yáng","yǐng"],"㦺":["rǔ","rù"],"㦻":["xí","zhé"],"㦽":["xù","yù"],"㧄":["qiǎn","qiú"],"㧅":["mù","dāo"],"㧈":["yǐn","yìn"],"㧉":["gài","kuì"],"㧊":["bá","pō"],"㧋":["xiǎn","xuǎn"],"㧎":["yá","yà","qiā"],"㧑":["wéi","wěi"],"㧒":["xué","yù","yuè"],"㧕":["jiù","liǔ","yú"],"㧗":["zǐ","jǐ","zhǐ"],"㧘":["cuì","nǎo","zì"],"㧱":["chèn","ná","nì","nì","tiàn"],"㧳":["bǎi","bó","zhuò"],"㧵":["póu","pǒu"],"㧷":["duò","tùn"],"㧻":["zhǐ","zhuó","zú"],"㧽":["gù","hú"],"㨁":["zhí","zhì"],"㨃":["chéng","duǐ"],"㨅":["nèi","ruì"],"㨋":["chě","lè","zhèn"],"㨌":["gòu","rú","rǔ"],"㨎":["rú","ruán"],"㨐":["bǔ","péi"],"㨒":["kuí","wěi","xié"],"㨓":["láo","liáo"],"㨤":["huì","kuǎi","wài"],"㨯":["huò","kuò"],"㨰":["gé","gǔn","hùn","huò","jié"],"㨶":["chóu","dǎo","zhǒu","zhòu"],"㨺":["mén","mì","miǎn"],"㨻":["cán","shǎn","zàn"],"㨽":["pǐ","pì","qiǎo"],"㩇":["huà","huò"],"㩈":["xiàn","yǔn"],"㩋":["sù","xiāo"],"㩖":["qiáng","tiáo"],"㩗":["xí","xié"],"㩢":["mí","miè"],"㩩":["qǐ","qǐng"],"㩪":["xié","xìn","yé"],"㩭":["bó","jiǎo","xiào"],"㩮":["qián","xián"],"㩯":["bǎn","pán","pó"],"㩰":["jiǎo","qiáo","xiǔ"],"㩲":["kǔn","quán"],"㩶":["niè","nǐng"],"㩹":["dié","zhá"],"㩻":["guǐ","qī"],"㪌":["tǒng","yú","yǔ"],"㪔":["sàn","tán"],"㪙":["kě","kè","kuò"],"㪪":["sà","xǐ"],"㪯":["chá","jǔ","qú"],"㪽":["suǒ","suò"],"㪾":["gé","luò"],"㪿":["zhé","shé"],"㫅":["chá","qí","shí"],"㫎":["gǔn","kuài"],"㫑":["shí","zhǐ"],"㫓":["qǐ","qì"],"㫘":["mì","miǎn"],"㫛":["guàng","kuáng","kuàng","mǔ"],"㫜":["dàn","tǎn"],"㫤":["chǎng","zhào"],"㫶":["cǒu","zhǒu"],"㫹":["dài","shù","yú"],"㫼":["dié","zhé","zhì"],"㬆":["mián","miàn","mǐn"],"㬉":["nuǎn","ruò"],"㬐":["jǐn","jìn","xíng","yǐng"],"㬒":["mǎng","mào"],"㬪":["dié","zhì"],"㬭":["jiào","shǎn","yǎo"],"㬮":["kuài","nàn"],"㬵":["xiáo","jiāo"],"㭈":["jué","kuài"],"㭌":["móu","yú"],"㭘":["hé","gé"],"㭙":["shé","zhé"],"㭡":["xì","xìn"],"㭩":["lèi","líng","liè"],"㭫":["cuán","cuó","zhèn"],"㭯":["dié","nà","zhé"],"㭰":["jì","jué","zuǐ"],"㭱":["hé","xiá"],"㭾":["jué","yuè"],"㮄":["bǎng","bì","péng"],"㮋":["yǒu","yù"],"㮌":["mián","mǐn"],"㮐":["xǐng","shěng"],"㮕":["ér","ruǎn"],"㮖":["jiá","jiá"],"㮝":["hé","luò"],"㮞":["jié","ní","yá"],"㮟":["jí","niǎn","pèng","ròu","kā"],"㮣":["gài","zé"],"㮦":["sè","suǒ"],"㮨":["jí","jì"],"㮯":["huá","hún","kuǎn"],"㮰":["bí","pí"],"㮶":["shì","shuò"],"㯀":["xiǎn","xuàn"],"㯉":["huò","chū"],"㯐":["fǎng","tuǒ"],"㯗":["rǎn","shùn","xián","xiàn"],"㯛":["hú","huò"],"㯞":["juàn","yuè"],"㯠":["qiàn","xiàn","xún"],"㯥":["cáo","zāo"],"㯰":["zhé","zhí"],"㯱":["biǎo","piáo","pāo"],"㯻":["gǔn","hùn"],"㰂":["shěn","sǔn"],"㰐":["jué","kuí","lěi","tuǐ","tuǒ"],"㰒":["shé","xué"],"㰟":["jì","qì"],"㰤":["hē","qiè"],"㰯":["tòu","tǒu","hòu"],"㰲":["xù","yù"],"㰴":["pó","pǒu"],"㰸":["liǎn","liàn","luǎn"],"㰺":["xiá","xià"],"㰽":["mǐ","yàn"],"㱀":["chǐ","chuài"],"㱇":["sè","xì"],"㱌":["chè","yǎn","yé"],"㱔":["xiē","suò"],"㱘":["àn","yǎn"],"㱚":["cán","hài","shàn"],"㱟":["bó","pí","pǐ"],"㱦":["è","guì","jǐ","qī"],"㱪":["mèn","hūn"],"㱮":["kuài","kuì"],"㱱":["huì","wù","xì"],"㱵":["bèn","fèn"],"㱶":["bèng","jiào","péng","qiǎo","rù"],"㱸":["bì","bié"],"㱹":["lì","suàn","xiàn"],"㱻":["luǒ","luò"],"㱽":["dàn","qín","zhěn"],"㱾":["gāi","kāi"],"㲄":["kòu","kū"],"㲋":["chuò","zhuó","zú"],"㲏":["bǎo","piǎo","pín","pìng"],"㲜":["tán","tǎn"],"㲡":["nài","nì"],"㲢":["biàn","bié"],"㲦":["hàn","hě"],"㲲":["dié","yì"],"㲴":["zhòng","zhòu"],"㲹":["guǐ","qiú"],"㲺":["jí","kè","léi"],"㲽":["niàn","rěn","xiàn"],"㲾":["yǔ","yù"],"㳀":["guò","kǎi","xì"],"㳅":["jiǎo","liú"],"㳆":["shǔ","tǒu"],"㳎":["biàn","fàn"],"㳏":["chǐ","shì"],"㳐":["sà","zhá","zhǎ"],"㳥":["jù","lòng"],"㳨":["jiǎn","zá","zǎn"],"㳪":["pàn","pì"],"㳶":["gòu","nǒu"],"㳷":["wěn","hū"],"㴃":["lèi","lì"],"㴆":["jìn","xìng"],"㴔":["sè","yì"],"㴸":["nà","shǎn","yè"],"㴽":["xiè","yìn"],"㵀":["cuàn","zú"],"㵂":["chuǎng","shù"],"㵄":["hàn","qià","yù"],"㵅":["dàn","tàn"],"㵊":["shěn","zhé"],"㵌":["chàn","qióng","xún"],"㵎":["hǎn","jiàn","kǎn"],"㵔":["chě","chè"],"㵗":["fù","pán","píng"],"㵢":["léi","lěi"],"㵣":["kě","luǒ"],"㵤":["diàn","shà","xiá"],"㵥":["bì","mì"],"㵨":["bì","pì"],"㵫":["nǐ","yì"],"㵮":["chún","wěn"],"㵳":["liáo","liú"],"㵸":["yào","yuè"],"㵺":["pái","pài"],"㵽":["duì","lěi"],"㵾":["jìng","qìng"],"㶆":["chú","zhū"],"㶈":["yíng","yìng"],"㶒":["shǎn","shěn","tàn"],"㶡":["dài","huǒ","zuó"],"㶫":["liǎo","liào"],"㶬":["méi","mò"],"㶭":["jiù","yǒu"],"㶴":["chǐ","shǐ"],"㷅":["chǎo","miǎo"],"㷆":["dòu","fù"],"㷇":["guài","kuí"],"㷉":["wèi","yù","yùn"],"㷋":["tán","tǎn"],"㷎":["hè","hóng","xié"],"㷤":["hè","hù","xuè"],"㷪":["cuì","zuǎn"],"㷴":["gé","lì"],"㷶":["bèi","bì"],"㷸":["dié","yè"],"㸁":["hǎn","hàn"],"㸄":["jì","jié"],"㸊":["là","lài","liè"],"㸛":["sháo","shuò"],"㸣":["yè","yì"],"㸧":["kèn","yín"],"㸬":["bèi","fèi","pèi"],"㸲":["zuó","zuò"],"㸵":["guǐ","wěi"],"㸸":["hǒu","ǒu","kǒu"],"㹂":["cì","qiǎn"],"㹃":["bì","fèi"],"㹄":["jì","qì"],"㹈":["lí","máo"],"㹌":["chǎn","shèng"],"㹍":["dí","dú"],"㹐":["chóng","zhòu"],"㹑":["sì","yí"],"㹗":["táo","tāo"],"㹘":["rú","rù","ruí"],"㹛":["ráo","rǎo"],"㹞":["yín","yǐn"],"㹡":["xuán","xuàn"],"㹤":["qiè","què"],"㹫":["xì","yí"],"㹱":["hú","què","rǎn"],"㹷":["shǐ","xìn"],"㹼":["chǔ","jú","yù"],"㹽":["chǎn","shàn"],"㹿":["diǎo","zhào","zhuó"],"㺂":["gǎn","jiàn","yán"],"㺑":["cán","shǎn"],"㺒":["liào","yáo","xiāo"],"㺔":["hài","wèi"],"㺗":["dàn","yán"],"㺠":["yòu","yù"],"㺥":["chán","tán"],"㺩":["jiù","sè"],"㻀":["yóu","yú"],"㻅":["huì","kuài"],"㻊":["máng","mén","mèng"],"㻋":["là","lèi"],"㻎":["lì","sè"],"㻏":["líng","lǐng"],"㻔":["duǒ","ruì"],"㻞":["biàn","fèn","pìn"],"㻡":["dié","jué"],"㻧":["duò","hé"],"㻭":["sè","zé"],"㻰":["miǎn","rè","wèi","yù"],"㻶":["bǐ","bì"],"㻸":["cén","jìn","xín","zēn"],"㻺":["lì","liè"],"㼂":["é","wèn","yuǎn"],"㼉":["yìn","zhèn"],"㼋":["gǔ","jiǔ","móu","rǔ"],"㼎":["bèi","bó","kě"],"㼑":["liàn","luán"],"㼒":["qiǔ","tǎng"],"㼓":["lián","liǎn"],"㼗":["dǐng","tíng"],"㼜":["àng","póu"],"㼝":["fàn","wǎn"],"㼢":["ě","yí"],"㼣":["bǎi","bó"],"㼤":["qì","qiè","yà"],"㼥":["chú","kǎo","tǒu"],"㼭":["diàn","niǎo"],"㼮":["chāi","qì"],"㼰":["é","pí"],"㼽":["shuǎng","chuǎng"],"㽇":["guài","hú","huí","méng","sè"],"㽉":["hǎn","jiàn","xiàn"],"㽋":["luó","luò"],"㽎":["dǎn","tán"],"㽛":["gōu","qú"],"㽢":["ǎn","yè"],"㽩":["càn","cào"],"㽪":["zěng","zhǎ"],"㽱":["jiǎo","jiū","niú"],"㽳":["hàn","xiè","xǔ","yú"],"㽹":["fàn","wǎn"],"㾆":["rán","shǎn"],"㾒":["jì","rú","rù"],"㾖":["lǐ","luó"],"㾗":["lǎng","liàng"],"㾠":["huáng","kuáng","kuì"],"㾦":["bàng","pèi","pén"],"㾨":["qǐ","yǐ"],"㾯":["tuí","wěi"],"㾱":["bèi","fàn","fèi","fú"],"㾺":["mà","mò"],"㾽":["tuí","zhuì"],"㾿":["láng","lǎng"],"㿃":["dài","zhì"],"㿅":["xiǎn","xuǎn"],"㿇":["xí","xì"],"㿛":["lí","lì"],"㿟":["bái","jiǎo"],"㿢":["yào","zhuì"],"㿣":["hé","xiá"],"㿥":["hú","hé"],"㿷":["cuó","cāo"],"㿸":["wǎn","mán"],"䀅":["shè","zhé"],"䀇":["gǔ","què"],"䀉":["qiáo","shà"],"䀏":["xiàn","xuàn"],"䀑":["nà","nì","wò"],"䀔":["niú","rèn"],"䀕":["chèng","zhèn"],"䀘":["xí","xié"],"䀛":["mèi","wù"],"䀜":["gǔ","mèi","xué"],"䀟":["fán","fèi","fèn"],"䀠":["qú","jù"],"䀡":["chàn","tàn"],"䀣":["bì","mà"],"䀰":["gǔ","yíng"],"䀳":["ài","là","lài"],"䀶":["lǎng","liàng"],"䀸":["dì","zhì"],"䀹":["jiá","shè","jié"],"䀼":["rèn","zhěn"],"䁁":["lǎng","liàng"],"䁅":["bèi","bì","měng","mèng"],"䁆":["ǎn","yì"],"䁍":["jià","kè","qià"],"䁓":["jiè","zǒng"],"䁔":["hàn","huǎn","xuān"],"䁙":["yǎn","yàn"],"䁛":["guǐ","guì","kuì"],"䁜":["huǎng","huàng"],"䁟":["chá","duó"],"䁤":["chè","chèng"],"䁪":["nǎn","zhǎn"],"䁯":["shè","xié"],"䁷":["jué","wò"],"䁻":["lì","shuò"],"䁼":["mò","mù"],"䂃":["jiào","jié"],"䂄":["huò","kuàng"],"䂇":["náng","niǔ","nǒng","páng"],"䂒":["jié","qià","yà"],"䂖":["shí","sì"],"䂚":["yáo","yóu"],"䂜":["bàng","péi"],"䂝":["jié","zé","zhé"],"䂠":["shé","shǐ"],"䂡":["dǐ","zhǐ"],"䂤":["fù","hái"],"䂪":["diào","tiǎo"],"䂯":["guài","guàn"],"䂱":["cuì","ruì"],"䂸":["guó","xù"],"䂺":["wǎn","wǒ"],"䂽":["diào","yì"],"䂿":["tà","tiè"],"䃀":["cuì","xùn"],"䃂":["gǔn","gùn"],"䃍":["zhào","zhuì"],"䃕":["láo","luò"],"䃛":["lián","qiàn"],"䃞":["shú","yì"],"䃲":["pán","pàn"],"䃹":["làn","lǎng"],"䃺":["mó","mò"],"䃻":["bà","pái"],"䃽":["fú","guǐ","sì"],"䄆":["huó","kuò"],"䄍":["dù","duó","zhà"],"䄏":["yú","yāo"],"䄑":["huó","kuò"],"䄒":["niè","rěn"],"色":["sè","shǎi"],"臑":["rú","nào","ér"],"戛":["jiá","gā"]},hs="editor-popover",us=new(function(){return o(function e(){var t=this;i(this,e),s(this,"tooltip",null),s(this,"root",null),s(this,"popoverController",null),s(this,"clickEvent",function(e){var n;null!==(n=e.target)&&void 0!==n&&n.closest(".".concat(hs))||t.hide()})},[{key:"isVisible",value:function(){return!!this.tooltip}},{key:"create",value:function(e){return this.root=document.createElement("div"),this.tooltip=document.createElement("div"),this.tooltip.classList.add(hs),this.tooltip.classList.add((null==e?void 0:e.rootClassName)||""),this.root.appendChild(this.tooltip),document.body.appendChild(this.root),this.tooltip}},{key:"adjustPos",value:function(e){var t=this.tooltip,n=t.offsetWidth,i=t.offsetHeight,r=d({},e);n+e.x>window.innerWidth-10&&(r.x=window.innerWidth-n-10),i+e.y>window.innerHeight-10&&(r.y=window.innerHeight-i-10),r.x<5&&(r.x=5),r.y<5&&(r.y=5),this.tooltip.style.left="".concat(r.x,"px"),this.tooltip.style.top="".concat(r.y,"px")}},{key:"show",value:(e=p().m(function e(t,n,i){var r,o=this;return p().w(function(e){for(;;)if(0===e.n)return this.hide(),(r=this.create(i)).style.position="fixed",r.style.display="block",r.appendChild(t),this.adjustPos(n),setTimeout(function(){document.addEventListener("click",o.clickEvent)}),e.a(2,new Promise(function(e,t){o.popoverController={resolve:e}}))},e,this)}),n=function(){var n=this,i=arguments;return new Promise(function(r,o){var s=e.apply(n,i);function a(e){t(s,r,o,a,l,"next",e)}function l(e){t(s,r,o,a,l,"throw",e)}a(void 0)})},function(e,t,i){return n.apply(this,arguments)})},{key:"hide",value:function(){var e;null===(e=this.popoverController)||void 0===e||e.resolve(void 0),document.removeEventListener("click",this.clickEvent);var t=this.root;t&&(t.style.display="none",t.remove()),this.tooltip=null}}]);var e,n}()),ds={"ā":"a","á":"a","ǎ":"a","ă":"a","à":"a","ō":"o","ó":"o","ǒ":"o","ŏ":"o","ò":"o","ē":"e","é":"e","ě":"e","ĕ":"e","è":"e","ī":"i","í":"i","ǐ":"i","ĭ":"i","ì":"i","ū":"u","ú":"u","ǔ":"u","ŭ":"u","ù":"u","ǖ":"v","ǘ":"v","ǚ":"v","ǜ":"v","ń":"n","ň":"n","ǹ":"n"};var ps=function(e){return((e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t})(e||8)};function fs(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}function ms(e){return e?e.replace(/&#39;/g,"'").replace(/&quot;/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&"):""}function gs(e){return e.replace(/\u200b/g,"")}var ys=new en("polyphoneTip");function vs(e,t){var n=document.createElement("div");return n.classList.add("ssml-editor-phoneme__list"),[].concat(y(e),[""]).forEach(function(e){var t=document.createElement("div");t.classList.add("ssml-editor-phoneme__item"),t.setAttribute("data-value",function(e){var t=5,n=(e||"").match(/([^\d]+)(\d)?/);if(!n)return"";var i=n[1];return Number.isNaN(Number(n[2]))||(t=Number(n[2])),(i=i.replace(/ā|á|ǎ|ă|à|ō|ó|ǒ|ŏ|ò|ē|é|ě|ĕ|è|ī|í|ǐ|ĭ|ì|ū|ú|ǔ|ŭ|ù|ǖ|ǘ|ǚ|ǜ|ń|ň|ǹ/,function(e){return/ā|ō|ē|ī|ū|ǖ/.test(e)?t=1:/á|ó|é|í|ú|ǘ|ń/.test(e)?t=2:/ǎ|ă|ǒ|ŏ|ĕ|ě|ǐ|ĭ|ǔ|ŭ|ǚ|ň/.test(e)?t=3:/à|ò|è|ì|ù|ǜ|ǹ/.test(e)&&(t=4),ds[e]||e}))+t}(e)),t.textContent=e||"移除",n.appendChild(t)}),n}var xs=new Xt({key:ys,state:{init:function(){return{active:!1,decorations:Fr.empty}},apply:function(e,t,n,i){var r,o=e.getMeta(ys),s=null!==(r=null==o?void 0:o.active)&&void 0!==r?r:t.active,a=Fr.empty;return s&&(a=!t.active||e.docChanged?function(e,t){var n=[],i=function(e){var i,r=e.pos,o=e.index,s=e.char,a=ps(4);n.push(_r.inline(r+o,r+o+1,{class:So,"data-phoneme-char":s,"data-deco-id":a},{inclusiveStart:!1,inclusiveEnd:!1,decoId:a,char:s,polyphones:JSON.stringify(null!==(i=t[s])&&void 0!==i?i:[])}))};return e.descendants(function(e,n){var r,o="";e.isText?null===(r=e.text)||void 0===r||r.split("").filter(Boolean).forEach(function(e,r){t[e]&&i({pos:n,index:r,char:e})}):e.type.name===k.Phoneme&&(o=e.attrs.text,t[o]&&i({pos:n,index:0,char:o}))}),Fr.create(e,n)}(i.doc,cs):t.decorations.map(e.mapping,e.doc)),d(d({},t),{},{active:s,decorations:a})}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations},handleClick:function(e,t,n){var i=xs.getState(e.state),r=n.target,o=r.closest(".".concat(So)),s=r.closest('[data-type="'.concat(k.Phoneme,'"]'));if(!o&&!s)return!1;var a="",l=-1,c=-1;if(o){var h;if(null==i||!i.active)return!1;var u=null===(h=o.dataset)||void 0===h?void 0:h.decoId,d=i.decorations.find(t,t),p=null;if(d.forEach(function(e){e.spec.decoId===u&&(p=e)}),!p)return!1;a=p.spec.char,l=p.from,c=p.to}else{var f=e.state.doc.resolve(e.posAtDOM(s,0)),m=f.nodeAfter;if(!m||m.type.name!==k.Phoneme)return!1;a=m.attrs.text,l=f.pos,c=f.pos+m.nodeSize}var g=vs(cs[a]),y=function(t){var n,i,r=null===(n=(i=t.target).closest)||void 0===n?void 0:n.call(i,".ssml-editor-phoneme__item");if(r){var o=r.dataset.value,s=e.state.tr.setSelection(qt.create(e.state.doc,l,c));s=o?s.replaceSelectionWith(e.state.schema.nodes[k.Phoneme].create({value:o,text:a})):s.replaceSelectionWith(e.state.schema.text(a)),e.dispatch(s.setSelection(qt.near(s.doc.resolve(l)))),us.hide()}};return g.addEventListener("click",y),us.show(g,{x:n.clientX,y:n.clientY},{rootClassName:"ssml-editor-phoneme__popover"}).then(function(){g.removeEventListener("click",y)}),e.dispatch(e.state.tr.setSelection(qt.create(e.state.doc,l,c)).setMeta(Mo,!0)),!0}}});Eo.registerPlugin("phoneme",xs);var bs={switchPhonemeMode:"switchPhonemeMode",insertPhoneme:"insertPhoneme"};D({name:bs.switchPhonemeMode,description:"切换多音字模式",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r&&r(i.tr.setMeta(ys,{active:!(null==n||!n.active),tooltip:null})),{success:!0}},validate:function(e){var t=e.state.doc.textContent;return null!=t&&t.length&&/[\u4e00-\u9fa5]/.test(t)?{available:!0}:{available:!1,reason:"当前无有效中文文本"}}});var ws=/^[+-]?(?!0\d)\d{1,3}(?:,\d{3})*(?:\.\d+)?$|^[+-]?\d+(?:\.\d+)?$/,ks={setSayAs:"setSayAs"};D({name:ks.setSayAs,description:"设置文本读法 (say-as)",execute:function(e,t){var n,i,r=t,o=e.state,s=e.dispatch,a=o.selection,l=a.from,c=a.to,h=a.$from,u=a.$to,d=o.doc.textBetween(l,c,"");return(null===(n=h.nodeAfter)||void 0===n?void 0:n.type.name)===k.SayAs&&(null===(i=u.nodeBefore)||void 0===i?void 0:i.type.name)===k.SayAs&&(d=h.nodeAfter.attrs.text||""),s?(s(o.tr.replaceSelectionWith(o.schema.nodes[k.SayAs].create({interpretAs:r.interpretAs,type:k.SayAs,text:d})).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t,n,i,r=e.state,o=r.selection,s=o.from,a=o.to,l=o.$from,c=o.$to;if(o.empty)return{available:!1,code:I.SelectionInvalid,reason:"请选择文本内容"};var h=r.doc.textBetween(s,a,"");return(null===(t=l.nodeAfter)||void 0===t?void 0:t.type.name)===k.SayAs&&(null===(n=c.nodeBefore)||void 0===n?void 0:n.type.name)===k.SayAs&&(h=l.nodeAfter.attrs.text||""),ws.test(null===(i=h)||void 0===i?void 0:i.trim())?l.parent!==c.parent?{available:!1,code:I.SelectionInvalid,reason:"选区不能跨节点"}:{available:!0}:{available:!1,code:I.ParamsInvalid,reason:"请选择纯数字文本内容"}}}),D({name:O.setSpeechLanguage,description:"设置语种",execute:function(e,t){var n=t,i=e.state,r=e.dispatch,o=i.selection,s=o.from,a=o.to,l=o.empty,c=i.tr,h=ps(6),u=i.schema,d=u.marks,p=u.nodes,f=d[k.SpeechLanguage];if(l){if(r){var m=p[k.RangeAnchor].create({anchorType:"start",tagType:k.SpeechLanguage,value:n.value,tagId:h}),g=p[k.RangeAnchor].create({anchorType:"end",tagType:k.SpeechLanguage,value:n.value,tagId:h}),y=i.schema.text("​",[f.create({value:n.value,tagId:h})]),v=L.from([m,y,g]);c.replaceWith(s,s,v);var x=s+m.nodeSize+y.nodeSize;c.setSelection(jt.near(c.doc.resolve(x),-1)),r(c)}return{success:!0}}if(r){var b=f.create({value:n.value,tagId:h}),w=p[k.RangeAnchor].create({anchorType:"start",tagType:k.SpeechLanguage,value:n.value,tagId:h});c.insert(s,w);var S=p[k.RangeAnchor].create({anchorType:"end",tagType:k.SpeechLanguage,value:n.value,tagId:h});return c.insert(a+w.nodeSize,S),c.addMark(s+w.nodeSize,a+w.nodeSize,b),r(c),{success:!0}}return{success:!0}},validate:function(e){return{available:!0}}}),D({name:N.setSpeechPitch,description:"设置语调",execute:function(e,t){var n=t,i=e.state,r=e.dispatch,o=i.selection,s=o.from,a=o.to;if(o.empty||s===a)return{success:!1,code:I.SelectionInvalid,reason:"请先选择文本"};if(r){var l=i.tr,c=ps(6),h=i.schema,u=h.marks,d=h.nodes,p=u[k.SpeechPitch].create({value:n.value,tagId:c}),f=d[k.RangeAnchor].create({anchorType:"start",tagType:k.SpeechPitch,value:n.value,tagId:c});l.insert(s,f);var m=d[k.RangeAnchor].create({anchorType:"end",tagType:k.SpeechPitch,value:n.value,tagId:c});return l.insert(a+f.nodeSize,m),l.addMark(s+f.nodeSize,a+f.nodeSize,p),r(l),{success:!0}}return{success:!0}},validate:function(e){return e.state.selection.empty?{available:!1,code:I.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}}),D({name:M.setSpeechRate,description:"设置语速",execute:function(e,t){var n=t,i=e.state,r=e.dispatch,o=i.selection,s=o.from,a=o.to;if(o.empty||s===a)return{success:!1,code:I.SelectionInvalid,reason:"请先选择文本"};var l=[];if(i.doc.nodesBetween(s,a,function(e,t){var n=e.marks.find(function(e){return e.type.name===k.SpeechRate});if(n){var i=l.find(function(e){return e.mark.attrs.tagId===n.attrs.tagId});i?i.to=Math.max(i.to,t+e.nodeSize):l.push({mark:n,from:t,to:t+e.nodeSize})}}),r){var c=i.tr,h=ps(6),u=i.schema,d=u.marks,p=u.nodes,f=d[k.SpeechRate].create({value:n.value,tagId:h}),m=p[k.RangeAnchor].create({anchorType:"start",tagType:k.SpeechRate,value:n.value,tagId:h});c.insert(s,m);var g=p[k.RangeAnchor].create({anchorType:"end",tagType:k.SpeechRate,value:n.value,tagId:h});return c.insert(a+m.nodeSize,g),c.addMark(s+m.nodeSize,a+m.nodeSize,f),r(c),{success:!0}}return{success:!0}},validate:function(e){return e.state.selection.empty?{available:!1,code:I.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}}),D({name:T.setSpeechVolume,description:"设置音量",execute:function(e,t){var n=t,i=e.state,r=e.dispatch,o=i.selection,s=o.from,a=o.to;if(o.empty||s===a)return{success:!1,code:I.SelectionInvalid,reason:"请先选择文本"};if(r){var l=i.tr,c=ps(6),h=i.schema,u=h.marks,d=h.nodes,p=u[k.SpeechVolume].create({value:n.value,tagId:c}),f=d[k.RangeAnchor].create({anchorType:"start",tagType:k.SpeechVolume,value:n.value,tagId:c});l.insert(s,f);var m=d[k.RangeAnchor].create({anchorType:"end",tagType:k.SpeechVolume,value:n.value,tagId:c});return l.insert(a+f.nodeSize,m),l.addMark(s+f.nodeSize,a+f.nodeSize,p),r(l),{success:!0}}return{success:!0}},validate:function(e){return e.state.selection.empty?{available:!1,code:I.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}});var Ss={insertWord:"insertWord"};function zs(){var e=document.createElement("span");return e.classList.add("ssml-tag-remove"),e.innerHTML='<svg class="icon-remove" viewBox="0 0 7 7" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M1 1L6 6" stroke="white" stroke-linecap="round"/>\n<path d="M6 1L1 6" stroke="white" stroke-linecap="round"/>\n</svg>',e}function Cs(e){var t,n;return null===(t=e.target)||void 0===t||null===(n=t.closest)||void 0===n?void 0:n.call(t,".ssml-tag-remove")}D({name:Ss.insertWord,description:"插入连读节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Word].create(d(d({},n),{},{type:k.Word}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Word])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"光标插入文本设置连读"}}});var Ms={group:"inline",attrs:{type:{default:k.Action,validate:"string"},value:{default:"",validate:"string"},label:{default:No[k.Action]}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){var t;return["b",{"data-type":e.attrs.type,"data-value":null===(t=e.attrs.value)||void 0===t?void 0:t.trim(),"data-label":e.attrs.label,class:"".concat(wo," ").concat(wo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label||"".concat(No[k.Action]).concat(e.attrs.value)],zs()]},parseDOM:[{tag:"b[data-type='".concat(k.Action,"']"),getAttrs:function(e){var t=e.dataset,n=t.value;return{label:t.label||"".concat(No[k.Action]).concat(n),type:k.Action,value:n}}},{tag:"i.tts-mark-action",getAttrs:function(e){var t,n=e.dataset,i=n.tts,r=n.label,o=null==i||null===(t=i.replace(/\[act-|\]/g,""))||void 0===t?void 0:t.trim();return{label:r||"".concat(No[k.Action]).concat(o),type:k.Action,value:o}}}],handleClickOn:function(e,t,n,i,r){if(Cs(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.Action,Ms);var Ns={group:"inline",attrs:{value:{default:"",validate:"string"},label:{default:""},pptAction:{default:"next",validate:function(e){return["play","next","prev","end"].includes(e)}}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-type":k.PptControl,"data-value":encodeURIComponent(fs(e.attrs.value||"")),class:"".concat(wo," ").concat(wo,"-").concat(k.PptControl),"data-ppt-action":e.attrs.pptAction},["span",{class:"ssml-tag-label"},"".concat(No[k.PptControl]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],zs()]},parseDOM:[{tag:"b[data-type='".concat(k.PptControl,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i,o=t.pptAction;return{type:k.PptControl,value:decodeURIComponent(ms(n||"")),label:r,pptAction:o}}}],handleClickOn:function(e,t,n,i,r){if(Cs(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.PptControl,Ns);var Ts={group:"inline",attrs:{type:{default:k.SoundEvent},value:{default:"",validate:"string"},label:{default:"",validate:"string"},volume:{default:100,validate:"number"}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-type":k.SoundEvent,"data-value":e.attrs.value,"data-label":e.attrs.label,"data-volume":e.attrs.volume,class:"".concat(wo," ").concat(wo,"-soundEvent")},["span",{class:"ssml-tag-label"},"".concat(No[k.SoundEvent]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],zs()]},parseDOM:[{tag:"b[data-type='".concat(k.SoundEvent,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i,o=t.volume;return{type:k.SoundEvent,value:n,label:r,volume:o?Number(o):100}}},{tag:"i[data-type='effectmusic']",getAttrs:function(e){var t=e.dataset,n=t.tts,i=t.label,r=void 0===i?"":i,o=t.volume;return{type:k.SoundEvent,value:n,label:r,volume:Number.isNaN(Number(o))?100:Number(o)}}}],handleClickOn:function(e,t,n,i,r){if(Cs(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.SoundEvent,Ts);var Os={group:"inline",attrs:{value:{default:"",validate:"string"},label:{default:""}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-type":k.Command,"data-value":e.attrs.value,class:"".concat(wo," ").concat(wo,"-").concat(k.Command)},["span",{class:"ssml-tag-label"},"".concat(No[k.Command]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],zs()]},parseDOM:[{tag:"b[data-type='".concat(k.Command,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i;return{type:k.Command,value:n,label:r}}}],handleClickOn:function(e,t,n,i,r){if(Cs(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.Command,Os);var Es={group:"inline",attrs:{value:{default:"",validate:"string"},label:{default:""}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){var t;return["b",{"data-type":k.Data,"data-value":e.attrs.value,"data-label":e.attrs.name,class:"".concat(wo," ").concat(wo,"-").concat(k.Data)},["span",{class:"ssml-tag-label"},"{{ ".concat(null!==(t=e.attrs.label)&&void 0!==t?t:""," }}")],zs()]},parseDOM:[{tag:"b[data-type='".concat(k.Data,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"":n,r=t.label,o=void 0===r?"":r;return{type:k.Data,value:i,label:o}}}],handleClickOn:function(e,t,n,i,r){if(Cs(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.Data,Es);var As={group:"inline",attrs:{value:{default:"",validate:"string"},label:{default:""},waitType:{default:"sleep",validate:function(e){return["sleep","video_ended","audio_ended"].includes(e)}},context:{default:""}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){var t;return["b",{"data-type":k.Wait,"data-value":fs(e.attrs.value||""),class:"".concat(wo," ").concat(wo,"-").concat(k.Wait),"data-wait-type":e.attrs.waitType,"data-context":null!==(t=e.attrs.context)&&void 0!==t?t:""},["span",{class:"ssml-tag-label"},"".concat(No[k.Wait]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],zs()]},parseDOM:[{tag:"b[data-type='".concat(k.Wait,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i,o=t.waitType,s=t.context;return{type:k.Wait,value:ms(n||""),label:r,waitType:o,context:null!=s?s:""}}}],handleClickOn:function(e,t,n,i,r){if(Cs(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.Wait,As);var js={group:"inline",attrs:{anchorType:{default:"start"},tagType:{default:k.SpeechRate},value:{default:"70"},tagId:{default:""}},inline:!0,draggable:!1,selectable:!0,atom:!0,toDOM:function(e){var t,n=e.attrs,i=n.anchorType,r=n.tagType,o=n.value,s=n.tagId,a=No[r]||r,l=document.createElement("b");l.setAttribute("contenteditable","false"),l.classList.add(wo),l.classList.add("".concat(wo,"-").concat(r)),l.classList.add("".concat(wo,"-anchor-").concat(i)),l.dataset.type=k.RangeAnchor,l.dataset.anchorType=i,l.dataset.tagType=r,l.dataset.value=String(o),l.dataset.tagId=s,r===k.SpeechLanguage&&(t=String(o).split("-")[0].toLowerCase(),["ar","he","fa","ur"].includes(t))&&l.setAttribute("dir","rtl");var c=document.createElement("span");if(c.className="ssml-tag-label","start"===i){var h=r===k.SpeechLanguage?o.toUpperCase():o;c.innerText="".concat(a).concat(h),l.appendChild(c),l.appendChild(zs())}else l.classList.add("range-anchor-end");return l},parseDOM:[{tag:"b[data-type='".concat(k.RangeAnchor,"']"),getAttrs:function(e){var t=e.dataset;return{anchorType:t.anchorType,tagType:t.tagType,value:t.value,tagId:t.tagId}}}],handleClickOn:function(e,t,n,i,r){if(Cs(r)){var o=n.attrs.tagId,s=e.state.tr,a=[],l=[];return e.state.doc.descendants(function(e,t){var n=e.marks.find(function(e){return e.attrs.tagId===o});n&&l.push({from:t,to:t+e.nodeSize,type:n.type}),e.type.name===k.RangeAnchor&&e.attrs.tagId===o&&a.push({from:t,to:t+e.nodeSize})}),l.forEach(function(e){var t=e.from,n=e.to,i=e.type;s.removeMark(t,n,i)}),a.sort(function(e,t){return t.from-e.from}).forEach(function(e){var t=e.from,n=e.to;s.delete(t,n)}),e.dispatch(s),!0}return!1}};Eo.registerNode(k.RangeAnchor,js);var Ds={group:"inline",attrs:{type:{default:k.Break,validate:"string"},value:{default:500,validate:"number"},label:{default:""}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){var t=e.attrs.label||"".concat(Number((e.attrs.value/1e3).toFixed(2)),"秒");return["b",{"data-id":ps(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(wo," ").concat(wo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},t]]},parseDOM:[{tag:"b[data-type='".concat(k.Break,"']"),getAttrs:function(e){var t=e.dataset.value,n=Number(t);if(t&&!Number.isNaN(n))return{label:"".concat(Number((n/1e3).toFixed(2)),"秒"),type:k.Break,value:n}}},{tag:"i.tts-mark-pause",getAttrs:function(e){var t=e.dataset.tts,n=Number(null==t?void 0:t.replace(/\[p|\]|\s/g,""));if(!Number.isNaN(n))return{label:"".concat(Number((n/1e3).toFixed(2)),"秒"),type:k.Break,value:n}}}]};Eo.registerNode(k.Break,Ds);var Rs={group:"inline",attrs:{type:{default:k.Breath,validate:"string"},value:{default:To[k.Breath]},label:{default:No[k.Breath]}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-id":ps(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(wo," ").concat(wo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label]]},parseDOM:[{tag:"b[data-type='".concat(k.Breath,"']"),getAttrs:function(e){return{label:No[k.Breath],type:k.Breath,value:To[k.Breath]}}},{tag:"i.tts-mark-segmentation",getAttrs:function(e){return{label:No[k.Breath],type:k.Breath,value:To[k.Breath]}}}]};Eo.registerNode(k.Breath,Rs);var Is={group:"inline",attrs:{type:{default:k.Phoneme,validate:"string"},value:{default:"",validate:"string"},text:{default:"",validate:"string"}},inline:!0,draggable:!0,selectable:!0,atom:!0,toDOM:function(e){return["b",{"data-type":e.attrs.type,"data-value":e.attrs.value,"data-text":e.attrs.text,class:"".concat(wo," ").concat(wo,"-").concat(e.attrs.type)},["span",{class:"tag-text"},e.attrs.text],["span",{class:"ssml-tag-label"},e.attrs.value]]},parseDOM:[{tag:"b[data-type='".concat(k.Phoneme,"']"),getAttrs:function(e){var t,n=e.dataset,i=n.value,r=n.text;return{text:null==r||null===(t=r.trim)||void 0===t?void 0:t.call(r),type:k.Phoneme,value:i}}},{tag:"i.tts-mark-annotation",getAttrs:function(e){var t,n,i,r=e.dataset.tts,o=null==r||null===(t=r.replace(/\[=|\]/g,""))||void 0===t?void 0:t.trim();return{type:k.Phoneme,text:null===(n=e.textContent)||void 0===n||null===(i=n.trim)||void 0===i?void 0:i.call(n),value:o}}}],leafText:function(e){return e.attrs.text}};Eo.registerNode(k.Phoneme,Is);var qs={group:"inline",attrs:{type:{default:k.SayAs,validate:"string"},interpretAs:{default:S.digits},text:{default:"",validate:"string"}},inline:!0,draggable:!1,selectable:!0,atom:!0,toDOM:function(e){var t;return["b",{"data-type":k.SayAs,"data-interpret-as":e.attrs.interpretAs,"data-text":e.attrs.text,class:"".concat(wo," ").concat(wo,"-say-as")},["span",{class:"tag-text"},e.attrs.text],["span",{class:"ssml-tag-label"},"".concat((null===(t=No[k.SayAs])||void 0===t?void 0:t[e.attrs.interpretAs])||"读法")]]},parseDOM:[{tag:"b.".concat(wo,"-say-as"),getAttrs:function(e){var t,n,i=e.dataset.interpretAs||S.digits;return{text:(null===(t=e.dataset.text)||void 0===t||null===(n=t.trim)||void 0===n?void 0:n.call(t))||"",type:k.SayAs,interpretAs:i}}},{tag:"b.".concat(wo,"-number"),getAttrs:function(e){var t,n=e.dataset,i=n.value,r=n.text,o={0:S.auto,1:S.digits,2:S.cardinal};return{text:null==r||null===(t=r.trim)||void 0===t?void 0:t.call(r),type:k.SayAs,interpretAs:o[null!=i?i:"1"]||S.digits}}},{tag:'i.mark-range-start[data-type="number"]',getAttrs:function(e){for(var t,n,i,r,o=e.dataset.tts,s=e.nextSibling,a="";s;){if(s.nodeType!==Node.TEXT_NODE&&"SPAN"!==s.nodeName){if(s.nodeType===Node.ELEMENT_NODE)break;break}var l;a+=s.textContent||"";var c=s;s=s.nextSibling,null===(l=c.parentNode)||void 0===l||l.removeChild(c)}if(!ws.test((null===(t=a)||void 0===t||null===(n=t.trim)||void 0===n?void 0:n.call(t))||""))return!1;var h={0:S.auto,1:S.digits,2:S.cardinal};return{text:null===(i=a)||void 0===i||null===(r=i.trim)||void 0===r?void 0:r.call(i),type:k.SayAs,interpretAs:h[null!=o?o:"1"]||S.digits}}}],leafText:function(e){return e.attrs.text}};Eo.registerNode(k.SayAs,qs);var Ps={group:"inline",attrs:{type:{default:k.Word,validate:"string"},value:{default:To[k.Word]},label:{default:No[k.Word]}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-id":ps(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(wo," ").concat(wo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label]]},parseDOM:[{tag:"b[data-type='".concat(k.Word,"']"),getAttrs:function(e){return{label:No[k.Word],type:k.Word,value:To[k.Word]}}},{tag:"i.tts-mark-continuity",getAttrs:function(e){return{label:No[k.Word],type:k.Word,value:To[k.Word]}}}]};Eo.registerNode(k.Word,Ps);var _s={attrs:{value:{default:"en-US"},tagId:{default:""}},inclusive:!0,group:w.textmedia,excludes:"".concat(k.SpeechLanguage),spanning:!0,toDOM:function(e){var t,n=e.attrs,i=n.value,r=n.tagId,o=(t=i.split("-")[0].toLowerCase(),["ar","he","fa","ur"].includes(t));return["span",{class:"".concat(ko," ").concat(ko,"-").concat(k.SpeechLanguage),"data-tag-id":r||ps(6),"data-type":k.SpeechLanguage,"data-value":i,dir:o?"rtl":"ltr"},0]},parseDOM:[{tag:"span[data-type='".concat(k.SpeechLanguage,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"en-US":n,r=t.tagId;return{value:i,tagId:void 0===r?ps(6):r}}},{tag:"lang",getAttrs:function(e){return{value:e.getAttribute("xml:lang")||e.getAttribute("lang")||"en-US",tagId:ps(6)}}},{tag:"span[lang]",getAttrs:function(e){return{value:e.getAttribute("lang")||"en-US",tagId:ps(6)}}}]};Eo.registerMark(k.SpeechLanguage,_s);var Ls={attrs:{value:{default:50},tagId:{default:""}},inclusive:!0,group:w.textmedia,excludes:"".concat(k.SpeechPitch),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(ko," ").concat(ko,"-").concat(k.SpeechPitch),"data-tag-id":i||ps(6),"data-type":k.SpeechPitch,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(k.SpeechPitch,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"50":n,r=t.tagId,o=void 0===r?ps(6):r;return{value:parseInt(i,10),tagId:o}}},{tag:"prosody[pitch]",getAttrs:function(e){var t=e.getAttribute("pitch")||"0",n=0;return n=(t.endsWith("%"),parseFloat(t)),{value:Math.max(0,Math.min(100,Math.round(50+n))),tagId:ps(6)}}}]};Eo.registerMark(k.SpeechPitch,Ls);var Bs={attrs:{value:{default:70},tagId:{default:""}},inclusive:!0,group:w.textmedia,excludes:"".concat(k.SpeechRate),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(ko," ").concat(ko,"-").concat(k.SpeechRate),"data-tag-id":i||ps(6),"data-type":k.SpeechRate,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(k.SpeechRate,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"70":n,r=t.tagId,o=void 0===r?ps(6):r;return{value:parseInt(i,10),tagId:o}}},{tag:"prosody[rate]",getAttrs:function(e){var t=e.getAttribute("rate")||"1.0",n=1;return n=t.endsWith("%")?parseFloat(t)/100:parseFloat(t),{value:Math.max(40,Math.min(100,Math.round(70+60*(n-1)))),tagId:ps(6)}}}]};Eo.registerMark(k.SpeechRate,Bs);var Fs={attrs:{value:{default:50},tagId:{default:""}},inclusive:!0,group:w.textmedia,excludes:"".concat(k.SpeechVolume),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(ko," ").concat(ko,"-").concat(k.SpeechVolume),"data-tag-id":i||ps(6),"data-type":k.SpeechVolume,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(k.SpeechVolume,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"50":n,r=t.tagId,o=void 0===r?ps(6):r;return{value:parseInt(i,10),tagId:o}}},{tag:"prosody[volume]",getAttrs:function(e){var t=e.getAttribute("volume")||"50",n=50;return n=(t.endsWith("%"),parseFloat(t)),{value:Math.max(0,Math.min(100,Math.round(n))),tagId:ps(6)}}}]};Eo.registerMark(k.SpeechVolume,Fs);var Vs={attrs:{src:{default:""},mediaType:{default:"image"},extra:{default:""},name:{default:""},tagId:{default:""}},inclusive:!1,group:w.textmedia,excludes:w.textmedia,toDOM:function(e){var t=e.attrs,n=t.mediaType,i=t.src,r=t.name,o=t.tagId,s=e.attrs.extra||"",a="string";return s&&"[object String]"!==Object.prototype.toString.call(s)&&(s=JSON.stringify(s),a="json"),["span",{class:"".concat(ko," ").concat(ko,"-").concat(w.textmedia),"data-tag-id":o,"data-name":fs(r||""),"data-type":w.textmedia,"data-extra":fs("".concat(s||"")),"data-extra-type":a,"data-media-type":n,"data-media-src":fs("".concat(i||""))},0]},parseDOM:[{tag:"span[data-type='".concat(w.textmedia,"']"),getAttrs:function(e){var t=e.dataset,n=t.name,i=void 0===n?"":n,r=t.mediaSrc,o=void 0===r?"":r,s=t.tagId,a=void 0===s?"":s,l=t.mediaType,c=void 0===l?"image":l,h=t.extra,u=t.extraType,d=ms(h||"");if("json"===u)try{d=JSON.parse(d)}catch(e){A.warn("parse dataExtra fail",e)}return{tagId:a,src:o||"",name:ms(i),mediaType:c,extra:d}}}]};Eo.registerMark(w.textmedia,Vs);const Ws=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function $s(e,t,n=!1){for(let i=e;i;i="start"==t?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&1!=i.childCount)return!1}return!1}function Js(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Us(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function Hs(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Ks=(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof _t&&e.selection.node.isBlock)return!(!n.parentOffset||!ft(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let r,o,s=[],a=!1,l=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){a=n.end(e)==n.pos+(n.depth-e),l=n.start(e)==n.pos-(n.depth-e),o=Hs(n.node(e-1).contentMatchAt(n.indexAfter(e-1))),s.unshift(a&&o?{type:o}:null),r=e;break}if(1==e)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof qt||e.selection instanceof Bt)&&c.deleteSelection();let h=c.mapping.map(n.pos),u=ft(c.doc,h,s.length,s);if(u||(s[0]=o?{type:o}:null,u=ft(c.doc,h,s.length,s)),!u)return!1;if(c.split(h,s.length,s),!a&&l&&n.node(r).type!=o){let e=c.mapping.map(n.before(r)),t=c.doc.resolve(e);o&&n.node(r-1).canReplaceWith(t.index(),t.index()+1,o)&&c.setNodeMarkup(c.mapping.map(n.before(r)),o)}return t&&t(c.scrollIntoView()),!0};function Gs(e,t,n,i){let r,o,s=t.nodeBefore,a=t.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(e,t,n){let i=t.nodeBefore,r=t.nodeAfter,o=t.index();return!(!(i&&r&&i.type.compatibleContent(r.type))||(!i.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!r.isTextblock&&!mt(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(r=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){let i=t.pos+a.nodeSize,o=L.empty;for(let e=r.length-1;e>=0;e--)o=L.from(r[e].create(null,o));o=L.from(s.copy(o));let l=e.tr.step(new at(t.pos-1,i,t.pos,i,new J(o,1,0),r.length,!0)),c=l.doc.resolve(i+2*r.length);c.nodeAfter&&c.nodeAfter.type==s.type&&mt(l.doc,c.pos)&&l.join(c.pos),n(l.scrollIntoView())}return!0}let h=a.type.spec.isolating||i>0&&l?null:jt.findFrom(t,1),u=h&&h.$from.blockRange(h.$to),d=u&&ut(u);if(null!=d&&d>=t.depth)return n&&n(e.tr.lift(u,d).scrollIntoView()),!0;if(c&&$s(a,"start",!0)&&$s(s,"end")){let i=s,r=[];for(;r.push(i),!i.isTextblock;)i=i.lastChild;let o=a,l=1;for(;!o.isTextblock;o=o.firstChild)l++;if(i.canReplace(i.childCount,i.childCount,o.content)){if(n){let i=L.empty;for(let e=r.length-1;e>=0;e--)i=L.from(r[e].copy(i));n(e.tr.step(new at(t.pos-r.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new J(i,r.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Ys(e){return function(t,n){let i=t.selection,r=e<0?i.$from:i.$to,o=r.depth;for(;r.node(o).isInline;){if(!o)return!1;o--}return!!r.node(o).isTextblock&&(n&&n(t.tr.setSelection(qt.create(t.doc,e<0?r.start(o):r.end(o)))),!0)}}const Xs=Ys(-1),Zs=Ys(1);function Qs(...e){return function(t,n,i){for(let r=0;r<e.length;r++)if(e[r](t,n,i))return!0;return!1}}let ea=Qs(Ws,(e,t,n)=>{let i=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!i)return!1;let r=Js(i);if(!r){let n=i.blockRange(),r=n&&ut(n);return null!=r&&(t&&t(e.tr.lift(n,r).scrollIntoView()),!0)}let o=r.nodeBefore;if(Gs(e,r,t,-1))return!0;if(0==i.parent.content.size&&($s(o,"end")||_t.isSelectable(o)))for(let n=i.depth;;n--){let s=gt(e.doc,i.before(n),i.after(n),J.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection($s(o,"end")?jt.findFrom(n.doc.resolve(n.mapping.map(r.pos,-1)),-1):_t.create(n.doc,r.pos-o.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||i.node(n-1).childCount>1)break}return!(!o.isAtom||r.depth!=i.depth-1)&&(t&&t(e.tr.delete(r.pos-o.nodeSize,r.pos).scrollIntoView()),!0)},(e,t,n)=>{let{$head:i,empty:r}=e.selection,o=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;o=Js(i)}let s=o&&o.nodeBefore;return!(!s||!_t.isSelectable(s))&&(t&&t(e.tr.setSelection(_t.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)}),ta=Qs(Ws,(e,t,n)=>{let i=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}(e,n);if(!i)return!1;let r=Us(i);if(!r)return!1;let o=r.nodeAfter;if(Gs(e,r,t,1))return!0;if(0==i.parent.content.size&&($s(o,"start")||_t.isSelectable(o))){let n=gt(e.doc,i.before(),i.after(),J.empty);if(n&&n.slice.size<n.to-n.from){if(t){let i=e.tr.step(n);i.setSelection($s(o,"start")?jt.findFrom(i.doc.resolve(i.mapping.map(r.pos)),1):_t.create(i.doc,i.mapping.map(r.pos))),t(i.scrollIntoView())}return!0}}return!(!o.isAtom||r.depth!=i.depth-1)&&(t&&t(e.tr.delete(r.pos,r.pos+o.nodeSize).scrollIntoView()),!0)},(e,t,n)=>{let{$head:i,empty:r}=e.selection,o=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;o=Us(i)}let s=o&&o.nodeAfter;return!(!s||!_t.isSelectable(s))&&(t&&t(e.tr.setSelection(_t.create(e.doc,o.pos)).scrollIntoView()),!0)});const na={Enter:Qs((e,t)=>{let{$head:n,$anchor:i}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(i))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)},(e,t)=>{let n=e.selection,{$from:i,$to:r}=n;if(n instanceof Bt||i.parent.inlineContent||r.parent.inlineContent)return!1;let o=Hs(r.parent.contentMatchAt(r.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(qt.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(ft(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),r=i&&ut(i);return null!=r&&(t&&t(e.tr.lift(i,r).scrollIntoView()),!0)},Ks),"Mod-Enter":(e,t)=>{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),o=n.indexAfter(-1),s=Hs(r.contentMatchAt(o));if(!s||!r.canReplaceWith(o,o,s))return!1;if(t){let i=n.after(),r=e.tr.replaceWith(i,i,s.createAndFill());r.setSelection(jt.near(r.doc.resolve(i),1)),t(r.scrollIntoView())}return!0},Backspace:ea,"Mod-Backspace":ea,"Shift-Backspace":ea,Delete:ta,"Mod-Delete":ta,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Bt(e.doc))),!0)},ia={"Ctrl-h":na.Backspace,"Alt-Backspace":na["Mod-Backspace"],"Ctrl-d":na.Delete,"Ctrl-Alt-Backspace":na["Mod-Delete"],"Alt-Delete":na["Mod-Delete"],"Alt-d":na["Mod-Delete"],"Ctrl-a":Xs,"Ctrl-e":Zs};for(let e in na)ia[e]=na[e];const ra=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?ia:na;for(var oa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},sa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},aa="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),la="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ca=0;ca<10;ca++)oa[48+ca]=oa[96+ca]=String(ca);for(ca=1;ca<=24;ca++)oa[ca+111]="F"+ca;for(ca=65;ca<=90;ca++)oa[ca]=String.fromCharCode(ca+32),sa[ca]=String.fromCharCode(ca);for(var ha in oa)sa.hasOwnProperty(ha)||(sa[ha]=oa[ha]);const ua="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),da="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function pa(e){let t,n,i,r,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))r=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))i=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);ua?r=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),r&&(s="Meta-"+s),i&&(s="Shift-"+s),s}function fa(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function ma(e){return new Xt({props:{handleKeyDown:ga(e)}})}function ga(e){let t=function(e){let t=Object.create(null);for(let n in e)t[pa(n)]=e[n];return t}(e);return function(e,n){let i,r=function(e){var t=!(aa&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||la&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?sa:oa)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=t[fa(r,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==r.length&&" "!=r){if(n.shiftKey){let i=t[fa(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(da&&n.ctrlKey&&n.altKey)&&(i=oa[n.keyCode])&&i!=r){let r=t[fa(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var ya=function(){return o(function e(){i(this,e),s(this,"events",new Map)},[{key:"on",value:function(e,t){var n;this.events.has(e)||this.events.set(e,new Set),null===(n=this.events.get(e))||void 0===n||n.add(t)}},{key:"off",value:function(e,t){var n=this.events.get(e);n&&(n.delete(t),0===n.size&&this.events.delete(e))}},{key:"emit",value:function(e,t){var n=this.events.get(e);n&&n.forEach(function(e){return e(t)})}},{key:"removeAllListeners",value:function(e){e?this.events.delete(e):this.events.clear()}}])}(),va=function(e){return e.StateChange="stateChange",e.WordCount="wordCount",e.Focus="focus",e.Blur="blur",e.Error="error",e.SelectionUpdate="selectionUpdate",e.ContextMenu="contextMenu",e.PluginTextMediaClick="plugin.textmedia_click",e}({});function xa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.margin,i=void 0===n?12:n,r=t.offset,o=void 0===r?8:r,s=t.menuWidth,a=void 0===s?200:s,l=t.menuHeight,c=void 0===l?40:l,h="undefined"!=typeof window?window.innerWidth:1920,u=(e.left+e.right)/2;u-a/2<i?u=a/2+i:u+a/2>h-i&&(u=h-a/2-i);var d,p,f=c+i+o,m=!1;return e.top<f?(d=e.bottom+o,p="translate(-50%, 0)",m=!0):(d=e.top-o,p="translate(-50%, -100%)",m=!1),{left:u,top:d,transform:p,isFlipped:m}}var ba=new en("contextMenu"),wa=function(){function e(t,r){i(this,e);var o=null;return n(this,e,[{key:ba,props:{handleDOMEvents:{contextmenu:function(e,n){var i,s;n.preventDefault(),o||((o=document.createElement("div")).style.position="fixed",o.style.zIndex="10000",o.className="ssml-editor-context-menu-container",document.body.appendChild(o));var a=e.posAtCoords({left:n.clientX,top:n.clientY}),l={left:n.clientX,top:n.clientY},c=xa({left:n.clientX,right:n.clientX,top:n.clientY,bottom:n.clientY,width:0,height:0},{menuWidth:o.offsetWidth||150,menuHeight:o.offsetHeight||200,offset:2});o.style.left="".concat(c.left,"px"),o.style.top="".concat(c.top,"px"),c.isFlipped?o.style.transform="translate(0, -100%)":o.style.transform="none";var h=void 0;if(a){var u=e.state.doc.resolve(a.pos),p=u.nodeAfter||u.nodeBefore||u.parent;p&&(h={type:p.type.name,attrs:p.attrs})}var f=e.state.selection,m=!!a&&(a.pos>=f.from&&a.pos<=f.to),g={isActive:!0,event:n,pos:null!==(i=null==a?void 0:a.pos)&&void 0!==i?i:0,coords:l,node:h,selection:{from:f.from,to:f.to,text:e.state.doc.textBetween(f.from,f.to," "),content:e.state.doc.slice(f.from,f.to).toJSON(),isClickInside:!f.empty&&m},target:o};t.emit(va.ContextMenu,g),null===(s=r.onRender)||void 0===s||s.call(r,o,g);var y=function(e){var t;if(null===(t=o)||void 0===t||!t.contains(e.target)){var n;if(o)null===(n=r.onRender)||void 0===n||n.call(r,o,d(d({},g),{},{isActive:!1}));window.removeEventListener("mousedown",y)}};return window.addEventListener("mousedown",y),!0}}},view:function(){return{destroy:function(){o&&o.remove()}}}}])}return c(e,Xt),o(e)}(),ka=new en("floatingMenu"),Sa=function(){function e(t,r){i(this,e);var o=!1,s=!1;return n(this,e,[{key:ka,state:{init:function(){return{prevent:!1}},apply:function(e,t){var n=e.getMeta(Mo);return void 0!==n?{prevent:!!n}:e.docChanged||e.selectionSet?{prevent:!1}:t}},props:{handleDOMEvents:{pointerdown:function(){return o=!0,s=!1,!1},pointerup:function(e){return o=!1,e.isDestroyed||e.dispatch(e.state.tr),!1},contextmenu:function(e){return s=!0,e.isDestroyed||e.dispatch(e.state.tr),!1}}},view:function(e){return new za(e,t,r,function(){return{isMouseDown:o,isContextMenuOpen:s,isPopoverVisible:us.isVisible()}})}}])}return c(e,Xt),o(e)}(),za=function(){return o(function e(t,n,r,o){i(this,e),this.editor=n,this.options=r,this.getContext=o,this.mountPoint=document.createElement("div"),this.mountPoint.style.position="fixed",this.mountPoint.style.zIndex="9999",this.mountPoint.style.pointerEvents="auto",this.mountPoint.className="ssml-editor-floating-menu-container",this.update(t)},[{key:"ensureAttached",value:function(){this.mountPoint.parentNode||document.body.appendChild(this.mountPoint)}},{key:"update",value:function(e){var t,n,i=e.state,r=i.selection,o=this.getContext(),s=!1;if(this.options.shouldShow)s=this.options.shouldShow(e,o);else if(s=!r.empty&&e.hasFocus()&&!o.isMouseDown&&!o.isContextMenuOpen&&!o.isPopoverVisible){var a=ka.getState(i);if(null!=a&&a.prevent&&(s=!1),r instanceof _t){var l=r.node.type.name;l!==k.SayAs&&l!==k.Phoneme||(s=!1)}}var c,h,u=r.from,d=r.to,p=i.doc.textBetween(u,d," "),f=i.doc.slice(u,d).toJSON();if(!s)return null===(c=(h=this.options).onRender)||void 0===c||c.call(h,this.mountPoint,{isActive:!1,rect:null,from:u,to:d,text:p,content:f,target:this.mountPoint,isFlipped:!1}),void this.editor.emit(va.SelectionUpdate,{isActive:!1,rect:null,from:u,to:d,text:p,content:f});this.ensureAttached();var m=e.coordsAtPos(u),g=e.coordsAtPos(d),y={left:Math.min(m.left,g.left),right:Math.max(m.right,g.right),top:Math.min(m.top,g.top),bottom:Math.max(m.bottom,g.bottom),width:Math.abs(g.left-m.left),height:Math.abs(g.bottom-m.top)},v=xa(y,{menuWidth:this.mountPoint.offsetWidth||200,menuHeight:this.mountPoint.offsetHeight||40});this.mountPoint.style.left="".concat(v.left,"px"),this.mountPoint.style.top="".concat(v.top,"px"),this.mountPoint.style.transform=v.transform;var x={isActive:!0,rect:y,from:u,to:d,text:p,content:f,target:this.mountPoint,isFlipped:v.isFlipped};null===(t=(n=this.options).onRender)||void 0===t||t.call(n,this.mountPoint,x),this.editor.emit(va.SelectionUpdate,x)}},{key:"destroy",value:function(){this.mountPoint.remove()}}])}(),Ca=new en("maxLength"),Ma=function(){function e(t,r){var o;return i(this,e),s(o=n(this,e,[{key:Ca,state:{init:function(e,n){var i=o.calculateCount(n.doc);return t.emit("wordCount",{count:i,exceeded:o.config.maxLength<=i}),{count:i}},apply:function(e,t){var n=o.calculateCount(e.doc);return e.docChanged?{count:n}:t}},props:{handleDOMEvents:{compositionstart:function(){return o.isComposing=!0,!1},compositionend:function(e){o.isComposing=!1;var n=e.state,i=o.calculateCount(n.doc);if(i>o.config.maxLength){var r=n.tr;o.truncateDocument(r,n.doc,n.schema),e.dispatch(r),t.emit("wordCount",{count:o.config.maxLength,exceeded:!0})}else t.emit("wordCount",{count:i,exceeded:!1});return!1}}},filterTransaction:function(e,n){if(e.docChanged){if(o.isComposing)return!0;var i=e.doc,r=o.calculateCount(i);if(r>=o.config.maxLength){var s=o.calculateCount(n.doc);if(s>=o.config.maxLength&&r>s)return t.emit("wordCount",{count:o.config.maxLength,exceeded:!0}),!1}if(r>o.config.maxLength)return o.truncateDocument(e,i,n.schema),t.emit("wordCount",{count:o.config.maxLength,exceeded:!0}),!0;t.emit("wordCount",{count:r,exceeded:!1})}return!0}}]),"config",{countBreak:!0,countSpaces:!0,excludeNodes:["paragraph"],maxLength:2e4}),s(o,"isComposing",!1),o.config=d(d({},o.config),r),o}return c(e,Xt),o(e,[{key:"maxLength",set:function(e){this.config.maxLength=e}},{key:"truncateDocument",value:function(e,t,n){var i=this.calculateCount(t)-this.config.maxLength;if(!(i<=0)){for(var r=e.selection.to,o=0,s=r,a=null,l=r-1;l>=0&&o<i;l-=1)try{var c=t.resolve(l),h=t.resolve(l+1),u=this.hasCountableCharBetween(t,c,h);if(u&&(o+=u,s=l),o>i)a=h.nodeBefore}catch(e){}if(s<r&&o>0){if(e.delete(s,r),a){var d,p=(null===(d=a.attrs.text)||void 0===d?void 0:d.slice(0,o-i))||"";p&&(e.insert(s,n.text(p)),s+=p.length)}var f=e.doc.resolve(s);e.setSelection(qt.near(f))}}}},{key:"hasCountableCharBetween",value:function(e,t,n){var i=t.pos;if(n.pos-i!==1)return 0;var r,o,s=n.nodeBefore;return null!=s&&s.isText?s.text.length?1:0:"paragraph"===(null==s?void 0:s.type.name)||(null==s?void 0:s.type.name)===k.Phoneme?1:((null==s?void 0:s.type.name)===k.SayAs||(null==s?void 0:s.type.name)===k.Sub||"sayas"===(null==s?void 0:s.type.name)||"number"===(null==s?void 0:s.type.name)||"alias"===(null==s?void 0:s.type.name))&&((null===(r=s.attrs.text)||void 0===r?void 0:r.length)||(null===(o=s.attrs.value)||void 0===o?void 0:o.length))||0}},{key:"shouldCount",value:function(e,t){var n,i=null==e?void 0:e.type.name;return"paragraph"===i&&t&&t.lastChild!==e?{count:!0,text:"\n"}:!e.isLeaf||null!==(n=this.config.excludeNodes)&&void 0!==n&&n.includes(e.type.name)?{count:!1,text:""}:e.isText?{count:!0,text:e.text||""}:i===k.Phoneme||i===k.SayAs||"sayas"===i||"number"===i?{count:!0,text:e.attrs.text||""}:i===k.Sub||"alias"===i?{count:!0,text:e.attrs.value||e.attrs.text||""}:{count:!0,text:e.text||""}}},{key:"calculateCount",value:function(e){var t=this,n="";return e.descendants(function(e,i,r){var o=t.shouldCount(e,r),s=o.text;o.count&&(n+=s||"")}),n.length}}])}(),Na=new en("placeholder");var Ta=function(){return o(function e(){i(this,e),s(this,"editable",!0),this.editable=!0},[{key:"setEditable",value:function(e){this.editable=e}},{key:"getEditable",value:function(){return this.editable}}])}();function Oa(e){return e.type.name===k.Phoneme||e.type.name===k.SayAs||e.type.name===k.Sub}function Ea(e){return e.type.name===k.Break||e.type.name===k.Word||e.type.name===k.Breath||e.type.name===k.Action||e.type.name===k.Emotion||e.type.name===k.Command||"expression"===e.type.name}
3
+ var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var l=i&&i.prototype instanceof a?i:a,c=Object.create(l.prototype);return f(c,"_invoke",function(n,i,r){var o,a,l,c=0,h=r||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,a=0,l=e,d.n=n,s}};function p(n,i){for(a=n,l=i,t=0;!u&&c&&!r&&t<h.length;t++){var r,o=h[t],p=d.p,f=o[2];n>3?(r=f===i)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=p&&((r=n<2&&p<o[1])?(a=0,d.v=i,d.n=o[1]):p<f&&(r=n<3||o[0]>i||i>f)&&(o[4]=n,o[5]=i,d.n=f,a=0))}if(r||n>1)return s;throw u=!0,i}return function(r,h,f){if(c>1)throw TypeError("Generator is already running");for(u&&1===h&&p(h,f),a=h,l=f;(t=a<2?e:l)||!u;){o||(a?a<3?(a>1&&(d.n=-1),p(a,l)):d.n=l:d.v=l);try{if(c=2,o){if(a||(r="next"),t=o[r]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),a=1);o=e}else if((t=(u=d.n<0)?l:n.call(i,d))!==s)break}catch(t){o=e,a=1,l=t}finally{c=1}}return{value:t,done:u}}}(n,r,o),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(f(t={},i,function(){return this}),t),u=c.prototype=a.prototype=Object.create(h);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,r,"GeneratorFunction")),e.prototype=Object.create(u),e}return l.prototype=c,f(u,"constructor",c),f(c,"constructor",l),l.displayName="GeneratorFunction",f(c,r,"GeneratorFunction"),f(u),f(u,r,"Generator"),f(u,i,function(){return this}),f(u,"toString",function(){return"[object Generator]"}),(p=function(){return{w:o,m:d}})()}function f(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}f=function(e,t,n,i){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,i)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||b(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function x(e){return x="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},x(e)}function b(t,n){if(t){if("string"==typeof t)return e(t,n);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?e(t,n):void 0}}var w=function(e){return e.phoneme_mark="phoneme_mark",e.highlight="highlight",e.textmedia="textmedia",e.tts_speed="tts_speed",e.tts_pitch="tts_pitch",e.tts_volume="tts_volume",e.word_mark="word_mark",e}({}),k=function(e){return e.Word="word",e.Breath="breath",e.Break="break",e.Phoneme="phoneme",e.SayAs="say-as",e.Number="say-as",e.Sub="sub",e.Alias="sub",e.Speaker="speaker",e.SpeechRate="speed",e.SpeechPitch="pitch",e.SpeechVolume="volume",e.SpeechLanguage="lang",e.Action="action",e.Avatar="avatar",e.Emotion="emotion",e.Command="command",e.Data="data",e.Wait="wait",e.PptControl="ppt_control",e.SoundEvent="soundEvent",e.RangeAnchor="range_anchor",e}({}),S=function(e){return e.auto="auto",e.cardinal="cardinal",e.digits="digits",e}({}),z=function(e){return e[e.auto=0]="auto",e[e.digits=1]="digits",e[e.cardinal=2]="cardinal",e}({}),C=function(e){return e.insertAction="insertAction",e.clearAction="clearAction",e}({}),M=function(e){return e.setSpeechRate="setSpeechRate",e}({}),N=function(e){return e.setSpeechPitch="setSpeechPitch",e}({}),T=function(e){return e.setSpeechVolume="setSpeechVolume",e}({}),O=function(e){return e.setSpeechLanguage="setSpeechLanguage",e}({}),E=function(e){return e[e.ERROR=0]="ERROR",e[e.WARN=1]="WARN",e[e.INFO=2]="INFO",e[e.DEBUG=3]="DEBUG",e}({}),A=new(function(){return o(function e(){i(this,e),s(this,"level",E.WARN),s(this,"prefix","[XSSML Editor]")},[{key:"setLevel",value:function(e){this.level=e}},{key:"getLevel",value:function(){return this.level}},{key:"error",value:function(e){if(this.level>=E.ERROR){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=console).error.apply(t,[this.prefix,e].concat(i))}}},{key:"warn",value:function(e){if(this.level>=E.WARN){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=console).warn.apply(t,[this.prefix,e].concat(i))}}},{key:"info",value:function(e){if(this.level>=E.INFO){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=console).info.apply(t,[this.prefix,e].concat(i))}}},{key:"debug",value:function(e){if(this.level>=E.DEBUG){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=console).log.apply(t,[this.prefix,"[DEBUG]",e].concat(i))}}}])}()),j=new(function(){function e(){i(this,e),s(this,"commands",new Map)}return o(e,[{key:"register",value:function(e){var t=e.name;this.commands.has(t)&&A.warn("Command ".concat(t," already registered, overwriting...")),this.commands.set(t,e)}},{key:"unregister",value:function(e){this.commands.delete(e)}},{key:"get",value:function(e){return this.commands.get(e)}},{key:"getAll",value:function(){return Object.fromEntries(this.commands)}},{key:"execute",value:function(e,t){var n=this.commands.get(e);if(!n)return{success:!1,error:"Command ".concat(e," not found")};for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];if(n.validate){var s=n.validate.apply(n,[t].concat(r)),a=s.reason;if(!s.available)return{success:!1,error:a}}try{return n.execute.apply(n,[t].concat(r))}catch(e){return{success:!1,error:e instanceof Error?e.message:"Unknown error"}}}},{key:"clone",value:function(){var t=new e;return this.commands.forEach(function(e,n){return t.register(e)}),t}}])}());function D(e){j.register(e)}var R=function(e){return e.all="all",e.selection="selection",e.cursorRight="cursor_right",e}({}),I=function(e){return e[e.Success=0]="Success",e[e.ParamsMissing=1e5]="ParamsMissing",e[e.ParamsInvalid=100001]="ParamsInvalid",e[e.SelectionInvalid=100002]="SelectionInvalid",e[e.CursorInvalid=100003]="CursorInvalid",e[e.StateError=100004]="StateError",e[e.CommandNotFound=100005]="CommandNotFound",e[e.ExecutionError=999999]="ExecutionError",e}({});function q(e){this.content=e}function P(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let r=e.child(i),o=t.child(i);if(r!=o){if(!r.sameMarkup(o))return n;if(r.isText&&r.text!=o.text){for(let e=0;r.text[e]==o.text[e];e++)n++;return n}if(r.content.size||o.content.size){let e=P(r.content,o.content,n+1);if(null!=e)return e}n+=r.nodeSize}else n+=r.nodeSize}}function _(e,t,n,i){for(let r=e.childCount,o=t.childCount;;){if(0==r||0==o)return r==o?null:{a:n,b:i};let s=e.child(--r),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:i};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,i--;return{a:n,b:i}}if(s.content.size||a.content.size){let e=_(s.content,a.content,n-1,i-1);if(e)return e}n-=l,i-=l}else n-=l,i-=l}}D({name:C.insertAction,description:"插入动作",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Action].create(d(d({},n),{},{type:k.Action}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Action])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"光标处插入设置动作"}}}),D({name:C.clearAction,description:"清空动作",execute:function(e){var t=e.state,n=e.dispatch;if(n){var i=t.tr,r=t.doc,o=t.schema,s=[];r.descendants(function(e,t){e.type===o.nodes[k.Action]&&s.push({node:e,pos:t})});for(var a=s.length-1;a>=0;a-=1){var l=s[a],c=l.node,h=l.pos;i.delete(h,h+c.nodeSize)}n(i.scrollIntoView())}return{success:!0}},validate:function(e){return{available:!0}}}),q.prototype={constructor:q,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,r=i.find(e),o=i.content.slice();return-1==r?o.push(n||e,t):(o[r+1]=t,n&&(o[r]=n)),new q(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new q(n)},addToStart:function(e,t){return new q([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new q(n)},addBefore:function(e,t,n){var i=this.remove(t),r=i.content.slice(),o=i.find(e);return r.splice(-1==o?r.length:o,0,t,n),new q(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=q.from(e)).size?new q(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=q.from(e)).size?new q(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=q.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},q.from=function(e){if(e instanceof q)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new q(t)};class L{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,i=0,r){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,i+s,r||null,o)&&a.content.size){let r=s+1;a.nodesBetween(Math.max(0,e-r),Math.min(a.content.size,t-r),n,i+r)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let r="",o=!0;return this.nodesBetween(e,t,(s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?i?"function"==typeof i?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!1:r+=n),r+=l},0),r}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),r=1);r<e.content.length;r++)i.push(e.content[r]);return new L(i,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],i=0;if(t>e)for(let r=0,o=0;o<t;r++){let s=this.content[r],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),i+=s.nodeSize),o=a}return new L(n,i)}cutByIndex(e,t){return e==t?L.empty:0==e&&t==this.content.length?this:new L(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),r=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new L(i,r)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return P(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return _(this,e,t,n)}findIndex(e){if(0==e)return F(0,e);if(e==this.size)return F(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=n+this.child(t).nodeSize;if(i>=e)return i==e?F(t+1,i):F(t,n);n=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return L.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.empty;let t,n=0;for(let i=0;i<e.length;i++){let r=e[i];n+=r.nodeSize,i&&r.isText&&e[i-1].sameMarkup(r)?(t||(t=e.slice(0,i)),t[t.length-1]=r.withText(t[t.length-1].text+r.text)):t&&t.push(r)}return new L(t||e,n)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const B={index:0,offset:0};function F(e,t){return B.index=e,B.offset=t,B}function V(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!V(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!V(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class W{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let r=e[i];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,i));else{if(r.type.excludes(this.type))return e;!n&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(r)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&V(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return W.none;if(e instanceof W)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}W.none=[];class $ extends Error{}class J{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=H(this.content,e+this.openStart,t);return n&&new J(n,this.openStart,this.openEnd)}removeBetween(e,t){return new J(U(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return J.empty;let n=t.openStart||0,i=t.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new J(L.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)i++;return new J(e,n,i)}}function U(e,t,n){let{index:i,offset:r}=e.findIndex(t),o=e.maybeChild(i),{index:s,offset:a}=e.findIndex(n);if(r==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(i,o.copy(U(o.content,t-r-1,n-r-1)))}function H(e,t,n,i){let{index:r,offset:o}=e.findIndex(t),s=e.maybeChild(r);if(o==t||s.isText)return i&&!i.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=H(s.content,t-o-1,n,s);return a&&e.replaceChild(r,s.copy(a))}function K(e,t,n){if(n.openStart>e.depth)throw new $("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new $("Inconsistent open depths");return G(e,t,n,0)}function G(e,t,n,i){let r=e.index(i),o=e.node(i);if(r==t.index(i)&&i<e.depth-n.openStart){let s=G(e,t,n,i+1);return o.copy(o.content.replaceChild(r,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=i||t.depth!=i){let{start:r,end:s}=function(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)i=t.node(e).copy(L.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(n,e);return ee(o,te(e,r,s,t,i))}{let i=e.parent,r=i.content;return ee(i,r.cut(0,e.parentOffset).append(n.content).append(r.cut(t.parentOffset)))}}return ee(o,ne(e,t,i))}function Y(e,t){if(!t.type.compatibleContent(e.type))throw new $("Cannot join "+t.type.name+" onto "+e.type.name)}function X(e,t,n){let i=e.node(n);return Y(i,t.node(n)),i}function Z(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Q(e,t,n,i){let r=(t||e).node(n),o=0,s=t?t.index(n):r.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Z(e.nodeAfter,i),o++));for(let e=o;e<s;e++)Z(r.child(e),i);t&&t.depth==n&&t.textOffset&&Z(t.nodeBefore,i)}function ee(e,t){return e.type.checkContent(t),e.copy(t)}function te(e,t,n,i,r){let o=e.depth>r&&X(e,t,r+1),s=i.depth>r&&X(n,i,r+1),a=[];return Q(null,e,r,a),o&&s&&t.index(r)==n.index(r)?(Y(o,s),Z(ee(o,te(e,t,n,i,r+1)),a)):(o&&Z(ee(o,ne(e,t,r+1)),a),Q(t,n,r,a),s&&Z(ee(s,ne(n,i,r+1)),a)),Q(i,null,r,a),new L(a)}function ne(e,t,n){let i=[];if(Q(null,e,n,i),e.depth>n){Z(ee(X(e,t,n+1),ne(e,t,n+1)),i)}return Q(t,null,n,i),new L(i)}J.empty=new J(L.empty,0,0);class ie{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],i=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)i+=n.child(t).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return W.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let e=n;n=i,i=e}let r=n.marks;for(var o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||i&&r[o].isInSet(i.marks)||(r=r[o--].removeFromSet(r));return r}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var r=0;r<n.length;r++)!1!==n[r].type.spec.inclusive||i&&n[r].isInSet(i.marks)||(n=n[r--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ae(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,r=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(r),s=r-o;if(n.push(t,e,i+o),!s)break;if(t=t.child(e),t.isText)break;r=s-1,i+=o+1}return new ie(t,n,r)}static resolveCached(e,t){let n=se.get(e);if(n)for(let e=0;e<n.elts.length;e++){let i=n.elts[e];if(i.pos==t)return i}else se.set(e,n=new re);let i=n.elts[n.i]=ie.resolve(e,t);return n.i=(n.i+1)%oe,i}}class re{constructor(){this.elts=[],this.i=0}}const oe=12,se=new WeakMap;class ae{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const le=Object.create(null);let ce=class e{constructor(e,t,n,i=W.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||L.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&V(this.attrs,t||e.defaultAttrs||le)&&W.sameSet(this.marks,n||W.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return J.empty;let i=this.resolve(e),r=this.resolve(t),o=n?0:i.sharedDepth(t),s=i.start(o),a=i.node(o).content.cut(i.pos-s,r.pos-s);return new J(a,i.depth-o,r.depth-o)}replace(e,t,n){return K(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return ie.resolveCached(this,e)}resolveNoCache(e){return ie.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ue(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=L.empty,i=0,r=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,r),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=i;e<r;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let r=this.contentMatchAt(e).matchType(n),o=r&&r.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=W.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!W.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=L.fromJSON(e,t.content),r=e.nodeType(t.type).create(t.attrs,i,n);return r.type.checkAttrs(r.attrs),r}};ce.prototype.text=void 0;class he extends ce{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ue(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new he(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new he(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ue(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class de{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new pe(e,t);if(null==n.next)return de.empty;let i=fe(n);n.next&&n.err("Unexpected trailing text");let r=function(e){let t=Object.create(null);return n(be(e,0));function n(i){let r=[];i.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let i;for(let e=0;e<r.length;e++)r[e][0]==t&&(i=r[e][1]);be(e,n).forEach(e=>{i||r.push([t,i=[]]),-1==i.indexOf(e)&&i.push(e)})})});let o=t[i.join(",")]=new de(i.indexOf(e.length-1)>-1);for(let e=0;e<r.length;e++){let i=r[e][1].sort(xe);o.next.push({type:r[e][0],next:t[i.join(",")]||n(i)})}return o}}(function(e){let t=[[]];return r(o(e,0),n()),t;function n(){return t.push([])-1}function i(e,n,i){let r={term:i,to:n};return t[e].push(r),r}function r(e,t){e.forEach(e=>e.to=t)}function o(e,t){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(o(n,t)),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return i(t,s),r(o(e.expr,s),s),[i(s)]}if("plus"==e.type){let s=n();return r(o(e.expr,t),s),r(o(e.expr,s),s),[i(s)]}if("opt"==e.type)return[i(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();r(o(e.expr,s),t),s=t}if(-1==e.max)r(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();i(s,t),r(o(e.expr,s),t),s=t}return[i(s)]}if("name"==e.type)return[i(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let i=0;;i++){let s=o(e.exprs[i],t);if(i==e.exprs.length-1)return s;r(s,t=n())}}}(i));return function(e,t){for(let n=0,i=[e];n<i.length;n++){let e=i[n],r=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!r||n.isText||n.hasRequiredAttrs()||(r=!1),-1==i.indexOf(s)&&i.push(s)}r&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(r,n),r}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let r=t;i&&r<n;r++)i=i.matchType(e.child(r).type);return i}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];return function r(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return L.from(s.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==i.indexOf(n)){i.push(n);let e=r(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),r=i.match;if(r.matchType(e)){let e=[];for(let t=i;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<r.next.length;e++){let{type:o,next:s}=r.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||i.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:i}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let i=0;i<n.next.length;i++)-1==e.indexOf(n.next[i].next)&&t(n.next[i].next)}(this),e.map((t,n)=>{let i=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)i+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return i}).join("\n")}}de.empty=new de(!0);class pe{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function fe(e){let t=[];do{t.push(me(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function me(e){let t=[];do{t.push(ge(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function ge(e){let t=function(e){if(e.eat("(")){let t=fe(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let r=[];for(let e in n){let i=n[e];i.isInGroup(t)&&r.push(i)}0==r.length&&e.err("No node type or group '"+t+"' found");return r}(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=ve(e,t)}return t}function ye(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function ve(e,t){let n=ye(e),i=n;return e.eat(",")&&(i="}"!=e.next?ye(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function xe(e,t){return t-e}function be(e,t){let n=[];return function t(i){let r=e[i];if(1==r.length&&!r[0].term)return t(r[0].to);n.push(i);for(let e=0;e<r.length;e++){let{term:i,to:o}=r[e];i||-1!=n.indexOf(o)||t(o)}}(t),n.sort(xe)}function we(e){let t=Object.create(null);for(let n in e){let i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function ke(e,t){let n=Object.create(null);for(let i in e){let r=t&&t[i];if(void 0===r){let t=e[i];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+i);r=t.default}n[i]=r}return n}function Se(e,t,n,i){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let n in e){let i=e[n];i.validate&&i.validate(t[n])}}function ze(e,t){let n=Object.create(null);if(t)for(let i in t)n[i]=new Me(e,i,t[i]);return n}let Ce=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=ze(e,n.attrs),this.defaultAttrs=we(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==de.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ke(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ce(this,this.computeAttrs(e),L.from(t),W.setFrom(n))}createChecked(e=null,t,n){return t=L.from(t),this.checkContent(t),new ce(this,this.computeAttrs(e),t,W.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=L.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let i=this.contentMatch.matchFragment(t),r=i&&i.fillBefore(L.empty,!0);return r?new ce(this,e,t.append(r),W.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Se(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:W.none:e}static compile(t,n){let i=Object.create(null);t.forEach((t,r)=>i[t]=new e(t,n,r));let r=n.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let e in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};class Me{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let i=n.split("|");return n=>{let r=null===n?"null":typeof n;if(i.indexOf(r)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${r}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Ne{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=ze(e,i.attrs),this.excluded=null;let r=we(this.attrs);this.instance=r?new W(this,r):null}create(e=null){return!e&&this.instance?this.instance:new W(this,ke(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((e,r)=>n[e]=new Ne(e,i++,t,r)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Se(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Te{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=q.from(e.nodes),t.marks=q.from(e.marks||{}),this.nodes=Ce.compile(this.spec.nodes,this),this.marks=Ne.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],i=t.spec.content||"",r=t.spec.marks;if(t.contentMatch=n[i]||(n[i]=de.parse(i,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==r?null:r?Oe(this,r.split(" ")):""!=r&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Oe(this,n.split(" "))}this.nodeFromJSON=e=>ce.fromJSON(this,e),this.markFromJSON=e=>W.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Ce))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new he(n,n.defaultAttrs,e,W.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Oe(e,t){let n=[];for(let i=0;i<t.length;i++){let r=t[i],o=e.marks[r],s=o;if(o)n.push(o);else for(let t in e.marks){let i=e.marks[t];("_"==r||i.spec.group&&i.spec.group.split(" ").indexOf(r)>-1)&&n.push(s=i)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}let Ee=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new qe(this,t,!1);return n.addAll(e,W.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new qe(this,t,!0);return n.addAll(e,W.none,t.from,t.to),J.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let n=this.tags[i];if(Pe(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,i){for(let r=i?this.styles.indexOf(i)+1:0;r<this.styles.length;r++){let i=this.styles[r],o=i.style;if(!(0!=o.indexOf(e)||i.context&&!n.matchesContext(i.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(i.getAttrs){let e=i.getAttrs(t);if(!1===e)continue;i.attrs=e||void 0}return i}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,i=0;for(;i<t.length;i++){let e=t[i];if((null==e.priority?50:e.priority)<n)break}t.splice(i,0,e)}for(let t in e.marks){let i=e.marks[t].spec.parseDOM;i&&i.forEach(e=>{n(e=_e(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let i=e.nodes[t].spec.parseDOM;i&&i.forEach(e=>{n(e=_e(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}};const Ae={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},je={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},De={ol:!0,ul:!0};function Re(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Ie{constructor(e,t,n,i,r,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=W.none,this.match=r||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(L.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=L.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ae.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class qe{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i,r=t.topNode,o=Re(null,t.preserveWhitespace,0)|(n?4:0);i=r?new Ie(r.type,r.attrs,W.none,!0,t.topMatch||r.type.contentMatch,o):new Ie(n?null:e.schema.topNodeType,null,W.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,r=2&i.options?"full":this.localPreserveWS||(1&i.options)>0,{schema:o}=this.parser;if("full"===r||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r)if("full"===r)n=n.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=i.content[i.content.length-1],r=e.previousSibling;(!t||r&&"BR"==r.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,r=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o,s=e.nodeName.toLowerCase();De.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&De.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));e:if(a?a.ignore:je.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let n,i=this.needsBlock;if(Ae.hasOwnProperty(s))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),n=!0,r.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let o=a&&a.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(r),this.needsBlock=i}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,a,n,!1===a.consuming?o:void 0)}this.localPreserveWS=i}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let i=this.parser.matchedStyles[e],r=n.getPropertyValue(i);if(r)for(let e;;){let n=this.parser.matchStyle(i,r,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1!==n.consuming)break;e=n}}return t}addElementByRule(e,t,n,i){let r,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(r=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let i=e;"string"==typeof t.contentElement?i=e.querySelector(t.contentElement):"function"==typeof t.contentElement?i=t.contentElement(e):t.contentElement&&(i=t.contentElement),this.findAround(e,i,!0),this.addAll(i,n),this.findAround(e,i,!1)}r&&this.sync(s)&&this.open--}addAll(e,t,n,i){let r=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==i?null:e.childNodes[i];o!=s;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o,t);this.findAtPoint(e,r)}findPlace(e,t,n){let i,r;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],a=s.findWrapping(e);if(a&&(!i||i.length>a.length+o)&&(i=a,r=s,!a.length))break;if(s.solid){if(n)break;o+=2}}if(!i)return null;this.sync(r);for(let e=0;e<i.length;e++)t=this.enterInner(i[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=W.none;for(let r of i.concat(e.marks))(t.type?t.type.allowsMarkType(r.type):Le(r.type,e.type))&&(n=r.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,i){let r=this.findPlace(e.create(t),n,!1);return r&&(r=this.enterInner(e,t,n,!0,i)),r}enterInner(e,t,n,i=!1,r){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=Re(e,r,o.options);4&o.options&&0==o.content.length&&(s|=4);let a=W.none;return n=n.filter(t=>!(o.type?o.type.allowsMarkType(t.type):Le(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new Ie(e,t,a,i,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)if(null==this.find[i].pos&&1==e.nodeType&&e.contains(this.find[i].node)){t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),r=-(n?n.depth+1:0)+(i?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=r;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&i?this.nodes[s].type:n&&s>=r?n.node(s-r).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function Pe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function _e(e){let t={};for(let n in e)t[n]=e[n];return t}function Le(e,t){let n=t.schema.nodes;for(let i in n){let r=n[i];if(!r.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:i,next:r}=e.edge(n);if(i==t)return!0;if(o.indexOf(r)<0&&s(r))return!0}};if(s(r.contentMatch))return!0}}class Be{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Ve(t).createDocumentFragment());let i=n,r=[];return e.forEach(e=>{if(r.length||e.marks.length){let n=0,o=0;for(;n<r.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(r[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<r.length;)i=r.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(r.push([n,i]),i.appendChild(s.dom),i=s.contentDOM||s.dom)}}i.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=Je(Ve(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let r=this.serializeMark(e.marks[i],e.isInline,t);r&&((r.contentDOM||r.dom).appendChild(n),n=r.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Je(Ve(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return Je(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Be(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Fe(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Fe(e.marks)}}function Fe(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Ve(e){return e.document||window.document}const We=new WeakMap;function $e(e){let t=We.get(e);return void 0===t&&We.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}(e)),t}function Je(e,t,n,i){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,o=t[0];if("string"!=typeof o)throw new RangeError("Invalid array passed to renderSpec");if(i&&(r=$e(i))&&r.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,a=o.indexOf(" ");a>0&&(n=o.slice(0,a),o=o.slice(a+1));let l=n?e.createElementNS(n,o):e.createElement(o),c=t[1],h=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){h=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?l.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&l.style?l.style.cssText=c[e]:l.setAttribute(e,c[e])}}for(let r=h;r<t.length;r++){let o=t[r];if(0===o){if(r<t.length-1||r>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}{let{dom:t,contentDOM:r}=Je(e,o,n,i);if(l.appendChild(t),r){if(s)throw new RangeError("Multiple content holes");s=r}}}return{dom:l,contentDOM:s}}const Ue=Math.pow(2,16);function He(e,t){return e+t*Ue}function Ke(e){return 65535&e}class Ge{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Ye{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ye.empty)return Ye.empty}recover(e){let t=0,n=Ke(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Ue}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,r=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?i:0);if(a>e)break;let l=this.ranges[s+r],c=this.ranges[s+o],h=a+l;if(e<=h){let r=a+i+((l?e==a?-1:e==h?1:t:t)<0?0:c);if(n)return r;let o=e==(t<0?a:h)?null:He(s/3,e-a),u=e==a?2:e==h?1:4;return(t<0?e!=a:e!=h)&&(u|=8),new Ge(r,u,o)}i+=c-l}return n?e+i:new Ge(e+i,0,null)}touches(e,t){let n=0,i=Ke(t),r=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+r];if(e<=s+a&&t==3*i)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,r=0;i<this.ranges.length;i+=3){let o=this.ranges[i],s=o-(this.inverted?r:0),a=o+(this.inverted?0:r),l=this.ranges[i+t],c=this.ranges[i+n];e(s,s+l,a,a+c),r+=c-l}}invert(){return new Ye(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Ye.empty:new Ye(e<0?[0,-e,0]:[0,0,e])}}Ye.empty=new Ye([]);class Xe{constructor(e,t,n=0,i=(e?e.length:0)){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Xe(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],null!=i&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=i&&i>t?n-i-1:void 0)}}invert(){let e=new Xe;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let n=this.from;n<this.to;n++){let r=this._maps[n].mapResult(e,t);if(null!=r.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(r.recover);continue}}i|=r.delInfo,e=r.pos}return n?e:new Ge(e,i,null)}}const Ze=Object.create(null);class Qe{getMap(){return Ye.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Ze[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ze)throw new RangeError("Duplicate use of step JSON ID "+e);return Ze[e]=t,t.prototype.jsonID=e,t}}class et{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new et(e,null)}static fail(e){return new et(null,e)}static fromReplace(e,t,n,i){try{return et.ok(e.replace(t,n,i))}catch(e){if(e instanceof $)return et.fail(e.message);throw e}}}function tt(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let o=e.child(r);o.content.size&&(o=o.copy(tt(o.content,t,o))),o.isInline&&(o=t(o,n,r)),i.push(o)}return L.fromArray(i)}class nt extends Qe{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),r=new J(tt(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,i),t.openStart,t.openEnd);return et.fromReplace(e,this.from,this.to,r)}invert(){return new it(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new nt(t.pos,n.pos,this.mark)}merge(e){return e instanceof nt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new nt(t.from,t.to,e.markFromJSON(t.mark))}}Qe.jsonID("addMark",nt);class it extends Qe{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new J(tt(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return et.fromReplace(e,this.from,this.to,n)}invert(){return new nt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new it(t.pos,n.pos,this.mark)}merge(e){return e instanceof it&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new it(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new it(t.from,t.to,e.markFromJSON(t.mark))}}Qe.jsonID("removeMark",it);class rt extends Qe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return et.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return et.fromReplace(e,this.pos,this.pos+1,new J(L.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new rt(this.pos,t.marks[n]);return new rt(this.pos,this.mark)}}return new ot(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rt(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new rt(t.pos,e.markFromJSON(t.mark))}}Qe.jsonID("addNodeMark",rt);class ot extends Qe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return et.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return et.fromReplace(e,this.pos,this.pos+1,new J(L.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new rt(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ot(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ot(t.pos,e.markFromJSON(t.mark))}}Qe.jsonID("removeNodeMark",ot);class st extends Qe{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&lt(e,this.from,this.to)?et.fail("Structure replace would overwrite content"):et.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ye([this.from,this.to-this.from,this.slice.size])}invert(e){return new st(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new st(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof st)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?J.empty:new J(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new st(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?J.empty:new J(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new st(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new st(t.from,t.to,J.fromJSON(e,t.slice),!!t.structure)}}Qe.jsonID("replace",st);class at extends Qe{constructor(e,t,n,i,r,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=r,this.insert=o,this.structure=s}apply(e){if(this.structure&&(lt(e,this.from,this.gapFrom)||lt(e,this.gapTo,this.to)))return et.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return et.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?et.fromReplace(e,this.from,this.to,n):et.fail("Content does not fit in gap")}getMap(){return new Ye([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new at(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),r=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||r>n.pos?null:new at(t.pos,n.pos,i,r,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new at(t.from,t.to,t.gapFrom,t.gapTo,J.fromJSON(e,t.slice),t.insert,!!t.structure)}}function lt(e,t,n){let i=e.resolve(t),r=n-t,o=i.depth;for(;r>0&&o>0&&i.indexAfter(o)==i.node(o).childCount;)o--,r--;if(r>0){let e=i.node(o).maybeChild(i.indexAfter(o));for(;r>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,r--}}return!1}function ct(e,t,n,i=n.contentMatch,r=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<o.childCount;t++){let l=o.child(t),c=a+l.nodeSize,h=i.matchType(l.type);if(h){i=h;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new it(a,c,l.marks[t]));if(r&&l.isText&&"pre"!=n.whitespace){let e,t,i=/\r?\n|\r/g;for(;e=i.exec(l.text);)t||(t=new J(L.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new st(a+e.index,a+e.index+e[0].length,t))}}else s.push(new st(a,c,J.empty));a=c}if(!i.validEnd){let t=i.fillBefore(L.empty,!0);e.replace(a,a,new J(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function ht(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ut(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,i=0,r=0;;--n){let o=e.$from.node(n),s=e.$from.index(n)+i,a=e.$to.indexAfter(n)-r;if(n<e.depth&&o.canReplace(s,a,t))return n;if(0==n||o.type.spec.isolating||!ht(o,s,a))break;s&&(i=1),a<o.childCount&&(r=1)}return null}function dt(e,t,n,i){t.forEach((r,o)=>{if(r.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(r.text);){let r=e.mapping.slice(i).map(n+1+o+s.index);e.replaceWith(r,r+1,t.type.schema.linebreakReplacement.create())}}})}function pt(e,t,n,i){t.forEach((r,o)=>{if(r.type==r.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+o);e.replaceWith(r,r+1,t.type.schema.text("\n"))}})}function ft(e,t,n=1,i){let r=e.resolve(t),o=r.depth-n,s=i&&i[i.length-1]||r.parent;if(o<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!s.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let e=r.depth-1,t=n-2;e>o;e--,t--){let n=r.node(e),o=r.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=i&&i[t+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=i&&i[t]||n;if(!n.canReplace(o+1,n.childCount)||!l.type.validContent(s))return!1}let a=r.indexAfter(o),l=i&&i[0];return r.node(o).canReplaceWith(a,a,l?l.type:r.node(o+1).type)}function mt(e,t){let n=e.resolve(t),i=n.index();return r=n.nodeBefore,o=n.nodeAfter,!(!r||!o||r.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let r=0;r<t.childCount;r++){let o=t.child(r),s=o.type==i?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n)return!1;if(!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(r,o))&&n.parent.canReplace(i,i+1);var r,o}function gt(e,t,n=t,i=J.empty){if(t==n&&!i.size)return null;let r=e.resolve(t),o=e.resolve(n);return yt(r,o,i)?new st(t,n,i):new vt(r,o,i).fit()}function yt(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Qe.jsonID("replaceAround",at);class vt{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=L.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=L.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let r=this.placed,o=n.depth,s=i.depth;for(;o&&s&&1==r.childCount;)r=r.firstChild.content,o--,s--;let a=new J(r,o,s);return e>-1?new at(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new st(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let r=t.firstChild;if(t.childCount>1&&(i=0),r.type.spec.isolating&&i<=n){e=n;break}t=r.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,i=null;n?(i=wt(this.unplaced.content,n-1).firstChild,e=i.content):e=this.unplaced.content;let r=e.firstChild;for(let e=this.depth;e>=0;e--){let o,{type:s,match:a}=this.frontier[e],l=null;if(1==t&&(r?a.matchType(r.type)||(l=a.fillBefore(L.from(r),!1)):i&&s.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:e,parent:i,inject:l};if(2==t&&r&&(o=a.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:e,parent:i,wrap:o};if(i&&a.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=wt(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new J(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=wt(e,t);if(i.childCount<=1&&t>0){let r=e.size-t<=t+i.size;this.unplaced=new J(xt(e,t-1,1),t-1,r?t-1:n)}else this.unplaced=new J(xt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:r}){for(;this.depth>t;)this.closeFrontierNode();if(r)for(let e=0;e<r.length;e++)this.openFrontierNode(r[e]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,c=[],{match:h,type:u}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)c.push(i.child(e));h=h.matchFragment(i)}let d=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=h.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(h=t,c.push(kt(e.mark(u.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?d:-1)))}let p=l==s.childCount;p||(d=-1),this.placed=bt(this.placed,t,L.from(c)),this.frontier[t].match=h,p&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<d;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?0==e?J.empty:new J(xt(o.content,e-1,1),e-1,d<0?o.openEnd:e-1):new J(xt(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!St(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=St(e,t,i,n,r);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:i}=this.frontier[n],r=St(e,n,i,t,!0);if(!r||r.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=bt(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),i=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,i)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=bt(this.placed,this.depth,L.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(L.empty,!0);e.childCount&&(this.placed=bt(this.placed,this.frontier.length,e))}}function xt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(xt(e.firstChild.content,t-1,n)))}function bt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(bt(e.lastChild.content,t-1,n)))}function wt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function kt(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,kt(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(L.empty,!0)))),e.copy(i)}function St(e,t,n,i,r){let o=e.node(t),s=r?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=i.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}(n,o.content,s)?a:null}function zt(e){return e.spec.defining||e.spec.definingForContent}function Ct(e,t,n,i,r){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(Ct(r.content,t+1,n,i,r)))}if(t>i){let t=r.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(L.empty,!0))}return e}function Mt(e,t){let n=[];for(let i=Math.min(e.depth,t.depth);i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}class Nt extends Qe{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return et.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return et.fromReplace(e,this.pos,this.pos+1,new J(L.from(i),0,t.isLeaf?0:1))}getMap(){return Ye.empty}invert(e){return new Nt(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Nt(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Nt(t.pos,t.attr,t.value)}}Qe.jsonID("attr",Nt);class Tt extends Qe{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return et.ok(n)}getMap(){return Ye.empty}invert(e){return new Tt(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Tt(t.attr,t.value)}}Qe.jsonID("docAttr",Tt);let Ot=class extends Error{};Ot=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Ot.prototype=Object.create(Error.prototype)).constructor=Ot,Ot.prototype.name="TransformError";class Et{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Xe}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ot(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let i=this.mapping.maps[n];n&&(e=i.map(e,1),t=i.map(t,-1)),i.forEach((n,i,r,o)=>{e=Math.min(e,r),t=Math.max(t,o)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=J.empty){let i=gt(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new J(L.from(n),0,0))}delete(e,t){return this.replace(e,t,J.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let r=e.doc.resolve(t),o=e.doc.resolve(n);if(yt(r,o,i))return e.step(new st(t,n,i));let s=Mt(r,o);0==s[s.length-1]&&s.pop();let a=-(r.depth+1);s.unshift(a);for(let e=r.depth,t=r.pos-1;e>0;e--,t--){let n=r.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:r.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],h=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==i.openStart)break;e=n.content}for(let e=h-1;e>=0;e--){let t=c[e],n=zt(t.type);if(n&&!t.sameMarkup(r.node(Math.abs(a)-1)))h=e;else if(n||!t.type.isTextblock)break}for(let t=i.openStart;t>=0;t--){let a=(t+h+1)%(i.openStart+1),u=c[a];if(u)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],h=!0;c<0&&(h=!1,c=-c);let d=r.node(c-1),p=r.index(c-1);if(d.canReplaceWith(p,p,u.type,u.marks))return e.replace(r.before(c),h?o.after(c):n,new J(Ct(i.content,0,i.openStart,a),a,i.openEnd))}}let u=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,i),!(e.steps.length>u));a--){let e=s[a];e<0||(t=r.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=function(e,t,n){let i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(0==i.parentOffset)for(let e=i.depth-1;e>=0;e--){let t=i.index(e);if(i.node(e).canReplaceWith(t,t,n))return i.before(e+1);if(t>0)return null}if(i.parentOffset==i.parent.content.size)for(let e=i.depth-1;e>=0;e--){let t=i.indexAfter(e);if(i.node(e).canReplaceWith(t,t,n))return i.after(e+1);if(t<i.node(e).childCount)return null}return null}(e.doc,t,i.type);null!=r&&(t=n=r)}e.replaceRange(t,n,new J(L.from(i),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let i=e.doc.resolve(t),r=e.doc.resolve(n),o=Mt(i,r);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||i.node(n).type.contentMatch.validEnd)return e.delete(i.start(n),r.end(n));if(n>0&&(s||i.node(n-1).canReplace(i.index(n-1),r.indexAfter(n-1))))return e.delete(i.before(n),r.after(n))}for(let o=1;o<=i.depth&&o<=r.depth;o++)if(t-i.start(o)==i.depth-o&&n>i.end(o)&&r.end(o)-n!=r.depth-o&&i.start(o-1)==r.start(o-1)&&i.node(o-1).canReplace(i.index(o-1),r.index(o-1)))return e.delete(i.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:i,$to:r,depth:o}=t,s=i.before(o+1),a=r.after(o+1),l=s,c=a,h=L.empty,u=0;for(let e=o,t=!1;e>n;e--)t||i.index(e)>0?(t=!0,h=L.from(i.node(e).copy(h)),u++):l--;let d=L.empty,p=0;for(let e=o,t=!1;e>n;e--)t||r.after(e+1)<r.end(e)?(t=!0,d=L.from(r.node(e).copy(d)),p++):c++;e.step(new at(l,c,s,a,new J(h.append(d),u,p),h.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let i=null,{linebreakReplacement:r}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(r&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(r);e&&!t?i=!1:!e&&t&&(i=!0)}let a=e.steps.length;if(!1===i){let i=e.doc.resolve(t+n);pt(e,i.node(),i.before(),a)}s.inlineContent&&ct(e,t+n-1,s,o.node().contentMatchAt(o.index()),null==i);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new st(c,l.map(t+n,-1),J.empty,!0)),!0===i){let t=e.doc.resolve(c);dt(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let i=L.empty;for(let e=n.length-1;e>=0;e--){if(i.size){let t=n[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=L.from(n[e].type.create(n[e].attrs,i))}let r=t.start,o=t.end;e.step(new at(r,o,r,o,new J(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){return function(e,t,n,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let s="function"==typeof r?r(t):r;if(t.isTextblock&&!t.hasMarkup(i,s)&&function(e,t,n){let i=e.resolve(t),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}(e.doc,e.mapping.slice(o).map(n),i)){let r=null;if(i.schema.linebreakReplacement){let e="pre"==i.whitespace,t=!!i.contentMatch.matchType(i.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0)}!1===r&&pt(e,t,n,o),ct(e,e.mapping.slice(o).map(n,1),i,void 0,null===r);let a=e.mapping.slice(o),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new at(l,c,l+1,c-1,new J(L.from(i.create(s,null,t.marks)),0,0),1,!0)),!0===r&&dt(e,t,n,o),!1}})}(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return function(e,t,n,i,r){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(i,null,r||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new at(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new J(L.from(s),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Nt(e,t,n)),this}setDocAttribute(e,t){return this.step(new Tt(e,t)),this}addNodeMark(e,t){return this.step(new rt(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof W)t.isInSet(n.marks)&&this.step(new ot(e,t));else{let i,r=n.marks,o=[];for(;i=t.isInSet(r);)o.push(new ot(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,n){return function(e,t,n=1,i){let r=e.doc.resolve(t),o=L.empty,s=L.empty;for(let e=r.depth,t=r.depth-n,a=n-1;e>t;e--,a--){o=L.from(r.node(e).copy(o));let t=i&&i[a];s=L.from(t?t.type.create(t.attrs,s):r.node(e).copy(s))}e.step(new st(t,t,new J(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,i){let r,o,s=[],a=[];e.doc.nodesBetween(t,n,(e,l,c)=>{if(!e.isInline)return;let h=e.marks;if(!i.isInSet(h)&&c.type.allowsMarkType(i.type)){let c=Math.max(l,t),u=Math.min(l+e.nodeSize,n),d=i.addToSet(h);for(let e=0;e<h.length;e++)h[e].isInSet(d)||(r&&r.to==c&&r.mark.eq(h[e])?r.to=u:s.push(r=new it(c,u,h[e])));o&&o.to==c?o.to=u:a.push(o=new nt(c,u,i))}}),s.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,i){let r=[],o=0;e.doc.nodesBetween(t,n,(e,s)=>{if(!e.isInline)return;o++;let a=null;if(i instanceof Ne){let t,n=e.marks;for(;t=i.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else i?i.isInSet(e.marks)&&(a=[i]):a=e.marks;if(a&&a.length){let i=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<r.length;e++){let t=r[e];t.step==o-1&&l.eq(r[e].style)&&(n=t)}n?(n.to=i,n.step=o):r.push({style:l,from:Math.max(s,t),to:i,step:o})}}}),r.forEach(t=>e.step(new it(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return ct(this,e,t,n),this}}const At=Object.create(null);class jt{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Dt(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=J.empty){let n=t.content.lastChild,i=null;for(let e=0;e<t.openEnd;e++)i=n,n=n.lastChild;let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=e.mapping.slice(r);e.replaceRange(c.map(a.pos),c.map(l.pos),s?J.empty:t),0==s&&Wt(e,r,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let r=0;r<i.length;r++){let{$from:o,$to:s}=i[r],a=e.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);r?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),Wt(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new qt(e):Vt(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let i=e.depth-1;i>=0;i--){let r=t<0?Vt(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):Vt(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Bt(e.node(0))}static atStart(e){return Vt(e,e,0,0,1)||new Bt(e)}static atEnd(e){return Vt(e,e,e.content.size,e.childCount,-1)||new Bt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=At[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in At)throw new RangeError("Duplicate use of selection JSON ID "+e);return At[e]=t,t.prototype.jsonID=e,t}getBookmark(){return qt.between(this.$anchor,this.$head).getBookmark()}}jt.prototype.visible=!0;class Dt{constructor(e,t){this.$from=e,this.$to=t}}let Rt=!1;function It(e){Rt||e.parent.inlineContent||(Rt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class qt extends jt{constructor(e,t=e){It(e),It(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return jt.near(n);let i=e.resolve(t.map(this.anchor));return new qt(i.parent.inlineContent?i:n,n)}replace(e,t=J.empty){if(super.replace(e,t),t==J.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof qt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Pt(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new qt(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if(n&&!i||(n=i>=0?1:-1),!t.parent.inlineContent){let e=jt.findFrom(t,n,!0)||jt.findFrom(t,-n,!0);if(!e)return jt.near(t,n);t=e.$head}return e.parent.inlineContent||(0==i||(e=(jt.findFrom(e,-n,!0)||jt.findFrom(e,n,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new qt(e,t)}}jt.jsonID("text",qt);class Pt{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Pt(e.map(this.anchor),e.map(this.head))}resolve(e){return qt.between(e.resolve(this.anchor),e.resolve(this.head))}}class _t extends jt{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:i}=t.mapResult(this.anchor),r=e.resolve(i);return n?jt.near(r):new _t(r)}content(){return new J(L.from(this.node),0,0)}eq(e){return e instanceof _t&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Lt(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new _t(e.resolve(t.anchor))}static create(e,t){return new _t(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}_t.prototype.visible=!1,jt.jsonID("node",_t);class Lt{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Pt(n,n):new Lt(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&_t.isSelectable(n)?new _t(t):jt.near(t)}}class Bt extends jt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=J.empty){if(t==J.empty){e.delete(0,e.doc.content.size);let t=jt.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Bt(e)}map(e){return new Bt(e)}eq(e){return e instanceof Bt}getBookmark(){return Ft}}jt.jsonID("all",Bt);const Ft={map(){return this},resolve:e=>new Bt(e)};function Vt(e,t,n,i,r,o=!1){if(t.inlineContent)return qt.create(e,n);for(let s=i-(r>0?0:1);r>0?s<t.childCount:s>=0;s+=r){let i=t.child(s);if(i.isAtom){if(!o&&_t.isSelectable(i))return _t.create(e,n-(r<0?i.nodeSize:0))}else{let t=Vt(e,i,n+r,r<0?i.childCount:0,r,o);if(t)return t}n+=i.nodeSize*r}return null}function Wt(e,t,n){let i=e.steps.length-1;if(i<t)return;let r,o=e.steps[i];(o instanceof st||o instanceof at)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(jt.near(e.doc.resolve(r),n)))}class $t extends Et{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return W.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||W.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let r=this.storedMarks;if(!r){let e=this.doc.resolve(t);r=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,r)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(jt.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Jt(e,t){return t&&e?e.bind(t):e}class Ut{constructor(e,t,n){this.name=e,this.init=Jt(t.init,n),this.apply=Jt(t.apply,n)}}const Ht=[new Ut("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Ut("selection",{init:(e,t)=>e.selection||jt.atStart(t.doc),apply:e=>e.selection}),new Ut("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,i)=>i.selection.$cursor?e.storedMarks:null}),new Ut("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Kt{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ht.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Ut(e.key,e.spec.state,e))})}}class Gt{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),i=null;for(;;){let r=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=i?i[o].n:0,l=i?i[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let e=0;e<this.config.plugins.length;e++)i.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),r=!0}i&&(i[o]={state:n,n:t.length})}}if(!r)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Gt(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let r=n[i];t[r.name]=r.apply(e,this[r.name],this,t)}return t}get tr(){return new $t(this)}static create(e){let t=new Kt(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Gt(t);for(let i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n}reconfigure(e){let t=new Kt(this.schema,e.plugins),n=t.fields,i=new Gt(t);for(let t=0;t<n.length;t++){let r=n[t].name;i[r]=this.hasOwnProperty(r)?this[r]:n[t].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],r=i.spec.state;r&&r.toJSON&&(t[n]=r.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Kt(e.schema,e.plugins),r=new Gt(i);return i.fields.forEach(i=>{if("doc"==i.name)r.doc=ce.fromJSON(e.schema,t.doc);else if("selection"==i.name)r.selection=jt.fromJSON(r.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(r.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==i.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(r[i.name]=a.fromJSON.call(s,e,t[o],r))}r[i.name]=i.init(e,r)}}),r}}function Yt(e,t,n){for(let i in e){let r=e[i];r instanceof Function?r=r.bind(t):"handleDOMEvents"==i&&(r=Yt(r,t,{})),n[i]=r}return n}class Xt{constructor(e){this.spec=e,this.props={},e.props&&Yt(e.props,this,this.props),this.key=e.key?e.key.key:Qt("plugin")}getState(e){return e[this.key]}}const Zt=Object.create(null);function Qt(e){return e in Zt?e+"$"+ ++Zt[e]:(Zt[e]=0,e+"$")}class en{constructor(e="key"){this.key=Qt(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const tn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},nn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let rn=null;const on=function(e,t,n){let i=rn||(rn=document.createRange());return i.setEnd(e,null==n?e.nodeValue.length:n),i.setStart(e,t||0),i},sn=function(e,t,n,i){return n&&(ln(e,t,n,i,-1)||ln(e,t,n,i,1))},an=/^(img|br|input|textarea|hr)$/i;function ln(e,t,n,i,r){for(var o;;){if(e==n&&t==i)return!0;if(t==(r<0?0:cn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||hn(e)||an.test(e.nodeName)||"false"==e.contentEditable)return!1;t=tn(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(r<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(o=n.pmViewDesc)||void 0===o?void 0:o.ignoreForSelection))return!1;t+=r}else e=n,t=r<0?cn(e):0}}}}function cn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function hn(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const un=function(e){return e.focusNode&&sn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function dn(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const pn="undefined"!=typeof navigator?navigator:null,fn="undefined"!=typeof document?document:null,mn=pn&&pn.userAgent||"",gn=/Edge\/(\d+)/.exec(mn),yn=/MSIE \d/.exec(mn),vn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mn),xn=!!(yn||vn||gn),bn=yn?document.documentMode:vn?+vn[1]:gn?+gn[1]:0,wn=!xn&&/gecko\/(\d+)/i.test(mn);wn&&(/Firefox\/(\d+)/.exec(mn)||[0,0])[1];const kn=!xn&&/Chrome\/(\d+)/.exec(mn),Sn=!!kn,zn=kn?+kn[1]:0,Cn=!xn&&!!pn&&/Apple Computer/.test(pn.vendor),Mn=Cn&&(/Mobile\/\w+/.test(mn)||!!pn&&pn.maxTouchPoints>2),Nn=Mn||!!pn&&/Mac/.test(pn.platform),Tn=!!pn&&/Win/.test(pn.platform),On=/Android \d/.test(mn),En=!!fn&&"webkitFontSmoothing"in fn.documentElement.style,An=En?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function jn(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Dn(e,t){return"number"==typeof e?e:e[t]}function Rn(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,i=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*i}}function In(e,t,n){let i=e.someProp("scrollThreshold")||0,r=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=nn(s);continue}let e=s,n=e==o.body,a=n?jn(o):Rn(e),l=0,c=0;if(t.top<a.top+Dn(i,"top")?c=-(a.top-t.top+Dn(r,"top")):t.bottom>a.bottom-Dn(i,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+Dn(r,"top")-a.top:t.bottom-a.bottom+Dn(r,"bottom")),t.left<a.left+Dn(i,"left")?l=-(a.left-t.left+Dn(r,"left")):t.right>a.right-Dn(i,"right")&&(l=t.right-a.right+Dn(r,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,i=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let r=e.scrollLeft-n,o=e.scrollTop-i;t={left:t.left-r,top:t.top-o,right:t.right-r,bottom:t.bottom-o}}let h=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(h))break;s="absolute"==h?s.offsetParent:nn(s)}}function qn(e){let t=[],n=e.ownerDocument;for(let i=e;i&&(t.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),e!=n);i=nn(i));return t}function Pn(e,t){for(let n=0;n<e.length;n++){let{dom:i,top:r,left:o}=e[n];i.scrollTop!=r+t&&(i.scrollTop=r+t),i.scrollLeft!=o&&(i.scrollLeft=o)}}let _n=null;function Ln(e,t){let n,i,r,o,s=2e8,a=0,l=t.top,c=t.top;for(let h=e.firstChild,u=0;h;h=h.nextSibling,u++){let e;if(1==h.nodeType)e=h.getClientRects();else{if(3!=h.nodeType)continue;e=on(h).getClientRects()}for(let d=0;d<e.length;d++){let p=e[d];if(p.top<=l&&p.bottom>=c){l=Math.max(p.bottom,l),c=Math.min(p.top,c);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<s){n=h,s=e,i=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==h.nodeType&&e&&(a=u+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!r&&p.left<=t.left&&p.right>=t.left&&(r=h,o={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=u+1)}}return!n&&r&&(n=r,i=o,s=0),n&&3==n.nodeType?function(e,t){let n,i=e.nodeValue.length,r=document.createRange();for(let o=0;o<i;o++){r.setEnd(e,o+1),r.setStart(e,o);let i=$n(r,1);if(i.top!=i.bottom&&Bn(t,i)){n={node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)};break}}return r.detach(),n||{node:e,offset:0}}(n,i):!n||s&&1==n.nodeType?{node:e,offset:a}:Ln(n,i)}function Bn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Fn(e,t,n){let i=e.childNodes.length;if(i&&n.top<n.bottom)for(let r=Math.max(0,Math.min(i-1,Math.floor(i*(t.top-n.top)/(n.bottom-n.top))-2)),o=r;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let i=0;i<e.length;i++){let r=e[i];if(Bn(t,r))return Fn(n,t,r)}}if((o=(o+1)%i)==r)break}return e}function Vn(e,t){let n,i=e.dom.ownerDocument,r=0,o=function(e,t,n){if(e.caretPositionFromPoint)try{let i=e.caretPositionFromPoint(t,n);if(i)return{node:i.offsetNode,offset:Math.min(cn(i.offsetNode),i.offset)}}catch(e){}if(e.caretRangeFromPoint){let i=e.caretRangeFromPoint(t,n);if(i)return{node:i.startContainer,offset:Math.min(cn(i.startContainer),i.startOffset)}}}(i,t.left,t.top);o&&({node:n,offset:r}=o);let s,a=(e.root.elementFromPoint?e.root:i).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!Bn(t,n))return null;if(a=Fn(e.dom,t,n),!a)return null}if(Cn)for(let e=a;n&&e;e=nn(e))e.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(wn&&1==n.nodeType&&(r=Math.min(r,n.childNodes.length),r<n.childNodes.length)){let e,i=n.childNodes[r];"IMG"==i.nodeName&&(e=i.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&r++}let i;En&&r&&1==n.nodeType&&1==(i=n.childNodes[r-1]).nodeType&&"false"==i.contentEditable&&i.getBoundingClientRect().top>=t.top&&r--,n==e.dom&&r==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=r&&1==n.nodeType&&"BR"==n.childNodes[r-1].nodeName||(s=function(e,t,n,i){let r=-1;for(let n=t,o=!1;n!=e.dom;){let t,s=e.docView.nearestDesc(n,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((t=s.dom.getBoundingClientRect()).width||t.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!o&&t.left>i.left||t.top>i.top?r=s.posBefore:(!o&&t.right<i.left||t.bottom<i.top)&&(r=s.posAfter),o=!0),!s.contentDOM&&r<0&&!s.node.isText))return(s.node.isBlock?i.top<(t.top+t.bottom)/2:i.left<(t.left+t.right)/2)?s.posBefore:s.posAfter;n=s.dom.parentNode}return r>-1?r:e.docView.posFromDOM(t,n,-1)}(e,n,r,t))}null==s&&(s=function(e,t,n){let{node:i,offset:r}=Ln(t,n),o=-1;if(1==i.nodeType&&!i.firstChild){let e=i.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(i,r,o)}(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function Wn(e){return e.top<e.bottom||e.left<e.right}function $n(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Wn(e))return e}return Array.prototype.find.call(n,Wn)||e.getBoundingClientRect()}const Jn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Un(e,t,n){let{node:i,offset:r,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=En||wn;if(3==i.nodeType){if(!s||!Jn.test(i.nodeValue)&&(n<0?r:r!=i.nodeValue.length)){let e=r,t=r,o=n<0?1:-1;return n<0&&!r?(t++,o=-1):n>=0&&r==i.nodeValue.length?(e--,o=1):n<0?e--:t++,Hn($n(on(i,e,t),o),o<0)}{let e=$n(on(i,r,r),n);if(wn&&r&&/\s/.test(i.nodeValue[r-1])&&r<i.nodeValue.length){let t=$n(on(i,r-1,r-1),-1);if(t.top==e.top){let n=$n(on(i,r,r+1),-1);if(n.top!=e.top)return Hn(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&r&&(n<0||r==cn(i))){let e=i.childNodes[r-1];if(1==e.nodeType)return Kn(e.getBoundingClientRect(),!1)}if(null==o&&r<cn(i)){let e=i.childNodes[r];if(1==e.nodeType)return Kn(e.getBoundingClientRect(),!0)}return Kn(i.getBoundingClientRect(),n>=0)}if(null==o&&r&&(n<0||r==cn(i))){let e=i.childNodes[r-1],t=3==e.nodeType?on(e,cn(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Hn($n(t,1),!1)}if(null==o&&r<cn(i)){let e=i.childNodes[r];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?on(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Hn($n(t,-1),!0)}return Hn($n(3==i.nodeType?on(i):i,-n),n>=0)}function Hn(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Kn(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Gn(e,t,n){let i=e.state,r=e.root.activeElement;i!=t&&e.updateState(t),r!=e.dom&&e.focus();try{return n()}finally{i!=t&&e.updateState(i),r!=e.dom&&r&&r.focus()}}const Yn=/[\u0590-\u08ac]/;let Xn=null,Zn=null,Qn=!1;function ei(e,t,n){return Xn==t&&Zn==n?Qn:(Xn=t,Zn=n,Qn="up"==n||"down"==n?function(e,t,n){let i=t.selection,r="up"==n?i.$from:i.$to;return Gn(e,t,()=>{let{node:t}=e.docView.domFromPos(r.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let i=Un(e,r.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=on(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let r=t[e];if(r.bottom>r.top+1&&("up"==n?i.top-r.top>2*(r.bottom-i.top):r.bottom-i.bottom>2*(i.bottom-r.top)))return!1}}return!0})}(e,t,n):function(e,t,n){let{$head:i}=t.selection;if(!i.parent.isTextblock)return!1;let r=i.parentOffset,o=!r,s=r==i.parent.content.size,a=e.domSelection();return a?Yn.test(i.parent.textContent)&&a.modify?Gn(e,t,()=>{let{focusNode:t,focusOffset:r,anchorNode:o,anchorOffset:s}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=i.depth?e.docView.domAfterPos(i.before()):e.dom,{focusNode:h,focusOffset:u}=e.domSelectionRange(),d=h&&!c.contains(1==h.nodeType?h:h.parentNode)||t==h&&r==u;try{a.collapse(o,s),t&&(t!=o||r!=s)&&a.extend&&a.extend(t,r)}catch(e){}return null!=l&&(a.caretBidiLevel=l),d}):"left"==n||"backward"==n?o:s:i.pos==i.start()||i.pos==i.end()}(e,t,n))}class ti{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let i=this.children[t];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,i;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(i=n.pmViewDesc)||i.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(i)+i.size:this.posAtStart}{let n,i;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(i=n.pmViewDesc)||i.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(i):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=t>tn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){i=!1;break}if(t.previousSibling)break}if(null==i&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){i=!0;break}if(t.nextSibling)break}}return(null==i?n>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let r,o=this.getDesc(i);if(o&&(!t||o.node)){if(!n||!(r=o.nodeDOM)||(1==r.nodeType?r.contains(1==e.nodeType?e:e.parentNode):r==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let r=this.getDesc(i);if(r)return r.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],r=n+i.size;if(n==e&&r!=n){for(;!i.border&&i.children.length;)for(let e=0;e<i.children.length;e++){let t=i.children[e];if(t.size){i=t;break}}return i}if(e<r)return i.descAt(e-n-i.border);n=r}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let t=0;n<this.children.length;n++){let r=this.children[n],o=t+r.size;if(o>e||r instanceof li){i=e-t;break}t=o}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof ni&&e.side>=0;n--);if(t<=0){let e,i=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,i=!1);return e&&t&&i&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?tn(e.dom)+1:0}}{let e,i=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,i=!1);return e&&i&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?tn(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,r=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==i&&e<=a){let r=o+n.border;if(e>=r&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,r);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){i=tn(n.dom)+1;break}e-=n.size}-1==i&&(i=0)}if(i>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){r=tn(n.dom);break}t+=n.size}-1==r&&(r=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:r}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,i=!1){let r=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(r>a&&o<c)return l.setSelection(e-a-l.border,t-a-l.border,n,i);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),h=!1;if((wn||Cn)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(h=!(!t||"\n"!=e.nodeValue[t-1]),h&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:tn(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];h=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(wn&&c.focusNode&&c.focusNode!=a.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(i=!0)}if(!(i||h&&Cn)&&sn(s.node,s.offset,c.anchorNode,c.anchorOffset)&&sn(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((l.extend||e==t)&&(!h||!wn)){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),u=!0}catch(e){}}if(!u){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let r=this.children[i],o=n+r.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let i=n+r.border,s=o-r.border;if(e>=i&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=i||t!=s||!r.contentLost&&r.dom.parentNode==this.contentDOM?r.markDirty(e-i,t-i):r.dirty=3);r.dirty=r.dom!=r.contentDOM||r.dom.parentNode!=this.contentDOM||r.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class ni extends ti{constructor(e,t,n,i){let r,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,()=>r?r.parent?r.parent.posBeforeChild(r):void 0:i)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,r=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ii extends ti{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class ri extends ti{constructor(e,t,n,i,r){super(e,[],n,i),this.mark=t,this.spec=r}static create(e,t,n,i){let r=i.nodeViews[t.type.name],o=r&&r(t,i,n);return o&&o.dom||(o=Be.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new ri(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let i=ri.create(this.parent,this.mark,!0,n),r=this.children,o=this.size;t<o&&(r=wi(r,t,o,n)),e>0&&(r=wi(r,0,e,n));for(let e=0;e<r.length;e++)r[e].parent=i;return i.children=r,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class oi extends ti{constructor(e,t,n,i,r,o,s,a,l){super(e,[],r,o),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=s}static create(e,t,n,i,r,o){let s,a=r.nodeViews[t.type.name],l=a&&a(t,r,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o,n,i),c=l&&l.dom,h=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=Be.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:h}=e)}h||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return c=gi(c,n,t),l?s=new ci(e,t,n,i,c,h||null,u,l,r,o+1):t.isText?new ai(e,t,n,i,c,u,r):new oi(e,t,n,i,c,h||null,u,r,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>L.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&yi(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,r=e.composing?this.localCompositionInfo(e,t):null,o=r&&r.pos>-1?r:null,s=r&&r.pos<0,a=new xi(this,o&&o.node,e);!function(e,t,n,i){let r=t.locals(e),o=0;if(0==r.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);i(s,r,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let h,u,d,p;for(;s<r.length&&r[s].to==o;){let e=r[s++];e.widget&&(h?(u||(u=[h])).push(e):h=e)}if(h)if(u){u.sort(bi);for(let e=0;e<u.length;e++)n(u[e],c,!!l)}else n(h,c,!!l);if(l)p=-1,d=l,l=null;else{if(!(c<e.childCount))break;p=c,d=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<r.length&&r[s].from<=o&&r[s].to>o;)a.push(r[s++]);let f=o+d.nodeSize;if(d.isText){let e=f;s<r.length&&r[s].from<e&&(e=r[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=d.cut(e-o),d=d.cut(0,e-o),f=e,p=-1)}else for(;s<r.length&&r[s].to<f;)s++;i(d,d.isInline&&!d.isLeaf?a.filter(e=>!e.inline):a.slice(),t.forChild(o,d),p),o=f}}(this.node,this.innerDeco,(t,r,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,r):t.type.side>=0&&!o&&a.syncToMarks(r==this.node.childCount?W.none:this.node.child(r).marks,n,e,r),a.placeWidget(t,e,i)},(t,o,l,c)=>{let h;a.syncToMarks(t.marks,n,e,c),a.findNodeMatch(t,o,l,c)||s&&e.state.selection.from>i&&e.state.selection.to<i+t.nodeSize&&(h=a.findIndexWithChild(r.node))>-1&&a.updateNodeAt(t,o,l,h,e)||a.updateNextNode(t,o,l,e,c,i)||a.addNode(t,o,l,e,i),i+=t.nodeSize}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),hi(this.contentDOM,this.children,e),Mn&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof qt)||n<t||i>t+this.node.content.size)return null;let r=e.input.compositionNode;if(!r||!this.dom.contains(r.parentNode))return null;if(this.node.inlineContent){let e=r.nodeValue,o=function(e,t,n,i){for(let r=0,o=0;r<e.childCount&&o<=i;){let s=e.child(r++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;r<e.childCount;){let t=e.child(r++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){if(o>=i&&l.slice(i-t.length-a,i-a)==t)return i-t.length;let e=a<i?l.lastIndexOf(t,i-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==i&&l.length>=i+t.length-a&&l.slice(i-a,i-a+t.length)==t)return i}}return-1}(this.node.content,e,n-t,i-t);return o<0?null:{node:r,pos:o,text:e}}return{node:r,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let r=t;for(;r.parentNode!=this.contentDOM;r=r.parentNode){for(;r.previousSibling;)r.parentNode.removeChild(r.previousSibling);for(;r.nextSibling;)r.parentNode.removeChild(r.nextSibling);r.pmViewDesc&&(r.pmViewDesc=void 0)}let o=new ii(this,r,t,i);e.input.compositionNodes.push(o),this.children=wi(this.children,n,n+i.length,e,o)}update(e,t,n,i){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(yi(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=fi(this.dom,this.nodeDOM,pi(this.outerDeco,this.node,t),pi(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function si(e,t,n,i,r){gi(i,t,e);let o=new oi(void 0,e,t,n,i,i,i,r,0);return o.contentDOM&&o.updateChildren(r,0),o}class ai extends oi{constructor(e,t,n,i,r,o,s){super(e,t,n,i,r,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let i=this.node.cut(e,t),r=document.createTextNode(i.text);return new ai(this.parent,i,this.outerDeco,this.innerDeco,r,r,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class li extends ti{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ci extends oi{constructor(e,t,n,i,r,o,s,a,l,c){super(e,t,n,i,r,o,s,l,c),this.spec=a}update(e,t,n,i){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let r=this.spec.update(e,t,n);return r&&this.updateInner(e,t,n,i),r}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function hi(e,t,n){let i=e.firstChild,r=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=i;)i=vi(i),r=!0;i=i.nextSibling}else r=!0,e.insertBefore(a,i);if(s instanceof ri){let t=i?i.previousSibling:e.lastChild;hi(s.contentDOM,s.children,n),i=t?t.nextSibling:e.firstChild}}for(;i;)i=vi(i),r=!0;r&&n.trackWrites==e&&(n.trackWrites=null)}const ui=function(e){e&&(this.nodeName=e)};ui.prototype=Object.create(null);const di=[new ui];function pi(e,t,n){if(0==e.length)return di;let i=n?di[0]:new ui,r=[i];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&r.push(i=new ui(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==r.length&&r.push(i=new ui(t.isInline?"span":"div")),"class"==e?i.class=(i.class?i.class+" ":"")+o:"style"==e?i.style=(i.style?i.style+";":"")+o:"nodeName"!=e&&(i[e]=o))}}}return r}function fi(e,t,n,i){if(n==di&&i==di)return t;let r=t;for(let t=0;t<i.length;t++){let o=i[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&r!=e&&(t=r.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||(t=document.createElement(o.nodeName),t.pmIsDeco=!0,t.appendChild(r),s=di[0]),r=t}mi(r,s||di[0],o)}return r}function mi(e,t,n){for(let i in t)"class"==i||"style"==i||"nodeName"==i||i in n||e.removeAttribute(i);for(let i in n)"class"!=i&&"style"!=i&&"nodeName"!=i&&n[i]!=t[i]&&e.setAttribute(i,n[i]);if(t.class!=n.class){let i=t.class?t.class.split(" ").filter(Boolean):[],r=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.remove(i[t]);for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.add(r[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=i.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function gi(e,t,n){return fi(e,e,di,pi(t,n,1!=e.nodeType))}function yi(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function vi(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class xi{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,i=n.children.length,r=e.childCount,o=new Map,s=[];e:for(;r>0;){let a;for(;;)if(i){let e=n.children[i-1];if(!(e instanceof ri)){a=e,i--;break}n=e,i=e.children.length}else{if(n==t)break e;i=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(r-1))break;--r,o.set(a,r),s.push(a)}}return{index:r,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,i){let r=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;r<s&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let r=-1,s=this.top.children.length;i<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let i=ri.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,i),this.top=i,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,i){let r,o=-1;if(i>=this.preMatch.index&&(r=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&r.matchesNode(e,t,n))o=this.top.children.indexOf(r,this.index);else for(let i=this.index,r=Math.min(this.top.children.length,i+5);i<r;i++){let r=this.top.children[i];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){o=i;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,i,r){let o=this.top.children[i];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,r)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,i,r,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof oi){let l=this.preMatch.matched.get(a);if(null!=l&&l!=r)return!1;let c,h=a.dom,u=this.isLocked(h)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&yi(t,a.outerDeco));if(!u&&a.update(e,t,n,i))return this.destroyBetween(this.index,s),a.dom!=h&&(this.changed=!0),this.index++,!0;if(!u&&(c=this.recreateWrapper(a,e,t,n,i,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(i,o+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,i,r,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!yi(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let s=oi.create(this.top,t,n,i,r,o);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,i,r){let o=oi.create(this.top,e,t,n,i,r);o.contentDOM&&o.updateChildren(i,r+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let i=new ni(this.top,e,t,n);this.top.children.splice(this.index++,0,i),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof ri;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ai)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Cn||Sn)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let i=new li(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function bi(e,t){return e.type.side-t.type.side}function wi(e,t,n,i,r){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,h=a+=l.size;c>=n||h<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,i)),r&&(o.push(r),r=void 0),h>n&&o.push(l.slice(n-c,l.size,i)))}return o}function ki(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let r=e.docView.nearestDesc(n.focusNode),o=r&&0==r.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=i.resolve(s);if(un(n)){for(a=s;r&&!r.node;)r=r.parent;let e=r.node;if(r&&e.isAtom&&_t.isSelectable(e)&&r.parent&&(!e.isInline||!function(e,t,n){for(let i=0==t,r=t==cn(e);i||r;){if(e==n)return!0;let t=tn(e);if(!(e=e.parentNode))return!1;i=i&&0==t,r=r&&t==cn(e)}}(n.focusNode,n.focusOffset,r.dom))){let e=r.posBefore;l=new _t(s==e?c:i.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,r=s;for(let i=0;i<n.rangeCount;i++){let o=n.getRangeAt(i);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),r=Math.max(r,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[a,s]=r==e.state.selection.anchor?[r,t]:[t,r],c=i.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let h=i.resolve(a);if(!l){l=Ai(e,h,c,"pointer"==t||e.state.selection.head<c.pos&&!o?1:-1)}return l}function Si(e){return e.editable?e.hasFocus():Di(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function zi(e,t=!1){let n=e.state.selection;if(Oi(e,n),Si(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Sn){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&sn(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,i="IMG"==n.nodeName;i?t.collapse(n.parentNode,tn(n)+1):t.collapse(n,0);!i&&!e.state.selection.visible&&xn&&bn<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let i,r,{anchor:o,head:s}=n;!Ci||n instanceof qt||(n.$from.parent.inlineContent||(i=Mi(e,n.from)),n.empty||n.$from.parent.inlineContent||(r=Mi(e,n.to))),e.docView.setSelection(o,s,e,t),Ci&&(i&&Ti(i),r&&Ti(r)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),i=n.anchorNode,r=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==i&&n.anchorOffset==r||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{Si(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ci=Cn||Sn&&zn<63;function Mi(e,t){let{node:n,offset:i}=e.docView.domFromPos(t,0),r=i<n.childNodes.length?n.childNodes[i]:null,o=i?n.childNodes[i-1]:null;if(Cn&&r&&"false"==r.contentEditable)return Ni(r);if(!(r&&"false"!=r.contentEditable||o&&"false"!=o.contentEditable)){if(r)return Ni(r);if(o)return Ni(o)}}function Ni(e){return e.contentEditable="true",Cn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ti(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Oi(e,t){if(t instanceof _t){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Ei(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Ei(e)}function Ei(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Ai(e,t,n,i){return e.someProp("createSelectionBetween",i=>i(e,t,n))||qt.between(t,n,i)}function ji(e){return!(e.editable&&!e.hasFocus())&&Di(e)}function Di(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Ri(e,t){let{$anchor:n,$head:i}=e.selection,r=t>0?n.max(i):n.min(i),o=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return o&&jt.findFrom(o,t)}function Ii(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function qi(e,t,n){let i=e.state.selection;if(!(i instanceof qt)){if(i instanceof _t&&i.node.isInline)return Ii(e,new qt(t>0?i.$to:i.$from));{let n=Ri(e.state,t);return!!n&&Ii(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=i,r=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!r||r.isText||!r.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+r.nodeSize*(t<0?-1:1));return Ii(e,new qt(i.$anchor,o))}if(!i.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Ri(e.state,t);return!!(n&&n instanceof _t)&&Ii(e,n)}if(!(Nn&&n.indexOf("m")>-1)){let n,r=i.$head,o=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!o||o.isText)return!1;let s=t<0?r.pos-o.nodeSize:r.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(_t.isSelectable(o)?Ii(e,new _t(t<0?e.state.doc.resolve(r.pos-o.nodeSize):r)):!!En&&Ii(e,new qt(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function Pi(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function _i(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function Li(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,o,s=!1;wn&&1==n.nodeType&&i<Pi(n)&&_i(n.childNodes[i],-1)&&(s=!0);for(;;)if(i>0){if(1!=n.nodeType)break;{let e=n.childNodes[i-1];if(_i(e,-1))r=n,o=--i;else{if(3!=e.nodeType)break;n=e,i=n.nodeValue.length}}}else{if(Bi(n))break;{let t=n.previousSibling;for(;t&&_i(t,-1);)r=n.parentNode,o=tn(t),t=t.previousSibling;if(t)n=t,i=Pi(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}s?Fi(e,n,i):r&&Fi(e,r,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,o,s=Pi(n);for(;;)if(i<s){if(1!=n.nodeType)break;if(!_i(n.childNodes[i],1))break;r=n,o=++i}else{if(Bi(n))break;{let t=n.nextSibling;for(;t&&_i(t,1);)r=t.parentNode,o=tn(t)+1,t=t.nextSibling;if(t)n=t,i=0,s=Pi(n);else{if(n=n.parentNode,n==e.dom)break;i=s=0}}}r&&Fi(e,r,o)}(e)}function Bi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Fi(e,t,n){if(3!=t.nodeType){let e,i;(i=function(e,t){for(;e&&t==e.childNodes.length&&!hn(e);)t=tn(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=i,n=0):(e=function(e,t){for(;e&&!t&&!hn(e);)t=tn(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let i=e.domSelection();if(!i)return;if(un(i)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),i.removeAllRanges(),i.addRange(e)}else i.extend&&i.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&zi(e)},50)}function Vi(e,t){let n=e.state.doc.resolve(t);if(!Sn&&!Tn&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),r=(n.top+n.bottom)/2;if(r>i.top&&r<i.bottom&&Math.abs(n.left-i.left)>1)return n.left<i.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),r=(n.top+n.bottom)/2;if(r>i.top&&r<i.bottom&&Math.abs(n.left-i.left)>1)return n.left>i.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Wi(e,t,n){let i=e.state.selection;if(i instanceof qt&&!i.empty||n.indexOf("s")>-1)return!1;if(Nn&&n.indexOf("m")>-1)return!1;let{$from:r,$to:o}=i;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Ri(e.state,t);if(n&&n instanceof _t)return Ii(e,n)}if(!r.parent.inlineContent){let n=t<0?r:o,s=i instanceof Bt?jt.near(n,t):jt.findFrom(n,t);return!!s&&Ii(e,s)}return!1}function $i(e,t){if(!(e.state.selection instanceof qt))return!0;let{$head:n,$anchor:i,empty:r}=e.state.selection;if(!n.sameParent(i))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let i=e.state.tr;return t<0?i.delete(n.pos-o.nodeSize,n.pos):i.delete(n.pos,n.pos+o.nodeSize),e.dispatch(i),!0}return!1}function Ji(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ui(e,t){let n=t.keyCode,i=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||Nn&&72==n&&"c"==i)return $i(e,-1)||Li(e,-1);if(46==n&&!t.shiftKey||Nn&&68==n&&"c"==i)return $i(e,1)||Li(e,1);if(13==n||27==n)return!0;if(37==n||Nn&&66==n&&"c"==i){let t=37==n?"ltr"==Vi(e,e.state.selection.from)?-1:1:-1;return qi(e,t,i)||Li(e,t)}if(39==n||Nn&&70==n&&"c"==i){let t=39==n?"ltr"==Vi(e,e.state.selection.from)?1:-1:1;return qi(e,t,i)||Li(e,t)}return 38==n||Nn&&80==n&&"c"==i?Wi(e,-1,i)||Li(e,-1):40==n||Nn&&78==n&&"c"==i?function(e){if(!Cn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Ji(e,n,"true"),setTimeout(()=>Ji(e,n,"false"),20)}return!1}(e)||Wi(e,1,i)||Li(e,1):i==(Nn?"m":"c")&&(66==n||73==n||89==n||90==n)}function Hi(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:i,openStart:r,openEnd:o}=t;for(;r>1&&o>1&&1==i.childCount&&1==i.firstChild.childCount;){r--,o--;let e=i.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),i=e.content}let s=e.someProp("clipboardSerializer")||Be.fromSchema(e.state.schema),a=ir(),l=a.createElement("div");l.appendChild(s.serializeFragment(i,{document:a}));let c,h=l.firstChild,u=0;for(;h&&1==h.nodeType&&(c=tr[h.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),u++}h=l.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${r} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function Ki(e,t,n,i,r){let o,s,a=r.parent.type.spec.code;if(!n&&!t)return null;let l=!!t&&(i||a||!n);if(l){if(e.someProp("transformPastedText",n=>{t=n(t,a||i,e)}),a)return s=new J(L.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0)}),s;let n=e.someProp("clipboardTextParser",n=>n(t,r,i,e));if(n)s=n;else{let n=r.marks(),{schema:i}=e.state,s=Be.fromSchema(i);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(i.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,i=ir().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e);(n=r&&tr[r[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join(""));if(i.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;rr||(rr=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return rr.createHTML(e)}(e),n)for(let e=0;e<n.length;e++)i=i.querySelector(n[e])||i;return i}(n),En&&function(e){let t=e.querySelectorAll(Sn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let i=t[n];1==i.childNodes.length&&" "==i.textContent&&i.parentNode&&i.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),i)}}(o);let c=o&&o.querySelector("[data-pm-slice]"),h=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let e=+h[3];e>0;e--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Ee.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!h),context:r,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Gi.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(h)s=function(e,t){if(!e.size)return e;let n,i=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:r,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=i.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;r=L.from(t.create(n[e+1],r)),o++,s++}return new J(r,o,s)}(er(s,+h[1],+h[2]),h[4]);else if(s=J.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i,r=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach(e=>{if(!o)return;let t,n=r.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&i.length&&Xi(n,i,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Zi(o[o.length-1],i.length));let t=Yi(e,n);o.push(t),r=r.matchType(t.type),i=n}}),o)return L.from(o)}return e}(s.content,r),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=er(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,l)}),s}const Gi=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Yi(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,L.from(e));return e}function Xi(e,t,n,i,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let o=Xi(e,t,n,i.lastChild,r+1);if(o)return i.copy(i.content.replaceChild(i.childCount-1,o));if(i.contentMatchAt(i.childCount).matchType(r==e.length-1?n.type:e[r+1]))return i.copy(i.content.append(L.from(Yi(n,e,r+1))))}}function Zi(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Zi(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(L.empty,!0);return e.copy(n.append(i))}function Qi(e,t,n,i,r,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),r<i-1&&(a=Qi(a,t,n,i,r+1,o)),r>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=r).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(L.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function er(e,t,n){return t<e.openStart&&(e=new J(Qi(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new J(Qi(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const tr={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let nr=null;function ir(){return nr||(nr=document.implementation.createHTMLDocument("title"))}let rr=null;const or={},sr={},ar={touchstart:!0,touchmove:!0};class lr{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function cr(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function hr(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>ur(e,t))})}function ur(e,t){return e.someProp("handleDOMEvents",n=>{let i=n[t.type];return!!i&&(i(e,t)||t.defaultPrevented)})}function dr(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function pr(e){return{left:e.clientX,top:e.clientY}}function fr(e,t,n,i,r){if(-1==i)return!1;let o=e.state.doc.resolve(i);for(let i=o.depth+1;i>0;i--)if(e.someProp(t,t=>i>o.depth?t(e,n,o.nodeAfter,o.before(i),r,!0):t(e,n,o.node(i),o.before(i),r,!1)))return!0;return!1}function mr(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let i=e.state.tr.setSelection(t);i.setMeta("pointer",!0),e.dispatch(i)}function gr(e,t,n,i,r){return fr(e,"handleClickOn",t,n,i)||e.someProp("handleClick",n=>n(e,t,i))||(r?function(e,t){if(-1==t)return!1;let n,i,r=e.state.selection;r instanceof _t&&(n=r.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(_t.isSelectable(t)){i=n&&r.$from.depth>0&&e>=r.$from.depth&&o.before(r.$from.depth+1)==r.$from.pos?o.before(r.$from.depth):o.before(e);break}}return null!=i&&(mr(e,_t.create(e.state.doc,i)),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&_t.isSelectable(i))&&(mr(e,new _t(n)),!0)}(e,n))}function yr(e,t,n,i){return fr(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",n=>n(e,t,i))}function vr(e,t,n,i){return fr(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",n=>n(e,t,i))||function(e,t,n){if(0!=n.button)return!1;let i=e.state.doc;if(-1==t)return!!i.inlineContent&&(mr(e,qt.create(i,0,i.content.size)),!0);let r=i.resolve(t);for(let t=r.depth+1;t>0;t--){let n=t>r.depth?r.nodeAfter:r.node(t),o=r.before(t);if(n.inlineContent)mr(e,qt.create(i,o+1,o+1+n.content.size));else{if(!_t.isSelectable(n))continue;mr(e,_t.create(i,o))}return!0}}(e,n,i)}function xr(e){return Nr(e)}sr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!kr(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!On||!Sn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Mn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||Ui(e,n)?n.preventDefault():cr(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,dn(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},sr.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},sr.keypress=(e,t)=>{let n=t;if(kr(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Nn&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof qt&&i.$from.sameParent(i.$to))){let t=String.fromCharCode(n.charCode),r=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",n=>n(e,i.$from.pos,i.$to.pos,t,r))||e.dispatch(r()),n.preventDefault()}};const br=Nn?"metaKey":"ctrlKey";or.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=xr(e),r=Date.now(),o="singleClick";r-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}(n,e.input.lastClick)&&!n[br]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:o,button:n.button};let s=e.posAtCoords(pr(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new wr(e,s,n,!!i)):("doubleClick"==o?yr:vr)(e,s.pos,s.inside,n)?n.preventDefault():cr(e,"pointer"))};class wr{constructor(e,t,n,i){let r,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[br],this.allowDefault=n.shiftKey,t.inside>-1)r=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);r=n.parent,o=n.depth?n.before():0}const s=i?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:l}=e.state;(0==n.button&&r.type.spec.draggable&&!1!==r.type.spec.selectable||l instanceof _t&&l.from<=o&&l.to>o)&&(this.mightDrag={node:r,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!wn||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),cr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>zi(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(pr(e))),this.updateAllowDefault(e),this.allowDefault||!t?cr(this.view,"pointer"):gr(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Cn&&this.mightDrag&&!this.mightDrag.node.isAtom||Sn&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(mr(this.view,jt.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):cr(this.view,"pointer")}move(e){this.updateAllowDefault(e),cr(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function kr(e,t){return!!e.composing||!!(Cn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}or.touchstart=e=>{e.input.lastTouch=Date.now(),xr(e),cr(e,"pointer")},or.touchmove=e=>{e.input.lastTouch=Date.now(),cr(e,"pointer")},or.contextmenu=e=>xr(e);const Sr=On?5e3:-1;function zr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Nr(e),t))}function Cr(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Mr(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=cn(e=e.childNodes[t-1])}else{if(!e.parentNode||hn(e))return null;t=tn(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),i=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||hn(e))return null;t=tn(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&i&&n!=i){let t=i.pmViewDesc,r=e.domObserver.lastChangedTextNode;if(n==r||i==r)return r;if(!t||!t.isText(i.nodeValue))return i;if(e.input.compositionNode==i){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return i}}return n||i}function Nr(e,t=!1){if(!(On&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Cr(e),t||e.docView&&e.docView.dirty){let n=ki(e),i=e.state.selection;return n&&!n.eq(i)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}sr.compositionstart=sr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof qt&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||Sn&&Tn&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let i=t.childNodes[n];return 1==i.nodeType&&"false"==i.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),Nr(e,!0),e.markCursor=null;else if(Nr(e,!t.selection.empty),wn&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,i=t.focusOffset;n&&1==n.nodeType&&0!=i;){let t=i<0?n.lastChild:n.childNodes[i-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,i=-1}}e.input.composing=!0}zr(e,Sr)},sr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,zr(e,20))};const Tr=xn&&bn<15||Mn&&An<604;function Or(e,t,n,i,r){let o=Ki(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,r,o||J.empty)))return!0;if(!o)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=s?e.state.tr.replaceSelectionWith(s,i):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Er(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}or.copy=sr.cut=(e,t)=>{let n=t,i=e.state.selection,r="cut"==n.type;if(i.empty)return;let o=Tr?null:n.clipboardData,s=i.content(),{dom:a,text:l}=Hi(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,a),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},sr.paste=(e,t)=>{let n=t;if(e.composing&&!On)return;let i=Tr?null:n.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;i&&Or(e,Er(i),i.getData("text/html"),r,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?Or(e,i.value,null,r,t):Or(e,i.textContent,i.innerHTML,r,t)},50)}(e,n)};class Ar{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const jr=Nn?"altKey":"ctrlKey";function Dr(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[jr]}or.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r,o=e.state.selection,s=o.empty?null:e.posAtCoords(pr(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof _t?o.to-1:o.to));else if(i&&i.mightDrag)r=_t.create(e.state.doc,i.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(r=_t.create(e.state.doc,t.posBefore))}let a=(r||e.state.selection).content(),{dom:l,text:c,slice:h}=Hi(e,a);(!n.dataTransfer.files.length||!Sn||zn>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Tr?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Tr||n.dataTransfer.setData("text/plain",c),e.dragging=new Ar(h,Dr(e,n),r)},or.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},sr.dragover=sr.dragenter=(e,t)=>t.preventDefault(),sr.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(pr(t));if(!i)return;let r=e.state.doc.resolve(i.pos),o=n&&n.slice;o?e.someProp("transformPasted",t=>{o=t(o,e,!1)}):o=Ki(e,Er(t.dataTransfer),Tr?null:t.dataTransfer.getData("text/html"),!1,r);let s=!(!n||!Dr(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||J.empty,s)))return void t.preventDefault();if(!o)return;t.preventDefault();let a=o?function(e,t,n){let i=e.resolve(t);if(!n.content.size)return t;let r=n.content;for(let e=0;e<n.openStart;e++)r=r.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=i.depth;t>=0;t--){let n=t==i.depth?0:i.pos<=(i.start(t+1)+i.end(t+1))/2?-1:1,o=i.index(t)+(n>0?1:0),s=i.node(t),a=!1;if(1==e)a=s.canReplace(o,o,r);else{let e=s.contentMatchAt(o).findWrapping(r.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?i.pos:n<0?i.before(t+1):i.after(t+1)}return null}(e.state.doc,r.pos,o):r.pos;null==a&&(a=r.pos);let l=e.state.tr;if(s){let{node:e}=n;e?e.replace(l):l.deleteSelection()}let c=l.mapping.map(a),h=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,u=l.doc;h?l.replaceRangeWith(c,c,o.content.firstChild):l.replaceRange(c,c,o);if(l.doc.eq(u))return;let d=l.doc.resolve(c);if(h&&_t.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new _t(d));else{let t=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((e,n,i,r)=>t=r),l.setSelection(Ai(e,d,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},or.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&zi(e)},20))},or.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},or.beforeinput=(e,t)=>{if(Sn&&On&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,dn(8,"Backspace"))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in sr)or[e]=sr[e];function Rr(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Ir{constructor(e,t){this.toDOM=e,this.spec=t||Br,this.side=this.spec.side||0}map(e,t,n,i){let{pos:r,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new _r(r-n,r-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Ir&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Rr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class qr{constructor(e,t){this.attrs=e,this.spec=t||Br}map(e,t,n,i){let r=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return r>=o?null:new _r(r,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof qr&&Rr(this.attrs,e.attrs)&&Rr(this.spec,e.spec)}static is(e){return e.type instanceof qr}destroy(){}}class Pr{constructor(e,t){this.attrs=e,this.spec=t||Br}map(e,t,n,i){let r=e.mapResult(t.from+i,1);if(r.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=r.pos?null:new _r(r.pos-n,o.pos-n,this)}valid(e,t){let n,{index:i,offset:r}=e.content.findIndex(t.from);return r==t.from&&!(n=e.child(i)).isText&&r+n.nodeSize==t.to}eq(e){return this==e||e instanceof Pr&&Rr(this.attrs,e.attrs)&&Rr(this.spec,e.spec)}destroy(){}}class _r{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new _r(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new _r(e,e,new Ir(t,n))}static inline(e,t,n,i){return new _r(e,t,new qr(n,i))}static node(e,t,n,i){return new _r(e,t,new Pr(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof qr}get widget(){return this.type instanceof Ir}}const Lr=[],Br={};class Fr{constructor(e,t){this.local=e.length?e:Lr,this.children=t.length?t:Lr}static create(e,t){return t.length?Hr(t,e,0,Br):Vr}find(e,t,n){let i=[];return this.findInner(null==e?0:e,null==t?1e9:t,i,0,n),i}findInner(e,t,n,i,r){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!r||r(s.spec))&&n.push(s.copy(s.from+i,s.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,i+s,r)}}map(e,t,n){return this==Vr||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Br)}mapInner(e,t,n,i,r){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,i);a&&a.type.valid(t,a)?(o||(o=[])).push(a):r.onRemove&&r.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,i,r,o,s){let a=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let i=0;n.maps[e].forEach((e,n,r,o)=>{let s=o-r-(n-e);for(let r=0;r<a.length;r+=3){let o=a[r+1];if(o<0||e>o+t-i)continue;let l=a[r]+t-i;n>=l?a[r+1]=e<=l?-2:-1:e>=t&&s&&(a[r]+=s,a[r+1]+=s)}i+=s}),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+o),h=c-r;if(h<0||h>=i.content.size){l=!0;continue}let u=n.map(e[t+1]+o,-1)-r,{index:d,offset:p}=i.content.findIndex(h),f=i.maybeChild(d);if(f&&p==h&&p+f.nodeSize==u){let i=a[t+2].mapInner(n,f,c+1,e[t]+o+1,s);i!=Vr?(a[t]=h,a[t+1]=u,a[t+2]=i):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,i,r,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(i,r,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,r,o,s),c=Hr(l,i,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Fr(t.sort(Kr),a)}(this.children,o||[],e,t,n,i,r):o?new Fr(o.sort(Kr),Lr):Vr}add(e,t){return t.length?this==Vr?Fr.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,r=0;e.forEach((e,o)=>{let s,a=o+n;if(s=Jr(t,e,a)){for(i||(i=this.children.slice());r<i.length&&i[r]<o;)r+=3;i[r]==o?i[r+2]=i[r+2].addInner(e,s,a+1):i.splice(r,0,o,o+e.nodeSize,Hr(s,e,a+1,Br)),r+=3}});let o=$r(r?Ur(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new Fr(o.length?this.local.concat(o).sort(Kr):this.local,i||this.children)}remove(e){return 0==e.length||this==Vr?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let i=0;i<n.length;i+=3){let r,o=n[i]+t,s=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(r||(r=[])).push(t));if(!r)continue;n==this.children&&(n=this.children.slice());let a=n[i+2].removeInner(r,o+1);a!=Vr?n[i+2]=a:(n.splice(i,3),i-=3)}if(i.length)for(let n,r=0;r<e.length;r++)if(n=e[r])for(let e=0;e<i.length;e++)i[e].eq(n,t)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1));return n==this.children&&i==this.local?this:i.length||n.length?new Fr(i,n):Vr}forChild(e,t){if(this==Vr)return this;if(t.isLeaf)return Fr.empty;let n,i;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let r=e+1,o=r+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>r&&t.type instanceof qr){let e=Math.max(r,t.from)-r,n=Math.min(o,t.to)-r;e<n&&(i||(i=[])).push(t.copy(e,n))}}if(i){let e=new Fr(i.sort(Kr),Lr);return n?new Wr([e,n]):e}return n||Vr}eq(e){if(this==e)return!0;if(!(e instanceof Fr)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Gr(this.localsInner(e))}localsInner(e){if(this==Vr)return Lr;if(e.inlineContent||!this.local.some(qr.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof qr||t.push(this.local[e]);return t}forEachSet(e){e(this)}}Fr.empty=new Fr([],[]),Fr.removeOverlap=Gr;const Vr=Fr.empty;class Wr{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,Br));return Wr.from(n)}forChild(e,t){if(t.isLeaf)return Fr.empty;let n=[];for(let i=0;i<this.members.length;i++){let r=this.members[i].forChild(e,t);r!=Vr&&(r instanceof Wr?n=n.concat(r.members):n.push(r))}return Wr.from(n)}eq(e){if(!(e instanceof Wr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let i=0;i<this.members.length;i++){let r=this.members[i].localsInner(e);if(r.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<r.length;e++)t.push(r[e])}else t=r}return t?Gr(n?t:t.sort(Kr)):Lr}static from(e){switch(e.length){case 0:return Vr;case 1:return e[0];default:return new Wr(e.every(e=>e instanceof Fr)?e:e.reduce((e,t)=>e.concat(t instanceof Fr?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function $r(e,t){if(!t||!e.length)return e;let n=[];for(let i=0;i<e.length;i++){let r=e[i];n.push(new _r(r.from+t,r.to+t,r.type))}return n}function Jr(e,t,n){if(t.isLeaf)return null;let i=n+t.nodeSize,r=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<i&&((r||(r=[])).push(t),e[o]=null);return r}function Ur(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Hr(e,t,n,i){let r=[],o=!1;t.forEach((t,s)=>{let a=Jr(e,t,s+n);if(a){o=!0;let e=Hr(a,t,n+s+1,i);e!=Vr&&r.push(s,s+t.nodeSize,e)}});let s=$r(o?Ur(e):e,-n).sort(Kr);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(i.onRemove&&i.onRemove(s[e].spec),s.splice(e--,1));return s.length||r.length?new Fr(s,r):Vr}function Kr(e,t){return e.from-t.from||e.to-t.to}function Gr(e){let t=e;for(let n=0;n<t.length-1;n++){let i=t[n];if(i.from!=i.to)for(let r=n+1;r<t.length;r++){let o=t[r];if(o.from!=i.from){o.from<i.to&&(t==e&&(t=e.slice()),t[n]=i.copy(i.from,o.from),Yr(t,r,i.copy(o.from,i.to)));break}o.to!=i.to&&(t==e&&(t=e.slice()),t[r]=o.copy(o.from,i.to),Yr(t,r+1,o.copy(i.to,o.to)))}}return t}function Yr(e,t,n){for(;t<e.length&&Kr(n,e[t])>0;)t++;e.splice(t,0,n)}function Xr(e){let t=[];return e.someProp("decorations",n=>{let i=n(e.state);i&&i!=Vr&&t.push(i)}),e.cursorWrapper&&t.push(Fr.create(e.state.doc,[e.cursorWrapper.deco])),Wr.from(t)}const Zr={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Qr=xn&&bn<=11;class eo{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class to{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eo,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);xn&&bn<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Cn&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Qr&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Zr)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ji(this.view)){if(this.suppressingSelectionUpdates)return zi(this.view);if(xn&&bn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&sn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let t=e.focusNode;t;t=nn(t))n.add(t);for(let i=e.anchorNode;i;i=nn(i))if(n.has(i)){t=i;break}let i=t&&this.view.docView.nearestDesc(t);return i&&i.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&ji(e)&&!this.ignoreSelectionChange(n),r=-1,o=-1,s=!1,a=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],a);n&&(r=r<0?n.from:Math.min(n.from,r),o=o<0?n.to:Math.max(n.to,o),n.typeOver&&(s=!0))}if(wn&&a.length){let t=a.filter(e=>"BR"==e.nodeName);if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let i of t){let t=i.parentNode;!t||"LI"!=t.nodeName||n&&oo(e,n)==t||i.remove()}}}else if((Sn||Cn)&&a.some(e=>"BR"==e.nodeName)&&(8==e.input.lastKeyCode||46==e.input.lastKeyCode))for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;t&&1==t.nodeType&&"false"==t.contentEditable&&e.parentNode.removeChild(e)}let l=null;r<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&un(n)&&(l=ki(e))&&l.eq(jt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,zi(e),this.currentSelection.set(n),e.scrollToSelection()):(r>-1||i)&&(r>-1&&(e.docView.markDirty(r,o),function(e){if(no.has(e))return;if(no.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=wn,io)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),io=!0}}(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:i,focusOffset:r}=e.domSelectionRange();for(let o of t)if("TR"==(null===(n=o.parentNode)||void 0===n?void 0:n.nodeName)){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(o,n.firstChild),i==o&&e.domSelection().collapse(o,r)}else o.parentNode.removeChild(o)}}(e,a)),this.handleDOMChange(r,o,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||zi(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let i=e.addedNodes[n];t.push(i),3==i.nodeType&&(this.lastChangedTextNode=i)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,r=e.nextSibling;if(xn&&bn<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(i=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(r=o)}let o=i&&i.parentNode==e.target?tn(i)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=r&&r.parentNode==e.target?tn(r):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let no=new WeakMap,io=!1;function ro(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return sn(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}function oo(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function so(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Cn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Cn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const ao=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function lo(e,t,n,i,r){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=ki(e,t);if(n&&!e.state.selection.eq(n)){if(Sn&&On&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,dn(13,"Enter"))))return;let i=e.state.tr.setSelection(n);"pointer"==t?i.setMeta("pointer",!0):"key"==t&&i.scrollIntoView(),o&&i.setMeta("composition",o),e.dispatch(i)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l,c,h=e.state.selection,u=function(e,t,n){let i,{node:r,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),h=c.anchorNode;if(h&&e.dom.contains(1==h.nodeType?h:h.parentNode)&&(i=[{node:h,offset:c.anchorOffset}],un(c)||i.push({node:c.focusNode,offset:c.focusOffset})),Sn&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let u=e.state.doc,d=e.someProp("domParser")||Ee.fromSchema(e.state.schema),p=u.resolve(a),f=null,m=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:i,ruleFromNode:so,context:p});if(i&&null!=i[0].pos){let e=i[0].pos,t=i[1]&&i[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),d=e.state.doc,p=d.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,c="end"):(l=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let f=function(e,t,n,i,r){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==r){i-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){let e=i<=o&&i>=s?o-i:0;o-=e,o&&o<t.size&&uo(t.textBetween(o-1,o+1))&&(o+=e?1:-1),a=o+(a-s),s=o}else if(a<o){let t=i<=o&&i>=a?o-i:0;o-=t,o&&o<e.size&&uo(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,u.doc.content,u.from,l,c);if(f&&e.input.domChangeCount++,(Mn&&e.input.lastIOSEnter>Date.now()-225||On)&&r.some(e=>1==e.nodeType&&!ao.test(e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",t=>t(e,dn(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!f){if(!(i&&h instanceof qt&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=co(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);o&&n.setMeta("composition",o),e.dispatch(n)}}return}f={start:h.from,endA:h.to,endB:h.to}}e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof qt&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),xn&&bn<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>u.from&&"  "==u.doc.textBetween(f.start-u.from-1,f.start-u.from+1)&&(f.start--,f.endA--,f.endB--);let m=u.doc.resolveNoCache(f.start-u.from),g=u.doc.resolveNoCache(f.endB-u.from),y=d.resolve(f.start),v=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((Mn&&e.input.lastIOSEnter>Date.now()-225&&(!v||r.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!v&&m.pos<u.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(u.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,dn(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,i,r){if(n-t<=r.pos-i.pos||ho(i,!0,!1)<r.pos)return!1;let o=e.resolve(t);if(!i.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(ho(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||ho(s,!0,!1)<n)&&i.parent.content.cut(i.parentOffset).eq(s.parent.content)}(d,f.start,f.endA,m,g)&&e.someProp("handleKeyDown",t=>t(e,dn(8,"Backspace"))))return void(On&&Sn&&e.domObserver.suppressSelectionUpdates());Sn&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),On&&!v&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==f.endA&&(f.endB-=2,g=u.doc.resolveNoCache(f.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,dn(13,"Enter"))})},20));let x,b=f.start,w=f.endA,k=t=>{let n=t||e.state.tr.replace(b,w,u.doc.slice(f.start-u.from,f.endB-u.from));if(u.sel){let t=co(e,n.doc,u.sel);t&&!(Sn&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==b||t.head==n.mapping.map(w)-1)||xn&&t.empty&&t.head==b)&&n.setSelection(t)}return o&&n.setMeta("composition",o),n.scrollIntoView()};if(v)if(m.pos==g.pos){xn&&bn<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>zi(e),20));let t=k(e.state.tr.delete(b,w)),n=d.resolve(f.start).marksAcross(d.resolve(f.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(f.endA==f.endB&&(x=function(e,t){let n,i,r,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<o.length;e++)l=o[e].removeFromSet(l);if(1==a.length&&0==l.length)i=a[0],n="add",r=e=>e.mark(i.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;i=l[0],n="remove",r=e=>e.mark(i.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(r(t.child(e)));if(L.from(c).eq(e))return{mark:i,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start())))){let t=k(e.state.tr);"add"==x.type?t.addMark(b,w,x.mark):t.removeMark(b,w,x.mark),e.dispatch(t)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset),n=()=>k(e.state.tr.insertText(t,b,w));e.someProp("handleTextInput",i=>i(e,b,w,t,n))||e.dispatch(n())}else e.dispatch(k());else e.dispatch(k())}function co(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Ai(e,t.resolve(n.anchor),t.resolve(n.head))}function ho(e,t,n){let i=e.depth,r=t?e.end():e.pos;for(;i>0&&(t||e.indexAfter(i)==e.node(i).childCount);)i--,r++,t=!1;if(n){let t=e.node(i).maybeChild(e.indexAfter(i));for(;t&&!t.isLeaf;)t=t.firstChild,r++}return r}function uo(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class po{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new lr,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(vo),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=go(this),mo(this),this.nodeViews=yo(this),this.docView=si(this.state.doc,fo(this),Xr(this),this.dom,this),this.domObserver=new to(this,(e,t,n,i)=>lo(this,e,t,n,i)),this.domObserver.start(),function(e){for(let t in or){let n=or[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!dr(e,t)||ur(e,t)||!e.editable&&t.type in sr||n(e,t)},ar[t]?{passive:!0}:void 0)}Cn&&e.dom.addEventListener("input",()=>null),hr(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&hr(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(vo),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let i=this.state,r=!1,o=!1;e.storedMarks&&this.composing&&(Cr(this),o=!0),this.state=e;let s=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=yo(this);(function(e,t){let n=0,i=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let e in t)i++;return n!=i})(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&hr(this),this.editable=go(this),mo(this);let a=Xr(this),l=fo(this),c=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",h=r||!this.docView.matchesNode(e.doc,l,a);!h&&e.selection.eq(i.selection)||(o=!0);let u="preserve"==c&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,i=e.dom.getBoundingClientRect(),r=Math.max(0,i.top);for(let o=(i.left+i.right)/2,s=r+1;s<Math.min(innerHeight,i.bottom);s+=5){let i=e.root.elementFromPoint(o,s);if(!i||i==e.dom||!e.dom.contains(i))continue;let a=i.getBoundingClientRect();if(a.top>=r-20){t=i,n=a.top;break}}return{refDOM:t,refTop:n,stack:qn(e.dom)}}(this);if(o){this.domObserver.stop();let t=h&&(xn||Sn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(i.selection,e.selection);if(h){let n=Sn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Mr(this)),!r&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=si(e.doc,l,a,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return sn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?zi(this,t):(Oi(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let i=e?e.getBoundingClientRect().top:0;Pn(n,0==i?0:i-t)}(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof _t){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&In(this,t.getBoundingClientRect(),e)}else In(this,this.coordsAtPos(this.state.selection.head,1),e);else;}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(i=e)}this.dragging=new Ar(e.slice,e.move,i<0?void 0:_t.create(this.state.doc,i))}someProp(e,t){let n,i=this._props&&this._props[e];if(null!=i&&(n=t?t(i):i))return n;for(let i=0;i<this.directPlugins.length;i++){let r=this.directPlugins[i].props[e];if(null!=r&&(n=t?t(r):r))return n}let r=this.state.plugins;if(r)for(let i=0;i<r.length;i++){let o=r[i].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){if(xn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(_n)return e.focus(_n);let t=qn(e);e.focus(null==_n?{get preventScroll(){return _n={preventScroll:!0},!0}}:void 0),_n||(_n=!1,Pn(t,0))}(this.dom),zi(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}updateRoot(){this._root=null}posAtCoords(e){return Vn(this,e)}coordsAtPos(e,t=1){return Un(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(null==i)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return ei(this,t||this.state,e)}pasteHTML(e,t){return Or(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Or(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Hi(this,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Xr(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,rn=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){ur(e,t)||!or[t.type]||!e.editable&&t.type in sr||or[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?Cn&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return ro(e,n)}let n;function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",i,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",i,!0),n?ro(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function fo(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[_r.node(0,e.state.doc.content.size,t)]}function mo(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:_r.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function go(e){return!e.someProp("editable",t=>!1===t(e.state))}function yo(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function vo(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var xo;po.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};var bo="ssml-editor-focused",wo="ssml-tag",ko="ssml-text-mark",So="ssml-editor-phoneme__char",zo="ssml-editor-number-tip__char",Co="ssml-editor-text-media__mark",Mo="preventFloatingMenu",No=(s(s(s(s(s(s(s(s(s(s(xo={},k.Word,"连读"),k.Breath,"换气"),k.Break,"停顿"),k.Phoneme,"多音字"),k.Speaker,"发音人"),k.SpeechRate,"语速"),k.SpeechPitch,"语调"),k.SpeechVolume,"音量"),k.SpeechLanguage,"语种"),k.Action,"动作"),s(s(s(s(s(s(s(xo,k.Avatar,"主播"),k.Emotion,"表情"),k.SayAs,s(s(s(s(s(s({},S.auto,"自动"),S.digits,"读数字"),S.cardinal,"读数值"),0,"自动"),1,"读数字"),2,"读数值")),k.Command,"指令"),k.Wait,"等待"),k.PptControl,"PPT控制"),k.SoundEvent,"音效")),To=s(s(s({},k.Word,"[w0]"),k.Breath,"[w3]"),k.SayAs,s(s(s({},S.auto,"[n0]"),S.digits,"[n1]"),S.cardinal,"[n2]")),Oo=function(){function e(){i(this,e),s(this,"nodes",{}),s(this,"marks",{}),s(this,"plugins",{})}return o(e,[{key:"registerNode",value:function(e,t){this.nodes[e]=t}},{key:"registerMark",value:function(e,t){this.marks[e]=t}},{key:"registerPlugin",value:function(e,t){this.plugins[e]=t}},{key:"getNodes",value:function(){return d({},this.nodes)}},{key:"getMarks",value:function(){return d({},this.marks)}},{key:"getPlugins",value:function(e){var t;return null===(t=Object.values(this.plugins))||void 0===t?void 0:t.map(function(t){return t instanceof Xt?t:t(e)})}},{key:"clone",value:function(){var t=new e;return Object.entries(this.nodes).forEach(function(e){var n=g(e,2),i=n[0],r=n[1];return t.registerNode(i,r)}),Object.entries(this.marks).forEach(function(e){var n=g(e,2),i=n[0],r=n[1];return t.registerMark(i,r)}),Object.entries(this.plugins).forEach(function(e){var n=g(e,2),i=n[0],r=n[1];return t.registerPlugin(i,r)}),t}}])}(),Eo=new Oo,Ao="highlight";var jo=new Xt({key:new en(Ao),state:{init:function(){return Fr.empty},apply:function(e,t,n,i){var r=e.getMeta(Ao);return null!=r&&r.active?function(e,t,n){var i=[];return i.push(_r.inline(t,n,{class:"ssml-text-highlight"})),Fr.create(e,i)}(i.doc,r.from,r.to):!1===(null==r?void 0:r.active)?Fr.empty:t.map(e.mapping,e.doc)}},props:{decorations:function(e){return this.getState(e)}}});Eo.registerPlugin(Ao,jo);var Do={highlight:"highlight",clearHighlight:"clearHighlight"};D({name:Do.highlight,description:"高亮",execute:function(e,t){var n=e.state,i=e.dispatch;return i&&i(n.tr.setMeta(Ao,t)),{success:!0}},validate:function(e){return{available:!0}}}),D({name:Do.clearHighlight,description:"清除高亮",execute:function(e){var t=e.state,n=e.dispatch;return n&&n(t.tr.setMeta(Ao,{from:0,to:0,active:!1})),{success:!0}},validate:function(e){return{available:!0}}});var Ro=200,Io=function(){};Io.prototype.append=function(e){return e.length?(e=Io.from(e),!this.length&&e||e.length<Ro&&this.leafAppend(e)||this.length<Ro&&e.leafPrepend(this)||this.appendInner(e)):this},Io.prototype.prepend=function(e){return e.length?Io.from(e).append(this):this},Io.prototype.appendInner=function(e){return new Po(this,e)},Io.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Io.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Io.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Io.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Io.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var i=[];return this.forEach(function(t,n){return i.push(e(t,n))},t,n),i},Io.from=function(e){return e instanceof Io?e:e&&e.length?new qo(e):Io.empty};var qo=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,i){for(var r=t;r<n;r++)if(!1===e(this.values[r],i+r))return!1},t.prototype.forEachInvertedInner=function(e,t,n,i){for(var r=t-1;r>=n;r--)if(!1===e(this.values[r],i+r))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Ro)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Ro)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Io);Io.empty=new qo([]);var Po=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,i){var r=this.left.length;return!(t<r&&!1===this.left.forEachInner(e,t,Math.min(n,r),i))&&(!(n>r&&!1===this.right.forEachInner(e,Math.max(t-r,0),Math.min(this.length,n)-r,i+r))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,i){var r=this.left.length;return!(t>r&&!1===this.right.forEachInvertedInner(e,t-r,Math.max(n,r)-r,i+r))&&(!(n<r&&!1===this.left.forEachInvertedInner(e,Math.min(t,r),n,i))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Io);class _o{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,i,r=this.items.length;for(;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(n=this.remapping(r,this.items.length),i=n.maps.length);let o,s,a=e.tr,l=[],c=[];return this.items.forEach((e,t)=>{if(!e.step)return n||(n=this.remapping(r,t+1),i=n.maps.length),i--,void c.push(e);if(n){c.push(new Lo(e.map));let t,r=e.step.map(n.slice(i));r&&a.maybeStep(r).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new Lo(t,void 0,void 0,l.length+c.length))),i--,t&&n.appendMap(t,i)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(i)):e.selection,s=new _o(this.items.slice(0,r).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,i){let r=[],o=this.eventCount,s=this.items,a=!i&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),h=new Lo(e.mapping.maps[n],c,t);(l=a&&a.merge(h))&&(h=l,n?r.pop():s=s.slice(0,s.length-1)),r.push(h),t&&(o++,t=void 0),i||(a=h)}let l=o-n.depth;return l>Fo&&(s=function(e,t){let n;return e.forEach((e,i)=>{if(e.selection&&0==t--)return n=i,!1}),e.slice(n)}(s,l),o-=l),new _o(s.append(r),o)}remapping(e,t){let n=new Xe;return this.items.forEach((t,i)=>{let r=null!=t.mirrorOffset&&i-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,r)},e,t),n}addMaps(e){return 0==this.eventCount?this:new _o(this.items.append(e.map(e=>new Lo(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),r=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let a=t;this.items.forEach(t=>{let i=r.getMirror(--a);if(null==i)return;o=Math.min(o,i);let l=r.maps[i];if(t.step){let o=e.steps[i].invert(e.docs[i]),c=t.selection&&t.selection.map(r.slice(a+1,i));c&&s++,n.push(new Lo(l,o,c))}else n.push(new Lo(l))},i);let l=[];for(let e=t;e<o;e++)l.push(new Lo(r.maps[e]));let c=this.items.slice(0,i).append(l).append(n),h=new _o(c,s);return h.emptyItemCount()>500&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],r=0;return this.items.forEach((o,s)=>{if(s>=e)i.push(o),o.selection&&r++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&r++;let l,c=new Lo(s.invert(),e,a),h=i.length-1;(l=i.length&&i[h].merge(c))?i[h]=l:i.push(c)}}else o.map&&n--},this.items.length,0),new _o(Io.from(i.reverse()),r)}}_o.empty=new _o(Io.empty,0);class Lo{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Lo(t.getMap().invert(),t,this.selection)}}}class Bo{constructor(e,t,n,i,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=r}}const Fo=20;function Vo(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,i,r)=>t.push(i,r));return t}function Wo(e,t){if(!e)return null;let n=[];for(let i=0;i<e.length;i+=2){let r=t.map(e[i],1),o=t.map(e[i+1],-1);r<=o&&n.push(r,o)}return n}let $o=!1,Jo=null;function Uo(e){let t=e.plugins;if(Jo!=t){$o=!1,Jo=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){$o=!0;break}}return $o}const Ho=new en("history"),Ko=new en("closeHistory");function Go(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Xt({key:Ho,state:{init:()=>new Bo(_o.empty,_o.empty,null,0,-1),apply:(t,n,i)=>function(e,t,n,i){let r,o=n.getMeta(Ho);if(o)return o.historyState;n.getMeta(Ko)&&(e=new Bo(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Ho))return s.getMeta(Ho).redo?new Bo(e.done.addTransform(n,void 0,i,Uo(t)),e.undone,Vo(n.mapping.maps),e.prevTime,e.prevComposition):new Bo(e.done,e.undone.addTransform(n,void 0,i,Uo(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new Bo(e.done.rebased(n,r),e.undone.rebased(n,r),Wo(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Bo(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Wo(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let r=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=r&&(e.prevTime<(n.time||0)-i.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,i)=>{for(let r=0;r<t.length;r+=2)e<=t[r+1]&&i>=t[r]&&(n=!0)}),n}(n,e.prevRanges)),a=s?Wo(e.prevRanges,n.mapping):Vo(n.mapping.maps);return new Bo(e.done.addTransform(n,o?t.selection.getBookmark():void 0,i,Uo(t)),_o.empty,a,n.time,null==r?e.prevComposition:r)}}(n,i,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i="historyUndo"==n?Xo:"historyRedo"==n?Zo:null;return!(!i||!e.editable)&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}function Yo(e,t){return(n,i)=>{let r=Ho.getState(n);if(!r||0==(e?r.undone:r.done).eventCount)return!1;if(i){let o=function(e,t,n){let i=Uo(t),r=Ho.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,i);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),r,i),l=new Bo(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Ho,{redo:n,historyState:l})}(r,n,e);o&&i(t?o.scrollIntoView():o)}return!0}}const Xo=Yo(!1,!0),Zo=Yo(!0,!0);var Qo={undo:"undo",redo:"redo",clear:"clear"};D({name:Qo.undo,description:"撤销",execute:function(e){var t=e.state,n=e.dispatch;return n&&Xo(t,n),{success:!0}},validate:function(e){return function(e){let t=Ho.getState(e);return t?t.done.eventCount:0}(e.state)<=0?{available:!1,reason:"历史栈为空"}:{available:!0}}}),D({name:Qo.clear,description:"清空历史栈",execute:function(e){var t=e.state,n=e.view,i=e.editor,r=Go(),o=Gt.create({doc:t.doc,schema:t.schema,plugins:t.plugins.map(function(e){return e.spec.key===r.spec.key?r:e})});if(n.updateState(o),i){var s=i.getCurrentState();i.emit("stateChange",{commands:s})}return{success:!0}},validate:function(e){return{available:!0}}}),D({name:Qo.redo,description:"重做",execute:function(e){var t=e.state,n=e.dispatch;return n&&Zo(t,n),{success:!0}},validate:function(e){return function(e){let t=Ho.getState(e);return t?t.undone.eventCount:0}(e.state)<=0?{available:!1,reason:"重做栈为空"}:{available:!0}}});var es={inputText:"inputText",replaceRange:"replaceRange"};D({name:es.inputText,description:"文本编辑",execute:function(e,t){var n=e.state,i=e.dispatch,r=t,o=r.content,s=r.cursorFollow;if(i&&void 0!==o){var a,l=n.selection,c=n.schema,h=n.tr;a=l.from!==l.to?(h=h.deleteSelection()).selection.from:s?l.from:Math.max(0,n.doc.content.size-1);var u=o.split("\n").map(function(e){return c.nodes.paragraph.create(null,e?c.text(e):void 0)}),d=new J(L.from(u),1,1),p=(h=h.replace(a,a,d)).mapping.map(a,1);return h.setSelection(qt.near(h.doc.resolve(p))),i(h.scrollIntoView()),{success:!0}}return{success:!1,code:I.ParamsMissing,reason:"缺少内容"}},validate:function(e){return{available:!0}}}),D({name:es.replaceRange,description:"替换指定范围文本",execute:function(e,t){var n=e.state,i=e.dispatch,r=t,o=r.content,s=r.from,a=r.to;if(i&&void 0!==o){var l=n.selection,c=n.schema,h=void 0!==s?s:l.from,u=void 0!==a?a:l.to,d=o.split("\n"),p=new J(L.from(d.map(function(e){return c.nodes.paragraph.create(null,e?c.text(e):void 0)})),1,1),f=n.tr,m=(f=f.replace(h,u,p)).mapping.map(u,-1);return f.setSelection(qt.near(f.doc.resolve(m))),i(f.scrollIntoView()),{success:!0}}return{success:!1,code:I.ParamsMissing,reason:"参数缺失"}},validate:function(e){return{available:!0}}});var ts={insertPptControl:"insertPptControl"};D({name:ts.insertPptControl,description:"插入PPT控制",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.PptControl].create(d(d({},n),{},{type:k.PptControl}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.PptControl])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"文本光标处插入Ppt控制"}}});var ns={insertSoundEvent:"insertSoundEvent"};D({name:ns.insertSoundEvent,description:"插入音效节点 (soundEvent)",execute:function(e,t){var n,i=t,r=e.state,o=e.dispatch;o&&o(r.tr.replaceSelectionWith(r.schema.nodes[k.SoundEvent].create(d(d({},i),{},{type:k.SoundEvent,volume:null!==(n=i.volume)&&void 0!==n?n:100}))).scrollIntoView());return{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.SoundEvent])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"当前位置无法插入音效节点"}}});var is={insertCommand:"insertCommand"};D({name:is.insertCommand,description:"插入指令",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Command].create(d(d({},n),{},{type:k.Command}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Command])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"文本光标处插入指令"}}});var rs={insertData:"insertData"};D({name:rs.insertData,description:"插入数据",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Data].create(d(d({},n),{},{type:k.Data}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Data])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"文本光标处插入数据槽位"}}});var ss={insertWait:"insertWait"};D({name:ss.insertWait,description:"插入等待",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Wait].create(d(d({},n),{},{type:k.Wait}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Wait])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"文本光标处插入等待"}}});var as={insertBreak:"insertBreak"};D({name:as.insertBreak,description:"插入停顿节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Break].create(d(d({},n),{},{type:k.Break}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Break])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"光标插入文本设置停顿时长"}}});var ls={insertBreath:"insertBreath"};D({name:ls.insertBreath,description:"插入换气节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Breath].create(d(d({},n),{},{type:k.Breath}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Breath])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"光标插入文本设置换气"}}});var cs=function(){return o(function e(t,n){i(this,e),this.container=document.createElement("div"),this.container.classList.add(t),this.itemClassName=n},[{key:"render",value:function(e){var t=this;return this.container.innerHTML="",e.forEach(function(e){var n=document.createElement("div");n.classList.add(t.itemClassName),e.className&&n.classList.add(e.className),n.setAttribute("data-value",e.value),n.textContent=e.label,t.container.appendChild(n)}),this.container}},{key:"getElement",value:function(){return this.container}}])}(),hs={"的":["dí","dì","de"],"不":["bù","fǒu"],"了":["liǎo","le"],"有":["yǒu","yòu"],"这":["zhè","zhèi"],"个":["gè","gě"],"上":["shàng","shǎng"],"她":["tā","jiě"],"大":["dà","dài","tài"],"中":["zhōng","zhòng"],"说":["shuō","shuì","yuè"],"为":["wéi","wèi"],"着":["zhuó","zháo","zhāo","zhe"],"得":["dé","děi","de"],"要":["yào","yāo"],"地":["dì","de"],"那":["nà","nǎ","nèi","nā"],"和":["hé","hè","huó","huò","hú"],"可":["kě","kè"],"会":["huì","kuài"],"过":["guò","guo","guō"],"么":["mó","ma","me","yāo"],"好":["hǎo","hào"],"看":["kàn","kān"],"家":["jiā","jia","jie"],"能":["néng","nài"],"没":["méi","mò"],"只":["zhī","zhǐ"],"还":["huán","hái"],"发":["fā","fà"],"行":["háng","xíng"],"见":["jiàn","xiàn"],"都":["dū","dōu"],"知":["zhī","zhì"],"头":["tóu","tou"],"分":["fēn","fèn"],"把":["bǎ","bà"],"当":["dāng","dàng"],"同":["tóng","tòng"],"其":["qí","jī"],"与":["yǔ","yù","yú"],"从":["cóng","zòng"],"什":["shí","shén"],"些":["xiē","suò"],"将":["jiāng","jiàng"],"长":["cháng","zhǎng"],"女":["nǚ","rǔ"],"间":["jiān","jiàn"],"种":["zhǒng","zhòng","chóng"],"相":["xiāng","xiàng"],"正":["zhèng","zhēng"],"数":["shù","shǔ","shuò"],"信":["xìn","shēn"],"系":["xì","jì"],"应":["yīng","yìng"],"何":["hé","hē","hè"],"便":["biàn","pián"],"重":["zhòng","chóng"],"给":["gěi","jǐ"],"并":["bìng","bīng"],"打":["dǎ","dá"],"处":["chǔ","chù"],"几":["jī","jǐ"],"别":["bié","biè"],"被":["bèi","pī"],"结":["jié","jiē"],"少":["shǎo","shào"],"合":["hé","gě"],"内":["nèi","nà"],"体":["tǐ","tī"],"夫":["fū","fú"],"王":["wáng","wàng"],"化":["huà","huā"],"据":["jù","jū"],"觉":["jué","jiào"],"提":["tí","dī","dǐ"],"解":["jiě","jiè","xiè"],"难":["nán","nàn","nuó"],"更":["gēng","gèng"],"亲":["qīn","qìng"],"风":["fēng","fěng"],"教":["jiào","jiāo"],"度":["dù","duó"],"任":["rèn","rén"],"各":["gè","gě"],"语":["yǔ","yù"],"许":["xǔ","hǔ"],"思":["sī","sāi"],"呢":["ní","ne"],"且":["qiě","jū"],"服":["fú","fù"],"场":["cháng","chǎng"],"万":["wàn","mò"],"若":["ruò","rě"],"量":["liáng","liàng"],"转":["zhuǎn","zhuàn","zhuǎi"],"吗":["má","mǎ","ma"],"似":["sì","shì"],"车":["chē","jū"],"强":["qiáng","qiǎng","jiàng"],"论":["lùn","lún"],"传":["chuán","zhuàn"],"干":["gān","gàn"],"条":["tiáo","tiāo"],"员":["yuán","yún","yùn"],"吧":["bā","ba"],"南":["nán","nā"],"北":["běi","bèi"],"模":["mó","mú"],"空":["kōng","kòng","kǒng"],"远":["yuǎn","yuàn"],"令":["líng","lǐng","lìng"],"术":["shù","shú","zhú"],"拉":["lā","lá"],"华":["huá","huà","huā"],"父":["fù","fǔ"],"红":["hóng","gōng"],"识":["shí","zhì"],"期":["qī","jī"],"倒":["dǎo","dào"],"区":["qū","ōu"],"切":["qiē","qiè"],"落":["là","luò","lào"],"单":["dān","shàn","chán"],"调":["tiáo","diào","zhōu"],"石":["shí","dàn"],"弟":["dì","tì","tuí"],"济":["jì","jǐ"],"句":["jù","gōu"],"尽":["jìn","jǐn"],"答":["dá","dā"],"奇":["qí","jī"],"台":["tái","tāi"],"兴":["xīng","xìng"],"共":["gòng","gōng"],"乐":["lè","yuè","yào","lào"],"曾":["zēng","céng"],"约":["yuē","yāo"],"甚":["shèn","shén"],"待":["dài","dāi"],"观":["guān","guàn"],"六":["liù","lù"],"片":["piàn","piān"],"研":["yán","yàn"],"节":["jié","jiē"],"阿":["ā","ē"],"哪":["nǎ","něi","na","né"],"查":["chá","zhā"],"委":["wěi","wēi"],"广":["guǎng","ān"],"参":["cān","shēn","cēn","sān"],"朝":["zhāo","cháo"],"称":["chēng","chèn","chèng"],"底":["dǐ","de"],"号":["hào","háo"],"啊":["ā","á","ǎ","à","a"],"采":["cǎi","cài"],"差":["chà","chā","chāi","cī"],"省":["shěng","xǐng"],"假":["jiǎ","jià"],"喝":["hē","hè","yè"],"莫":["mò","mù"],"纪":["jì","jǐ"],"丽":["lì","lí"],"角":["jiǎo","jué"],"否":["fǒu","pǐ"],"冲":["chōng","chòng"],"背":["bèi","bēi"],"血":["xiě","xuè"],"旁":["páng","bàng"],"齐":["qí","jì","zī","zhāi"],"罢":["bà","ba","pí"],"疑":["yí","nǐ"],"供":["gōng","gòng"],"县":["xiàn","xuán"],"率":["shuài","lǜ"],"恶":["è","wù","ě","wū"],"读":["dú","dòu"],"价":["jià","jiè","jie"],"雨":["yǔ","yù"],"属":["shǔ","zhǔ"],"络":["luò","lào"],"露":["lòu","lù"],"助":["zhù","chú"],"景":["jǐng","yǐng"],"责":["zé","zhài"],"伯":["bó","bǎi","bà"],"呀":["yā","ya"],"跑":["pǎo","páo"],"哈":["hā","hǎ","hà"],"划":["huá","huà"],"仅":["jǐn","jìn"],"适":["shì","kuò"],"追":["zhuī","duī"],"校":["xiào","jiào"],"孙":["sūn","xùn"],"氏":["shì","zhī"],"散":["sàn","sǎn"],"排":["pái","pǎi"],"副":["fù","pì"],"食":["shí","sì","yì"],"佛":["fó","fú","bì","bó"],"跳":["tiào","táo"],"创":["chuàng","chuāng"],"斗":["dǒu","dòu"],"沙":["shā","shà"],"妻":["qī","qì"],"渐":["jiàn","jiān"],"藏":["cáng","zàng"],"弄":["nòng","lòng"],"咱":["zán","zá","zǎ"],"织":["zhī","zhì"],"苏":["sū","sù"],"朱":["zhū","shú"],"隐":["yǐn","yìn"],"毒":["dú","dài"],"担":["dān","dàn","dǎn"],"著":["zhù","zhuó","zhe"],"曲":["qū","qǔ"],"禁":["jīn","jìn"],"叶":["yè","xié"],"份":["fèn","bīn"],"戏":["xì","hū"],"射":["shè","yè","yì"],"燕":["yàn","yān"],"卡":["qiǎ","kǎ"],"啦":["lā","la"],"压":["yā","yà"],"盖":["gài","gě","hé"],"监":["jiān","jiàn"],"刺":["cì","cī"],"宁":["níng","nìng","zhù"],"休":["xiū","xǔ"],"郎":["láng","làng"],"占":["zhān","zhàn"],"秘":["mì","bì"],"绿":["lǜ","lù"],"骨":["gǔ","gū"],"奔":["bēn","bèn"],"舍":["shě","shè"],"蒙":["mēng","méng","měng"],"熟":["shú","shóu"],"卷":["juàn","juǎn"],"吾":["wú","yù"],"择":["zé","zhái"],"奥":["ào","yù"],"沈":["shěn","chén"],"港":["gǎng","jiǎng"],"厂":["chǎng","ān","hàn"],"趣":["qù","cù"],"岂":["qǐ","kǎi"],"娜":["nà","nuó"],"折":["zhē","zhé","shé"],"载":["zǎi","zài"],"塞":["sāi","sài","sè"],"亡":["wáng","wú"],"降":["jiàng","xiáng"],"盛":["shèng","chéng"],"弹":["dàn","tán"],"番":["fān","pān"],"吓":["xià","hè"],"泽":["zé","shì"],"劲":["jìn","jìng"],"仇":["chóu","qiú"],"洗":["xǐ","xiǎn"],"挑":["tiāo","tiǎo"],"括":["kuò","guā"],"混":["hùn","hún"],"乘":["chéng","shèng"],"横":["héng","hèng"],"侯":["hóu","hòu"],"鲜":["xiān","xiǎn"],"纵":["zòng","zǒng"],"糊":["hū","hú","hù"],"邪":["xié","yá","yé","yú","xú"],"臂":["bì","bei"],"勒":["lè","lēi"],"累":["léi","lěi","lèi"],"冒":["mào","mò"],"抢":["qiāng","qiǎng","chēng"],"迫":["pò","pǎi"],"悄":["qiǎo","qiāo"],"尺":["chǐ","chě"],"侧":["cè","zè","zhāi"],"缩":["suō","sù"],"票":["piào","piāo"],"瓦":["wǎ","wà"],"稍":["shāo","shào"],"核":["hé","hú"],"净":["jìng","chēng"],"枝":["zhī","qí"],"凉":["liáng","liàng"],"仆":["pū","pú"],"贾":["gǔ","jiǎ"],"薄":["báo","bó","bò"],"扫":["sǎo","sào"],"召":["zhào","shào"],"予":["yú","yǔ"],"扎":["zā","zhā","zhá"],"吐":["tǔ","tù"],"仰":["yǎng","áng"],"哼":["hēng","hng"],"椅":["yǐ","yī"],"频":["pín","bīn"],"铺":["pū","pù"],"圈":["quān","juàn","juān"],"嘛":["má","ma"],"丧":["sāng","sàng"],"汤":["tāng","shāng"],"呵":["hē","a","kē"],"汗":["hàn","hán"],"旋":["xuán","xuàn"],"闷":["mèn","mēn"],"尾":["wěi","yǐ"],"羊":["yáng","xiáng"],"拾":["shí","shè"],"冠":["guān","guàn"],"宿":["sù","xiǔ","xiù"],"艾":["ài","yì"],"详":["xiáng","yáng"],"埋":["mái","mán"],"俩":["liǎng","liǎ"],"颤":["chàn","zhàn"],"耶":["yé","yē"],"磨":["mó","mò"],"肚":["dù","dǔ"],"繁":["fán","pó"],"哦":["ó","ò","é"],"漂":["piāo","piǎo","piào"],"蛇":["shé","yí"],"筑":["zhù","zhú"],"泥":["ní","nì"],"摩":["mó","mā"],"堡":["bǎo","bǔ","pù"],"仔":["zī","zǐ","zǎi"],"丁":["dīng","zhēng"],"综":["zōng","zèng"],"夹":["jiā","jiá","gā"],"菲":["fēi","fěi"],"哩":["li","lǐ","lī"],"扇":["shàn","shān"],"钢":["gāng","gàng"],"溜":["liū","liù"],"涌":["yǒng","chōng"],"挣":["zhèng","zhēng"],"勾":["gōu","gòu"],"裂":["liè","liě"],"晃":["huǎng","huàng"],"莎":["suō","shā"],"柏":["bǎi","bó","bò"],"抹":["mǒ","mò","mā"],"卜":["bǔ","bo"],"葛":["gé","gě"],"撒":["sā","sǎ"],"屏":["píng","bǐng"],"尉":["wèi","yù"],"冯":["féng","píng"],"摄":["shè","niè"],"挡":["dǎng","dàng"],"浅":["qiǎn","jiān"],"殷":["yīn","yān","yǐn"],"唉":["āi","ài"],"勃":["bó","bèi"],"估":["gū","gù"],"钻":["zuān","zuàn"],"趋":["qū","cù"],"拓":["tuò","tà","zhí"],"倘":["tǎng","cháng"],"猫":["māo","máo"],"嚷":["rǎng","rāng"],"胖":["pàng","pán","pàn"],"祭":["jì","zhài"],"炸":["zhà","zhá"],"炮":["páo","bāo","pào"],"柜":["guì","jǔ"],"挨":["āi","ái"],"吵":["chǎo","chāo"],"脉":["mài","mò"],"缝":["féng","fèng"],"笼":["lóng","lǒng"],"嘿":["hēi","mò"],"嗯":["ǹg","ńg","ňg","ǹ","ń","ň"],"叉":["chā","chá","chǎ"],"膀":["bǎng","páng"],"臭":["chòu","xiù"],"纤":["xiān","qiàn"],"洒":["sǎ","xǐ"],"愉":["yú","tōu"],"弥":["mí","mǐ"],"咽":["yān","yàn","yè"],"敦":["dūn","duì"],"颈":["jǐng","gěng"],"泄":["xiè","yì"],"揭":["jiē","qì"],"喷":["pēn","pèn"],"乾":["qián","gān"],"纹":["wén","wèn"],"卒":["zú","cù"],"劈":["pī","pǐ"],"禅":["chán","shàn"],"瞒":["mán","mén"],"煞":["shā","shà"],"岭":["lǐng","líng"],"夸":["kuā","kuà"],"刹":["chà","shā"],"拆":["chāi","cā"],"彭":["péng","bāng"],"妃":["fēi","pèi"],"嘲":["cháo","zhāo"],"哑":["yǎ","yā"],"裳":["cháng","shang"],"宛":["wǎn","yuān"],"刷":["shuā","shuà"],"衰":["shuāi","cuī"],"晕":["yùn","yūn"],"削":["xiāo","xuē"],"棍":["gùn","hùn"],"拂":["fú","bì"],"哄":["hōng","hǒng","hòng"],"钉":["dīng","dìng"],"朴":["pǔ","pò","pō","piáo"],"吁":["xū","yù"],"兹":["zī","cí"],"暴":["bào","pù"],"搂":["lǒu","lōu"],"巷":["xiàng","hàng"],"契":["qì","qiè","xiè"],"填":["tián","zhèn"],"囊":["náng","nāng"],"咳":["ké","hāi"],"咖":["kā","gā"],"钥":["yuè","yào"],"搁":["gē","gé"],"俞":["yú","yù","shù"],"趟":["tàng","tāng"],"爪":["zhǎo","zhuǎ"],"涨":["zhǎng","zhàng"],"辟":["bì","pì"],"疆":["jiāng","qiáng"],"畜":["xù","chù"],"泊":["bó","pō"],"拘":["jū","gōu"],"哇":["wā","wa"],"肖":["xiāo","xiào"],"症":["zhèng","zhēng"],"泡":["pào","pāo"],"杆":["gān","gǎn"],"伺":["sì","cì"],"麽":["mó","me","ma"],"雀":["què","qiāo","qiǎo"],"腊":["là","xī"],"稽":["jī","qǐ"],"澄":["chéng","dèng"],"淋":["lín","lìn"],"帖":["tiè","tiě","tiē"],"嵌":["qiàn","kàn"],"坊":["fāng","fáng"],"剥":["bāo","bō"],"哟":["yō","yo"],"券":["quàn","xuàn"],"俏":["qiào","xiào"],"骚":["sāo","sǎo"],"榜":["bǎng","bàng"],"拚":["pàn","pīn","fān"],"姥":["mǔ","lǎo"],"於":["yú","wū"],"撇":["piē","piě"],"匙":["chí","shi"],"龟":["guī","jūn","qiū"],"胳":["gē","gé"],"硕":["shuò","shí"],"渠":["qú","jù"],"倡":["chàng","chāng"],"苹":["píng","pēng"],"殖":["zhí","shi"],"喔":["ō","wō"],"佣":["yōng","yòng"],"藉":["jiè","jí"],"荫":["yīn","yìn"],"碌":["lù","liù"],"壳":["ké","qiào"],"堕":["duò","huī"],"哗":["huá","huā"],"咧":["liě","liē","lié","lie"],"厦":["shà","xià"],"阙":["quē","què"],"斐":["fěi","fēi"],"挟":["xié","jiā"],"扁":["biǎn","piān"],"呐":["nà","nè"],"亨":["hēng","pēng"],"熬":["āo","áo"],"幢":["chuáng","zhuàng"],"逮":["dài","dǎi"],"绰":["chuò","chāo"],"簿":["bù","bó"],"眯":["mī","mí"],"梢":["shāo","sào"],"叨":["tāo","dāo"],"轴":["zhóu","zhòu"],"褚":["zhǔ","chǔ"],"缴":["jiǎo","zhuó"],"粘":["nián","zhān"],"溃":["kuì","huì"],"淳":["chún","zhūn"],"彷":["páng","fǎng"],"绷":["bēng","běng","bèng"],"浆":["jiāng","jiàng"],"栖":["qī","xī"],"嚼":["jiáo","jué","jiào"],"咯":["kǎ","luò","lo","gē"],"呕":["ǒu","ōu","òu"],"觑":["qù","qū"],"膏":["gāo","gào"],"缪":["móu","miù","miào","mù","liáo"],"筠":["yún","jūn"],"牟":["móu","mù"],"熏":["xūn","xùn"],"溅":["jiàn","jiān"],"撩":["liāo","liáo"],"屯":["tún","zhūn"],"喽":["lóu","lou"],"唬":["hǔ","xià"],"粥":["zhōu","yù"],"溺":["nì","niào"],"栅":["zhà","shān","shi","cè"],"揣":["chuǎi","chuài","chuāi","tuán","zhuī"],"扛":["káng","gāng"],"嘘":["xū","shī"],"唔":["wù","wú","ńg","ń"],"吱":["zhī","zī"],"兑":["duì","ruì","yuè"],"豁":["huō","huò","huá"],"芯":["xīn","xìn"],"竺":["zhú","dǔ"],"尿":["niào","suī"],"媛":["yuàn","yuán"],"鞘":["qiào","shāo"],"隋":["suí","duò"],"铅":["qiān","yán"],"踉":["liáng","liàng"],"跄":["qiāng","qiàng"],"蔓":["màn","wàn"],"苔":["tái","tāi"],"翘":["qiáo","qiào"],"缉":["jī","qī"],"矫":["jiǎo","jiáo"],"甸":["diàn","tián","shèng"],"沮":["jǔ","jù"],"拧":["níng","nǐng","nìng"],"嘎":["gā","gá","gǎ"],"凹":["āo","wā"],"虾":["xiā","hā"],"琢":["zhuó","zuó"],"浚":["jùn","xùn"],"恁":["nèn","nín"],"姗":["shān","shàn"],"俟":["sì","qí"],"褪":["tuì","tùn"],"菌":["jūn","jùn"],"砌":["qì","qiè"],"淌":["tǎng","chǎng"],"槛":["jiàn","kǎn"],"攒":["zǎn","cuán"],"擂":["léi","lèi"],"忒":["tè","tuī"],"嗳":["ǎi","ài","āi"],"吭":["háng","kēng"],"吒":["zhà","zhā"],"倔":["jué","juè"],"苛":["kē","hē"],"肋":["lèi","lē"],"矜":["jīn","qín","guān"],"瞿":["qú","jù"],"皋":["gāo","háo"],"瀑":["pù","bào"],"氓":["méng","máng"],"棱":["léng","lēng","líng"],"杠":["gàng","gāng"],"杉":["shān","shā"],"撮":["cuō","zuǒ"],"拽":["zhuài","zhuāi","yè"],"拗":["ǎo","ào","niù"],"扒":["bā","pá"],"奄":["yǎn","yān"],"囗":["wéi","guó"],"嗨":["hāi","hēi"],"喳":["zhā","chā"],"啜":["chuò","chuài"],"呛":["qiāng","qiàng"],"伽":["qié","jiā","gā"],"隽":["jùn","juàn"],"诘":["jié","jí"],"蟒":["mǎng","měng"],"蚂":["mǎ","mā","mà"],"翟":["dí","zhái"],"烙":["lào","luò"],"涡":["wō","guō"],"楷":["kǎi","jiē"],"捻":["niǎn","niē"],"抡":["lūn","lún"],"惮":["dàn","dá"],"崭":["zhǎn","chán"],"喏":["nuò","rě"],"啰":["luō","luó","luo"],"唠":["lào","láo"],"侥":["jiǎo","yáo"],"辗":["zhǎn","niǎn"],"蛾":["é","yǐ"],"莞":["guān","guǎn","wǎn"],"疙":["gē","yì"],"渎":["dú","dòu"],"泌":["mì","bì"],"棣":["dì","dài","tì"],"桔":["jié","jú"],"拌":["bàn","pàn"],"峙":["zhì","shì"],"埔":["pǔ","bù"],"啐":["cuì","qi"],"呱":["guā","gū","guǎ"],"剿":["jiǎo","chāo"],"剌":["là","lá"],"僮":["tóng","zhuàng"],"亟":["jí","qì"],"靓":["jìng","liàng"],"蹊":["qī","xī"],"臧":["zāng","zàng","cáng"],"臊":["sāo","sào"],"簸":["bò","bǒ"],"磅":["bàng","páng"],"瘪":["biē","biě"],"瘩":["dá","da"],"槟":["bīn","bīng"],"椎":["zhuī","chuí"],"掺":["chān","xiān","càn","shǎn"],"捎":["shāo","shào"],"嫖":["piáo","piāo"],"咋":["zǎ","zé","zhā"],"咀":["jǔ","zuǐ"],"伎":["jì","qí"],"铛":["dāng","chēng"],"袊":["lǐng","líng"],"蛤":["gé","há"],"芥":["jiè","gài"],"缥":["piǎo","piāo"],"纶":["lún","guān"],"糜":["mí","méi"],"燎":["liáo","liǎo"],"潦":["lǎo","lào","liáo"],"沓":["tà","dá"],"汶":["wèn","mén"],"桧":["guì","huì"],"曝":["pù","bào"],"掖":["yè","yē"],"峒":["tóng","dòng"],"宓":["mì","fú"],"姣":["jiāo","xiáo"],"嚓":["cā","chā"],"嗒":["tà","dā"],"喋":["dié","zhá"],"倭":["wō","wēi"],"颉":["jié","xié","jiá"],"韫":["yùn","wēn"],"镐":["gǎo","hào"],"钿":["diàn","tián"],"迤":["yǐ","yí"],"贲":["bì","bēn"],"覃":["tán","qín"],"蟆":["má","mò"],"蚣":["gōng","zhōng"],"蚌":["bàng","bèng"],"腌":["ā","yān"],"耆":["qí","shì"],"繇":["yáo","yóu","zhòu"],"窕":["tiǎo","yáo"],"禺":["yú","yù","ǒu"],"碴":["chá","chā"],"熨":["yùn","yù"],"濯":["zhuó","zhào"],"澹":["dàn","tán"],"浒":["hǔ","xǔ"],"汩":["gǔ","yù"],"棹":["zhào","zhuō"],"撅":["juē","jué"],"掸":["dǎn","shàn"],"捋":["luō","lǚ"],"挝":["zhuā","wō"],"徵":["zhǐ","zhēng"],"坷":["kē","kě"],"吶":["nà","nè"],"匮":["kuì","guì"],"刨":["páo","bào"],"傀":["kuǐ","guī"],"佚":["yì","dié"],"佃":["diàn","tián"],"骠":["piào","biāo"],"陂":["bēi","pí","pō"],"钯":["bǎ","pá"],"酊":["dīng","dǐng"],"蹶":["jué","juě"],"裨":["bì","pí"],"螫":["shì","zhē"],"莘":["shēn","xīn"],"耙":["bà","pá"],"睢":["huī","suī"],"疟":["nüè","yào"],"町":["tǐng","dīng"],"甯":["níng","nìng"],"玟":["mín","wén"],"潢":["huáng","guāng"],"湮":["yān","yīn"],"泷":["lóng","shuāng"],"晟":["shèng","chéng"],"斡":["wò","guǎn"],"擞":["sòu","sǒu"],"挲":["suō","shā"],"幷":["bìng","bīng"],"峤":["jiào","qiáo"],"垛":["duǒ","duò"],"圜":["huán","yuán"],"嗄":["shà","á"],"咭":["jī","xī","qià"],"呗":["bei","bài"],"偻":["lǚ","lóu"],"偈":["jì","jié"],"侗":["dòng","tóng","tǒng"],"龈":["yín","kěn"],"鹘":["gǔ","hú"],"鲑":["guī","xié"],"鬲":["gé","lì"],"颌":["hé","gé"],"鞅":["yāng","yàng"],"隳":["huī","duò"],"隗":["wěi","kuí"],"铤":["tǐng","dìng"],"铣":["xiǎn","xǐ"],"钲":["zhēng","zhèng"],"郦":["lì","zhí"],"郄":["qiè","xì"],"趄":["qiè","jū"],"貉":["hé","háo","mò"],"谌":["chén","shèn"],"诒":["yí","dài"],"褔":["fù","fú"],"虺":["huǐ","huī"],"蓼":["liǎo","lù"],"菟":["tù","tú"],"菑":["zī","zì","zāi"],"莩":["fú","piǎo"],"荥":["xíng","yíng"],"荠":["jì","qí"],"荑":["yí","tí"],"苴":["jū","chá"],"苫":["shān","shàn"],"苕":["tiáo","sháo"],"膻":["shān","dàn"],"缯":["zēng","zèng"],"纰":["pī","pí","bǐ"],"纥":["hé","gē"],"綄":["huán","huàn","wàn"],"磻":["pán","bō"],"碣":["jié","yà"],"砉":["xū","huā"],"矞":["yù","xù","jué"],"睥":["bì","pì"],"疋":["pǐ","yǎ","shū"],"畤":["zhì","chóu","shì"],"玢":["bīn","fēn"],"猗":["yī","yǐ"],"焯":["zhuō","chāo"],"烊":["yáng","yàng"],"湫":["qiū","jiǎo"],"渑":["miǎn","shéng"],"淖":["nào","chuò","zhuō"],"沤":["òu","ōu"],"歙":["xī","shè"],"楂":["zhā","chá"],"桡":["ráo","náo"],"桁":["héng","háng"],"栎":["lì","yuè"],"柢":["dǐ","chí"],"柚":["yòu","yóu"],"枞":["cōng","zōng"],"杓":["sháo","biāo"],"杈":["chā","chà"],"旄":["máo","mào"],"擘":["bò","bāi"],"挎":["kuà","kū"],"拶":["zā","zǎn"],"拮":["jié","jiá"],"戆":["gàng","zhuàng"],"慊":["qiàn","qiè"],"怍":["zuò","zhà"],"忾":["kài","xì"],"忪":["sōng","zhōng"],"徼":["jiǎo","jiào"],"徕":["lài","lái"],"帑":["tǎng","nú"],"崴":["wǎi","wēi"],"孱":["chán","càn"],"嬛":["huán","xuān","qióng"],"婠":["wān","wà"],"娆":["ráo","rǎo"],"妳":["nǐ","nǎi"],"奘":["zàng","zhuǎng"],"夯":["hāng","bèn"],"埽":["sào","sǎo"],"埶":["yì","shì"],"垸":["yuàn","huán"],"圻":["qí","yín"],"圩":["wéi","xū"],"囤":["dùn","tún"],"囝":["jiǎn","nān"],"噱":["jué","xué"],"嗑":["kē","kè"],"啁":["zhōu","zhāo","tiào"],"哏":["gén","hěn"],"吋":["dòu","cùn"],"剡":["yǎn","shàn"],"儋":["dān","dàn"],"傕":["què","jué"],"佝":["gōu","kòu"],"伧":["cāng","chen"],"仡":["yì","gē"],"亶":["dǎn","dàn"],"乜":["miē","niè"],"龜":["guī","jūn","qiū"],"龓":["lóng","lǒng"],"龏":["gōng","wò"],"龍":["lóng","lǒng"],"龂":["yín","kěn"],"齊":["qí","zhāi"],"黾":["mǐn","miǎn","měng"],"黽":["mǐn","miǎn","měng"],"黵":["dǎn","zhǎn"],"黰":["zhěn","yān"],"黮":["dàn","shèn"],"麼":["mó","me"],"麗":["lí","lì"],"麇":["jūn","qún"],"麆":["zhù","cū"],"麃":["páo","biāo"],"鷜":["lóu","lǚ"],"鶽":["sǔn","xùn"],"鶻":["gǔ","hú"],"鶮":["hè","hú"],"鶬":["cāng","qiāng"],"鶨":["chuàn","zhì"],"鶣":["piān","biǎn"],"鶡":["hé","jiè"],"鶝":["fú","bì"],"鶙":["tí","chí"],"鶗":["tí","chí"],"鳽":["jiān","qiān","zhān"],"鳻":["bān","fén"],"鳺":["fū","guī"],"鳱":["gān","hàn","yàn"],"鳭":["diāo","zhāo"],"鳥":["niǎo","diǎo"],"鳣":["zhān","shàn"],"鳜":["guì","jué"],"鳃":["sāi","xǐ"],"鲌":["bó","bà"],"鲊":["zhǎ","zhà"],"鲄":["hé","gě"],"鲃":["bā","bà"],"鰓":["sāi","xǐ"],"鯣":["yì","sī"],"鯆":["pū","bū"],"鮮":["xiān","xiǎn"],"鮭":["guī","xié"],"鮥":["luò","gé"],"鮘":["chou","dài"],"鮓":["zhǎ","zhà"],"鮊":["bó","bà"],"鮆":["cǐ","jì"],"魞":["bā","bà"],"髺":["kuò","yuè"],"髳":["máo","méng"],"髲":["bì","pǒ"],"體":["tǐ","tī"],"髉":["bó","jué"],"骹":["qiāo","xiāo"],"骳":["bèi","mó"],"駺":["liáng","láng"],"駨":["xún","xuān"],"駘":["tái","dài"],"駄":["tuó","duò"],"駃":["jué","kuài"],"馾":["dǎn","dàn"],"馸":["xìn","jìn"],"馶":["zhī","shì"],"馲":["tuō","zhé"],"馱":["tuó","duò"],"馯":["hàn","hán"],"馮":["féng","píng"],"馧":["yūn","wò"],"馕":["náng","nǎng"],"馏":["liù","liú"],"饹":["gē","le"],"饟":["xiǎng","náng"],"飵":["zuò","zé","zhā"],"飴":["yí","sì"],"飳":["zhù","tǒu"],"飲":["yǐn","yìn"],"飮":["yǐn","yìn"],"飬":["yǎng","juàn"],"飂":["liù","liáo"],"颾":["sāo","sōu"],"颰":["bá","fú"],"颩":["biāo","diū"],"風":["fēng","fěng"],"韘":["shè","xiè"],"韎":["mèi","wà"],"鞸":["bì","bǐng"],"鞰":["wēn","yùn"],"鞬":["jiàn","jiān"],"鞪":["mù","móu"],"鞢":["xiè","dié"],"鞞":["bǐng","pí","bì","bēi"],"鞝":["shàng","zhǎng"],"鞙":["xuān","juān"],"鞕":["biān","yìng"],"鞔":["mán","mèn"],"鞊":["jié","jí"],"鞈":["gé","tà","sǎ"],"雽":["hū","hù"],"雺":["wù","méng"],"雭":["sè","xí"],"難":["nán","nàn","nuó"],"雟":["guī","xī"],"雚":["guàn","huán"],"雋":["jùn","juàn"],"隺":["hú","hè"],"隹":["zhuī","cuī","wéi"],"隱":["yǐn","yìn"],"隩":["ào","yù"],"隠":["yǐn","yìn"],"隓":["huī","duò"],"隑":["qí","gāi","ái"],"隊":["duì","zhuì"],"隃":["yú","yáo","shù"],"隁":["yàn","yǎn"],"阇":["dū","shé"],"闶":["kàng","kāng"],"闬":["hàn","bì"],"闣":["dāng","dàng"],"闟":["xì","sè","tà"],"闞":["kàn","hǎn"],"闛":["táng","tāng","chāng"],"闕":["què","quē"],"闍":["dū","shé"],"闆":["bǎn","pàn"],"闂":["hòng","juǎn","xiàng"],"閼":["è","yān"],"閮":["tíng","tǐng"],"閪":["sē","xī"],"閧":["hòng","xiàng"],"閤":["hé","gé"],"閞":["biàn","guān"],"閜":["xiǎ","kě"],"閛":["pēng","pèng"],"閕":["xiā","xiǎ"],"間":["jiān","jiàn"],"閒":["xián","jiān","jiàn"],"閌":["kāng","kàng"],"閈":["hàn","bì"],"閄":["huò","shǎn"],"長":["cháng","zhǎng"],"镉":["gé","lì"],"铴":["tàng","tāng"],"铫":["diào","tiáo","yáo"],"铪":["hā","kē"],"铦":["xiān","kuò","tiǎn","guā"],"铔":["yā","yà"],"铍":["pí","pī"],"铊":["tā","tuó"],"铇":["bào","páo"],"钑":["sà","xì"],"钐":["shān","shàn"],"钌":["liǎo","liào"],"鐺":["dāng","chēng"],"鏾":["sǎn","xiàn","sà"],"鏹":["qiǎng","qiāng"],"鏸":["huì","suì","ruì"],"鏩":["jiàn","zàn"],"鏜":["tāng","táng"],"鏕":["lù","áo"],"鏒":["sǎn","qiāo","càn"],"鏑":["dí","dī"],"鏉":["shòu","sōu"],"鏅":["xiū","xiù"],"鏃":["zú","chuò"],"鎬":["gǎo","hào"],"鎫":["wàn","jiǎn"],"鎦":["liú","liù"],"鎞":["bī","bì","pī"],"鎘":["gé","lì"],"鎗":["qiāng","chēng"],"鎑":["yè","tà","gé"],"鎐":["yáo","zú"],"鎍":["suǒ","sè"],"鎉":["dā","tà"],"鎈":["cuō","chā"],"鋼":["gāng","gàng"],"鋻":["jiān","jiàn"],"鋺":["yuǎn","yuān","wǎn","wān"],"鋸":["jù","jū"],"鋷":["zuì","niè"],"鋪":["pū","pù"],"鋦":["jū","jú"],"鋞":["xíng","xìng","jīng"],"鋜":["zhuó","chuò"],"鋘":["huá","wú","wū"],"鋗":["xuān","juān","juàn"],"鋖":["sī","tuó"],"鋑":["juān","jiān","cuān"],"鋌":["tǐng","dìng"],"鋄":["wàn","jiǎn"],"鋂":["méi","méng"],"鋀":["tōu","tù","dòu"],"銿":["zhōng","yōng"],"銾":["hòng","gǒng"],"銽":["xiān","kuò","tiǎn","guā"],"銸":["zhé","niè"],"銴":["shì","zhì"],"銛":["xiān","kuò","tiǎn","guā"],"銚":["diào","tiáo","yáo"],"銗":["hóu","xiàng"],"銑":["xiǎn","xǐ"],"銐":["chì","lì"],"銏":["shàn","shuò"],"銋":["rén","rěn"],"銊":["xù","huì"],"銉":["yù","sì"],"銄":["xiǎng","jiōng"],"鉿":["hā","kē"],"鉼":["bǐng","píng"],"鉋":["bào","páo"],"鉈":["tā","tuó"],"釾":["yé","yá"],"釽":["pī","zhāo"],"釼":["rì","rèn","jiàn"],"釶":["shī","yí"],"釱":["dì","dài"],"釰":["rì","rèn","jiàn"],"釫":["huá","wū"],"釪":["huá","yú"],"釥":["qiǎo","jiǎo"],"釤":["shān","shàn"],"釘":["dīng","dìng"],"釕":["liǎo","liào"],"釐":["lí","xǐ","xī"],"釀":["niàng","niáng"],"醶":["yàn","liǎn","xiān"],"醳":["yì","shì"],"醱":["pō","fā"],"醦":["chǎn","chěn"],"醗":["pō","fā"],"醔":["qiú","chōu"],"醍":["tí","tǐ"],"醈":["tán","dàn"],"酇":["cuó","zàn"],"酂":["cuó","zàn"],"郩":["xiáo","ǎo"],"郇":["xún","huán"],"郂":["gāi","hái"],"邟":["kàng","háng"],"邌":["lí","chí"],"還":["huán","hái"],"遆":["dì","tí"],"迱":["yǐ","yí"],"迬":["zhù","wǎng"],"迣":["zhì","lì"],"迋":["wàng","kuāng"],"迆":["yǐ","yí"],"辺":["dào","biān"],"軼":["yì","dié"],"軻":["kē","kě"],"軸":["zhóu","zhòu"],"軪":["āo","ào"],"転":["zhuàn","zhuǎn"],"軓":["fàn","guǐ"],"軐":["xìn","xiàn"],"軋":["yà","zhá","gá"],"車":["chē","jū"],"躠":["sǎ","xiè"],"躘":["lóng","lǒng"],"躒":["lì","luò"],"跾":["shū","chōu"],"跰":["pián","bèng"],"跢":["dài","duò","duō","chí"],"跞":["lì","luò"],"跙":["jū","jù","qiè"],"跘":["pán","bàn"],"跕":["diǎn","tiē","dié"],"跐":["cī","cǐ"],"跈":["jiàn","chén"],"跂":["qí","qǐ"],"跁":["bà","páo"],"趽":["fāng","fàng","páng"],"趹":["jué","guì"],"趶":["kuà","wù"],"趵":["bào","bō"],"趯":["tì","yuè"],"趨":["qū","cù"],"趠":["chuō","zhuó"],"趞":["què","qì","jí"],"趏":["guā","huó"],"趌":["jí","jié"],"趃":["dié","tú"],"贠":["yuán","yùn"],"贃":["wàn","zhuàn"],"賺":["zhuàn","zuàn"],"賯":["xiōng","mín"],"賈":["jiǎ","gǔ","jià"],"賁":["bì","bēn"],"責":["zé","zhài"],"貤":["yì","yí"],"貟":["yuán","yún","yùn"],"貗":["jù","lóu"],"貓":["māo","máo"],"貒":["tuān","tuàn"],"貈":["hé","mò"],"貇":["kěn","kūn"],"貆":["huán","huān"],"豣":["jiān","yàn"],"豈":["qǐ","kǎi"],"诶":["ēi","éi","ěi","èi","xī"],"诪":["zhōu","chóu"],"讉":["yí","tuī"],"讂":["juàn","xuān"],"諵":["nán","nàn"],"諰":["xǐ","shāi","āi"],"諣":["huà","guā"],"諟":["shì","dì"],"論":["lùn","lún"],"諕":["xià","háo"],"諔":["chù","jí"],"諎":["zé","zuò","zhǎ","cuò"],"諅":["jì","jī"],"諀":["pǐ","bēi"],"調":["diào","tiáo"],"誽":["nì","ná"],"誺":["chī","lài"],"誳":["qū","juè"],"誰":["shuí","shéi"],"説":["shuō","shuì","yuè"],"說":["shuō","shuì","yuè"],"語":["yǔ","yù"],"誖":["bèi","bó"],"誒":["ēi","éi","ěi","èi","xī"],"誏":["lǎng","làng"],"誇":["kuā","kuà"],"誃":["yí","chǐ","chì"],"誂":["tiǎo","diào"],"詒":["yí","dài"],"觻":["lì","lù"],"觷":["xué","hù"],"觭":["jī","qí"],"觧":["jiě","jiè","xiè"],"觟":["huà","xiè"],"觜":["zī","zuǐ"],"觀":["guān","guàn"],"覻":["qù","qū"],"覺":["jué","jiào"],"覷":["qù","qū"],"覶":["luó","luǎn"],"覵":["jiàn","biǎn"],"観":["guān","guàn"],"覱":["zhàn","zhān"],"覰":["qū","qù"],"覮":["yíng","yǐng"],"親":["qīn","qìng"],"覚":["jué","jiào"],"覕":["piē","miè"],"覐":["jué","jiào"],"覌":["guān","guàn"],"見":["jiàn","xiàn"],"裼":["xī","tì"],"裺":["yǎn","ān"],"裷":["yuān","gǔn"],"裯":["chóu","dāo"],"裓":["gé","jiē"],"裎":["chéng","chěng"],"袿":["guī","guà"],"袹":["bó","mò"],"袸":["jiàn","zùn"],"袷":["jiá","jié","qiā"],"袳":["chǐ","qǐ","duǒ","nuǒ"],"袲":["chǐ","nuǒ"],"袦":["nà","jué"],"袘":["yí","yì"],"袔":["hè","kè"],"袓":["jù","jiē"],"袌":["bào","páo","pào"],"袉":["tuó","tuō"],"蟫":["yín","xún"],"蟧":["láo","liáo"],"蟦":["fèi","bēn"],"蟞":["biē","bié"],"螹":["chán","jiàn"],"螶":["qú","jù"],"螲":["dié","zhì"],"螞":["mǎ","mā","mà"],"螝":["guì","huǐ"],"螛":["hé","xiá"],"螚":["nài","něng"],"螕":["bī","pí"],"螇":["xī","qī"],"蝦":["xiā","hā"],"蛪":["qiè","ní"],"蛡":["yì","xǔ"],"蛖":["máng","bàng"],"蛒":["gé","luò"],"蚾":["pí","bǒ"],"蚼":["gǒu","qú","xù"],"蚮":["dài","dé"],"蚥":["fù","fǔ"],"蚙":["qín","qián"],"蚗":["jué","quē"],"蚖":["yuán","wán"],"蚔":["qí","zhǐ"],"蚄":["fāng","bàng"],"號":["hào","háo"],"蘋":["pín","píng"],"藸":["zhū","chú"],"藱":["huì","huí"],"藰":["liú","liǔ"],"藨":["biāo","pāo"],"藋":["diào","zhuó"],"藇":["xù","yù","xū"],"藃":["xiāo","hào"],"薺":["jì","qí"],"薶":["mái","wō"],"薵":["chóu","zhòu"],"薳":["yuǎn","wěi"],"薧":["hāo","kǎo"],"薟":["xiān","liǎn"],"薔":["qiáng","sè"],"薍":["wàn","luàn"],"薋":["cí","zī"],"薂":["xí","xiào"],"蕁":["qián","xún"],"蓻":["zí","jú"],"蓲":["qiū","xū","fū"],"蓧":["diào","tiáo","dí"],"蓔":["yǎo","zhuó"],"蓋":["gài","gě","hé"],"蓃":["sōu","sǒu"],"蒵":["xí","xì"],"蒩":["zū","jù"],"蒣":["xú","shú"],"蒝":["yuán","huán"],"蒘":["rú","ná"],"蒔":["shì","shí"],"蒉":["kuì","kuài"],"菾":["tián","tiàn"],"菻":["lǐn","má"],"菳":["qín","qīn","jīn"],"華":["huá","huà","huā"],"菭":["tái","zhī","chí"],"菬":["qiáo","zhǎo"],"菨":["jiē","shà"],"菍":["niè","rěn"],"菆":["zōu","chù"],"菀":["wǎn","yùn"],"莶":["xiān","liǎn"],"莵":["tù","tú"],"莳":["shì","shí"],"莬":["wèn","wǎn","miǎn"],"莨":["làng","liáng"],"莦":["shāo","xiāo"],"莤":["sù","yóu"],"莑":["péng","fēng"],"荨":["qián","xún"],"苼":["shēng","ruí"],"苲":["zuó","zhǎ"],"苩":["pā","bó"],"苧":["zhù","níng"],"苣":["jù","qǔ"],"苙":["lì","jī"],"苐":["dì","tí"],"苂":["chán","yín"],"芾":["fèi","fú"],"芼":["máo","mào"],"芶":["gōu","gǒu"],"芴":["wù","hū"],"芲":["lún","huā"],"芫":["yuán","yán"],"芧":["xù","zhù"],"芚":["tún","chūn"],"芘":["bì","pí"],"芔":["huì","hū"],"芓":["zì","zǐ"],"芐":["hù","xià"],"芆":["chāi","chā"],"艽":["jiāo","qiú"],"臸":["zhī","jìn"],"臷":["dié","zhí"],"臱":["mián","biān"],"臩":["guǎng","jiǒng"],"臦":["guàng","jiǒng"],"臤":["qiān","xián"],"臡":["ní","luán"],"臒":["wò","yuè"],"臈":["là","gé"],"膴":["hū","wǔ"],"膰":["fán","pán"],"膞":["zhuān","chuán","chún","zhuǎn"],"膔":["lù","biāo"],"胿":["guī","kuì"],"胕":["fū","fú","zhǒu"],"胓":["píng","pēng"],"胐":["fěi","kū"],"胏":["zǐ","fèi"],"胇":["fèi","bì"],"肶":["pí","bǐ","bì"],"肫":["zhūn","chún"],"肨":["pàng","pán","pàn"],"肣":["qín","hán","hàn"],"肜":["róng","chēn"],"肑":["bó","dí"],"聻":["nǐ","jiàn"],"聜":["dǐ","zhì"],"聑":["tiē","zhé"],"聏":["ér","nǜ"],"聉":["wà","tuǐ","zhuó"],"耺":["yún","yíng"],"耫":["zhá","zé"],"耤":["jí","jiè"],"耣":["lún","lǔn"],"耝":["qù","chú"],"耛":["sì","chí"],"耑":["duān","zhuān"],"耏":["ér","nài"],"耎":["ruǎn","nuò"],"翹":["qiáo","qiào"],"翵":["hóu","qú"],"翢":["dào","zhōu"],"翑":["qú","yù"],"翍":["pī","bì","pō"],"羾":["hóng","gòng"],"羬":["qián","xián","yán"],"羫":["qiāng","kòng"],"羛":["yì","xī"],"羙":["měi","gāo"],"羏":["yáng","xiáng"],"罷":["bà","ba","pí"],"罫":["guǎi","guà"],"徿":["lòng","lǒng"],"忂":["qú","jù"],"忊":["dìng","tìng"],"忓":["gān","hàn"],"忔":["yì","qì"],"忕":["shì","tài"],"忚":["xī","liě"],"応":["yīng","yìng"],"忞":["mǐn","wěn","mín"],"忟":["mǐn","wěn","mín"],"忬":["yù","shū"],"忯":["qí","shì"],"忳":["tún","zhūn","dùn"],"忴":["qián","qín"],"忹":["kuáng","wǎng"],"忼":["kāng","hàng"],"怉":["bǎo","bào"],"怋":["mín","mén"],"怐":["kòu","jù"],"怓":["náo","niú"],"怗":["tiē","zhān"],"怘":["hù","gù"],"怚":["cū","jù","zū"],"怞":["yóu","chóu"],"怢":["tū","dié"],"怮":["yōu","yào"],"怴":["xù","xuè"],"怶":["bì","pī"],"怸":["xī","shù"],"恌":["tiāo","yáo"],"恓":["xī","qī","xù"],"恔":["xiào","jiǎo"],"恗":["hū","kuā"],"恮":["quán","zhuān"],"悁":["yuān","juàn"],"悂":["pī","pǐ"],"悆":["yù","shū"],"悈":["jiè","kè"],"悎":["hào","jiào"],"悗":["mán","mèn"],"悘":["yī","yì"],"悙":["hēng","hèng"],"悝":["kuī","lǐ"],"悥":["yì","niàn"],"悶":["mèn","mēn"],"悾":["kōng","kǒng"],"惀":["lǔn","lùn"],"惌":["yuān","wǎn"],"惏":["lán","lín"],"惐":["yù","xù"],"惒":["hé","hè"],"惓":["juàn","quán"],"惔":["tán","dàn"],"惙":["chuò","chuì"],"惛":["hūn","mèn"],"惡":["è","wù","ě","wū"],"惢":["suǒ","ruǐ"],"惿":["tí","shì"],"愒":["qì","kài"],"愓":["dàng","shāng","táng","yáng"],"愖":["chén","xìn","dān"],"愘":["kè","qià"],"愡":["còng","sōng"],"愢":["sāi","sī","sǐ"],"愩":["gōng","gòng","hǒng"],"愬":["sù","shuò"],"愮":["yáo","yào"],"愾":["kài","xì"],"慀":["xì","xié"],"慅":["cǎo","sāo"],"慉":["xù","chù"],"慐":["gōng","gòng","hǒng"],"慒":["cáo","cóng"],"慠":["ào","áo"],"慩":["lián","liǎn"],"慬":["qín","jìn","jǐn"],"慸":["dì","chì"],"慹":["zhí","zhé"],"慺":["lóu","lǚ"],"憄":["zhī","zhì"],"憕":["chéng","dèng","zhèng"],"憘":["xǐ","xī"],"憚":["dàn","dá"],"憞":["duì","dùn","tūn"],"憢":["xiāo","jiāo"],"憦":["lào","láo"],"憪":["xián","xiàn"],"憭":["liǎo","liáo"],"憹":["náo","nǎo","náng"],"憼":["jǐng","jìng"],"憿":["jiǎo","jǐ"],"懁":["xuān","huān"],"懆":["cǎo","sāo","sào"],"應":["yīng","yìng"],"懙":["yǔ","yú"],"懜":["mèng","méng","měng"],"懝":["ài","yì","nǐ"],"懞":["méng","měng"],"懠":["qí","jī","jì"],"懢":["lán","xiàn"],"懮":["yōu","yǒu"],"懰":["liú","liǔ"],"戂":["mí","mó"],"戅":["gàng","zhuàng"],"戇":["gàng","zhuàng"],"戗":["qiāng","qiàng"],"戧":["qiāng","qiàng"],"戯":["xì","hū"],"戱":["xì","hū"],"戲":["xì","hū"],"扄":["shǎng","jiōng"],"扐":["lè","lì","cái"],"払":["fǎn","fú"],"扚":["diǎo","dí","yuē","lì"],"扜":["yū","wū"],"扝":["yū","wū","kū"],"扡":["tuō","chǐ","yǐ"],"扢":["gǔ","xì","gē","jié"],"扱":["xī","chā","qì"],"扲":["qián","qín"],"扷":["bā","ào"],"扸":["xī","zhé"],"扻":["zhì","sǔn","kǎn"],"抂":["kuáng","wǎng","zài"],"抇":["hú","gǔ"],"抌":["dǎn","shěn"],"抐":["nè","nì","ruì","nà"],"抙":["póu","pōu","fū"],"抝":["ǎo","ào","niù"],"抧":["zhǐ","zhǎi"],"抪":["bù","pū"],"抭":["yǎo","tāo"],"抲":["hē","hè","qiā"],"抳":["nǐ","ní"],"抷":["pī","pēi"],"拁":["jiā","yá"],"拵":["cún","zùn"],"拸":["yí","chǐ","hài"],"拺":["cè","sè","chuò"],"挄":["kuò","guāng"],"挆":["duǒ","duò"],"挐":["rú","ná"],"挕":["dié","shè"],"挜":["yà","yǎ"],"挩":["tuō","shuì"],"挮":["tǐ","tì"],"挱":["suō","shā"],"挳":["kēng","qiān"],"挷":["bàng","péng"],"挾":["xié","jiā"],"捁":["jiǎo","kù"],"捇":["huò","chì"],"捈":["tú","shū","chá"],"捊":["póu","pōu","fū"],"捒":["shù","sǒng","sōu"],"捓":["yé","yú"],"捔":["jué","zhuó"],"捗":["bù","pú","zhì"],"捝":["tuō","shuì"],"捥":["wàn","wǎn","wān","yù"],"捬":["fǔ","fù","bǔ"],"捰":["wǒ","luò","luǒ"],"捲":["juǎn","quán"],"捼":["ruó","wěi","ré"],"捾":["wò","xiá"],"掃":["sǎo","sào"],"掄":["lūn","lún"],"掅":["qìng","qiàn"],"掊":["pǒu","póu"],"掔":["qiān","wàn"],"掗":["yà","yǎ"],"掙":["zhēng","zhèng"],"掜":["nǐ","niè","yì"],"掝":["huò","xù"],"掞":["shàn","yàn","yǎn"],"掟":["zhěng","dìng"],"掫":["zōu","zhōu","chōu"],"揁":["zhēng","kēng"],"揂":["jiū","yóu"],"揃":["jiǎn","jiān"],"揊":["pì","chè"],"揔":["zǒng","sōng"],"揕":["zhèn","zhēn"],"揘":["huáng","yóng"],"揝":["zǎn","zuàn"],"揟":["xū","jū"],"揢":["ké","qiā"],"揥":["tì","dì"],"揦":["là","lá"],"揰":["chòng","dǒng"],"揲":["shé","dié","yè"],"揵":["qián","jiàn","jiǎn"],"搊":["chōu","zǒu"],"搑":["róng","náng","nǎng"],"搒":["bàng","péng"],"搕":["kē","è"],"搙":["nù","nuò","nòu"],"搚":["lā","xié","xiàn"],"搟":["xiǎn","xiān"],"搩":["jié","zhé"],"搫":["pán","bān","pó"],"搱":["zhì","nái"],"搲":["wā","wǎ","wà"],"搶":["qiāng","qiǎng","chēng"],"搷":["tián","shēn"],"搻":["ná","nuò"],"摋":["sà","shā","shǎi"],"摌":["chǎn","sùn"],"摎":["jiū","liú","liáo","jiǎo","náo"],"摓":["féng","pěng"],"摕":["dì","tú","zhí"],"摖":["qì","jì","chá"],"摗":["sōu","sǒng"],"摙":["liǎn","liàn"],"摟":["lǒu","lōu"],"摡":["gài","xì"],"摢":["hù","chū"],"摨":["zhì","nái"],"摪":["jiāng","qiàng"],"摮":["áo","qiáo"],"摰":["niè","chè"],"摱":["mán","màn"],"摲":["chàn","cán"],"摵":["sè","mí","sù"],"摷":["jiǎo","chāo"],"摻":["chān","xiān","càn","shǎn"],"摼":["kēng","qiān"],"摽":["biào","biāo"],"撍":["zǎn","zān","zēn","qián"],"撗":["héng","guàng"],"撜":["zhěng","chéng"],"撝":["huī","wéi"],"撣":["dǎn","shàn"],"撨":["xiāo","sōu"],"撱":["wěi","tuǒ"],"撽":["qiào","yāo","jī"],"撾":["zhuā","wō"],"擇":["zé","zhái"],"擋":["dǎng","dàng"],"擏":["qíng","jǐng"],"擔":["dān","dàn"],"擖":["qiā","jiā","yè"],"擗":["pǐ","bò"],"據":["jù","jū"],"擰":["níng","nǐng","nìng"],"擱":["gē","gé"],"擳":["zhì","jié"],"擸":["liè","là"],"擻":["sòu","sǒu"],"擽":["lì","luò","yuè"],"擿":["tī","zhì","zhāi"],"攂":["léi","lèi"],"攃":["cā","sǎ"],"攈":["jùn","pèi"],"攊":["lì","luò"],"攋":["là","lài"],"攎":["lú","luó"],"攕":["xiān","jiān"],"攝":["shè","niè"],"攠":["mí","mǐ","mó"],"攢":["zǎn","cuán"],"攦":["lì","shài"],"攭":["lì","luǒ"],"攱":["guǐ","guì"],"攲":["qī","yǐ","jī"],"攼":["gān","hàn"],"敄":["wù","móu"],"敊":["chù","shōu"],"敋":["gé","guó","è"],"敎":["jiào","jiāo"],"敓":["duó","duì"],"敚":["duó","duì"],"敠":["duō","què"],"敧":["qī","yǐ","jī"],"敩":["xiào","xué"],"敪":["duō","què"],"敱":["ái","zhú"],"數":["shù","shǔ","shuò"],"敻":["xiòng","xuàn"],"斀":["zhuó","zhú"],"斁":["yì","dù"],"斄":["lí","tái"],"斍":["jué","jiào"],"斔":["yǔ","zhōng"],"斖":["wěi","mén"],"斢":["tǒu","tiǎo"],"斦":["yín","zhì"],"斺":["chǎn","jiè"],"斿":["liú","yóu"],"旇":["pī","bì"],"旰":["gàn","hàn"],"旲":["tái","yīng"],"旳":["dì","dí","de"],"旴":["xù","xū"],"旽":["tūn","zhùn"],"旿":["wù","wǔ"],"昢":["pò","pèi"],"昳":["dié","yì"],"晇":["xù","kuā"],"晵":["qǐ","dù"],"晻":["àn","ǎn","yǎn"],"暀":["wǎng","wàng"],"暈":["yùn","yūn"],"暋":["mǐn","mín"],"暏":["shǔ","dǔ"],"暕":["jiǎn","lán"],"暿":["xī","xǐ"],"曶":["hū","hù"],"曽":["zēng","céng"],"朁":["cǎn","qián","jiàn"],"會":["huì","kuài"],"朅":["qiè","hé"],"朇":["bì","pí"],"朌":["fén","bān"],"朏":["fěi","kū"],"朐":["qú","xù","chǔn"],"朒":["nǜ","gǎ"],"朘":["juān","zuī"],"朚":["huāng","máng","wáng"],"朣":["tóng","chuáng"],"朮":["shù","shú","zhú"],"朷":["dāo","tiáo","mù"],"朹":["qiú","guǐ"],"朾":["chéng","chēng"],"杅":["yú","wū"],"杒":["rèn","ér"],"杔":["tuō","zhé"],"杕":["dì","duò"],"杚":["gū","gài"],"杝":["yí","lì","lí","duò","tuò"],"杩":["mà","mǎ"],"杫":["sì","zhǐ","xǐ"],"杬":["yuán","wán"],"杮":["fèi","bèi"],"杸":["shū","duì"],"杻":["niǔ","chǒu"],"枂":["wò","yuè"],"枈":["pī","mì"],"枋":["fāng","bìng"],"枎":["fú","fū"],"枑":["hù","dǐ"],"枖":["yǎo","yāo"],"枙":["ě","è"],"枤":["dì","duò"],"枮":["xiān","zhēn"],"枱":["sì","tái"],"枸":["jǔ","gǒu"],"枹":["bāo","fú"],"枻":["yì","xiè"],"柁":["tuó","duò"],"柂":["yí","duò","lí"],"柅":["nǐ","chì"],"柈":["pán","bàn"],"柍":["yǎng","yàng","yāng","yīng"],"柎":["fū","fǔ","fù"],"柖":["sháo","shào"],"柞":["zuò","zhà"],"柣":["zhì","dié"],"柤":["zhā","zǔ","zū"],"柨":["bù","pū"],"柪":["āo","ào"],"柭":["bā","fú","pèi","bó","biē"],"柮":["duò","zuó","wù"],"柲":["bì","bié"],"柸":["bēi","pēi"],"柹":["shì","fèi"],"査":["chá","zhā"],"栔":["qì","qiè"],"栝":["guā","tiǎn"],"栟":["bēn","bīng"],"栧":["yì","xiè"],"栫":["jiàn","zùn"],"栯":["yǒu","yù"],"栺":["zhī","yì"],"桄":["guāng","guàng"],"桋":["yí","tí"],"桙":["yú","móu"],"桚":["zā","zǎn"],"桭":["chén","zhèn"],"桯":["tīng","yíng"],"桳":["bèn","fàn"],"桻":["fēng","fèng"],"梀":["sù","yìn"],"梃":["tǐng","tìng"],"梋":["xuān","juān","xié"],"梌":["tú","chá"],"梎":["āo","yòu"],"梕":["rèn","ér"],"條":["tiáo","tiāo"],"梩":["sì","qǐ"],"梴":["chān","yán"],"梹":["bīn","bīng"],"梼":["chóu","táo","dào"],"梿":["lián","liǎn"],"棇":["cōng","sōng"],"棏":["dé","zhé"],"棑":["pái","bèi","pèi"],"棓":["bàng","pǒu","bèi","bēi"],"棙":["lì","liè"],"棪":["yǎn","yàn"],"棬":["quān","juàn"],"棯":["rěn","shěn"],"棴":["fú","sù"],"棷":["zōu","sǒu"],"棽":["chēn","shēn"],"棿":["ní","nǐ"],"椄":["jiē","qiè"],"椆":["chóu","zhòu","diāo"],"椉":["chéng","shèng"],"椊":["zú","cuì"],"椌":["qiāng","kōng"],"椦":["quān","juàn","quán"],"椯":["duǒ","chuán"],"椲":["wěi","huī"],"椵":["jiǎ","jiā"],"椷":["jiān","hán"],"椹":["zhēn","shèn"],"椻":["yàn","yà"],"楇":["guō","kuǎ"],"楖":["jí","zhì"],"楛":["kǔ","hù"],"楢":["yóu","yǒu"],"楤":["sǒng","cōng"],"楥":["xuàn","yuán"],"楧":["yǎng","yàng","yīng"],"楪":["dié","yè"],"楯":["shǔn","dùn"],"楱":["còu","zòu"],"楴":["dì","dǐ","shì"],"楺":["róu","ròu"],"楽":["lè","yuè"],"榅":["wēn","yùn"],"榌":["bī","pi"],"榐":["zhǎn","niǎn","zhèn"],"榑":["fú","fù","bó"],"榗":["jiàn","jìn"],"榝":["shā","xiè"],"榪":["mà","mā"],"槏":["qiǎn","lián","xiàn"],"槙":["diān","zhěn","zhēn"],"槢":["xí","dié"],"槣":["jī","guī"],"槤":["lián","liǎn"],"槦":["róng","yōng"],"槫":["tuán","shuàn","quán"],"槭":["qì","sè"],"槯":["cuī","zhǐ"],"槱":["yǒu","chǎo"],"槾":["màn","wàn"],"樂":["lè","yuè","yào","lào"],"樅":["cōng","zōng"],"樆":["lí","chī"],"樏":["léi","lěi"],"樔":["cháo","jiǎo","chāo"],"樛":["jiū","liáo"],"樢":["niǎo","mù"],"樧":["shā","xiè"],"橃":["fá","fèi"],"橈":["ráo","náo"],"橏":["zhǎn","jiǎn"],"橔":["tuí","dūn"],"橖":["táng","chēng"],"橚":["sù","qiū"],"橝":["tán","diàn"],"橦":["tóng","chuáng"],"橧":["zēng","céng"],"橨":["fén","fèn","fèi"],"橪":["rǎn","yān"],"橫":["héng","hèng"],"橻":["cū","chu"],"橾":["shū","qiāo"],"檘":["píng","bò"],"檜":["guì","huì"],"檡":["zhái","shì","tú"],"檦":["biāo","biǎo"],"檮":["chóu","táo","dǎo"],"檳":["bīn","bīng"],"檶":["qiān","lián"],"檷":["nǐ","mí"],"檻":["jiàn","kǎn"],"檽":["nòu","ruǎn","rú"],"櫅":["jī","jì"],"櫎":["huǎng","guǒ","gǔ"],"櫑":["léi","lěi"],"櫖":["lǜ","chū"],"櫗":["miè","mèi"],"櫟":["lì","yuè"],"櫡":["zhuó","zhù"],"櫣":["lián","liǎn"],"櫭":["jué","jì"],"櫰":["huái","guī"],"櫴":["là","lài"],"櫾":["yòu","yóu"],"欃":["chán","zhàn"],"欈":["wéi","zuì"],"欥":["yù","yì"],"欦":["qiān","xiān"],"欪":["chù","qù","xì"],"欬":["kài","ài"],"欭":["yì","yīn"],"欯":["xì","kài"],"欶":["shuò","sòu"],"欸":["ǎi","ēi","éi","ěi","èi"],"欻":["xū","chuā"],"欼":["chǐ","chuài"],"欿":["kǎn","qiàn"],"歁":["kǎn","kè"],"歂":["chuǎn","chuán"],"歅":["yān","yīn"],"歏":["jìn","qūn"],"歛":["liǎn","hān"],"歭":["zhì","chí"],"歰":["sè","shà"],"歾":["mò","wěn"],"殑":["qíng","jìng"],"殕":["fǒu","bó"],"殗":["yè","yān","yàn"],"殙":["hūn","mèi"],"殨":["kuì","huì"],"殸":["qìng","kēng","shēng"],"殻":["ké","qiào"],"殼":["ké","qiào"],"殽":["xiáo","yáo","xiào"],"毌":["guàn","wān"],"毥":["xún","xùn"],"毭":["dòu","nuò"],"毸":["sāi","suī"],"氐":["dī","dǐ"],"氜":["yáng","rì"],"氶":["zhěng","chéng","zhèng"],"氿":["guǐ","jiǔ"],"汃":["bīn","pà","pā"],"汋":["zhuó","què"],"汏":["tài","dà"],"汥":["zhī","jì"],"汵":["gàn","hán","cén"],"汸":["fāng","pāng"],"汻":["hǔ","huǎng"],"汼":["niú","yóu"],"沑":["nǜ","niǔ"],"沒":["méi","mò"],"沕":["mì","wù"],"沗":["hóng","pāng"],"沝":["zhuǐ","zǐ"],"沰":["tuō","duó"],"沲":["tuó","duò"],"沵":["mǐ","lì"],"沶":["yí","chí"],"泆":["yì","dié"],"泍":["bēn","bèn"],"泏":["chù","shè"],"泑":["yōu","yòu","āo"],"泙":["pēng","píng"],"泧":["yuè","sà"],"泬":["jué","xuè"],"泺":["luò","pō"],"洑":["fú","fù"],"洓":["sè","qì","zì"],"洘":["kǎo","kào"],"洝":["àn","yàn","è"],"洡":["lěi","lèi"],"洬":["sù","shuò"],"洯":["qiè","jié"],"浍":["kuài","huì"],"浟":["yōu","dí"],"浧":["yǐng","chéng","yíng"],"浲":["féng","hóng"],"浻":["jiǒng","jiōng"],"浽":["suī","něi"],"涒":["tūn","yūn"],"涭":["shòu","tāo"],"涳":["kōng","náng"],"涴":["wǎn","wò","yuān"],"涶":["tuō","tuò"],"涼":["liáng","liàng"],"淁":["qiè","jí"],"淉":["guǒ","guàn"],"淜":["píng","péng"],"淠":["pì","pèi"],"淢":["yù","xù"],"淨":["jìng","chēng"],"淰":["niǎn","shěn"],"淲":["biāo","hǔ"],"渂":["wèn","mín"],"渃":["ruò","rè","luò"],"済":["jì","jǐ"],"渜":["nuǎn","nuán"],"渞":["qiú","wù"],"渟":["tíng","tīng"],"渦":["wō","guō"],"渧":["tí","dī","dì"],"渰":["yān","yǎn"],"渹":["hōng","qìng"],"湏":["huì","mǐn","xū"],"湑":["xǔ","xū"],"湣":["mǐn","hūn"],"湪":["tuàn","nuǎn"],"湬":["qiū","jiǎo"],"湯":["tāng","shāng"],"湴":["bàn","pán"],"湷":["zhuāng","hún"],"溄":["féng","hóng"],"溎":["yàn","guì"],"溓":["lián","liǎn","nián","xián","xiàn"],"溚":["dá","tǎ"],"溱":["zhēn","qín"],"滀":["chù","xù"],"滃":["wěng","wēng"],"滈":["hào","xuè"],"滊":["qì","xì","xiē"],"滎":["xíng","yíng"],"滜":["zé","hào"],"滸":["hǔ","xǔ"],"漎":["cóng","sǒng"],"漙":["tuán","zhuān"],"漚":["òu","ōu"],"漨":["féng","péng"],"漯":["luò","tà"],"漰":["bēn","pēng"],"漲":["zhǎng","zhàng"],"漴":["chóng","zhuàng"],"漷":["huǒ","huò","kuò"],"漸":["jiàn","jiān"],"漻":["liáo","liú"],"漼":["cuǐ","cuī"],"漿":["jiāng","jiàng"],"潀":["cóng","zǒng"],"潈":["cóng","zōng"],"潎":["pì","piē"],"潐":["jiào","qiáo"],"潒":["dàng","xiàng"],"潝":["xī","yà"],"潨":["cōng","zòng"],"潪":["zhí","zhì"],"潬":["tān","shàn"],"潰":["kuì","huì"],"潳":["tú","zhā"],"潵":["sàn","sǎ"],"澊":["cūn","cún"],"澍":["shù","zhù"],"澑":["liū","liù"],"澒":["hòng","gǒng"],"澚":["ào","yù"],"澠":["miǎn","shéng"],"澤":["zé","shì"],"澫":["wàn","màn"],"澭":["yōng","yǒng"],"澮":["kuài","huì"],"濄":["guō","wō"],"濆":["fén","pēn"],"濈":["jí","shà"],"濊":["huì","huò"],"濎":["dǐng","tìng"],"濔":["mǐ","nǐ"],"濞":["bì","pì"],"濟":["jì","jǐ"],"濢":["cuì","zuǐ"],"濩":["huò","hù"],"濬":["jùn","xùn"],"濭":["ǎi","kài","kè"],"濺":["jiàn","jiān"],"濻":["wěi","duì"],"濼":["luò","pō"],"濽":["zàn","cuán"],"瀁":["yǎng","yàng"],"瀆":["dú","dòu"],"瀇":["wǎng","wāng"],"瀎":["miè","mò"],"瀓":["chéng","dèng"],"瀢":["wěi","duì"],"瀤":["huái","wāi"],"瀧":["lóng","shuāng"],"瀳":["jiàn","zùn"],"瀴":["yīng","yǐng","yìng"],"瀼":["ráng","nǎng"],"灂":["zhuó","jiào","zé"],"灒":["zàn","cuán"],"灓":["luán","luàn"],"灙":["dǎng","tǎng"],"灥":["xún","quán","quàn"],"灬":["huǒ","biāo"],"灹":["zhà","yù"],"炃":["fén","bèn"],"炅":["jiǒng","guì"],"炐":["pàng","fēng"],"炤":["zhào","zhāo"],"炪":["zhuō","chù"],"炰":["páo","fǒu"],"炶":["shǎn","qián","shān"],"為":["wéi","wèi"],"烄":["jiǎo","yào"],"烋":["xiū","xiāo"],"烔":["tóng","dòng"],"烠":["huí","huǐ"],"烰":["fú","páo"],"烲":["xiè","chè"],"焄":["xūn","hūn"],"焆":["juān","yè"],"焌":["qū","jùn"],"焎":["xiè","chè"],"焏":["jí","qì"],"焣":["chǎo","jù"],"焥":["wò","ài"],"焧":["zǒng","cōng"],"焬":["xī","yì"],"焸":["xiǒng","yīng"],"焽":["xiǒng","yīng"],"煇":["huī","yùn","xūn"],"煍":["jiǎo","qiāo"],"煔":["shǎn","qián","shān"],"煕":["xī","yí"],"煠":["yè","zhá"],"煬":["yáng","yàng"],"煴":["yūn","yǔn"],"煾":["ēn","yūn"],"熅":["yūn","yǔn"],"熇":["hè","xiāo"],"熜":["cōng","zǒng"],"熝":["lù","āo"],"熢":["péng","fēng"],"熣":["suī","cuǐ"],"熯":["hàn","rǎn"],"熰":["ōu","ǒu"],"熿":["huáng","huǎng"],"燀":["chǎn","dǎn","chàn"],"燋":["jiāo","qiáo","jué","zhuó"],"燑":["tóng","dòng"],"燤":["tài","liè"],"爃":["róng","yíng"],"爄":["lì","liè"],"爉":["là","liè"],"爋":["xūn","xùn"],"爌":["kuàng","huǎng"],"爎":["liáo","liǎo"],"爒":["liáo","liǎo"],"爓":["yàn","xún"],"爦":["lǎn","làn"],"爫":["zhǎo","zhuǎ"],"爯":["chēng","chèn"],"爲":["wéi","wèi"],"牑":["biān","miàn"],"牗":["yǒu","yōng"],"牚":["chēng","chèng"],"牞":["jiū","lè"],"牫":["gē","qiú"],"牰":["yòu","chōu"],"犆":["zhí","tè"],"犍":["jiān","qián"],"犛":["máo","lí"],"犮":["quǎn","bá"],"犳":["zhuó","bào"],"犴":["hān","àn"],"犺":["kàng","gǎng"],"犻":["pèi","fèi"],"犿":["huān","fān"],"狋":["yí","quán","chí"],"狌":["shēng","xīng"],"狏":["tuó","yí"],"狟":["huán","huān"],"狢":["hé","mò"],"狧":["tà","shì"],"狪":["tóng","dòng"],"狵":["máng","dòu"],"狶":["xī","shǐ"],"猈":["bài","pí"],"猏":["jiān","yàn"],"猚":["yá","wèi"],"猭":["chuàn","chuān"],"猯":["tuān","tuàn"],"猰":["yà","jiá","qiè"],"猲":["xiē","hè","gé","hài"],"猵":["biān","piàn"],"猼":["bó","pò"],"獋":["háo","gāo"],"獖":["fén","fèn"],"獜":["lín","lìn"],"獟":["yào","xiāo"],"獡":["shuò","xī"],"獦":["gé","liè","xiē"],"獱":["biān","piàn"],"獳":["nòu","rú"],"獶":["náo","nǎo","yōu"],"獿":["náo","yōu"],"玚":["chàng","yáng"],"玧":["mén","yǔn"],"玪":["jiān","qián"],"玱":["qiāng","cāng"],"玵":["án","gān"],"玹":["xuán","xián"],"玼":["cī","cǐ"],"珆":["yí","tāi"],"珇":["zǔ","jù"],"珢":["yín","kèn"],"珲":["hún","huī"],"珶":["dì","tí"],"琁":["xuán","qióng"],"琈":["fú","fū"],"琕":["pín","bǐng"],"琗":["cuì","sè"],"琟":["wéi","yù"],"琠":["tiǎn","tiàn"],"琣":["běng","pěi"],"琿":["hún","huī"],"瑎":["xié","jiē"],"瑒":["chàng","yáng"],"瑱":["tiàn","tián","zhèn"],"瑲":["qiāng","cāng"],"瑸":["bīn","pián"],"瑹":["tú","shū"],"璅":["zǎo","suǒ"],"璚":["qióng","jué"],"璯":["huì","kuài"],"璷":["lú","fū"],"璸":["bīn","pián"],"璾":["jì","zī"],"瓕":["mí","xǐ"],"瓗":["qióng","wěi","wèi"],"瓛":["huán","yè","yà"],"瓟":["bó","páo"],"瓡":["zhí","hú"],"瓨":["xiáng","hóng"],"瓸":["bǎi","wǎ"],"瓹":["juàn","juān"],"甴":["yóu","zhá"],"甼":["tǐng","dīng"],"甾":["zāi","zī"],"畁":["bì","qí"],"畐":["fú","bì"],"畗":["dá","fú"],"畟":["cè","jì"],"畠":["zāi","zī"],"畨":["fān","pān"],"畬":["shē","yú"],"當":["dāng","dàng","dǎng"],"畺":["jiāng","jiàng"],"疄":["lín","lìn"],"疌":["jié","qiè"],"疐":["zhì","dì"],"疠":["lì","lài"],"疦":["jué","xuè"],"疨":["yǎ","xiā"],"疺":["fá","biǎn"],"疿":["fèi","féi"],"痁":["shān","diàn"],"痋":["téng","chóng"],"痌":["tōng","tóng"],"痏":["wěi","yòu","yù"],"痑":["tān","shǐ"],"痡":["pū","pù"],"痭":["bēng","péng"],"痱":["fèi","féi"],"痳":["má","lìn"],"痶":["tiǎn","diàn"],"痷":["ān","yè","è"],"痾":["kē","ē"],"瘅":["dàn","dān"],"瘈":["zhì","chì"],"瘕":["jiǎ","xiá","xiā"],"瘣":["huì","lěi"],"瘥":["chài","cuó"],"瘧":["nüè","yào"],"瘨":["diān","chēn"],"癄":["qiáo","jiào"],"癉":["dàn","dān"],"癐":["guì","wēi"],"癑":["nòng","nóng"],"癘":["lì","lài"],"癟":["biē","biě"],"癷":["bō","bǒ"],"皀":["jí","bī"],"皅":["pā","bà"],"皐":["gāo","yáo"],"皪":["lì","luò","bō"],"皻":["zhā","cǔ"],"皽":["zhāo","zhǎn","dǎn"],"監":["jiān","jiàn"],"盩":["zhōu","chóu"],"盳":["máng","wàng"],"盷":["xián","tián"],"盻":["xì","pǎn"],"眃":["yún","hùn"],"眏":["yāng","yǎng","yìng"],"眑":["yǎo","āo","ǎo"],"眗":["jū","xū","kōu"],"眙":["yí","chì"],"眜":["mò","miè"],"眣":["dié","tì"],"眪":["bǐng","fǎng"],"眫":["pàng","pán"],"眭":["guì","suī"],"眰":["dié","zhì"],"眴":["xuàn","shùn","xún"],"睄":["qiáo","shào","xiāo"],"睉":["cuó","zhuài"],"睟":["suì","zuì"],"睪":["yì","zé","gāo"],"睲":["xǐng","xìng"],"瞆":["guì","wèi","kuì"],"瞇":["mī","mí"],"瞉":["kòu","jì"],"瞏":["qióng","huán"],"瞗":["diāo","dōu"],"瞜":["lóu","lǘ","lou"],"瞞":["mán","mén"],"瞢":["méng","měng"],"瞤":["rún","shùn"],"瞭":["liǎo","liào"],"瞯":["xián","jiàn"],"瞴":["wǔ","mí"],"瞶":["guì","kuì"],"矃":["nǐng","chēng"],"矆":["huò","yuè"],"矌":["kuàng","guō"],"矒":["méng","měng"],"矔":["guàn","quán"],"矕":["mǎn","mán"],"矝":["jīn","qín","guān"],"矦":["hóu","hòu"],"矯":["jiǎo","jiáo"],"矼":["gāng","qiāng","kòng"],"砏":["pīn","bīn","fēn"],"砢":["kē","luǒ"],"砩":["fú","fèi"],"砫":["zhù","zhǔ"],"砬":["lì","lā","lá"],"硄":["kuāng","guāng"],"硊":["wěi","guì"],"硌":["luò","gè"],"硍":["kèn","xiàn","gǔn","yǐn"],"硏":["yán","yàn"],"硑":["pēng","píng"],"硙":["wéi","wèi"],"硞":["què","kè","kù"],"硥":["mǎng","bàng"],"硦":["luò","lòng"],"硧":["yǒng","tóng"],"硻":["kēng","kěng"],"硽":["yān","yǎn"],"硾":["zhuì","chuí","duǒ"],"碂":["zòng","cóng"],"碊":["jiān","zhàn"],"碏":["què","xī"],"碖":["lún","lǔn","lùn"],"碙":["náo","gāng"],"碨":["wěi","wèi"],"碩":["shuò","shí"],"碮":["tí","dī"],"碻":["què","qiāo"],"碿":["sù","xiè"],"磂":["liú","liù"],"磃":["sī","tí"],"磆":["huá","kě","gū"],"磈":["kuǐ","wěi"],"磍":["xiá","qià","yà"],"磏":["lián","qiān"],"磑":["ái","wèi"],"磖":["lá","lā"],"磝":["áo","qiāo"],"磞":["pēng","pèng"],"磤":["yīn","yǐn"],"磥":["lěi","léi"],"磩":["qì","zhú"],"磱":["láo","luò"],"磼":["jí","shé"],"礉":["hé","qiāo","qiào"],"礊":["kè","huò"],"礌":["léi","lěi"],"礐":["què","hú"],"礘":["è","qì"],"礥":["xián","xín"],"礧":["léi","lěi","lèi"],"礹":["yán","yǎn"],"祇":["zhǐ","qí"],"祊":["bēng","fāng"],"祕":["mì","bì"],"祱":["shuì","lèi"],"禆":["bì","pí"],"禓":["shāng","yáng"],"禔":["tí","zhǐ"],"禨":["jī","jì"],"禪":["shàn","chán"],"秄":["zǐ","zì"],"秅":["chá","ná"],"秇":["yì","zhí"],"秏":["hào","mào"],"秙":["kù","kū"],"秜":["ní","nì"],"秮":["huó","kuò"],"秲":["shì","zhì"],"秳":["huó","kuò"],"秿":["fù","pū"],"稄":["xùn","zè"],"稌":["tú","shǔ"],"稕":["zhùn","zhǔn"],"稘":["jī","qí"],"稜":["léng","lēng","líng"],"稡":["zuì","zú","sū"],"稧":["xì","qiè"],"稫":["pì","bì"],"種":["zhǒng","zhòng"],"稯":["zōng","zǒng"],"稰":["xǔ","xū"],"稱":["chēng","chèn","chèng"],"稴":["xián","jiān","liàn"],"稵":["zī","jiū"],"穇":["cǎn","shān","cēn"],"穈":["mén","méi"],"穖":["jǐ","jì"],"穘":["xiāo","rào"],"穛":["zhuō","bó"],"穜":["tóng","zhǒng"],"穪":["chēng","chèn","chèng"],"穮":["biāo","pāo"],"穱":["zhuō","jué"],"穳":["cuán","zàn"],"穻":["yū","yǔ"],"窋":["zhú","kū"],"窌":["jiào","liáo","liù"],"窐":["wā","guī"],"窨":["yìn","xūn"],"窫":["yà","yē"],"窴":["tián","diān","yǎn"],"窼":["chāo","kē"],"窽":["kuǎn","cuàn"],"窾":["kuǎn","cuàn"],"竀":["chēng","chèng"],"竐":["chù","qì"],"竘":["qǔ","kǒu"],"竧":["jìng","zhěn"],"竲":["céng","zēng"],"竷":["kǎn","kàn"],"竻":["lè","jīn"],"笅":["jiǎo","jiào"],"笍":["zhuì","ruì"],"笐":["háng","hàng"],"笒":["cén","jìn","hán"],"笓":["pí","bì"],"笚":["dā","xiá","nà"],"笮":["zuó","zé"],"笰":["fú","fèi"],"筊":["jiǎo","jiào"],"筤":["láng","làng"],"筫":["zhì","zhǐ"],"箁":["póu","bù","fú","pú"],"箄":["pái","bēi"],"箈":["tái","chí"],"箉":["guǎi","dài"],"箌":["zhào","dào"],"箐":["qìng","jīng"],"箖":["lín","lǐn"],"箘":["jùn","qūn"],"箢":["wǎn","yuān"],"箷":["shī","yí"],"箹":["yuē","yào","chuò"],"箾":["shuò","xiāo","qiào"],"築":["zhù","zhú"],"篢":["gōng","gǎn","lǒng"],"篣":["péng","páng"],"篧":["zhuó","huò"],"篬":["qiāng","cāng"],"篭":["lóng","lǒng"],"篯":["jiǎn","jiān"],"篴":["zhú","dí"],"篸":["cēn","zān","cǎn"],"篹":["zhuàn","zuàn","suǎn"],"篻":["piǎo","biāo"],"篿":["tuán","zhuān"],"簂":["guó","guì"],"簎":["cè","jí"],"簚":["mì","miè"],"簨":["sǔn","zhuàn"],"簳":["gǎn","gàn"],"籈":["zhēn","jiān"],"籓":["fān","pān","biān"],"籔":["sǒu","shǔ"],"籛":["jiǎn","jiān"],"籠":["lóng","lǒng"],"粆":["shā","chǎo"],"粇":["kāng","jīng"],"粢":["zī","cí"],"粣":["cè","sè"],"粰":["fū","fú"],"糁":["sǎn","shēn"],"糄":["biān","biǎn"],"糓":["gǔ","gòu"],"糝":["sǎn","shēn"],"糣":["sǎn","shēn"],"糸":["mì","sī"],"糺":["jiū","jiǔ"],"糽":["zhēng","zhěng"],"紁":["chà","chǎ"],"約":["yuē","yāo"],"紅":["hóng","gōng"],"紇":["hé","gē"],"紋":["wén","wèn"],"紒":["jì","jié","jiè"],"紕":["pī","pí","bǐ"],"紟":["jīn","jìn"],"紥":["zhā","zā"],"紨":["fū","fù"],"紬":["chōu","chóu"],"紮":["zhā","zā"],"紴":["bō","bì"],"紶":["qū","qǔ"],"紾":["zhěn","tiǎn"],"絅":["jiōng","jiǒng"],"結":["jié","jiē"],"絓":["guà","kuā"],"絔":["bǎi","mò"],"絙":["huán","gēng"],"絜":["xié","jié"],"絟":["quán","shuān"],"絠":["gǎi","ǎi"],"絡":["luò","lào"],"絣":["bēng","bīng","pēng"],"給":["gěi","jǐ"],"絧":["tōng","tóng","dòng"],"絩":["tiào","diào","dào"],"絫":["lěi","lèi","léi"],"絯":["gāi","hài"],"絺":["chī","zhǐ"],"絻":["miǎn","wèn","mán","wàn"],"綅":["qīn","xiān"],"綈":["tí","tì"],"綖":["yán","xiàn"],"綜":["zōng","zèng"],"綝":["lín","chēn"],"綟":["lì","liè"],"綧":["zhǔn","zhùn"],"綨":["jī","qí"],"綪":["qiàn","qīng","zhēng"],"綮":["qìng","qǐ"],"綳":["bēng","běng","bèng"],"綸":["lún","guān"],"綽":["chuò","chāo"],"緂":["tián","tǎn","chān"],"緑":["lǜ","lù"],"緛":["ruǎn","ruàn"],"緝":["jī","qī"],"緟":["chóng","zhòng"],"緢":["miáo","máo"],"緤":["xiè","yè"],"緪":["gēng","gèng"],"緰":["tōu","xū","shū"],"緵":["zōng","zòng"],"緶":["biàn","pián"],"緷":["gǔn","yùn"],"緺":["guā","wō"],"緼":["yùn","yūn","wēn"],"縆":["gēng","gèng"],"縍":["bāng","bàng"],"縎":["gǔ","hú"],"縒":["cī","cuò","suǒ"],"縕":["yùn","yūn","wēn"],"縗":["cuī","suī","shuāi"],"縙":["róng","rǒng","ròng"],"縡":["zài","zēng"],"縣":["xiàn","xuán"],"縫":["féng","fèng"],"縮":["suō","sù"],"縯":["yǎn","yǐn"],"縱":["zòng","zǒng"],"縳":["zhuàn","juàn"],"縸":["mù","mò"],"縹":["piǎo","piāo"],"繃":["bēng","běng","bèng"],"繆":["móu","miù","miào","mù","liǎo"],"繌":["zōng","zòng"],"繒":["zēng","zèng"],"織":["zhī","zhì"],"繘":["jú","jué"],"繛":["chuō","chuò"],"繜":["zūn","zǔn"],"繟":["chǎn","chán"],"繢":["huì","huí"],"繫":["xì","jì"],"繰":["qiāo","sāo"],"繳":["jiǎo","zhuó"],"繵":["dàn","tán","chán"],"纀":["pú","fú"],"纅":["yào","lì"],"纕":["xiāng","rǎng"],"纚":["lí","xǐ","lǐ","sǎ"],"绨":["tí","tì"],"缊":["yùn","yūn","wēn"],"缋":["huì","huí"],"缏":["biàn","pián"],"缞":["cuī","suī","shuāi"],"缲":["qiāo","sāo"],"罖":["wǎng","ra"],"㐁":["tiǎn","tiàn"],"㐆":["yǐn","yī"],"㐌":["sì","yí"],"㐲":["dài","fú"],"㐷":["mǎ","mà","mián"],"㐺":["zhòng","yín"],"㐼":["chèng","zhěng"],"㐾":["ruǎn","yuàn"],"㑂":["fǎng","páng"],"㑋":["jiòng","kǒng","qióng"],"㑍":["lěi","lèi"],"㑑":["lǎn","jì"],"㑙":["dié","yǒng"],"㑜":["yì","chì"],"㑟":["běng","bó","pěng"],"㑮":["hún","wén"],"㑵":["hàn","jí","jié","zhǎ","zí"],"㑸":["ǎi","yáo","yóu"],"㑾":["xiáo","yáo"],"㒁":["yǔ","yùn"],"㒂":["kù","zhuó"],"㒄":["nàng","nèn","rǎn"],"㒆":["chì","kè","xì","xiào","yàn"],"㒇":["mù","wǔ"],"㒍":["léi","lěi"],"㒎":["sǎ","sà","tàn"],"㒑":["huì","kuǐ"],"㒜":["yú","yǔ"],"㒝":["miè","wà"],"㒞":["jùn","kě"],"㒤":["shè","chè"],"㒷":["guǎ","xìng","xǔ"],"㒸":["suì","xuán"],"㓃":["chuí","dù","zhà"],"㓈":["bèi","bìng","fèi","yè"],"㓉":["huàn","huó","huò"],"㓎":["qīn","qǐn","qìn"],"㓖":["bì","bié"],"㓗":["jié","qǐ"],"㓞":["qì","qià","yáo"],"㓡":["fǔ","fǒu"],"㓤":["jié","qià"],"㓨":["cí","cì"],"㓴":["jùn","ruǎn"],"㓸":["jué","zhuó"],"㓼":["chì","chòng"],"㔀":["lüè","qíng"],"㔃":["jué","pì"],"㔋":["jiàn","lán","làn"],"㔍":["duǒ","zhá"],"㔎":["xiè","yì"],"㔑":["chì","dào","qì","shuì"],"㔓":["jiǎn","xiàn"],"㔕":["jí","yì"],"㔙":["bǎng","péng"],"㔜":["bá","bó"],"㔞":["kuài","kuàng","wàng"],"㔠":["hé","jiá"],"㔣":["léi","lèi"],"㔭":["chè","chí","yí"],"㔯":["suǎn","xuán"],"㔳":["guǐ","gùn","huán","jué"],"㔵":["xiàn","xuǎn"],"㔽":["yào","yǒu"],"㕇":["lá","lā"],"㕈":["hòu","yǐ"],"㕋":["jìng","qín"],"㕎":["è","kè","kǔn"],"㕒":["wéi","wěi","wēi"],"㕙":["jùn","ruì"],"㕛":["xù","yǒu","yòu"],"㕡":["hé","hè","huò"],"㕢":["gài","hài","jù","lǔn","nǒu"],"㕣":["yǎn","yàn"],"㕭":["ào","bì"],"㕲":["huá","yíng"],"㕵":["guó","hún","luǒ"],"㕶":["ň","ňg"],"㖀":["lè","luò"],"㖃":["hǒu","hòu"],"㖆":["qú","qǔ"],"㖕":["bò","niè"],"㖠":["bà","nuò"],"㖢":["jí","qí"],"㖷":["shí","tí"],"㖼":["duǒ","lín","móu"],"㖽":["zé","zéi"],"㗃":["wěn","yìn"],"㗄":["mán","màn"],"㗆":["gé","kài"],"㗇":["xiá","ya"],"㗉":["bì","è","lüè"],"㗊":["jí","qì","bī","léi"],"㗘":["bó","fù"],"㗙":["nà","chú","zhōu"],"㗢":["dòng","hóng"],"㗰":["chù","cóng"],"㗲":["huò","xì"],"㗿":["hé","xià","xiā"],"㘈":["yī","yì"],"㘍":["jí","qì"],"㘎":["hǎn","hàn"],"㘐":["pào","pěng"],"㘔":["cǎn","sǎi"],"㘕":["hǎn","lán"],"㘙":["yán","yǎn"],"㘜":["chǐ","chóu","chù"],"㘝":["niǎn","niè","nà","lǎn"],"㘠":["bì","mì"],"㘣":["xuán","yuán"],"㙁":["mǎng","méi","mèi","mù","nà"],"㙈":["hán","xià"],"㙊":["cháng","zhàng"],"㙜":["chí","tái"],"㙠":["yì","yī"],"㙢":["mán","mén"],"㙨":["jì","qí"],"㙪":["yè","yì"],"㙮":["dā","da"],"㙳":["hǎn","hé","kǎn"],"㙴":["chàn","zhàn"],"㙸":["bào","bó","pú"],"㙺":["guì","kuí"],"㙻":["chán","qiè","zàn"],"㙾":["xì","xué"],"㚁":["qiáo","qiào","qù"],"㚃":["yún","yùn","yūn"],"㚌":["huà","huǒ"],"㚍":["guó","kuǐ","kuì"],"㚓":["lái","lǎi"],"㚕":["fú","bì"],"㚗":["qié","xié"],"㚜":["xù","yù"],"㚞":["měng","shěn","yìng","yùn"],"㚣":["jiāo","xiáo"],"㚫":["shà","zhà"],"㚯":["xín","xún"],"㚲":["diǎn","shàn","chān"],"㚷":["ěr","nǎi"],"㛆":["duǒ","duò"],"㛏":["òu","qiú"],"㛗":["zuò","qiē"],"㛙":["qiè","qín","shěn","shèn"],"㛛":["xìn","zhèn"],"㛝":["bèi","bèng"],"㛪":["yàn","yuán"],"㛱":["ruì","wěi"],"㛳":["chà","yì"],"㛶":["chóu","tán","tàn"],"㛼":["shà","chā"],"㜃":["liàn","liáo","máng"],"㜇":["huì","yè"],"㜊":["pàng","zhǎn"],"㜎":["xī","xì"],"㜑":["fú","pó"],"㜗":["cǎn","chú","xuàn"],"㜛":["nèn","ruǎn"],"㜝":["ǎn","àn"],"㜣":["rán","niàn"],"㜤":["shěn","niǎn"],"㜥":["mái","mó"],"㜦":["hàn","niè","sì","xié","xín"],"㜨":["ér","nái"],"㜫":["mà","méi","měi"],"㜱":["dòng","zhì"],"㜲":["wěng","yíng"],"㜷":["mí","nǎi","xiǎn"],"㜼":["zhí","zhì"],"㝃":["fàn","miǎn","wǎn"],"㝄":["chún","qì","rùn"],"㝋":["liáo","liǎo","liú"],"㝌":["jié","jiù","zhòu"],"㝑":["máng","páng"],"㝓":["gé","kè"],"㝖":["yí","yín"],"㝟":["máo","mào","kuān"],"㝣":["yè","yì"],"㝦":["jùn","yá"],"㝪":["diàn","dǐng"],"㝶":["ài","dé"],"㝺":["lián","lín"],"㝽":["chuí","shuǐ","zhuǐ"],"㝿":["bó","bǒ","fù","qiàn"],"㞎":["bǎ","fú","pá"],"㞒":["xì","xiè"],"㞓":["qǐ","qì"],"㞚":["qì","zhǎ"],"㞠":["láo","liáo"],"㞨":["zǎi","zǐ"],"㞫":["jù","zǒu"],"㞼":["chéng","shèng","zhé"],"㞾":["ní","yì"],"㞿":["chì","qí"],"㟂":["chǐ","mǔ"],"㟇":["cuó","cuǒ"],"㟙":["lǎo","zé","zhái"],"㟝":["péi","pǒu"],"㟧":["è","niè","xùn"],"㟩":["mín","mǐn","wěn"],"㟬":["shǔ","sǒu"],"㟲":["jué","yuán"],"㟴":["kuài","kuǐ","wěi"],"㟿":["máng","mǎng"],"㠅":["fú","fù"],"㠍":["jí","jié","qì"],"㠖":["jì","yǐ"],"㠗":["ào","wò"],"㠚":["duì","zhuó"],"㠣":["lài","lì"],"㠧":["mí","mǐ"],"㠭":["zhǎn","zhàn"],"㠱":["jì","qǐ"],"㡁":["kǎi","kuà"],"㡄":["sǔn","xún"],"㡇":["jí","zhé"],"㡈":["mén","wèn"],"㡉":["xián","yán"],"㡊":["qià","qiǎn"],"㡋":["è","yé"],"㡌":["mào","mèi"],"㡏":["tóu","shū"],"㡔":["wù","mù"],"㡙":["bī","pí"],"㡝":["fèng","fú"],"㡞":["lěi","lóu"],"㡨":["qiān","jiān"],"㡯":["zhái","dù"],"㡳":["dǐ","zhé","zhǐ"],"㡸":["zhǎ","zhà"],"㡹":["cì","jū"],"㢀":["cì","zì"],"㢍":["yíng","yǐng"],"㢎":["chà","zé","zhái","zhé"],"㢓":["yǎo","zhàng"],"㢟":["chǎn","chān"],"㢠":["jiǒng","jùn"],"㢣":["jìng","qíng"],"㢰":["bì","huán"],"㢵":["shè","xié"],"㣃":["yǔ","yù"],"㣆":["mí","mí","pèi"],"㣇":["nǐ","yì"],"㣚":["tóng","tǒng"],"㣞":["duó","duò"],"㣣":["shǎn","shàn"],"㣧":["yìn","yǒng"],"㣪":["huǎn","kuò"],"㣱":["zé","zuò"],"㤁":["miǎn","tiǎn"],"㤇":["ǎo","fó","wù"],"㤉":["qiā","yá"],"㤊":["xiào","yáo"],"㤔":["fú","fù"],"㤘":["chù","cù","zhòu"],"㤛":["nín","rèn"],"㤜":["jué","yù"],"㤟":["kǒng","tòu"],"㤢":["xù","yù"],"㤤":["yú","yǔ"],"㤧":["hóu","hòu"],"㤨":["gǒng","qióng"],"㤬":["huì","kuì"],"㤮":["kuáng","guàng"],"㤯":["jiǒng","jùn"],"㤰":["zǎn","zuò"],"㤲":["qiè","qù"],"㥁":["dé","zhí","zhòu"],"㥆":["diàn","tuì"],"㥇":["cán","càn"],"㥉":["chè","chì"],"㥎":["lái","lí"],"㥔":["yú","yù"],"㥛":["jí","kè","sù"],"㥝":["mǐ","miǎn"],"㥞":["cuì","qiàn","suì"],"㥦":["qiè","xiá","xiǎn"],"㥨":["chuí","shuì","wěi"],"㥲":["shèn","yín"],"㥴":["yí","yǐ"],"㥷":["yè","yì"],"㥺":["hé","hè"],"㥽":["cè","zé"],"㦂":["cháng","tàng"],"㦄":["má","mì"],"㦅":["diē","dì"],"㦌":["tuì","xù","hū"],"㦏":["sǔn","xuàn"],"㦑":["liǎn","xiàn"],"㦗":["jiàn","jìn"],"㦛":["yú","yǔ"],"㦜":["huò","xuè"],"㦟":["hài","mái"],"㦢":["jié","qì"],"㦥":["huán","xiǎn"],"㦨":["lán","làn"],"㦴":["gé","qià"],"㦹":["àng","yáng","yǐng"],"㦺":["rǔ","rù"],"㦻":["xí","zhé"],"㦽":["xù","yù"],"㧄":["qiǎn","qiú"],"㧅":["mù","dāo"],"㧈":["yǐn","yìn"],"㧉":["gài","kuì"],"㧊":["bá","pō"],"㧋":["xiǎn","xuǎn"],"㧎":["yá","yà","qiā"],"㧑":["wéi","wěi"],"㧒":["xué","yù","yuè"],"㧕":["jiù","liǔ","yú"],"㧗":["zǐ","jǐ","zhǐ"],"㧘":["cuì","nǎo","zì"],"㧱":["chèn","ná","nì","nì","tiàn"],"㧳":["bǎi","bó","zhuò"],"㧵":["póu","pǒu"],"㧷":["duò","tùn"],"㧻":["zhǐ","zhuó","zú"],"㧽":["gù","hú"],"㨁":["zhí","zhì"],"㨃":["chéng","duǐ"],"㨅":["nèi","ruì"],"㨋":["chě","lè","zhèn"],"㨌":["gòu","rú","rǔ"],"㨎":["rú","ruán"],"㨐":["bǔ","péi"],"㨒":["kuí","wěi","xié"],"㨓":["láo","liáo"],"㨤":["huì","kuǎi","wài"],"㨯":["huò","kuò"],"㨰":["gé","gǔn","hùn","huò","jié"],"㨶":["chóu","dǎo","zhǒu","zhòu"],"㨺":["mén","mì","miǎn"],"㨻":["cán","shǎn","zàn"],"㨽":["pǐ","pì","qiǎo"],"㩇":["huà","huò"],"㩈":["xiàn","yǔn"],"㩋":["sù","xiāo"],"㩖":["qiáng","tiáo"],"㩗":["xí","xié"],"㩢":["mí","miè"],"㩩":["qǐ","qǐng"],"㩪":["xié","xìn","yé"],"㩭":["bó","jiǎo","xiào"],"㩮":["qián","xián"],"㩯":["bǎn","pán","pó"],"㩰":["jiǎo","qiáo","xiǔ"],"㩲":["kǔn","quán"],"㩶":["niè","nǐng"],"㩹":["dié","zhá"],"㩻":["guǐ","qī"],"㪌":["tǒng","yú","yǔ"],"㪔":["sàn","tán"],"㪙":["kě","kè","kuò"],"㪪":["sà","xǐ"],"㪯":["chá","jǔ","qú"],"㪽":["suǒ","suò"],"㪾":["gé","luò"],"㪿":["zhé","shé"],"㫅":["chá","qí","shí"],"㫎":["gǔn","kuài"],"㫑":["shí","zhǐ"],"㫓":["qǐ","qì"],"㫘":["mì","miǎn"],"㫛":["guàng","kuáng","kuàng","mǔ"],"㫜":["dàn","tǎn"],"㫤":["chǎng","zhào"],"㫶":["cǒu","zhǒu"],"㫹":["dài","shù","yú"],"㫼":["dié","zhé","zhì"],"㬆":["mián","miàn","mǐn"],"㬉":["nuǎn","ruò"],"㬐":["jǐn","jìn","xíng","yǐng"],"㬒":["mǎng","mào"],"㬪":["dié","zhì"],"㬭":["jiào","shǎn","yǎo"],"㬮":["kuài","nàn"],"㬵":["xiáo","jiāo"],"㭈":["jué","kuài"],"㭌":["móu","yú"],"㭘":["hé","gé"],"㭙":["shé","zhé"],"㭡":["xì","xìn"],"㭩":["lèi","líng","liè"],"㭫":["cuán","cuó","zhèn"],"㭯":["dié","nà","zhé"],"㭰":["jì","jué","zuǐ"],"㭱":["hé","xiá"],"㭾":["jué","yuè"],"㮄":["bǎng","bì","péng"],"㮋":["yǒu","yù"],"㮌":["mián","mǐn"],"㮐":["xǐng","shěng"],"㮕":["ér","ruǎn"],"㮖":["jiá","jiá"],"㮝":["hé","luò"],"㮞":["jié","ní","yá"],"㮟":["jí","niǎn","pèng","ròu","kā"],"㮣":["gài","zé"],"㮦":["sè","suǒ"],"㮨":["jí","jì"],"㮯":["huá","hún","kuǎn"],"㮰":["bí","pí"],"㮶":["shì","shuò"],"㯀":["xiǎn","xuàn"],"㯉":["huò","chū"],"㯐":["fǎng","tuǒ"],"㯗":["rǎn","shùn","xián","xiàn"],"㯛":["hú","huò"],"㯞":["juàn","yuè"],"㯠":["qiàn","xiàn","xún"],"㯥":["cáo","zāo"],"㯰":["zhé","zhí"],"㯱":["biǎo","piáo","pāo"],"㯻":["gǔn","hùn"],"㰂":["shěn","sǔn"],"㰐":["jué","kuí","lěi","tuǐ","tuǒ"],"㰒":["shé","xué"],"㰟":["jì","qì"],"㰤":["hē","qiè"],"㰯":["tòu","tǒu","hòu"],"㰲":["xù","yù"],"㰴":["pó","pǒu"],"㰸":["liǎn","liàn","luǎn"],"㰺":["xiá","xià"],"㰽":["mǐ","yàn"],"㱀":["chǐ","chuài"],"㱇":["sè","xì"],"㱌":["chè","yǎn","yé"],"㱔":["xiē","suò"],"㱘":["àn","yǎn"],"㱚":["cán","hài","shàn"],"㱟":["bó","pí","pǐ"],"㱦":["è","guì","jǐ","qī"],"㱪":["mèn","hūn"],"㱮":["kuài","kuì"],"㱱":["huì","wù","xì"],"㱵":["bèn","fèn"],"㱶":["bèng","jiào","péng","qiǎo","rù"],"㱸":["bì","bié"],"㱹":["lì","suàn","xiàn"],"㱻":["luǒ","luò"],"㱽":["dàn","qín","zhěn"],"㱾":["gāi","kāi"],"㲄":["kòu","kū"],"㲋":["chuò","zhuó","zú"],"㲏":["bǎo","piǎo","pín","pìng"],"㲜":["tán","tǎn"],"㲡":["nài","nì"],"㲢":["biàn","bié"],"㲦":["hàn","hě"],"㲲":["dié","yì"],"㲴":["zhòng","zhòu"],"㲹":["guǐ","qiú"],"㲺":["jí","kè","léi"],"㲽":["niàn","rěn","xiàn"],"㲾":["yǔ","yù"],"㳀":["guò","kǎi","xì"],"㳅":["jiǎo","liú"],"㳆":["shǔ","tǒu"],"㳎":["biàn","fàn"],"㳏":["chǐ","shì"],"㳐":["sà","zhá","zhǎ"],"㳥":["jù","lòng"],"㳨":["jiǎn","zá","zǎn"],"㳪":["pàn","pì"],"㳶":["gòu","nǒu"],"㳷":["wěn","hū"],"㴃":["lèi","lì"],"㴆":["jìn","xìng"],"㴔":["sè","yì"],"㴸":["nà","shǎn","yè"],"㴽":["xiè","yìn"],"㵀":["cuàn","zú"],"㵂":["chuǎng","shù"],"㵄":["hàn","qià","yù"],"㵅":["dàn","tàn"],"㵊":["shěn","zhé"],"㵌":["chàn","qióng","xún"],"㵎":["hǎn","jiàn","kǎn"],"㵔":["chě","chè"],"㵗":["fù","pán","píng"],"㵢":["léi","lěi"],"㵣":["kě","luǒ"],"㵤":["diàn","shà","xiá"],"㵥":["bì","mì"],"㵨":["bì","pì"],"㵫":["nǐ","yì"],"㵮":["chún","wěn"],"㵳":["liáo","liú"],"㵸":["yào","yuè"],"㵺":["pái","pài"],"㵽":["duì","lěi"],"㵾":["jìng","qìng"],"㶆":["chú","zhū"],"㶈":["yíng","yìng"],"㶒":["shǎn","shěn","tàn"],"㶡":["dài","huǒ","zuó"],"㶫":["liǎo","liào"],"㶬":["méi","mò"],"㶭":["jiù","yǒu"],"㶴":["chǐ","shǐ"],"㷅":["chǎo","miǎo"],"㷆":["dòu","fù"],"㷇":["guài","kuí"],"㷉":["wèi","yù","yùn"],"㷋":["tán","tǎn"],"㷎":["hè","hóng","xié"],"㷤":["hè","hù","xuè"],"㷪":["cuì","zuǎn"],"㷴":["gé","lì"],"㷶":["bèi","bì"],"㷸":["dié","yè"],"㸁":["hǎn","hàn"],"㸄":["jì","jié"],"㸊":["là","lài","liè"],"㸛":["sháo","shuò"],"㸣":["yè","yì"],"㸧":["kèn","yín"],"㸬":["bèi","fèi","pèi"],"㸲":["zuó","zuò"],"㸵":["guǐ","wěi"],"㸸":["hǒu","ǒu","kǒu"],"㹂":["cì","qiǎn"],"㹃":["bì","fèi"],"㹄":["jì","qì"],"㹈":["lí","máo"],"㹌":["chǎn","shèng"],"㹍":["dí","dú"],"㹐":["chóng","zhòu"],"㹑":["sì","yí"],"㹗":["táo","tāo"],"㹘":["rú","rù","ruí"],"㹛":["ráo","rǎo"],"㹞":["yín","yǐn"],"㹡":["xuán","xuàn"],"㹤":["qiè","què"],"㹫":["xì","yí"],"㹱":["hú","què","rǎn"],"㹷":["shǐ","xìn"],"㹼":["chǔ","jú","yù"],"㹽":["chǎn","shàn"],"㹿":["diǎo","zhào","zhuó"],"㺂":["gǎn","jiàn","yán"],"㺑":["cán","shǎn"],"㺒":["liào","yáo","xiāo"],"㺔":["hài","wèi"],"㺗":["dàn","yán"],"㺠":["yòu","yù"],"㺥":["chán","tán"],"㺩":["jiù","sè"],"㻀":["yóu","yú"],"㻅":["huì","kuài"],"㻊":["máng","mén","mèng"],"㻋":["là","lèi"],"㻎":["lì","sè"],"㻏":["líng","lǐng"],"㻔":["duǒ","ruì"],"㻞":["biàn","fèn","pìn"],"㻡":["dié","jué"],"㻧":["duò","hé"],"㻭":["sè","zé"],"㻰":["miǎn","rè","wèi","yù"],"㻶":["bǐ","bì"],"㻸":["cén","jìn","xín","zēn"],"㻺":["lì","liè"],"㼂":["é","wèn","yuǎn"],"㼉":["yìn","zhèn"],"㼋":["gǔ","jiǔ","móu","rǔ"],"㼎":["bèi","bó","kě"],"㼑":["liàn","luán"],"㼒":["qiǔ","tǎng"],"㼓":["lián","liǎn"],"㼗":["dǐng","tíng"],"㼜":["àng","póu"],"㼝":["fàn","wǎn"],"㼢":["ě","yí"],"㼣":["bǎi","bó"],"㼤":["qì","qiè","yà"],"㼥":["chú","kǎo","tǒu"],"㼭":["diàn","niǎo"],"㼮":["chāi","qì"],"㼰":["é","pí"],"㼽":["shuǎng","chuǎng"],"㽇":["guài","hú","huí","méng","sè"],"㽉":["hǎn","jiàn","xiàn"],"㽋":["luó","luò"],"㽎":["dǎn","tán"],"㽛":["gōu","qú"],"㽢":["ǎn","yè"],"㽩":["càn","cào"],"㽪":["zěng","zhǎ"],"㽱":["jiǎo","jiū","niú"],"㽳":["hàn","xiè","xǔ","yú"],"㽹":["fàn","wǎn"],"㾆":["rán","shǎn"],"㾒":["jì","rú","rù"],"㾖":["lǐ","luó"],"㾗":["lǎng","liàng"],"㾠":["huáng","kuáng","kuì"],"㾦":["bàng","pèi","pén"],"㾨":["qǐ","yǐ"],"㾯":["tuí","wěi"],"㾱":["bèi","fàn","fèi","fú"],"㾺":["mà","mò"],"㾽":["tuí","zhuì"],"㾿":["láng","lǎng"],"㿃":["dài","zhì"],"㿅":["xiǎn","xuǎn"],"㿇":["xí","xì"],"㿛":["lí","lì"],"㿟":["bái","jiǎo"],"㿢":["yào","zhuì"],"㿣":["hé","xiá"],"㿥":["hú","hé"],"㿷":["cuó","cāo"],"㿸":["wǎn","mán"],"䀅":["shè","zhé"],"䀇":["gǔ","què"],"䀉":["qiáo","shà"],"䀏":["xiàn","xuàn"],"䀑":["nà","nì","wò"],"䀔":["niú","rèn"],"䀕":["chèng","zhèn"],"䀘":["xí","xié"],"䀛":["mèi","wù"],"䀜":["gǔ","mèi","xué"],"䀟":["fán","fèi","fèn"],"䀠":["qú","jù"],"䀡":["chàn","tàn"],"䀣":["bì","mà"],"䀰":["gǔ","yíng"],"䀳":["ài","là","lài"],"䀶":["lǎng","liàng"],"䀸":["dì","zhì"],"䀹":["jiá","shè","jié"],"䀼":["rèn","zhěn"],"䁁":["lǎng","liàng"],"䁅":["bèi","bì","měng","mèng"],"䁆":["ǎn","yì"],"䁍":["jià","kè","qià"],"䁓":["jiè","zǒng"],"䁔":["hàn","huǎn","xuān"],"䁙":["yǎn","yàn"],"䁛":["guǐ","guì","kuì"],"䁜":["huǎng","huàng"],"䁟":["chá","duó"],"䁤":["chè","chèng"],"䁪":["nǎn","zhǎn"],"䁯":["shè","xié"],"䁷":["jué","wò"],"䁻":["lì","shuò"],"䁼":["mò","mù"],"䂃":["jiào","jié"],"䂄":["huò","kuàng"],"䂇":["náng","niǔ","nǒng","páng"],"䂒":["jié","qià","yà"],"䂖":["shí","sì"],"䂚":["yáo","yóu"],"䂜":["bàng","péi"],"䂝":["jié","zé","zhé"],"䂠":["shé","shǐ"],"䂡":["dǐ","zhǐ"],"䂤":["fù","hái"],"䂪":["diào","tiǎo"],"䂯":["guài","guàn"],"䂱":["cuì","ruì"],"䂸":["guó","xù"],"䂺":["wǎn","wǒ"],"䂽":["diào","yì"],"䂿":["tà","tiè"],"䃀":["cuì","xùn"],"䃂":["gǔn","gùn"],"䃍":["zhào","zhuì"],"䃕":["láo","luò"],"䃛":["lián","qiàn"],"䃞":["shú","yì"],"䃲":["pán","pàn"],"䃹":["làn","lǎng"],"䃺":["mó","mò"],"䃻":["bà","pái"],"䃽":["fú","guǐ","sì"],"䄆":["huó","kuò"],"䄍":["dù","duó","zhà"],"䄏":["yú","yāo"],"䄑":["huó","kuò"],"䄒":["niè","rěn"],"色":["sè","shǎi"],"臑":["rú","nào","ér"],"戛":["jiá","gā"]},us="ssml-editor-popover",ds=new(function(){return o(function e(){var t=this;i(this,e),s(this,"tooltip",null),s(this,"root",null),s(this,"popoverController",null),s(this,"clickEvent",function(e){var n;null!==(n=e.target)&&void 0!==n&&n.closest(".".concat(us))||t.hide()})},[{key:"isVisible",value:function(){return!!this.tooltip}},{key:"create",value:function(e){return this.root=document.createElement("div"),this.tooltip=document.createElement("div"),this.tooltip.classList.add(us),this.tooltip.classList.add((null==e?void 0:e.rootClassName)||""),this.root.appendChild(this.tooltip),document.body.appendChild(this.root),this.tooltip}},{key:"adjustPos",value:function(e){var t=this.tooltip,n=t.offsetWidth,i=t.offsetHeight,r=d({},e);n+e.x>window.innerWidth-10&&(r.x=window.innerWidth-n-10),i+e.y>window.innerHeight-10&&(r.y=window.innerHeight-i-10),r.x<5&&(r.x=5),r.y<5&&(r.y=5),this.tooltip.style.left="".concat(r.x,"px"),this.tooltip.style.top="".concat(r.y,"px")}},{key:"show",value:(e=p().m(function e(t,n,i){var r,o=this;return p().w(function(e){for(;;)if(0===e.n)return this.hide(),(r=this.create(i)).style.position="fixed",r.style.display="block",r.appendChild(t),this.adjustPos(n),setTimeout(function(){document.addEventListener("click",o.clickEvent)}),e.a(2,new Promise(function(e,t){o.popoverController={resolve:e}}))},e,this)}),n=function(){var n=this,i=arguments;return new Promise(function(r,o){var s=e.apply(n,i);function a(e){t(s,r,o,a,l,"next",e)}function l(e){t(s,r,o,a,l,"throw",e)}a(void 0)})},function(e,t,i){return n.apply(this,arguments)})},{key:"hide",value:function(){var e;null===(e=this.popoverController)||void 0===e||e.resolve(void 0),document.removeEventListener("click",this.clickEvent);var t=this.root;t&&(t.style.display="none",t.remove()),this.tooltip=null}}]);var e,n}()),ps={"ā":"a","á":"a","ǎ":"a","ă":"a","à":"a","ō":"o","ó":"o","ǒ":"o","ŏ":"o","ò":"o","ē":"e","é":"e","ě":"e","ĕ":"e","è":"e","ī":"i","í":"i","ǐ":"i","ĭ":"i","ì":"i","ū":"u","ú":"u","ǔ":"u","ŭ":"u","ù":"u","ǖ":"v","ǘ":"v","ǚ":"v","ǜ":"v","ń":"n","ň":"n","ǹ":"n"},fs=function(e){var t=5,n=(e||"").match(/([^\d]+)(\d)?/);if(!n)return"";var i=n[1];return Number.isNaN(Number(n[2]))||(t=Number(n[2])),(i=i.replace(/ā|á|ǎ|ă|à|ō|ó|ǒ|ŏ|ò|ē|é|ě|ĕ|è|ī|í|ǐ|ĭ|ì|ū|ú|ǔ|ŭ|ù|ǖ|ǘ|ǚ|ǜ|ń|ň|ǹ/,function(e){return/ā|ō|ē|ī|ū|ǖ/.test(e)?t=1:/á|ó|é|í|ú|ǘ|ń/.test(e)?t=2:/ǎ|ă|ǒ|ŏ|ĕ|ě|ǐ|ĭ|ǔ|ŭ|ǚ|ň/.test(e)?t=3:/à|ò|è|ì|ù|ǜ|ǹ/.test(e)&&(t=4),ps[e]||e}))+t};var ms=function(e){return((e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t})(e||8)};function gs(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}function ys(e){return e?e.replace(/&#39;/g,"'").replace(/&quot;/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&"):""}function vs(e){return e.replace(/\u200b/g,"")}var xs=new en("polyphoneTip");var bs=new Xt({key:xs,state:{init:function(){return{active:!1,decorations:Fr.empty}},apply:function(e,t,n,i){var r,o=e.getMeta(xs),s=null!==(r=null==o?void 0:o.active)&&void 0!==r?r:t.active,a=Fr.empty;return s&&(a=!t.active||e.docChanged?function(e,t){var n=[],i=function(e){var i,r=e.pos,o=e.index,s=e.char,a=ms(4);n.push(_r.inline(r+o,r+o+1,{class:So,"data-phoneme-char":s,"data-deco-id":a},{inclusiveStart:!1,inclusiveEnd:!1,decoId:a,char:s,polyphones:JSON.stringify(null!==(i=t[s])&&void 0!==i?i:[])}))};return e.descendants(function(e,n){var r,o="";e.isText?null===(r=e.text)||void 0===r||r.split("").filter(Boolean).forEach(function(e,r){t[e]&&i({pos:n,index:r,char:e})}):e.type.name===k.Phoneme&&(o=e.attrs.text,t[o]&&i({pos:n,index:0,char:o}))}),Fr.create(e,n)}(i.doc,hs):t.decorations.map(e.mapping,e.doc)),d(d({},t),{},{active:s,decorations:a})}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations},handleClick:function(e,t,n){var i=bs.getState(e.state),r=n.target,o=r.closest(".".concat(So)),s=r.closest('[data-type="'.concat(k.Phoneme,'"]'));if(!o&&!s)return!1;var a="",l=-1,c=-1;if(o){var h;if(null==i||!i.active)return!1;var u=null===(h=o.dataset)||void 0===h?void 0:h.decoId,d=i.decorations.find(t,t),p=null;if(d.forEach(function(e){e.spec.decoId===u&&(p=e)}),!p)return!1;a=p.spec.char,l=p.from,c=p.to}else{var f=e.state.doc.resolve(e.posAtDOM(s,0)),m=f.nodeAfter;if(!m||m.type.name!==k.Phoneme)return!1;a=m.attrs.text,l=f.pos,c=f.pos+m.nodeSize}var g,v,x,b=(g=hs[a],v=new cs("ssml-editor-phoneme__list","ssml-editor-phoneme__item"),x=[].concat(y(g),[""]).map(function(e){return{label:e||"移除",value:fs(e)}}),v.render(x)),w=function(t){var n,i,r=null===(n=(i=t.target).closest)||void 0===n?void 0:n.call(i,".ssml-editor-phoneme__item");if(r){var o=r.dataset.value,s=e.state.tr.setSelection(qt.create(e.state.doc,l,c));s=o?s.replaceSelectionWith(e.state.schema.nodes[k.Phoneme].create({value:o,text:a})):s.replaceSelectionWith(e.state.schema.text(a)),e.dispatch(s.setSelection(qt.near(s.doc.resolve(l)))),ds.hide()}};return b.addEventListener("click",w),ds.show(b,{x:n.clientX,y:n.clientY},{rootClassName:"ssml-editor-phoneme__popover"}).then(function(){b.removeEventListener("click",w)}),e.dispatch(e.state.tr.setSelection(qt.create(e.state.doc,l,c)).setMeta(Mo,!0)),!0}}});Eo.registerPlugin("phoneme",bs);var ws={switchPhonemeMode:"switchPhonemeMode",insertPhoneme:"insertPhoneme"};D({name:ws.switchPhonemeMode,description:"切换多音字模式",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r&&r(i.tr.setMeta(xs,{active:!(null==n||!n.active),tooltip:null})),{success:!0}},validate:function(e){var t=e.state.doc.textContent;return null!=t&&t.length&&/[\u4e00-\u9fa5]/.test(t)?{available:!0}:{available:!1,reason:"当前无有效中文文本"}}});var ks=/^[+-]?(?!0\d)\d{1,3}(?:,\d{3})*(?:\.\d+)?$|^[+-]?\d+(?:\.\d+)?$/,Ss={setSayAs:"setSayAs"};D({name:Ss.setSayAs,description:"设置文本读法 (say-as)",execute:function(e,t){var n,i,r=t,o=e.state,s=e.dispatch,a=o.selection,l=a.from,c=a.to,h=a.$from,u=a.$to,d=o.doc.textBetween(l,c,"");return(null===(n=h.nodeAfter)||void 0===n?void 0:n.type.name)===k.SayAs&&(null===(i=u.nodeBefore)||void 0===i?void 0:i.type.name)===k.SayAs&&(d=h.nodeAfter.attrs.text||""),s?(s(o.tr.replaceSelectionWith(o.schema.nodes[k.SayAs].create({interpretAs:r.interpretAs,type:k.SayAs,text:d})).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t,n,i,r=e.state,o=r.selection,s=o.from,a=o.to,l=o.$from,c=o.$to;if(o.empty)return{available:!1,code:I.SelectionInvalid,reason:"请选择文本内容"};var h=r.doc.textBetween(s,a,"");return(null===(t=l.nodeAfter)||void 0===t?void 0:t.type.name)===k.SayAs&&(null===(n=c.nodeBefore)||void 0===n?void 0:n.type.name)===k.SayAs&&(h=l.nodeAfter.attrs.text||""),ks.test(null===(i=h)||void 0===i?void 0:i.trim())?l.parent!==c.parent?{available:!1,code:I.SelectionInvalid,reason:"选区不能跨节点"}:{available:!0}:{available:!1,code:I.ParamsInvalid,reason:"请选择纯数字文本内容"}}}),D({name:O.setSpeechLanguage,description:"设置语种",execute:function(e,t){var n=t,i=e.state,r=e.dispatch,o=i.selection,s=o.from,a=o.to,l=o.empty,c=i.tr,h=ms(6),u=i.schema,d=u.marks,p=u.nodes,f=d[k.SpeechLanguage];if(l){if(r){var m=p[k.RangeAnchor].create({anchorType:"start",tagType:k.SpeechLanguage,value:n.value,tagId:h}),g=p[k.RangeAnchor].create({anchorType:"end",tagType:k.SpeechLanguage,value:n.value,tagId:h}),y=i.schema.text("​",[f.create({value:n.value,tagId:h})]),v=L.from([m,y,g]);c.replaceWith(s,s,v);var x=s+m.nodeSize+y.nodeSize;c.setSelection(jt.near(c.doc.resolve(x),-1)),r(c)}return{success:!0}}if(r){var b=f.create({value:n.value,tagId:h}),w=p[k.RangeAnchor].create({anchorType:"start",tagType:k.SpeechLanguage,value:n.value,tagId:h});c.insert(s,w);var S=p[k.RangeAnchor].create({anchorType:"end",tagType:k.SpeechLanguage,value:n.value,tagId:h});return c.insert(a+w.nodeSize,S),c.addMark(s+w.nodeSize,a+w.nodeSize,b),r(c),{success:!0}}return{success:!0}},validate:function(e){return{available:!0}}}),D({name:N.setSpeechPitch,description:"设置语调",execute:function(e,t){var n=t,i=e.state,r=e.dispatch,o=i.selection,s=o.from,a=o.to;if(o.empty||s===a)return{success:!1,code:I.SelectionInvalid,reason:"请先选择文本"};if(r){var l=i.tr,c=ms(6),h=i.schema,u=h.marks,d=h.nodes,p=u[k.SpeechPitch].create({value:n.value,tagId:c}),f=d[k.RangeAnchor].create({anchorType:"start",tagType:k.SpeechPitch,value:n.value,tagId:c});l.insert(s,f);var m=d[k.RangeAnchor].create({anchorType:"end",tagType:k.SpeechPitch,value:n.value,tagId:c});return l.insert(a+f.nodeSize,m),l.addMark(s+f.nodeSize,a+f.nodeSize,p),r(l),{success:!0}}return{success:!0}},validate:function(e){return e.state.selection.empty?{available:!1,code:I.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}}),D({name:M.setSpeechRate,description:"设置语速",execute:function(e,t){var n=t,i=e.state,r=e.dispatch,o=i.selection,s=o.from,a=o.to;if(o.empty||s===a)return{success:!1,code:I.SelectionInvalid,reason:"请先选择文本"};var l=[];if(i.doc.nodesBetween(s,a,function(e,t){var n=e.marks.find(function(e){return e.type.name===k.SpeechRate});if(n){var i=l.find(function(e){return e.mark.attrs.tagId===n.attrs.tagId});i?i.to=Math.max(i.to,t+e.nodeSize):l.push({mark:n,from:t,to:t+e.nodeSize})}}),r){var c=i.tr,h=ms(6),u=i.schema,d=u.marks,p=u.nodes,f=d[k.SpeechRate].create({value:n.value,tagId:h}),m=p[k.RangeAnchor].create({anchorType:"start",tagType:k.SpeechRate,value:n.value,tagId:h});c.insert(s,m);var g=p[k.RangeAnchor].create({anchorType:"end",tagType:k.SpeechRate,value:n.value,tagId:h});return c.insert(a+m.nodeSize,g),c.addMark(s+m.nodeSize,a+m.nodeSize,f),r(c),{success:!0}}return{success:!0}},validate:function(e){return e.state.selection.empty?{available:!1,code:I.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}}),D({name:T.setSpeechVolume,description:"设置音量",execute:function(e,t){var n=t,i=e.state,r=e.dispatch,o=i.selection,s=o.from,a=o.to;if(o.empty||s===a)return{success:!1,code:I.SelectionInvalid,reason:"请先选择文本"};if(r){var l=i.tr,c=ms(6),h=i.schema,u=h.marks,d=h.nodes,p=u[k.SpeechVolume].create({value:n.value,tagId:c}),f=d[k.RangeAnchor].create({anchorType:"start",tagType:k.SpeechVolume,value:n.value,tagId:c});l.insert(s,f);var m=d[k.RangeAnchor].create({anchorType:"end",tagType:k.SpeechVolume,value:n.value,tagId:c});return l.insert(a+f.nodeSize,m),l.addMark(s+f.nodeSize,a+f.nodeSize,p),r(l),{success:!0}}return{success:!0}},validate:function(e){return e.state.selection.empty?{available:!1,code:I.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}});var zs={insertWord:"insertWord"};function Cs(){var e=document.createElement("span");return e.classList.add("ssml-tag-remove"),e.innerHTML='<svg class="icon-remove" viewBox="0 0 7 7" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M1 1L6 6" stroke="white" stroke-linecap="round"/>\n<path d="M6 1L1 6" stroke="white" stroke-linecap="round"/>\n</svg>',e}function Ms(e){var t,n;return null===(t=e.target)||void 0===t||null===(n=t.closest)||void 0===n?void 0:n.call(t,".ssml-tag-remove")}D({name:zs.insertWord,description:"插入连读节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[k.Word].create(d(d({},n),{},{type:k.Word}))).scrollIntoView()),{success:!0}):{success:!0}},validate:function(e){var t=e.state,n=t.selection.$from,i=n.index();return n.parent.canReplaceWith(i,i,t.schema.nodes[k.Word])?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"光标插入文本设置连读"}}});var Ns={group:"inline",attrs:{type:{default:k.Action,validate:"string"},value:{default:"",validate:"string"},label:{default:No[k.Action]}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){var t;return["b",{"data-type":e.attrs.type,"data-value":null===(t=e.attrs.value)||void 0===t?void 0:t.trim(),"data-label":e.attrs.label,class:"".concat(wo," ").concat(wo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label||"".concat(No[k.Action]).concat(e.attrs.value)],Cs()]},parseDOM:[{tag:"b[data-type='".concat(k.Action,"']"),getAttrs:function(e){var t=e.dataset,n=t.value;return{label:t.label||"".concat(No[k.Action]).concat(n),type:k.Action,value:n}}},{tag:"i.tts-mark-action",getAttrs:function(e){var t,n=e.dataset,i=n.tts,r=n.label,o=null==i||null===(t=i.replace(/\[act-|\]/g,""))||void 0===t?void 0:t.trim();return{label:r||"".concat(No[k.Action]).concat(o),type:k.Action,value:o}}}],handleClickOn:function(e,t,n,i,r){if(Ms(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.Action,Ns);var Ts={group:"inline",attrs:{value:{default:"",validate:"string"},label:{default:""},pptAction:{default:"next",validate:function(e){return["play","next","prev","end"].includes(e)}}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-type":k.PptControl,"data-value":encodeURIComponent(gs(e.attrs.value||"")),class:"".concat(wo," ").concat(wo,"-").concat(k.PptControl),"data-ppt-action":e.attrs.pptAction},["span",{class:"ssml-tag-label"},"".concat(No[k.PptControl]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Cs()]},parseDOM:[{tag:"b[data-type='".concat(k.PptControl,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i,o=t.pptAction;return{type:k.PptControl,value:decodeURIComponent(ys(n||"")),label:r,pptAction:o}}}],handleClickOn:function(e,t,n,i,r){if(Ms(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.PptControl,Ts);var Os={group:"inline",attrs:{type:{default:k.SoundEvent},value:{default:"",validate:"string"},label:{default:"",validate:"string"},volume:{default:100,validate:"number"}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-type":k.SoundEvent,"data-value":e.attrs.value,"data-label":e.attrs.label,"data-volume":e.attrs.volume,class:"".concat(wo," ").concat(wo,"-soundEvent")},["span",{class:"ssml-tag-label"},"".concat(No[k.SoundEvent]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Cs()]},parseDOM:[{tag:"b[data-type='".concat(k.SoundEvent,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i,o=t.volume;return{type:k.SoundEvent,value:n,label:r,volume:o?Number(o):100}}},{tag:"i[data-type='effectmusic']",getAttrs:function(e){var t=e.dataset,n=t.tts,i=t.label,r=void 0===i?"":i,o=t.volume;return{type:k.SoundEvent,value:n,label:r,volume:Number.isNaN(Number(o))?100:Number(o)}}}],handleClickOn:function(e,t,n,i,r){if(Ms(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.SoundEvent,Os);var Es={group:"inline",attrs:{value:{default:"",validate:"string"},label:{default:""}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-type":k.Command,"data-value":e.attrs.value,class:"".concat(wo," ").concat(wo,"-").concat(k.Command)},["span",{class:"ssml-tag-label"},"".concat(No[k.Command]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Cs()]},parseDOM:[{tag:"b[data-type='".concat(k.Command,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i;return{type:k.Command,value:n,label:r}}}],handleClickOn:function(e,t,n,i,r){if(Ms(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.Command,Es);var As={group:"inline",attrs:{value:{default:"",validate:"string"},label:{default:""}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){var t;return["b",{"data-type":k.Data,"data-value":e.attrs.value,"data-label":e.attrs.name,class:"".concat(wo," ").concat(wo,"-").concat(k.Data)},["span",{class:"ssml-tag-label"},"{{ ".concat(null!==(t=e.attrs.label)&&void 0!==t?t:""," }}")],Cs()]},parseDOM:[{tag:"b[data-type='".concat(k.Data,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"":n,r=t.label,o=void 0===r?"":r;return{type:k.Data,value:i,label:o}}}],handleClickOn:function(e,t,n,i,r){if(Ms(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.Data,As);var js={group:"inline",attrs:{value:{default:"",validate:"string"},label:{default:""},waitType:{default:"sleep",validate:function(e){return["sleep","video_ended","audio_ended"].includes(e)}},context:{default:""}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){var t;return["b",{"data-type":k.Wait,"data-value":gs(e.attrs.value||""),class:"".concat(wo," ").concat(wo,"-").concat(k.Wait),"data-wait-type":e.attrs.waitType,"data-context":null!==(t=e.attrs.context)&&void 0!==t?t:""},["span",{class:"ssml-tag-label"},"".concat(No[k.Wait]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Cs()]},parseDOM:[{tag:"b[data-type='".concat(k.Wait,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i,o=t.waitType,s=t.context;return{type:k.Wait,value:ys(n||""),label:r,waitType:o,context:null!=s?s:""}}}],handleClickOn:function(e,t,n,i,r){if(Ms(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Eo.registerNode(k.Wait,js);var Ds={group:"inline",attrs:{anchorType:{default:"start"},tagType:{default:k.SpeechRate},value:{default:"70"},tagId:{default:""}},inline:!0,draggable:!1,selectable:!0,atom:!0,toDOM:function(e){var t,n=e.attrs,i=n.anchorType,r=n.tagType,o=n.value,s=n.tagId,a=No[r]||r,l=document.createElement("b");l.setAttribute("contenteditable","false"),l.classList.add(wo),l.classList.add("".concat(wo,"-").concat(r)),l.classList.add("".concat(wo,"-anchor-").concat(i)),l.dataset.type=k.RangeAnchor,l.dataset.anchorType=i,l.dataset.tagType=r,l.dataset.value=String(o),l.dataset.tagId=s,r===k.SpeechLanguage&&(t=String(o).split("-")[0].toLowerCase(),["ar","he","fa","ur"].includes(t))&&l.setAttribute("dir","rtl");var c=document.createElement("span");if(c.className="ssml-tag-label","start"===i){var h=r===k.SpeechLanguage?o.toUpperCase():o;c.innerText="".concat(a).concat(h),l.appendChild(c),l.appendChild(Cs())}else l.classList.add("range-anchor-end");return l},parseDOM:[{tag:"b[data-type='".concat(k.RangeAnchor,"']"),getAttrs:function(e){var t=e.dataset;return{anchorType:t.anchorType,tagType:t.tagType,value:t.value,tagId:t.tagId}}}],handleClickOn:function(e,t,n,i,r){if(Ms(r)){var o=n.attrs.tagId,s=e.state.tr,a=[],l=[];return e.state.doc.descendants(function(e,t){var n=e.marks.find(function(e){return e.attrs.tagId===o});n&&l.push({from:t,to:t+e.nodeSize,type:n.type}),e.type.name===k.RangeAnchor&&e.attrs.tagId===o&&a.push({from:t,to:t+e.nodeSize})}),l.forEach(function(e){var t=e.from,n=e.to,i=e.type;s.removeMark(t,n,i)}),a.sort(function(e,t){return t.from-e.from}).forEach(function(e){var t=e.from,n=e.to;s.delete(t,n)}),e.dispatch(s),!0}return!1}};Eo.registerNode(k.RangeAnchor,Ds);var Rs={group:"inline",attrs:{type:{default:k.Break,validate:"string"},value:{default:500,validate:"number"},label:{default:""}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){var t=e.attrs.label||"".concat(Number((e.attrs.value/1e3).toFixed(2)),"秒");return["b",{"data-id":ms(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(wo," ").concat(wo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},t]]},parseDOM:[{tag:"b[data-type='".concat(k.Break,"']"),getAttrs:function(e){var t=e.dataset.value,n=Number(t);if(t&&!Number.isNaN(n))return{label:"".concat(Number((n/1e3).toFixed(2)),"秒"),type:k.Break,value:n}}},{tag:"i.tts-mark-pause",getAttrs:function(e){var t=e.dataset.tts,n=Number(null==t?void 0:t.replace(/\[p|\]|\s/g,""));if(!Number.isNaN(n))return{label:"".concat(Number((n/1e3).toFixed(2)),"秒"),type:k.Break,value:n}}}]};Eo.registerNode(k.Break,Rs);var Is={group:"inline",attrs:{type:{default:k.Breath,validate:"string"},value:{default:To[k.Breath]},label:{default:No[k.Breath]}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-id":ms(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(wo," ").concat(wo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label]]},parseDOM:[{tag:"b[data-type='".concat(k.Breath,"']"),getAttrs:function(e){return{label:No[k.Breath],type:k.Breath,value:To[k.Breath]}}},{tag:"i.tts-mark-segmentation",getAttrs:function(e){return{label:No[k.Breath],type:k.Breath,value:To[k.Breath]}}}]};Eo.registerNode(k.Breath,Is);var qs={group:"inline",attrs:{type:{default:k.Phoneme,validate:"string"},value:{default:"",validate:"string"},text:{default:"",validate:"string"}},inline:!0,draggable:!0,selectable:!0,atom:!0,toDOM:function(e){return["b",{"data-type":e.attrs.type,"data-value":e.attrs.value,"data-text":e.attrs.text,class:"".concat(wo," ").concat(wo,"-").concat(e.attrs.type)},["span",{class:"tag-text"},e.attrs.text],["span",{class:"ssml-tag-label"},e.attrs.value]]},parseDOM:[{tag:"b[data-type='".concat(k.Phoneme,"']"),getAttrs:function(e){var t,n=e.dataset,i=n.value,r=n.text;return{text:null==r||null===(t=r.trim)||void 0===t?void 0:t.call(r),type:k.Phoneme,value:i}}},{tag:"i.tts-mark-annotation",getAttrs:function(e){var t,n,i,r=e.dataset.tts,o=null==r||null===(t=r.replace(/\[=|\]/g,""))||void 0===t?void 0:t.trim();return{type:k.Phoneme,text:null===(n=e.textContent)||void 0===n||null===(i=n.trim)||void 0===i?void 0:i.call(n),value:o}}}],leafText:function(e){return e.attrs.text}};Eo.registerNode(k.Phoneme,qs);var Ps={group:"inline",attrs:{type:{default:k.SayAs,validate:"string"},interpretAs:{default:S.digits},text:{default:"",validate:"string"}},inline:!0,draggable:!1,selectable:!0,atom:!0,toDOM:function(e){var t;return["b",{"data-type":k.SayAs,"data-interpret-as":e.attrs.interpretAs,"data-text":e.attrs.text,class:"".concat(wo," ").concat(wo,"-say-as")},["span",{class:"tag-text"},e.attrs.text],["span",{class:"ssml-tag-label"},"".concat((null===(t=No[k.SayAs])||void 0===t?void 0:t[e.attrs.interpretAs])||"读法")]]},parseDOM:[{tag:"b.".concat(wo,"-say-as"),getAttrs:function(e){var t,n,i=e.dataset.interpretAs||S.digits;return{text:(null===(t=e.dataset.text)||void 0===t||null===(n=t.trim)||void 0===n?void 0:n.call(t))||"",type:k.SayAs,interpretAs:i}}},{tag:"b.".concat(wo,"-number"),getAttrs:function(e){var t,n=e.dataset,i=n.value,r=n.text,o={0:S.auto,1:S.digits,2:S.cardinal};return{text:null==r||null===(t=r.trim)||void 0===t?void 0:t.call(r),type:k.SayAs,interpretAs:o[null!=i?i:"1"]||S.digits}}},{tag:'i.mark-range-start[data-type="number"]',getAttrs:function(e){for(var t,n,i,r,o=e.dataset.tts,s=e.nextSibling,a="";s;){if(s.nodeType!==Node.TEXT_NODE&&"SPAN"!==s.nodeName){if(s.nodeType===Node.ELEMENT_NODE)break;break}var l;a+=s.textContent||"";var c=s;s=s.nextSibling,null===(l=c.parentNode)||void 0===l||l.removeChild(c)}if(!ks.test((null===(t=a)||void 0===t||null===(n=t.trim)||void 0===n?void 0:n.call(t))||""))return!1;var h={0:S.auto,1:S.digits,2:S.cardinal};return{text:null===(i=a)||void 0===i||null===(r=i.trim)||void 0===r?void 0:r.call(i),type:k.SayAs,interpretAs:h[null!=o?o:"1"]||S.digits}}}],leafText:function(e){return e.attrs.text}};Eo.registerNode(k.SayAs,Ps);var _s={group:"inline",attrs:{type:{default:k.Word,validate:"string"},value:{default:To[k.Word]},label:{default:No[k.Word]}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-id":ms(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(wo," ").concat(wo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label]]},parseDOM:[{tag:"b[data-type='".concat(k.Word,"']"),getAttrs:function(e){return{label:No[k.Word],type:k.Word,value:To[k.Word]}}},{tag:"i.tts-mark-continuity",getAttrs:function(e){return{label:No[k.Word],type:k.Word,value:To[k.Word]}}}]};Eo.registerNode(k.Word,_s);var Ls={attrs:{value:{default:"en-US"},tagId:{default:""}},inclusive:!0,group:w.textmedia,excludes:"".concat(k.SpeechLanguage),spanning:!0,toDOM:function(e){var t,n=e.attrs,i=n.value,r=n.tagId,o=(t=i.split("-")[0].toLowerCase(),["ar","he","fa","ur"].includes(t));return["span",{class:"".concat(ko," ").concat(ko,"-").concat(k.SpeechLanguage),"data-tag-id":r||ms(6),"data-type":k.SpeechLanguage,"data-value":i,dir:o?"rtl":"ltr"},0]},parseDOM:[{tag:"span[data-type='".concat(k.SpeechLanguage,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"en-US":n,r=t.tagId;return{value:i,tagId:void 0===r?ms(6):r}}},{tag:"lang",getAttrs:function(e){return{value:e.getAttribute("xml:lang")||e.getAttribute("lang")||"en-US",tagId:ms(6)}}},{tag:"span[lang]",getAttrs:function(e){return{value:e.getAttribute("lang")||"en-US",tagId:ms(6)}}}]};Eo.registerMark(k.SpeechLanguage,Ls);var Bs={attrs:{value:{default:50},tagId:{default:""}},inclusive:!0,group:w.textmedia,excludes:"".concat(k.SpeechPitch),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(ko," ").concat(ko,"-").concat(k.SpeechPitch),"data-tag-id":i||ms(6),"data-type":k.SpeechPitch,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(k.SpeechPitch,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"50":n,r=t.tagId,o=void 0===r?ms(6):r;return{value:parseInt(i,10),tagId:o}}},{tag:"prosody[pitch]",getAttrs:function(e){var t=e.getAttribute("pitch")||"0",n=0;return n=(t.endsWith("%"),parseFloat(t)),{value:Math.max(0,Math.min(100,Math.round(50+n))),tagId:ms(6)}}}]};Eo.registerMark(k.SpeechPitch,Bs);var Fs={attrs:{value:{default:70},tagId:{default:""}},inclusive:!0,group:w.textmedia,excludes:"".concat(k.SpeechRate),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(ko," ").concat(ko,"-").concat(k.SpeechRate),"data-tag-id":i||ms(6),"data-type":k.SpeechRate,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(k.SpeechRate,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"70":n,r=t.tagId,o=void 0===r?ms(6):r;return{value:parseInt(i,10),tagId:o}}},{tag:"prosody[rate]",getAttrs:function(e){var t=e.getAttribute("rate")||"1.0",n=1;return n=t.endsWith("%")?parseFloat(t)/100:parseFloat(t),{value:Math.max(40,Math.min(100,Math.round(70+60*(n-1)))),tagId:ms(6)}}}]};Eo.registerMark(k.SpeechRate,Fs);var Vs={attrs:{value:{default:50},tagId:{default:""}},inclusive:!0,group:w.textmedia,excludes:"".concat(k.SpeechVolume),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(ko," ").concat(ko,"-").concat(k.SpeechVolume),"data-tag-id":i||ms(6),"data-type":k.SpeechVolume,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(k.SpeechVolume,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"50":n,r=t.tagId,o=void 0===r?ms(6):r;return{value:parseInt(i,10),tagId:o}}},{tag:"prosody[volume]",getAttrs:function(e){var t=e.getAttribute("volume")||"50",n=50;return n=(t.endsWith("%"),parseFloat(t)),{value:Math.max(0,Math.min(100,Math.round(n))),tagId:ms(6)}}}]};Eo.registerMark(k.SpeechVolume,Vs);var Ws={attrs:{src:{default:""},mediaType:{default:"image"},extra:{default:""},name:{default:""},tagId:{default:""}},inclusive:!1,group:w.textmedia,excludes:w.textmedia,toDOM:function(e){var t=e.attrs,n=t.mediaType,i=t.src,r=t.name,o=t.tagId,s=e.attrs.extra||"",a="string";return s&&"[object String]"!==Object.prototype.toString.call(s)&&(s=JSON.stringify(s),a="json"),["span",{class:"".concat(ko," ").concat(ko,"-").concat(w.textmedia),"data-tag-id":o,"data-name":gs(r||""),"data-type":w.textmedia,"data-extra":gs("".concat(s||"")),"data-extra-type":a,"data-media-type":n,"data-media-src":gs("".concat(i||""))},0]},parseDOM:[{tag:"span[data-type='".concat(w.textmedia,"']"),getAttrs:function(e){var t=e.dataset,n=t.name,i=void 0===n?"":n,r=t.mediaSrc,o=void 0===r?"":r,s=t.tagId,a=void 0===s?"":s,l=t.mediaType,c=void 0===l?"image":l,h=t.extra,u=t.extraType,d=ys(h||"");if("json"===u)try{d=JSON.parse(d)}catch(e){A.warn("parse dataExtra fail",e)}return{tagId:a,src:o||"",name:ys(i),mediaType:c,extra:d}}}]};Eo.registerMark(w.textmedia,Ws);const $s=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Js(e,t,n=!1){for(let i=e;i;i="start"==t?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&1!=i.childCount)return!1}return!1}function Us(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Hs(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function Ks(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Gs=(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof _t&&e.selection.node.isBlock)return!(!n.parentOffset||!ft(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let r,o,s=[],a=!1,l=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){a=n.end(e)==n.pos+(n.depth-e),l=n.start(e)==n.pos-(n.depth-e),o=Ks(n.node(e-1).contentMatchAt(n.indexAfter(e-1))),s.unshift(a&&o?{type:o}:null),r=e;break}if(1==e)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof qt||e.selection instanceof Bt)&&c.deleteSelection();let h=c.mapping.map(n.pos),u=ft(c.doc,h,s.length,s);if(u||(s[0]=o?{type:o}:null,u=ft(c.doc,h,s.length,s)),!u)return!1;if(c.split(h,s.length,s),!a&&l&&n.node(r).type!=o){let e=c.mapping.map(n.before(r)),t=c.doc.resolve(e);o&&n.node(r-1).canReplaceWith(t.index(),t.index()+1,o)&&c.setNodeMarkup(c.mapping.map(n.before(r)),o)}return t&&t(c.scrollIntoView()),!0};function Ys(e,t,n,i){let r,o,s=t.nodeBefore,a=t.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(e,t,n){let i=t.nodeBefore,r=t.nodeAfter,o=t.index();return!(!(i&&r&&i.type.compatibleContent(r.type))||(!i.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!r.isTextblock&&!mt(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(r=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){let i=t.pos+a.nodeSize,o=L.empty;for(let e=r.length-1;e>=0;e--)o=L.from(r[e].create(null,o));o=L.from(s.copy(o));let l=e.tr.step(new at(t.pos-1,i,t.pos,i,new J(o,1,0),r.length,!0)),c=l.doc.resolve(i+2*r.length);c.nodeAfter&&c.nodeAfter.type==s.type&&mt(l.doc,c.pos)&&l.join(c.pos),n(l.scrollIntoView())}return!0}let h=a.type.spec.isolating||i>0&&l?null:jt.findFrom(t,1),u=h&&h.$from.blockRange(h.$to),d=u&&ut(u);if(null!=d&&d>=t.depth)return n&&n(e.tr.lift(u,d).scrollIntoView()),!0;if(c&&Js(a,"start",!0)&&Js(s,"end")){let i=s,r=[];for(;r.push(i),!i.isTextblock;)i=i.lastChild;let o=a,l=1;for(;!o.isTextblock;o=o.firstChild)l++;if(i.canReplace(i.childCount,i.childCount,o.content)){if(n){let i=L.empty;for(let e=r.length-1;e>=0;e--)i=L.from(r[e].copy(i));n(e.tr.step(new at(t.pos-r.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new J(i,r.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Xs(e){return function(t,n){let i=t.selection,r=e<0?i.$from:i.$to,o=r.depth;for(;r.node(o).isInline;){if(!o)return!1;o--}return!!r.node(o).isTextblock&&(n&&n(t.tr.setSelection(qt.create(t.doc,e<0?r.start(o):r.end(o)))),!0)}}const Zs=Xs(-1),Qs=Xs(1);function ea(...e){return function(t,n,i){for(let r=0;r<e.length;r++)if(e[r](t,n,i))return!0;return!1}}let ta=ea($s,(e,t,n)=>{let i=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!i)return!1;let r=Us(i);if(!r){let n=i.blockRange(),r=n&&ut(n);return null!=r&&(t&&t(e.tr.lift(n,r).scrollIntoView()),!0)}let o=r.nodeBefore;if(Ys(e,r,t,-1))return!0;if(0==i.parent.content.size&&(Js(o,"end")||_t.isSelectable(o)))for(let n=i.depth;;n--){let s=gt(e.doc,i.before(n),i.after(n),J.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(Js(o,"end")?jt.findFrom(n.doc.resolve(n.mapping.map(r.pos,-1)),-1):_t.create(n.doc,r.pos-o.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||i.node(n-1).childCount>1)break}return!(!o.isAtom||r.depth!=i.depth-1)&&(t&&t(e.tr.delete(r.pos-o.nodeSize,r.pos).scrollIntoView()),!0)},(e,t,n)=>{let{$head:i,empty:r}=e.selection,o=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;o=Us(i)}let s=o&&o.nodeBefore;return!(!s||!_t.isSelectable(s))&&(t&&t(e.tr.setSelection(_t.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)}),na=ea($s,(e,t,n)=>{let i=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}(e,n);if(!i)return!1;let r=Hs(i);if(!r)return!1;let o=r.nodeAfter;if(Ys(e,r,t,1))return!0;if(0==i.parent.content.size&&(Js(o,"start")||_t.isSelectable(o))){let n=gt(e.doc,i.before(),i.after(),J.empty);if(n&&n.slice.size<n.to-n.from){if(t){let i=e.tr.step(n);i.setSelection(Js(o,"start")?jt.findFrom(i.doc.resolve(i.mapping.map(r.pos)),1):_t.create(i.doc,i.mapping.map(r.pos))),t(i.scrollIntoView())}return!0}}return!(!o.isAtom||r.depth!=i.depth-1)&&(t&&t(e.tr.delete(r.pos,r.pos+o.nodeSize).scrollIntoView()),!0)},(e,t,n)=>{let{$head:i,empty:r}=e.selection,o=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;o=Hs(i)}let s=o&&o.nodeAfter;return!(!s||!_t.isSelectable(s))&&(t&&t(e.tr.setSelection(_t.create(e.doc,o.pos)).scrollIntoView()),!0)});const ia={Enter:ea((e,t)=>{let{$head:n,$anchor:i}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(i))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)},(e,t)=>{let n=e.selection,{$from:i,$to:r}=n;if(n instanceof Bt||i.parent.inlineContent||r.parent.inlineContent)return!1;let o=Ks(r.parent.contentMatchAt(r.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(qt.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(ft(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),r=i&&ut(i);return null!=r&&(t&&t(e.tr.lift(i,r).scrollIntoView()),!0)},Gs),"Mod-Enter":(e,t)=>{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),o=n.indexAfter(-1),s=Ks(r.contentMatchAt(o));if(!s||!r.canReplaceWith(o,o,s))return!1;if(t){let i=n.after(),r=e.tr.replaceWith(i,i,s.createAndFill());r.setSelection(jt.near(r.doc.resolve(i),1)),t(r.scrollIntoView())}return!0},Backspace:ta,"Mod-Backspace":ta,"Shift-Backspace":ta,Delete:na,"Mod-Delete":na,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Bt(e.doc))),!0)},ra={"Ctrl-h":ia.Backspace,"Alt-Backspace":ia["Mod-Backspace"],"Ctrl-d":ia.Delete,"Ctrl-Alt-Backspace":ia["Mod-Delete"],"Alt-Delete":ia["Mod-Delete"],"Alt-d":ia["Mod-Delete"],"Ctrl-a":Zs,"Ctrl-e":Qs};for(let e in ia)ra[e]=ia[e];const oa=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?ra:ia;for(var sa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},aa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},la="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),ca="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ha=0;ha<10;ha++)sa[48+ha]=sa[96+ha]=String(ha);for(ha=1;ha<=24;ha++)sa[ha+111]="F"+ha;for(ha=65;ha<=90;ha++)sa[ha]=String.fromCharCode(ha+32),aa[ha]=String.fromCharCode(ha);for(var ua in sa)aa.hasOwnProperty(ua)||(aa[ua]=sa[ua]);const da="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),pa="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function fa(e){let t,n,i,r,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))r=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))i=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);da?r=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),r&&(s="Meta-"+s),i&&(s="Shift-"+s),s}function ma(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function ga(e){return new Xt({props:{handleKeyDown:ya(e)}})}function ya(e){let t=function(e){let t=Object.create(null);for(let n in e)t[fa(n)]=e[n];return t}(e);return function(e,n){let i,r=function(e){var t=!(la&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||ca&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?aa:sa)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=t[ma(r,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==r.length&&" "!=r){if(n.shiftKey){let i=t[ma(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(pa&&n.ctrlKey&&n.altKey)&&(i=sa[n.keyCode])&&i!=r){let r=t[ma(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var va=function(){return o(function e(){i(this,e),s(this,"events",new Map)},[{key:"on",value:function(e,t){var n;this.events.has(e)||this.events.set(e,new Set),null===(n=this.events.get(e))||void 0===n||n.add(t)}},{key:"off",value:function(e,t){var n=this.events.get(e);n&&(n.delete(t),0===n.size&&this.events.delete(e))}},{key:"emit",value:function(e,t){var n=this.events.get(e);n&&n.forEach(function(e){return e(t)})}},{key:"removeAllListeners",value:function(e){e?this.events.delete(e):this.events.clear()}}])}(),xa=function(e){return e.StateChange="stateChange",e.WordCount="wordCount",e.Focus="focus",e.Blur="blur",e.Error="error",e.SelectionUpdate="selectionUpdate",e.ContextMenu="contextMenu",e.PluginTextMediaClick="plugin.textmedia_click",e}({});function ba(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.margin,i=void 0===n?12:n,r=t.offset,o=void 0===r?8:r,s=t.menuWidth,a=void 0===s?200:s,l=t.menuHeight,c=void 0===l?40:l,h="undefined"!=typeof window?window.innerWidth:1920,u=(e.left+e.right)/2;u-a/2<i?u=a/2+i:u+a/2>h-i&&(u=h-a/2-i);var d,p,f=c+i+o,m=!1;return e.top<f?(d=e.bottom+o,p="translate(-50%, 0)",m=!0):(d=e.top-o,p="translate(-50%, -100%)",m=!1),{left:u,top:d,transform:p,isFlipped:m}}var wa=new en("contextMenu"),ka=function(){function e(t,r){i(this,e);var o=null;return n(this,e,[{key:wa,props:{handleDOMEvents:{contextmenu:function(e,n){var i,s;n.preventDefault(),o||((o=document.createElement("div")).style.position="fixed",o.style.zIndex="10000",o.className="ssml-editor-context-menu-container",document.body.appendChild(o));var a=e.posAtCoords({left:n.clientX,top:n.clientY}),l={left:n.clientX,top:n.clientY},c=ba({left:n.clientX,right:n.clientX,top:n.clientY,bottom:n.clientY,width:0,height:0},{menuWidth:o.offsetWidth||150,menuHeight:o.offsetHeight||200,offset:2});o.style.left="".concat(c.left,"px"),o.style.top="".concat(c.top,"px"),c.isFlipped?o.style.transform="translate(0, -100%)":o.style.transform="none";var h=void 0;if(a){var u=e.state.doc.resolve(a.pos),p=u.nodeAfter||u.nodeBefore||u.parent;p&&(h={type:p.type.name,attrs:p.attrs})}var f=e.state.selection,m=!!a&&(a.pos>=f.from&&a.pos<=f.to),g={isActive:!0,event:n,pos:null!==(i=null==a?void 0:a.pos)&&void 0!==i?i:0,coords:l,node:h,selection:{from:f.from,to:f.to,text:e.state.doc.textBetween(f.from,f.to," "),content:e.state.doc.slice(f.from,f.to).toJSON(),isClickInside:!f.empty&&m},target:o};t.emit(xa.ContextMenu,g),null===(s=r.onRender)||void 0===s||s.call(r,o,g);var y=function(e){var t;if(null===(t=o)||void 0===t||!t.contains(e.target)){var n;if(o)null===(n=r.onRender)||void 0===n||n.call(r,o,d(d({},g),{},{isActive:!1}));window.removeEventListener("mousedown",y)}};return window.addEventListener("mousedown",y),!0}}},view:function(){return{destroy:function(){o&&o.remove()}}}}])}return c(e,Xt),o(e)}(),Sa=new en("floatingMenu"),za=function(){function e(t,r){i(this,e);var o=!1,s=!1;return n(this,e,[{key:Sa,state:{init:function(){return{prevent:!1}},apply:function(e,t){var n=e.getMeta(Mo);return void 0!==n?{prevent:!!n}:e.docChanged||e.selectionSet?{prevent:!1}:t}},props:{handleDOMEvents:{pointerdown:function(){return o=!0,s=!1,!1},pointerup:function(e){return o=!1,e.isDestroyed||e.dispatch(e.state.tr),!1},contextmenu:function(e){return s=!0,e.isDestroyed||e.dispatch(e.state.tr),!1}}},view:function(e){return new Ca(e,t,r,function(){return{isMouseDown:o,isContextMenuOpen:s,isPopoverVisible:ds.isVisible()}})}}])}return c(e,Xt),o(e)}(),Ca=function(){return o(function e(t,n,r,o){i(this,e),this.editor=n,this.options=r,this.getContext=o,this.mountPoint=document.createElement("div"),this.mountPoint.style.position="fixed",this.mountPoint.style.zIndex="9999",this.mountPoint.style.pointerEvents="auto",this.mountPoint.className="ssml-editor-floating-menu-container",this.update(t)},[{key:"ensureAttached",value:function(){this.mountPoint.parentNode||document.body.appendChild(this.mountPoint)}},{key:"update",value:function(e){var t,n,i=e.state,r=i.selection,o=this.getContext(),s=!1;if(this.options.shouldShow)s=this.options.shouldShow(e,o);else if(s=!r.empty&&e.hasFocus()&&!o.isMouseDown&&!o.isContextMenuOpen&&!o.isPopoverVisible){var a=Sa.getState(i);if(null!=a&&a.prevent&&(s=!1),r instanceof _t){var l=r.node.type.name;l!==k.SayAs&&l!==k.Phoneme||(s=!1)}}var c,h,u=r.from,d=r.to,p=i.doc.textBetween(u,d," "),f=i.doc.slice(u,d).toJSON();if(!s)return null===(c=(h=this.options).onRender)||void 0===c||c.call(h,this.mountPoint,{isActive:!1,rect:null,from:u,to:d,text:p,content:f,target:this.mountPoint,isFlipped:!1}),void this.editor.emit(xa.SelectionUpdate,{isActive:!1,rect:null,from:u,to:d,text:p,content:f});this.ensureAttached();var m=e.coordsAtPos(u),g=e.coordsAtPos(d),y={left:Math.min(m.left,g.left),right:Math.max(m.right,g.right),top:Math.min(m.top,g.top),bottom:Math.max(m.bottom,g.bottom),width:Math.abs(g.left-m.left),height:Math.abs(g.bottom-m.top)},v=ba(y,{menuWidth:this.mountPoint.offsetWidth||200,menuHeight:this.mountPoint.offsetHeight||40});this.mountPoint.style.left="".concat(v.left,"px"),this.mountPoint.style.top="".concat(v.top,"px"),this.mountPoint.style.transform=v.transform;var x={isActive:!0,rect:y,from:u,to:d,text:p,content:f,target:this.mountPoint,isFlipped:v.isFlipped};null===(t=(n=this.options).onRender)||void 0===t||t.call(n,this.mountPoint,x),this.editor.emit(xa.SelectionUpdate,x)}},{key:"destroy",value:function(){this.mountPoint.remove()}}])}(),Ma=new en("maxLength"),Na=function(){function e(t,r){var o;return i(this,e),s(o=n(this,e,[{key:Ma,state:{init:function(e,n){var i=o.calculateCount(n.doc);return t.emit("wordCount",{count:i,exceeded:o.config.maxLength<=i}),{count:i}},apply:function(e,t){var n=o.calculateCount(e.doc);return e.docChanged?{count:n}:t}},props:{handleDOMEvents:{compositionstart:function(){return o.isComposing=!0,!1},compositionend:function(e){o.isComposing=!1;var n=e.state,i=o.calculateCount(n.doc);if(i>o.config.maxLength){var r=n.tr;o.truncateDocument(r,n.doc,n.schema),e.dispatch(r),t.emit("wordCount",{count:o.config.maxLength,exceeded:!0})}else t.emit("wordCount",{count:i,exceeded:!1});return!1}}},filterTransaction:function(e,n){if(e.docChanged){if(o.isComposing)return!0;var i=e.doc,r=o.calculateCount(i);if(r>=o.config.maxLength){var s=o.calculateCount(n.doc);if(s>=o.config.maxLength&&r>s)return t.emit("wordCount",{count:o.config.maxLength,exceeded:!0}),!1}if(r>o.config.maxLength)return o.truncateDocument(e,i,n.schema),t.emit("wordCount",{count:o.config.maxLength,exceeded:!0}),!0;t.emit("wordCount",{count:r,exceeded:!1})}return!0}}]),"config",{countBreak:!0,countSpaces:!0,excludeNodes:["paragraph"],maxLength:2e4}),s(o,"isComposing",!1),o.config=d(d({},o.config),r),o}return c(e,Xt),o(e,[{key:"maxLength",set:function(e){this.config.maxLength=e}},{key:"truncateDocument",value:function(e,t,n){var i=this.calculateCount(t)-this.config.maxLength;if(!(i<=0)){for(var r=e.selection.to,o=0,s=r,a=null,l=r-1;l>=0&&o<i;l-=1)try{var c=t.resolve(l),h=t.resolve(l+1),u=this.hasCountableCharBetween(t,c,h);if(u&&(o+=u,s=l),o>i)a=h.nodeBefore}catch(e){}if(s<r&&o>0){if(e.delete(s,r),a){var d,p=(null===(d=a.attrs.text)||void 0===d?void 0:d.slice(0,o-i))||"";p&&(e.insert(s,n.text(p)),s+=p.length)}var f=e.doc.resolve(s);e.setSelection(qt.near(f))}}}},{key:"hasCountableCharBetween",value:function(e,t,n){var i=t.pos;if(n.pos-i!==1)return 0;var r,o,s=n.nodeBefore;return null!=s&&s.isText?s.text.length?1:0:"paragraph"===(null==s?void 0:s.type.name)||(null==s?void 0:s.type.name)===k.Phoneme?1:((null==s?void 0:s.type.name)===k.SayAs||(null==s?void 0:s.type.name)===k.Sub||"sayas"===(null==s?void 0:s.type.name)||"number"===(null==s?void 0:s.type.name)||"alias"===(null==s?void 0:s.type.name))&&((null===(r=s.attrs.text)||void 0===r?void 0:r.length)||(null===(o=s.attrs.value)||void 0===o?void 0:o.length))||0}},{key:"shouldCount",value:function(e,t){var n,i=null==e?void 0:e.type.name;return"paragraph"===i&&t&&t.lastChild!==e?{count:!0,text:"\n"}:!e.isLeaf||null!==(n=this.config.excludeNodes)&&void 0!==n&&n.includes(e.type.name)?{count:!1,text:""}:e.isText?{count:!0,text:e.text||""}:i===k.Phoneme||i===k.SayAs||"sayas"===i||"number"===i?{count:!0,text:e.attrs.text||""}:i===k.Sub||"alias"===i?{count:!0,text:e.attrs.value||e.attrs.text||""}:{count:!0,text:e.text||""}}},{key:"calculateCount",value:function(e){var t=this,n="";return e.descendants(function(e,i,r){var o=t.shouldCount(e,r),s=o.text;o.count&&(n+=s||"")}),n.length}}])}(),Ta=new en("placeholder");var Oa=function(){return o(function e(){i(this,e),s(this,"editable",!0),this.editable=!0},[{key:"setEditable",value:function(e){this.editable=e}},{key:"getEditable",value:function(){return this.editable}}])}();function Ea(e){return e.type.name===k.Phoneme||e.type.name===k.SayAs||e.type.name===k.Sub}function Aa(e){return e.type.name===k.Break||e.type.name===k.Word||e.type.name===k.Breath||e.type.name===k.Action||e.type.name===k.Emotion||e.type.name===k.Command||"expression"===e.type.name}
4
4
  /*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
5
- const{entries:Aa,setPrototypeOf:ja,isFrozen:Da,getPrototypeOf:Ra,getOwnPropertyDescriptor:Ia}=Object;let{freeze:qa,seal:Pa,create:_a}=Object,{apply:La,construct:Ba}="undefined"!=typeof Reflect&&Reflect;qa||(qa=function(e){return e}),Pa||(Pa=function(e){return e}),La||(La=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return e.apply(t,i)}),Ba||(Ba=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return new e(...n)});const Fa=nl(Array.prototype.forEach),Va=nl(Array.prototype.lastIndexOf),Wa=nl(Array.prototype.pop),$a=nl(Array.prototype.push),Ja=nl(Array.prototype.splice),Ua=nl(String.prototype.toLowerCase),Ha=nl(String.prototype.toString),Ka=nl(String.prototype.match),Ga=nl(String.prototype.replace),Ya=nl(String.prototype.indexOf),Xa=nl(String.prototype.trim),Za=nl(Object.prototype.hasOwnProperty),Qa=nl(RegExp.prototype.test),el=(tl=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ba(tl,t)});var tl;function nl(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return La(e,t,i)}}function il(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ua;ja&&ja(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(Da(t)||(t[i]=e),r=e)}e[r]=!0}return e}function rl(e){for(let t=0;t<e.length;t++){Za(e,t)||(e[t]=null)}return e}function ol(e){const t=_a(null);for(const[n,i]of Aa(e)){Za(e,n)&&(Array.isArray(i)?t[n]=rl(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=ol(i):t[n]=i)}return t}function sl(e,t){for(;null!==e;){const n=Ia(e,t);if(n){if(n.get)return nl(n.get);if("function"==typeof n.value)return nl(n.value)}e=Ra(e)}return function(){return null}}const al=qa(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ll=qa(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),cl=qa(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),hl=qa(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ul=qa(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),dl=qa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pl=qa(["#text"]),fl=qa(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ml=qa(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),gl=qa(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),yl=qa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),vl=Pa(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xl=Pa(/<%[\w\W]*|[\w\W]*%>/gm),bl=Pa(/\$\{[\w\W]*/gm),wl=Pa(/^data-[\-\w.\u00B7-\uFFFF]+$/),kl=Pa(/^aria-[\-\w]+$/),Sl=Pa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zl=Pa(/^(?:\w+script|data):/i),Cl=Pa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ml=Pa(/^html$/i),Nl=Pa(/^[a-z][.\w]*(-[.\w]+)+$/i);var Tl=Object.freeze({__proto__:null,ARIA_ATTR:kl,ATTR_WHITESPACE:Cl,CUSTOM_ELEMENT:Nl,DATA_ATTR:wl,DOCTYPE_NAME:Ml,ERB_EXPR:xl,IS_ALLOWED_URI:Sl,IS_SCRIPT_OR_DATA:zl,MUSTACHE_EXPR:vl,TMPLIT_EXPR:bl});const Ol=1,El=3,Al=7,jl=8,Dl=9,Rl=function(){return"undefined"==typeof window?null:window};var Il=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rl();const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||t.document.nodeType!==Dl||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const r=i,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:h,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:f}=t,m=c.prototype,g=sl(m,"cloneNode"),y=sl(m,"remove"),v=sl(m,"nextSibling"),x=sl(m,"childNodes"),b=sl(m,"parentNode");if("function"==typeof a){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let w,k="";const{implementation:S,createNodeIterator:z,createDocumentFragment:C,getElementsByTagName:M}=i,{importNode:N}=r;let T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Aa&&"function"==typeof b&&S&&void 0!==S.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:E,TMPLIT_EXPR:A,DATA_ATTR:j,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:I,CUSTOM_ELEMENT:q}=Tl;let{IS_ALLOWED_URI:P}=Tl,_=null;const L=il({},[...al,...ll,...cl,...ul,...pl]);let B=null;const F=il({},[...fl,...ml,...gl,...yl]);let V=Object.seal(_a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),W=null,$=null;const J=Object.seal(_a(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let U=!0,H=!0,K=!1,G=!0,Y=!1,X=!0,Z=!1,Q=!1,ee=!1,te=!1,ne=!1,ie=!1,re=!0,oe=!1,se=!0,ae=!1,le={},ce=null;const he=il({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const de=il({},["audio","video","img","source","image","track"]);let pe=null;const fe=il({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let ve=ye,xe=!1,be=null;const we=il({},[me,ge,ye],Ha);let ke=il({},["mi","mo","mn","ms","mtext"]),Se=il({},["annotation-xml"]);const ze=il({},["title","style","font","a","script"]);let Ce=null;const Me=["application/xhtml+xml","text/html"];let Ne=null,Te=null;const Oe=i.createElement("form"),Ee=function(e){return e instanceof RegExp||e instanceof Function},Ae=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Te||Te!==e){if(e&&"object"==typeof e||(e={}),e=ol(e),Ce=-1===Me.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ne="application/xhtml+xml"===Ce?Ha:Ua,_=Za(e,"ALLOWED_TAGS")?il({},e.ALLOWED_TAGS,Ne):L,B=Za(e,"ALLOWED_ATTR")?il({},e.ALLOWED_ATTR,Ne):F,be=Za(e,"ALLOWED_NAMESPACES")?il({},e.ALLOWED_NAMESPACES,Ha):we,pe=Za(e,"ADD_URI_SAFE_ATTR")?il(ol(fe),e.ADD_URI_SAFE_ATTR,Ne):fe,ue=Za(e,"ADD_DATA_URI_TAGS")?il(ol(de),e.ADD_DATA_URI_TAGS,Ne):de,ce=Za(e,"FORBID_CONTENTS")?il({},e.FORBID_CONTENTS,Ne):he,W=Za(e,"FORBID_TAGS")?il({},e.FORBID_TAGS,Ne):ol({}),$=Za(e,"FORBID_ATTR")?il({},e.FORBID_ATTR,Ne):ol({}),le=!!Za(e,"USE_PROFILES")&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,H=!1!==e.ALLOW_DATA_ATTR,K=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,X=!1!==e.SAFE_FOR_XML,Z=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,ie=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,se=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,P=e.ALLOWED_URI_REGEXP||Sl,ve=e.NAMESPACE||ye,ke=e.MATHML_TEXT_INTEGRATION_POINTS||ke,Se=e.HTML_INTEGRATION_POINTS||Se,V=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ee(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ee(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(V.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(H=!1),ne&&(te=!0),le&&(_=il({},pl),B=[],!0===le.html&&(il(_,al),il(B,fl)),!0===le.svg&&(il(_,ll),il(B,ml),il(B,yl)),!0===le.svgFilters&&(il(_,cl),il(B,ml),il(B,yl)),!0===le.mathMl&&(il(_,ul),il(B,gl),il(B,yl))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?J.tagCheck=e.ADD_TAGS:(_===L&&(_=ol(_)),il(_,e.ADD_TAGS,Ne))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?J.attributeCheck=e.ADD_ATTR:(B===F&&(B=ol(B)),il(B,e.ADD_ATTR,Ne))),e.ADD_URI_SAFE_ATTR&&il(pe,e.ADD_URI_SAFE_ATTR,Ne),e.FORBID_CONTENTS&&(ce===he&&(ce=ol(ce)),il(ce,e.FORBID_CONTENTS,Ne)),e.ADD_FORBID_CONTENTS&&(ce===he&&(ce=ol(ce)),il(ce,e.ADD_FORBID_CONTENTS,Ne)),se&&(_["#text"]=!0),Z&&il(_,["html","head","body"]),_.table&&(il(_,["tbody"]),delete W.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw el('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw el('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,k=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(f,o)),null!==w&&"string"==typeof k&&(k=w.createHTML(""));qa&&qa(e),Te=e}},je=il({},[...ll,...cl,...hl]),De=il({},[...ul,...dl]),Re=function(e){$a(n.removed,{element:e});try{b(e).removeChild(e)}catch(t){y(e)}},Ie=function(e,t){try{$a(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){$a(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Re(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},qe=function(e){let t=null,n=null;if(ee)e="<remove></remove>"+e;else{const t=Ka(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ce&&ve===ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=w?w.createHTML(e):e;if(ve===ye)try{t=(new p).parseFromString(r,Ce)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(ve,"template",null);try{t.documentElement.innerHTML=xe?k:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),ve===ye?M.call(t,Z?"html":"body")[0]:Z?t.documentElement:o},Pe=function(e){return z.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},_e=function(e){return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof u)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Le=function(e){return"function"==typeof l&&e instanceof l};function Be(e,t,i){Fa(e,e=>{e.call(n,t,i,Te)})}const Fe=function(e){let t=null;if(Be(T.beforeSanitizeElements,e,null),_e(e))return Re(e),!0;const i=Ne(e.nodeName);if(Be(T.uponSanitizeElement,e,{tagName:i,allowedTags:_}),X&&e.hasChildNodes()&&!Le(e.firstElementChild)&&Qa(/<[/\w!]/g,e.innerHTML)&&Qa(/<[/\w!]/g,e.textContent))return Re(e),!0;if(e.nodeType===Al)return Re(e),!0;if(X&&e.nodeType===jl&&Qa(/<[/\w]/g,e.data))return Re(e),!0;if(!(J.tagCheck instanceof Function&&J.tagCheck(i))&&(!_[i]||W[i])){if(!W[i]&&We(i)){if(V.tagNameCheck instanceof RegExp&&Qa(V.tagNameCheck,i))return!1;if(V.tagNameCheck instanceof Function&&V.tagNameCheck(i))return!1}if(se&&!ce[i]){const t=b(e)||e.parentNode,n=x(e)||e.childNodes;if(n&&t){for(let i=n.length-1;i>=0;--i){const r=g(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,v(e))}}}return Re(e),!0}return e instanceof c&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:ve,tagName:"template"});const n=Ua(e.tagName),i=Ua(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===ye?"svg"===n:t.namespaceURI===me?"svg"===n&&("annotation-xml"===i||ke[i]):Boolean(je[n]):e.namespaceURI===me?t.namespaceURI===ye?"math"===n:t.namespaceURI===ge?"math"===n&&Se[i]:Boolean(De[n]):e.namespaceURI===ye?!(t.namespaceURI===ge&&!Se[i])&&!(t.namespaceURI===me&&!ke[i])&&!De[n]&&(ze[n]||!je[n]):!("application/xhtml+xml"!==Ce||!be[e.namespaceURI]))}(e)?(Re(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!Qa(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===El&&(t=e.textContent,Fa([O,E,A],e=>{t=Ga(t,e," ")}),e.textContent!==t&&($a(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(T.afterSanitizeElements,e,null),!1):(Re(e),!0)},Ve=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in i||n in Oe))return!1;if(H&&!$[t]&&Qa(j,t));else if(U&&Qa(D,t));else if(J.attributeCheck instanceof Function&&J.attributeCheck(t,e));else if(!B[t]||$[t]){if(!(We(e)&&(V.tagNameCheck instanceof RegExp&&Qa(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&Qa(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t,e))||"is"===t&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&Qa(V.tagNameCheck,n)||V.tagNameCheck instanceof Function&&V.tagNameCheck(n))))return!1}else if(pe[t]);else if(Qa(P,Ga(n,I,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Ya(n,"data:")||!ue[e]){if(K&&!Qa(R,Ga(n,I,"")));else if(n)return!1}else;return!0},We=function(e){return"annotation-xml"!==e&&Ka(e,q)},$e=function(e){Be(T.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||_e(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0};let r=t.length;for(;r--;){const o=t[r],{name:s,namespaceURI:a,value:l}=o,c=Ne(s),h=l;let u="value"===s?h:Xa(h);if(i.attrName=c,i.attrValue=u,i.keepAttr=!0,i.forceKeepAttr=void 0,Be(T.uponSanitizeAttribute,e,i),u=i.attrValue,!oe||"id"!==c&&"name"!==c||(Ie(s,e),u="user-content-"+u),X&&Qa(/((--!?|])>)|<\/(style|title|textarea)/i,u)){Ie(s,e);continue}if("attributename"===c&&Ka(u,"href")){Ie(s,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Ie(s,e);continue}if(!G&&Qa(/\/>/i,u)){Ie(s,e);continue}Y&&Fa([O,E,A],e=>{u=Ga(u,e," ")});const d=Ne(e.nodeName);if(Ve(d,c,u)){if(w&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(a);else switch(f.getAttributeType(d,c)){case"TrustedHTML":u=w.createHTML(u);break;case"TrustedScriptURL":u=w.createScriptURL(u)}if(u!==h)try{a?e.setAttributeNS(a,s,u):e.setAttribute(s,u),_e(e)?Re(e):Wa(n.removed)}catch(t){Ie(s,e)}}else Ie(s,e)}Be(T.afterSanitizeAttributes,e,null)},Je=function e(t){let n=null;const i=Pe(t);for(Be(T.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Be(T.uponSanitizeShadowNode,n,null),Fe(n),$e(n),n.content instanceof s&&e(n.content);Be(T.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,a=null,c=null;if(xe=!e,xe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Le(e)){if("function"!=typeof e.toString)throw el("toString is not a function");if("string"!=typeof(e=e.toString()))throw el("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Q||Ae(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Ne(e.nodeName);if(!_[t]||W[t])throw el("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)i=qe("\x3c!----\x3e"),o=i.ownerDocument.importNode(e,!0),o.nodeType===Ol&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!te&&!Y&&!Z&&-1===e.indexOf("<"))return w&&ie?w.createHTML(e):e;if(i=qe(e),!i)return te?null:ie?k:""}i&&ee&&Re(i.firstChild);const h=Pe(ae?e:i);for(;a=h.nextNode();)Fe(a),$e(a),a.content instanceof s&&Je(a.content);if(ae)return e;if(te){if(ne)for(c=C.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(B.shadowroot||B.shadowrootmode)&&(c=N.call(r,c,!0)),c}let u=Z?i.outerHTML:i.innerHTML;return Z&&_["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Qa(Ml,i.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+u),Y&&Fa([O,E,A],e=>{u=Ga(u,e," ")}),w&&ie?w.createHTML(u):u},n.setConfig=function(){Ae(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Q=!0},n.clearConfig=function(){Te=null,Q=!1},n.isValidAttribute=function(e,t,n){Te||Ae({});const i=Ne(e),r=Ne(t);return Ve(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&$a(T[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Va(T[e],t);return-1===n?void 0:Ja(T[e],n,1)[0]}return Wa(T[e])},n.removeHooks=function(e){T[e]=[]},n.removeAllHooks=function(){T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),ql=function(){return o(function e(){i(this,e)},null,[{key:"transform",value:function(e){if(!e)return"";var t=Il.sanitize(e,{FORBID_TAGS:["script","style","link","iframe","video","audio","img"],FORBID_ATTR:["onclick","onload","onerror"]});return t=this.transformNumberRange(t),t=this.transformProsodyRanges(t),t=this.transformAvatarLayout(t)}},{key:"transformNumberRange",value:function(e){return e.replace(/<i(?=[^>]*\bmark-range-start\b)(?=[^>]*data-type="number")[^>]*data-tts="(\d+)"[^>]*>.*?<\/i>([\s\S]*?)<i(?=[^>]*\bmark-range-end\b)[^>]*data-tts="\1"[^>]*>.*?<\/i>/gi,function(e,t,n){var i=n.replace(/<[^>]+>/g,"").trim();return i?'<b class="'.concat(wo," ").concat(wo,'-number" data-value="').concat(t,'" data-text="').concat(i,'">').concat(i,"</b>"):e})}},{key:"transformProsodyRanges",value:function(e){var t={speed:"speed",intonation:"pitch",volume:"volume"},n=e;return Object.keys(t).forEach(function(e){var i=t[e],r=new RegExp('<i(?=[^>]*\\bmark-range-start\\b)(?=[^>]*data-type="'.concat(e,'")[^>]*data-tts="(\\d+)"[^>]*>.*?<\\/i>([\\s\\S]*?)<i(?=[^>]*\\bmark-range-end\\b)[^>]*data-tts="\\1"[^>]*>.*?<\\/i>'),"gi");n=n.replace(r,function(e,t,n){return'<span class="'.concat(ko," ").concat(ko,"-").concat(i,'" data-type="').concat(i,'" data-value="').concat(t,'">').concat(n,"</span>")})}),n}},{key:"transformAvatarLayout",value:function(e){return e.replace(/(<p([^>]*class="[^"]*tts-content-paragraph[^"]*"[^>]*)>)([^]*?)(<i\s[^>]*class="[^"]*\btts-mark-avatar\b[^"]*"[^>]*>[^]*?<\/i>)([^]*?)(<\/p>)/gi,"<div>$4$1$3$5$6</div>")}}])}(),Pl=function(){return o(function e(){i(this,e)},null,[{key:"ssmlToDOM",value:function(e){var t=new DOMParser,n=e.trim();n.startsWith("<speak")||(n="<speak>".concat(n,"</speak>"));var i=t.parseFromString(n,"text/xml"),r=i.getElementsByTagName("parsererror");if(r.length>0){A.error("XSSML Parse Error:",r[0].textContent);var o=document.createElement("div");return o.textContent=e,o}var s=i.getElementsByTagName("speak")[0],a=document.createElement("div");return this.processChildren(s,a),a}},{key:"processChildren",value:function(e,t){var n=this;e.childNodes.forEach(function(e){if(e.nodeType===Node.TEXT_NODE)t.appendChild(document.createTextNode(e.textContent||""));else if(e.nodeType===Node.ELEMENT_NODE){var i=e,r=i.tagName.toLowerCase(),o=document.createElement(r);Array.from(i.attributes).forEach(function(e){o.setAttribute(e.name,e.value)}),n.processChildren(i,o),t.appendChild(o)}})}}])}(),_l=/\[((\w+\d*:?-?\d*)|(act-[^\]]+))\]/g,Ll={",":10,";":10,":":10,"、":5},Bl=/\[\[data=(.*?)\]\]/;function Fl(e){return e?"[[data=".concat(e,"]]"):""}function Vl(e){var t=e.replace(_l,"").replace(/\[\[action=(.*?)\]\]/g,"").replace(Bl,"").replace(/\[\[cmd=.*?\]\]/g,"").replace(/[“”"‘’'()\(\)\[\]\{\}、,。!?;:\s\n\t]/g,"").trim();return/([A-Za-z0-9])|([\u4e00-\u9fa5])/.test(t)}var Wl=function(){function e(){i(this,e),s(this,"currentPosition",0),s(this,"textRegExps",{}),s(this,"config",{CN_MAJOR_DELIMITERS:["。","!",";","?","……"],CN_MINOR_DELIMITERS:[",",":","、"],EN_MAJOR_DELIMITERS:["\\.","!",";","\\?"],EN_MINOR_DELIMITERS:[",",":"],CN_TARGET_MIN:5,CN_TARGET_MAX:25,EN_TARGET_MIN:5,EN_TARGET_MAX:40,MAX_CHAR_CN:100,MAX_CHAR_EN:150}),s(this,"ATOMIC_NODE_TYPES",["break","breath","word","phoneme","command","data","action","say-as","wait","ppt_control","range_anchor","soundEvent","sub"]),s(this,"SPLITED_NODE_TYPES",["command","data","ppt_control"]),s(this,"curParagraphLastRangeEvents",new Map)}return o(e,[{key:"setConfig",value:function(e){Object.assign(this.config,e)}},{key:"extractSentences",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||!e.content)throw new Error("Invalid document format: content is missing");this.currentPosition=t;var n=this.extractWithPosition(e.content),i=this.splitIntoSentences(n);return this.curParagraphLastRangeEvents.clear(),i}},{key:"splitIntoSentences",value:function(e){if(!e.length)return[];var t=[],n=[],i=[],r="",o=0,s=["speed","pitch","volume","lang"],a=[],l=function(e){var t=[];return s.forEach(function(n){var i=null==e?void 0:e.find(function(e){return e.type===n});i&&t.push({type:i.type,attrs:i.attrs})}),t},c=function(e,t){return e.length===t.length&&e.every(function(e,n){return e.type===t[n].type&&JSON.stringify(e.attrs)===JSON.stringify(t[n].attrs)})},h=function(e){return Vl(e)||/\[p\d+\]/.test(e)};this.textRegExps.CN_MAJOR||(this.textRegExps.CN_MAJOR=new RegExp("(".concat(this.config.CN_MAJOR_DELIMITERS.join("|"),")")),this.textRegExps.CN_MINOR=new RegExp("(".concat(this.config.CN_MINOR_DELIMITERS.join("|"),")")),this.textRegExps.EN_MAJOR=new RegExp("(".concat(this.config.EN_MAJOR_DELIMITERS.join("|"),")")),this.textRegExps.EN_MINOR=new RegExp("(".concat(this.config.EN_MINOR_DELIMITERS.join("|"),")")));for(var u="",p=[],f=[],m=function(){var e,s,l,c,h=arguments.length>0&&void 0!==arguments[0]&&arguments[0],m=u+r,g=[].concat(y(p),y(n)),v=[].concat(y(f.map(function(e){return d(d({},e),{},{charOffset:e.charOffset})})),y(i.map(function(e){return d(d({},e),{},{charOffset:e.charOffset+u.length})})));if(0!==g.length){var x=Vl(m)||/\[p\d+\]/.test(m);if(!x&&!h)return u=m,p=g,f=v,n=[],i=[],r="",void(o=0);if(!x&&h){if(t.length>0){var b=t[t.length-1];if(b&&"text"===b.taskType){var w,k,S=b.text.length;return b.text+=m,b.end=null!==(w=null===(k=g[g.length-1])||void 0===k?void 0:k.end)&&void 0!==w?w:b.end,v.forEach(function(e){b.events.push(d(d({},e),{},{trigger:"after",charOffset:S+e.charOffset}))}),u="",p=[],f=[],n=[],i=[],r="",void(o=0)}}if(!x)return u="",p=[],f=[],n=[],i=[],r="",void(o=0)}t.push({text:m,start:null!==(e=null===(s=g[0])||void 0===s?void 0:s.start)&&void 0!==e?e:0,end:null!==(l=null===(c=g[g.length-1])||void 0===c?void 0:c.end)&&void 0!==l?l:0,events:v,marks:y(a),taskType:"text"}),u="",p=[],f=[],n=[],i=[],r="",o=0}},g=function(e){m(!0),t.push(d({text:"[p10]"},e))},v=0;v<e.length;v+=1){var x=e[v],b=x.text,w=x.type,k=l(x.marks);if(n.length>0&&!c(a,k)&&h(r)&&m(!0),a=k,"command"===w||"ppt_control"===w){var S,z=!(null!==(S=r)&&void 0!==S&&S.trim());i.push({type:w,attrs:x.attrs,trigger:z?"before":"inner",charOffset:z?0:o})}else if("wait"===w)g({taskType:"wait",data:x.attrs||{}});else if("soundEvent"===w)m(!0),t.push({text:x.text,start:x.start,end:x.end,events:[],marks:y(a),taskType:"soundEvent"});else{var C,M,N=b,T=null===(C=x.marks)||void 0===C?void 0:C.find(function(e){return"textmedia"===e.type}),O=this.curParagraphLastRangeEvents.get("textmedia");if(T){if((null==O||null===(M=O.attrs)||void 0===M?void 0:M.src)!==T.attrs.src||"start"!==(null==O?void 0:O.eventLifeType)){var E=0===o;i.push({type:"textmedia",attrs:T.attrs,trigger:E?"before":"inner",charOffset:E?0:o,eventLifeType:"start"}),this.curParagraphLastRangeEvents.set("textmedia",i[i.length-1])}}else O&&"start"===O.eventLifeType&&(i.push(d(d({},O),{},{trigger:"inner",charOffset:o,eventLifeType:"stop"})),this.curParagraphLastRangeEvents.set("textmedia",i[i.length-1]));if("text"===w&&N){for(var A="",j=x.start,D=-1,R=0;R<N.length;R+=1){var I=N[R];if("\n"===I){if(A&&(r+=A,o+=A.length,n.push(d(d({},x),{},{text:A,start:j,end:x.start+R})),A=""),""===r&&0===n.length&&t.length>0){var q=t[t.length-1];q&&"text"===q.taskType?(q.text+=I,q.end+=1):r+=I}else{var P=h(r);r+=I,n.push(d(d({},x),{},{text:I,start:x.start+R,end:x.start+R+1})),P&&m(!0)}j=x.start+R+1,D=-1}else{var _=o+(A+=I).length,L=this.textRegExps.CN_MAJOR.test(I),B=this.textRegExps.EN_MAJOR.test(I),F=this.textRegExps.CN_MINOR.test(I),V=this.textRegExps.EN_MINOR.test(I),W=/[\u4e00-\u9fa5]|[\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF]|[\u1100-\u11FF\u3130-\u318F\uAC00-\uD7A3]/.test(I);if((F||V)&&_>=this.config.CN_TARGET_MIN){var $=Ll[I]||(V?10:1),J=-1!==D?N[D]:"";$>=(J?Ll[J]||(this.textRegExps.EN_MINOR.test(J)?10:1):-1)&&(D=R)}var U=!1;if(L||B){if(!("."===I&&R+1<N.length&&/\d/.test(N[R+1]))){for(var H=0,K=/[”"“)\)(\(「』」『【】> \n\s]/;R+1+H<N.length;){var G=N[R+1+H];if(!K.test(G))break;if(H++,"\n"===G)break}R+=H,U=!0}}else if(_>=this.config.CN_TARGET_MAX)if(F||V){for(var Y=0,X=/[”"“)\)(\(「』」『【】> \n\s]/;R+1+Y<N.length;){var Z=N[R+1+Y];if(!X.test(Z))break;if(Y++,"\n"===Z)break}R+=Y,U=!0}else _>1*this.config.CN_TARGET_MAX&&-1!==D&&(R=D,U=!0);else _>=(W?this.config.MAX_CHAR_CN:this.config.MAX_CHAR_EN)&&(U=!0);if(U&&h(r+A)){var Q=N.slice(j-x.start,R+1);r+=Q,o+=Q.length,n.push(d(d({},x),{},{text:Q,start:j,end:x.start+R+1})),m(),A="",j=x.start+R+1,D=-1}}}A&&(r+=A,o+=A.length,n.push(d(d({},x),{},{text:A,start:j,end:x.end})))}else{var ee;if("data"===w)r+=Fl(N);else r+=N,["phoneme","say-as","sub","word"].includes(w)&&null!==(ee=x.attrs)&&void 0!==ee&&ee.text&&(o+=x.attrs.text.length);n.push(x)}}v===e.length-1&&m(!0)}return t}},{key:"isAtomicNode",value:function(e){return this.ATOMIC_NODE_TYPES.includes(e.type)}},{key:"isSplitedNode",value:function(e){return this.SPLITED_NODE_TYPES.includes(e.type)}},{key:"getNodeSize",value:function(e){var t,n,i=this;if(!e)return 0;if(this.isAtomicNode(e))return 1;if("text"===e.type)return(null===(t=e.text)||void 0===t?void 0:t.length)||0;var r=2;return null!==(n=e.content)&&void 0!==n&&n.length&&(r+=e.content.reduce(function(e,t){return e+i.getNodeSize(t)},0)),r}},{key:"extractWithPosition",value:function(t){for(var n=[],i=!1,r=0;r<t.length;r+=1){var o=t[r],s=this.currentPosition;if("text"===o.type){var a=o.text||"";this.currentPosition+=this.getNodeSize(o),a&&n.push(e.createNodePosition("text",s,this.currentPosition,a,void 0,o.marks))}else if(this.isAtomicNode(o))if(this.currentPosition+=1,this.isSplitedNode(o)){var l;n.push(e.createNodePosition(o.type,s,this.currentPosition,(null===(l=o.attrs)||void 0===l?void 0:l.value)||"",o.attrs,o.marks))}else{var c=e.handleSpecialNode(o.type,o.attrs);n.push(e.createNodePosition(o.type,s,this.currentPosition,c,o.attrs,o.marks))}else"paragraph"===o.type&&(i&&n.push(e.createNodePosition("text",this.currentPosition,this.currentPosition,"\n")),this.currentPosition+=1,o.content&&n.push.apply(n,y(this.extractWithPosition(o.content))),this.currentPosition+=1);i="paragraph"===o.type}return n}},{key:"extractParagraphizedSentences",value:function(t){if(null==t||!t.content)throw new Error("Invalid document format: content is missing");var n=[],i=0;this.currentPosition=0;for(var r=0;r<t.content.length;r+=1){var o=t.content[r];if("paragraph"===o.type){var s=this.extractWithPosition([o]),a=this.splitIntoSentences(s),l=e.collectPreProcesss(o);n.push({index:i,preProcess:l,sentences:a}),i+=1}}for(var c,h=[],u=[],p=0;p<n.length;p+=1){var f,m=n[p];(f=u).push.apply(f,y(m.preProcess)),m.sentences.length>0&&(h.push(d(d({},m),{},{preProcess:u,index:h.length})),u=[])}u.length>0&&h.length>0?(c=h[h.length-1].preProcess).push.apply(c,y(u)):u.length>0&&0===h.length&&n.length>0&&h.push(d(d({},n[0]),{},{preProcess:u,sentences:[],index:0}));var g=this.curParagraphLastRangeEvents.get("textmedia");if(g&&"stop"!==g.eventLifeType){for(var v,x=h[h.length-1],b=x?x.sentences:[],w=b.length-1;w>=0;w-=1){var k;if("text"===(null===(k=b[w])||void 0===k?void 0:k.taskType)){v=b[w];break}}v&&v.events.push(d(d({},g),{},{trigger:"after",charOffset:v.text.length,eventLifeType:"stop"}))}return this.curParagraphLastRangeEvents.clear(),{paragraphs:h}}}],[{key:"createNodePosition",value:function(e,t,n,i,r,o){return{type:e,start:t,end:n,text:i,attrs:r,marks:o}}},{key:"handleSpecialNode",value:function(e,t){var n,i={break:function(e){return"[p".concat(null==e?void 0:e.value,"]")},breath:function(e){return(null==e?void 0:e.value)||""},word:function(e){return(null==e?void 0:e.value)||""},phoneme:function(e){return"".concat(null==e?void 0:e.text,"[=").concat(null==e?void 0:e.value,"]")},command:function(e){return"[[cmd=CUSTOM_EVENT;op=command;value=".concat(null==e?void 0:e.value,"]]")},data:function(e){return null!=e&&e.value?e.value:""},action:function(e){return"[[action=".concat(null==e?void 0:e.value,"]]")},number:function(e){return"[n".concat(null==e?void 0:e.value,"]").concat((null==e?void 0:e.text)||"","[n0]")},"say-as":function(e){var t,n=null!==(t=z[(null==e?void 0:e.interpretAs)||(null==e?void 0:e.value)||""])&&void 0!==t?t:(null==e?void 0:e.interpretAs)||(null==e?void 0:e.value)||"",i=(null==e?void 0:e.text)||"";return"[n".concat(n,"]").concat(i,"[n0]")},soundEvent:function(e){return"".concat(null==e?void 0:e.value)},range_anchor:function(){return""},sub:function(e){return(null==e?void 0:e.alias)||(null==e?void 0:e.value)||""}};return(null===(n=i[e])||void 0===n?void 0:n.call(i,t))||""}},{key:"collectPreProcesss",value:function(e){var t=[],n=function(e){var i;"data"===e.type&&t.push({type:"data",value:(null===(i=e.attrs)||void 0===i?void 0:i.value)||""});e.content&&e.content.forEach(n)};return n(e),t}}])}(),$l=function(e){if(!e||"object"!==x(e))return e;var t={number:"say-as",alias:"sub",sayas:"say-as",cmd:"command"};return e.type&&t[e.type]&&(e.type=t[e.type]),e.content&&Array.isArray(e.content)&&e.content.forEach($l),e.marks&&Array.isArray(e.marks)&&e.marks.forEach(function(e){e.type&&t[e.type]&&(e.type=t[e.type])}),e},Jl=function(e){var t={type:"doc",content:[]};if(!e)return t;try{if("".concat(e).trim()){var n=JSON.parse(e);"doc"===(n=$l(n)).type?t=n:"[object Array]"===Object.prototype.toString.call(n)?t.content=n:"[object Object]"===Object.prototype.toString.call(n)&&(t.content=[n])}}catch(n){A.warn("invalid editor content, upsert as plain text",n);var i="".concat(e).split("\n");t.content=i.map(function(e){return{type:"paragraph",content:e?[{type:"text",text:e}]:[]}})}return t},Ul=1e4,Hl=function(){function e(t){var r,o,a;i(this,e),s(o=n(this,e),"wordcount",0),s(o,"maxWordCount",Ul),s(o,"defaultPlugins",[Go(),(a={placeholder:"请输入内容..."},new Xt({key:Na,state:{init:function(){return{placeholder:a.placeholder||"请输入内容..."}},apply:function(e,t){var n=e.getMeta(Na);return n?d(d({},t),n):t}},props:{decorations:function(e){var t=e.doc;return this.spec.isEmpty(t)?Fr.create(t,[_r.widget(0,function(){var e=document.createElement("div");return e.classList.add("ssml-editor-placeholder"),e.textContent="请输入内容...",e})]):Fr.empty}},isEmpty:function(e){return 1===e.childCount&&2===e.content.size}})),ma({"Mod-z":Xo,"Mod-y":Zo}),ma(ra),new Ma(o,{maxLength:Ul})]),s(o,"isEmptyContentSize",function(e){return 2===e}),o.editorStateStore=new Ta,o.on(va.WordCount,function(e){o.wordcount=e.count}),o.config=e.mergeConfig(t),o.registry=Eo.clone(),o.commandRegister=j.clone(),o.maxWordCount=null!==(r=t.maxWordCount)&&void 0!==r?r:Ul;var l=[].concat(y(o.defaultPlugins),y(o.registry.getPlugins(o.editorStateStore)));o.config.floatingMenu&&l.push(new Sa(o,o.config.floatingMenu)),o.config.contextMenu&&l.push(new wa(o,o.config.contextMenu));var c=l.find(function(e){return e.spec.key===Ca});return c&&(c.maxLength=o.maxWordCount),l.forEach(function(e){e.spec.emitEvent=function(e,t){e.startsWith("plugin.")?o.emit(e,t):o.emit("plugin.".concat(e),t)}}),o.view=o.createView(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!t)return Gt.create({schema:e,plugins:n});var i=e.nodeFromJSON(Jl(t));return Gt.create({doc:i,schema:e,plugins:n})}(function(e){return new Te({nodes:d(d({},e.getNodes()),{},{doc:{content:"paragraph+"},paragraph:{group:"block",content:"inline*",parseDOM:[{tag:"p"}],toDOM:function(){return["p",0]}},text:{group:"inline"}}),marks:e.getMarks()})}(o.registry),o.config.content,l)),o.mount(),o}return c(e,ya),o(e,[{key:"editable",get:function(){return this.editorStateStore.editable},set:function(e){this.editorStateStore.editable=e,this.view.setProps({editable:function(){return e}}),e?this.view.dom.classList.remove("readonly"):(this.view.dom.blur(),this.view.dom.classList.add("readonly"))}},{key:"getCurrentState",value:function(){var e=this,t=this.commandRegister.getAll();return Object.entries(t).reduce(function(t,n){var i=g(n,2),r=i[0],o=i[1];if(!o.validate)return t[r]={available:!0},t;var s=o.validate({view:e.view,state:e.view.state,dispatch:e.view.dispatch}),a=s.available,l=s.reason,c=s.code;return t[r]={available:a,reason:l,code:c},t},{})}},{key:"createView",value:function(e){var t=this;return new po(null,{state:e,attributes:{class:"ssml-editor"},editable:function(){return t.editorStateStore.editable},handleKeyDown:function(e,t){if(("Backspace"===t.key||"Delete"===t.key)&&function(e,t){var n=e.selection,i=e.doc,r=n.from,o=n.to;if(!n.empty){var s=e.tr.delete(r,o);return t&&t(s),!0}var a=i.resolve(r),l=a.nodeBefore;if(l&&l.type.isInline&&(Oa(l)||Ea(l))){var c=e.tr,h=r-l.nodeSize,u=r;if(Ea(l))return c.delete(h,u),t&&t(c),!0;if(Oa(l)){var d=l.attrs.text||"";c.replaceWith(h,u,e.schema.text(d));var p=h+d.length;return c.setSelection(qt.create(c.doc,p)),t&&t(c),!0}}var f=a.nodeAfter;if(f&&f.type.isInline&&(Oa(f)||Ea(f))){var m=e.tr,g=r,y=r+f.nodeSize;if(Ea(f))return m.delete(g,y),t&&t(m),!0;if(Oa(f)){var v=f.textContent;m.replaceWith(g,y,e.schema.text(v));var x=g+v.length;return m.setSelection(qt.create(m.doc,x)),t&&t(m),!0}}return!1}(e.state,e.dispatch))return t.preventDefault(),!0;return!1},handleClickOn:function(e,t,n,i,r){return!!n.type.spec.handleClickOn&&n.type.spec.handleClickOn(e,t,n,i,r)},handleDOMEvents:{focus:function(e,n){return t.editable?(e.dom.classList.add(bo),requestIdleCallback(function(){return e.dom.classList.remove("ProseMirror-focused")}),t.emit(va.Focus,{focused:!0}),!1):(e.dom.blur(),!0)},blur:function(e,n){return e.dom.classList.remove(bo),t.emit(va.Focus,{focused:!1}),!1}},transformPastedHTML:function(e,t){return ql.transform(e)},dispatchTransaction:function(e){var n=t.view.state.apply(e);e.docChanged,t.view.updateState(n),(e.selectionSet||e.docChanged||e.storedMarksSet)&&(clearTimeout(t.stateCollect),t.stateCollect=setTimeout(function(){var e=t.getCurrentState();t.emit(va.StateChange,{commands:e})},100))}})}},{key:"getSelection",value:function(){var e=this.view.state,t=e.selection,n=e.doc;return{from:t.from,to:t.to,text:n.textBetween(t.from,t.to," ")}}},{key:"mount",value:function(){this.config.parent&&function(e){if(1==!!e.replaceChildren)e.replaceChildren();else for(;e.lastChild;)e.removeChild(e.lastChild)}(this.config.parent),this.view.dom.classList.remove("ProseMirror"),this.config.parent.appendChild(this.view.dom)}},{key:"getPlainText",value:function(e){var t=this.view.state,n=t.doc,i=t.selection,r="";switch((null==e?void 0:e.contentMode)||R.all){case R.selection:r=n.textBetween(i.from,i.to," ");break;case R.cursorRight:r=n.textBetween(i.$to.pos,n.content.size," ");break;case R.all:default:r=n.textContent}return gs(r)}},{key:"getPlaybackSegments",value:function(e){var t=this.view.state,n=t.selection,i=(null==e?void 0:e.contentMode)||R.all,r=0,o=t.doc.content.size;if(i===R.selection?(r=n.from,o=n.to):i===R.cursorRight&&(r=n.to,o=t.doc.content.size),r===o&&i!==R.all)return[];var s={type:"doc",content:t.doc.slice(r,o).content.toJSON()};return(new Wl).extractSentences(s,r).filter(function(e){return"text"===e.taskType||"soundEvent"===e.taskType}).map(function(e){return{type:e.taskType,text:gs(e.text),from:e.start,to:e.end,events:e.events,marks:e.marks}})}},{key:"execute",value:function(e){var t=this.commandRegister.get(e);if(!t)return{success:!1,code:I.CommandNotFound,reason:"Command ".concat(e," not found")};if(!this.editorStateStore.editable&&![Do.clearHighlight,Do.highlight].includes(e))return{success:!1,code:I.StateError,reason:"编辑器处于只读模式,无法执行命令"};try{this.view.focus();for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];if(t.validate){var o=t.validate.apply(t,[{state:this.view.state,dispatch:this.view.dispatch,view:this.view,editor:this}].concat(i));if(o&&!o.available)return{success:!1,code:o.code||I.ParamsInvalid,reason:o.reason}}return t.execute.apply(t,[{state:this.view.state,dispatch:this.view.dispatch,view:this.view,editor:this}].concat(i))}catch(e){return{success:!1,code:I.ExecutionError,reason:e instanceof Error?e.message:String(e)}}}},{key:"setContent",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.view,i=n.dispatch,r=n.state;if(null!=e&&e.trim()){var o=r.schema.nodeFromJSON(Jl(e));if(i)i(r.tr.replaceWith(0,r.doc.content.size,o).scrollIntoView()),t&&this.execute(Qo.clear)}else{i&&(i(r.tr.delete(0,r.doc.content.size)),t&&this.execute(Qo.clear))}}},{key:"count",get:function(){return this.wordcount}},{key:"toJSON",value:function(){var e=this.view.state.toJSON(),t=function(e){if(!e||"object"!==x(e))return e;if(Array.isArray(e))return e.map(t);var n={};return Object.keys(e).forEach(function(i){var r=e[i];r="text"===i&&"string"==typeof r?gs(r):t(r),n[i]=r}),n};return t(e)}},{key:"setContentFromSSML",value:function(e){var t=Pl.ssmlToDOM(e),n=this.view.state.schema,i=Ee.fromSchema(n).parse(t),r=this.view.state.tr.replaceWith(0,this.view.state.doc.content.size,i);this.view.dispatch(r)}},{key:"setContentFromHTML",value:function(e){var t=ql.transform(e),n=this.view.state.schema,i=(new DOMParser).parseFromString(t,"text/html").body,r=Ee.fromSchema(n).parse(i),o=this.view.state.tr.replaceWith(0,this.view.state.doc.content.size,r);this.view.dispatch(o.scrollIntoView())}},{key:"destroy",value:function(){var t,n,i,r;(n="removeAllListeners",i=this,"function"==typeof(r=a(l(e.prototype),n,i))?function(e){return r.apply(i,e)}:r)([]),this.view.destroy(),(null===(t=this.view.dom)||void 0===t?void 0:t.parentNode)===this.config.parent&&this.config.parent.removeChild(this.view.dom)}}],[{key:"mergeConfig",value:function(e){var t;return d(d({},e),{},{maxWordCount:null!==(t=e.maxWordCount)&&void 0!==t?t:Ul})}}])}(),Kl=new en("numberTip"),Gl={switchNumberTipMode:"switchNumberTipMode"};D({name:Gl.switchNumberTipMode,description:"切换数字读法标注模式",execute:function(e,t){var n=e.state,i=e.dispatch,r=t;return i?(i(n.tr.setMeta(Kl,{active:!(null==r||!r.active)})),{success:!0}):{success:!0}}});var Yl=/[+-]?(?:(?:\d{1,3}(?:,\d{3})+)|(?:\d+))(?:\.\d+)?/g;var Xl=new Xt({key:Kl,state:{init:function(){return{active:!1,decorations:Fr.empty}},apply:function(e,t,n,i){var r,o=e.getMeta(Kl),s=null!==(r=null==o?void 0:o.active)&&void 0!==r?r:t.active,a=Fr.empty;return s&&(a=!t.active||e.docChanged?function(e){var t=[];return e.descendants(function(e,n){var i;if(e.isText&&e.text)for(Yl.lastIndex=0;null!==(i=Yl.exec(e.text));){var r=i.index,o=i.index+i[0].length,s=i[0],a=ps(4);t.push(_r.inline(n+r,n+o,{class:zo,"data-number-tip-text":s,"data-deco-id":a},{decoId:a,text:s}))}else if(e.type.name===k.SayAs){var l=ps(4);t.push(_r.inline(n,n+e.nodeSize,{class:zo,"data-number-tip-text":e.attrs.text,"data-deco-id":l,"data-is-node":"true"},{decoId:l,text:e.attrs.text,isNode:!0}))}}),Fr.create(e,t)}(i.doc):t.decorations.map(e.mapping,e.doc)),{active:s,decorations:a}}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations},handleClick:function(e,t,n){var i=Xl.getState(e.state),r=n.target,o=r.closest(".".concat(zo)),s=r.closest('[data-type="'.concat(k.SayAs,'"]'));if(!o&&!s)return!1;var a="",l=-1,c=-1,h=!1;if(o){if(null==i||!i.active)return!1;var u=o.dataset.decoId,d=i.decorations.find(t,t),p=null;if(d.forEach(function(e){e.spec.decoId===u&&(p=e)}),!p)return!1;a=p.spec.text,l=p.from,c=p.to,h=!!p.spec.isNode}else{var f=e.state.doc.resolve(e.posAtDOM(s,0)),m=f.nodeAfter;if(!m||m.type.name!==k.SayAs)return!1;a=m.attrs.text,l=f.pos,c=f.pos+m.nodeSize,h=!0}var g,y=((g=document.createElement("div")).classList.add("ssml-editor-number-tip__list"),[{label:"读数字",value:S.digits},{label:"读数值",value:S.cardinal},{label:"移除/还原",value:""}].forEach(function(e){var t=document.createElement("div");t.classList.add("ssml-editor-number-tip__item"),t.setAttribute("data-value",e.value),t.textContent=e.label,g.appendChild(t)}),g);us.show(y,{x:n.clientX,y:n.clientY},{rootClassName:"ssml-editor-number-tip__popover"}).then(function(){y.removeEventListener("click",v)}),e.dispatch(e.state.tr.setSelection(qt.create(e.state.doc,l,c)).setMeta(Mo,!0));var v=function(t){var n=t.target.closest(".ssml-editor-number-tip__item");if(n){var i=n.dataset.value,r=e.state.tr.setSelection(qt.create(e.state.doc,l,c));i?r=r.replaceSelectionWith(e.state.schema.nodes[k.SayAs].create({interpretAs:i,text:a,type:k.SayAs})):h&&(r=r.replaceSelectionWith(e.state.schema.text(a))),e.dispatch(r.setSelection(qt.near(r.doc.resolve(l)))),us.hide()}};return y.addEventListener("click",v),!0}}});Eo.registerPlugin("number-tip",Xl);var Zl=new en("rangeBoundary");Eo.registerPlugin("rangeBoundary",new Xt({key:Zl,appendTransaction:function(e,t,n){if(!e.some(function(e){return e.selectionSet})||!n.selection.empty)return null;var i=n.selection.$from,r=n.tr,o=i.nodeBefore,s=i.nodeAfter;if(s&&s.type.name===k.RangeAnchor&&"start"===s.attrs.anchorType){var a=s.attrs.tagType,l=r.storedMarks||n.storedMarks||[];if(l.some(function(e){return e.type.name===a}))return r.setStoredMarks(l.filter(function(e){return e.type.name!==a})),r}if(o&&o.type.name===k.RangeAnchor&&"start"===o.attrs.anchorType){var c=o.attrs,h=c.tagType,u=c.value,d=c.tagId,p=n.schema.marks[h],f=r.storedMarks||n.storedMarks||[];if(!f.some(function(e){return e.type.name===h&&e.attrs.tagId===d}))return r.setStoredMarks([].concat(y(f),[p.create({value:u,tagId:d})])),r}if(s&&s.type.name===k.RangeAnchor&&"end"===s.attrs.anchorType){var m=s.attrs,g=m.tagType,v=m.value,x=m.tagId,b=n.schema.marks[g],w=r.storedMarks||n.storedMarks||[];if(!w.some(function(e){return e.type.name===g&&e.attrs.tagId===x}))return r.setStoredMarks([].concat(y(w),[b.create({value:v,tagId:x})])),r}if(o&&o.type.name===k.RangeAnchor&&"end"===o.attrs.anchorType){var S=o.attrs.tagType,z=r.storedMarks||n.storedMarks||[];if(z.some(function(e){return e.type.name===S}))return r.setStoredMarks(z.filter(function(e){return e.type.name!==S})),r}if(o&&o.type.name===k.RangeAnchor&&"end"===o.attrs.anchorType&&i.parentOffset===i.parent.content.size)return r.insertText("​",i.pos),r.setStoredMarks([]),r;var C=!1;return n.doc.nodesBetween(i.before(),i.after(),function(e,t){if(e.isText&&e.text&&e.text.includes("​")&&e.text.length>1){var i=e.text.replace(/\u200b/g,"");i!==e.text&&(r.replaceWith(t,t+e.nodeSize,n.schema.text(i,e.marks)),C=!0)}return!0}),C?r:null},props:{handleKeyDown:function(e,t){if("Backspace"===t.key&&e.state.selection.empty){var n=e.state.selection.$from,i=n.nodeBefore;if(i&&i.type.name===k.RangeAnchor&&"end"===i.attrs.anchorType){var r=n.pos-i.nodeSize,o=e.state.tr;if(e.state.doc.nodeAt(r-1))return o.delete(r-1,r),e.dispatch(o),!0}if(i&&i.type.name===k.RangeAnchor&&"start"===i.attrs.anchorType){var s=n.pos-i.nodeSize,a=e.state.tr;if(s>0)return a.delete(s-1,s),e.dispatch(a),!0}}if("ArrowRight"===t.key&&e.state.selection.empty){var l=e.state.selection.$from,c=l.nodeAfter;if(c&&c.type.name===k.RangeAnchor&&"end"===c.attrs.anchorType){var h=l.pos+c.nodeSize,u=e.state.doc.resolve(h);if(u.parentOffset===u.parent.content.size){var d=e.state.tr;return d.setSelection(qt.create(e.state.doc,u.pos)),d.setStoredMarks([]),e.dispatch(d),!0}}}return!1},handleClick:function(e,t,n){var i=e.state.doc.resolve(t),r=i.nodeBefore;if(r&&r.type.name===k.RangeAnchor&&"end"===r.attrs.anchorType&&i.parentOffset===i.parent.content.size){var o=e.state.tr;return o.insertText("​",i.pos),o.setSelection(qt.create(o.doc,i.pos)),o.setStoredMarks([]),e.dispatch(o),!0}return!1}}}));var Ql,ec=new en("rangeSync");Eo.registerPlugin("rangeSync",(Ql=[k.SpeechRate,k.SpeechPitch,k.SpeechVolume,k.SpeechLanguage],new Xt({key:ec,appendTransaction:function(e,t,n){if(!e.some(function(e){return e.docChanged}))return null;var i=n.tr,r=!1,o=new Set,s=new Map;n.doc.descendants(function(e,t){Ql.forEach(function(n){var i=e.marks.find(function(e){return e.type.name===n});if(i){var r=i.attrs.tagId;o.add(r),s.has(r)||s.set(r,[]);var a=s.get(r),l=a[a.length-1];(!l||t>=l.pos+l.size)&&a.push({pos:t,size:e.nodeSize,attrs:i.attrs,type:n})}})});var a=[];s.forEach(function(e,t){if(0!==e.length){for(var i={type:e[0].type,attrs:e[0].attrs,from:e[0].pos,to:e[0].pos+e[0].size},r=function(){var t=e[o],r=i.to,s=t.pos,l=!0,c=n.doc.resolve(i.from),h=n.doc.resolve(t.pos);c.parent!==h.parent?l=!1:s>r&&n.doc.nodesBetween(r,s,function(e,t){return t>=r&&t<s&&(e.isText||e.type.name!==k.RangeAnchor)&&(l=!1),l}),l?i.to=t.pos+t.size:(a.push(d({},i)),i={type:t.type,attrs:t.attrs,from:t.pos,to:t.pos+t.size})},o=1;o<e.length;o+=1)r();a.push(i)}});var l=[];a.forEach(function(e){var t=i.mapping.map(e.from),n=i.mapping.map(e.to);!Number.isNaN(t)&&t>=0&&l.push({pos:t,type:k.RangeAnchor,attrs:{anchorType:"start",tagType:e.type,value:e.attrs.value,tagId:e.attrs.tagId}}),!Number.isNaN(n)&&n>=0&&l.push({pos:n,type:k.RangeAnchor,attrs:{anchorType:"end",tagType:e.type,value:e.attrs.value,tagId:e.attrs.tagId}})});var c=[],h=new Set;i.doc.descendants(function(e,t){if(e.type.name===k.RangeAnchor){var n=l.findIndex(function(n,i){return!h.has(i)&&n.pos===t&&e.attrs.tagId===n.attrs.tagId&&e.attrs.anchorType===n.attrs.anchorType});-1!==n?h.add(n):c.push({pos:t,size:e.nodeSize})}});for(var u=c.length-1;u>=0;u-=1){var p=c[u],f=p.pos,m=p.size;i.delete(f,f+m),r=!0}return l.filter(function(e,t){return!h.has(t)}).sort(function(e,t){return t.pos-e.pos}).forEach(function(e){var t=i.mapping.map(e.pos);t>=0&&(i.insert(t,n.schema.nodes[k.RangeAnchor].create(e.attrs)),r=!0)}),r?(i.setMeta("addToHistory",!1),i):null},props:{transformPasted:function(e){var t=new Map,n=function(e){var i=e.marks.map(function(e){if(Ql.includes(e.type.name)){var n=e.attrs.tagId;return t.has(n)||t.set(n,ps(6)),e.type.create(d(d({},e.attrs),{},{tagId:t.get(n)}))}return e});if(e.type.name===k.RangeAnchor){var r=e.attrs.tagId;return t.has(r)||t.set(r,ps(6)),e.type.create(d(d({},e.attrs),{},{tagId:t.get(r)}))}if(e.content.size>0){var o=[];return e.content.forEach(function(e){return o.push(n(e))}),e.copy(L.from(o)).mark(i)}return e.mark(i)},i=[];return e.content.forEach(function(e){return i.push(n(e))}),new J(L.from(i),e.openStart,e.openEnd)}}})));var tc=new en("readOnly");Eo.registerPlugin("readOnly",function(e){return new Xt({key:tc,state:{init:function(){return Fr.empty},apply:function(e,t,n){return t.map(e.mapping,e.doc)}},props:{attributes:function(){var t;return{class:null===(t=null==e?void 0:e.editable)||void 0===t||t?"":"ssml-editor_readonly"}},editable:function(){var t;return null===(t=null==e?void 0:e.editable)||void 0===t||t}},filterTransaction:function(t){var n;return A.debug("filterTransaction",t),!(null==e||!e.editable)||!(null!==(n=t.steps)&&void 0!==n&&n.length||!t.selection)}})});var nc=new en("speechLanguage");Eo.registerPlugin("speechLanguage",new Xt({key:nc,state:{init:function(){return null},apply:function(e,t){return e.getMeta(nc)||t}}}));var ic=new en("speechPitch");function rc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===k.SpeechPitch});i&&n.push({from:t,to:t+e.nodeSize,value:i.attrs.value})});var i=[];return n.forEach(function(e){var t=i[i.length-1];t&&t.to===e.from?t.to=e.to:i.push(d({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(_r.inline(n,i,{class:"range-annotation-content speech-pitch-content","data-pitch":String(r)}))}),Fr.create(e.doc,t)}function oc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===k.SpeechRate});i&&n.push({from:t,to:t+e.nodeSize,value:i.attrs.value})});var i=[];return n.forEach(function(e){var t=i[i.length-1];t&&t.to===e.from?t.to=e.to:i.push(d({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(_r.inline(n,i,{class:"range-annotation-content speech-rate-content","data-rate":String(r)}))}),Fr.create(e.doc,t)}Eo.registerPlugin("speechPitch",new Xt({key:ic,state:{init:function(e,t){return{decorations:rc(t)}},apply:function(e,t,n,i){return e.docChanged?{decorations:rc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}}));var sc=new en("speechRate");Eo.registerPlugin("speechRate",new Xt({key:sc,state:{init:function(e,t){return{decorations:oc(t)}},apply:function(e,t,n,i){return e.docChanged?{decorations:oc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}}));var ac=new en("speechVolume");function lc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===k.SpeechVolume});i&&n.push({from:t,to:t+e.nodeSize,value:i.attrs.value})});var i=[];return n.forEach(function(e){var t=i[i.length-1];t&&t.to===e.from?t.to=e.to:i.push(d({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(_r.inline(n,i,{class:"range-annotation-content speech-volume-content","data-volume":String(r)}))}),Fr.create(e.doc,t)}Eo.registerPlugin("speechVolume",new Xt({key:ac,state:{init:function(e,t){return{decorations:lc(t)}},apply:function(e,t,n,i){return e.docChanged?{decorations:lc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}}));var cc="thumbnail-icon";function hc(e){var t=[],n=[],i=!0;return e.doc.descendants(function(e,t){var r,o=e.marks.find(function(e){return e.type.name===w.textmedia});o?!i&&null!==(r=n[n.length-1])&&void 0!==r&&null!==(r=r.mark)&&void 0!==r&&r.eq(o)?n[n.length-1].to=t+e.nodeSize:(n.push({mark:o,from:t,to:t+e.nodeSize}),i=!1):i=!0}),n.forEach(function(e){var n=e.mark,i=e.from;t.push(_r.widget(i,function(e,t,n){var i=document.createElement("b");i.className="".concat(Co," ").concat(Co,"__").concat(e),i.dataset.id=t,i.dataset.type=e;var r=document.createElement("span");r.classList.add(cc);var o=document.createElement("img");return o.src=n.src,o.style.maxHeight="1em",r.appendChild(o),i.append(r,zs()),i}("start",n.attrs.tagId,n.attrs),{side:1,key:"start-".concat(n.attrs.tagId)}))}),Fr.create(e.doc,t)}var uc=new en("textMedia");Eo.registerPlugin("textMedia",new Xt({key:uc,state:{init:function(e,t){return{decorations:hc(t)}},apply:function(e,t,n,i){return e.docChanged||e.getMeta("text-media-update")?{decorations:hc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations},handleClick:function(e,t,n){var i,r,o=null===(i=n.target)||void 0===i||null===(r=i.closest)||void 0===r?void 0:r.call(i,".".concat(Co));if(!o)return!1;var s=o.dataset,a=s.id,l=s.type;if(!a)return!1;if("start"===l)if(Cs(n)){var c=e.state,h=c.doc,u=c.tr,d=!1,p=!1;if(h.descendants(function(e,n){if(!(n<t||p))for(var i=0,r=e.marks.length;i<r;i+=1){var o=e.marks[i];if(o.type.name===w.textmedia){if(o.attrs.tagId!==a){p=!0;break}u.removeMark(t,t+e.nodeSize,o.type),d=!0}}}),d)return e.dispatch(u),!0}else if(function(e){var t;return null==e||null===(t=e.closest)||void 0===t?void 0:t.call(e,".".concat(cc))}(n.target)){var f,m,g=e.state.plugins.find(function(e){return e.spec.key===uc}),y=[];e.state.doc.nodesBetween(t,t+1,function(e){var t,n=null===(t=e.marks)||void 0===t?void 0:t.find(function(e){return e.type.name===w.textmedia});n&&y.push(null==n?void 0:n.attrs)}),y.length&&(null===(f=(m=g.spec).emitEvent)||void 0===f||f.call(m,va.PluginTextMediaClick,y[0]))}return!1}}}));var dc=o(function e(t){i(this,e),this.name=t.name,this.description=t.description,this.execute=t.execute}),pc=new en("wordmark"),fc=function(e){return e.markWord="markWord",e.clearWordMark="clearWordMark",e}({});function mc(e,t){var n=[];return t?(e.descendants(function(e,i){if(e.isText&&e.text)for(var r=0,o=e.text.indexOf(t,r);-1!==o;){var s=i+o,a=s+t.length;n.push(_r.inline(s,a,{class:"ssml-word-mark"})),r=o+t.length,o=e.text.indexOf(t,r)}}),Fr.create(e,n)):Fr.empty}var gc=new Xt({key:pc,state:{init:function(){return{word:"",decorations:Fr.empty}},apply:function(e,t,n,i){var r=e.getMeta(pc),o=t.word;return r&&"string"==typeof r.word&&(o=r.word),o!==t.word||e.docChanged?{word:o,decorations:mc(i.doc,o)}:{word:o,decorations:t.decorations.map(e.mapping,e.doc)}}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}});D(new dc({name:fc.markWord,execute:function(e,t){if("string"!=typeof t||!t)return{success:!1,code:t?I.ParamsInvalid:I.ParamsMissing,reason:"Invalid word"};var n=e.state.tr.setMeta(pc,{word:t});return e.dispatch(n),{success:!0}}})),D(new dc({name:fc.clearWordMark,execute:function(e){var t=e.state.tr.setMeta(pc,{word:""});return e.dispatch(t),{success:!0}}})),Eo.registerPlugin("wordmark",gc);var yc={setTextMedia:"setTextMedia",resetTextMediaStoredMark:"resetTextMediaStoredMark"};D({name:yc.setTextMedia,description:"设置当前文案媒体",execute:function(e,t){var n=t,i=e.state,r=e.dispatch,o=i.selection;return null==r||r(i.tr.addMark(o.from,o.to,i.schema.marks[w.textmedia].create(d({tagId:ps(6)},n))).scrollIntoView()),{success:!0}},validate:function(e,t){return e.state.selection.empty?{available:!1,code:I.SelectionInvalid,reason:"选中文本设置媒体"}:{available:!0}}}),D({name:yc.resetTextMediaStoredMark,description:"重置当前光标文案媒体",execute:function(e){var t=e.state,n=e.dispatch,i=t.schema.marks[w.textmedia];return null==n||n(t.tr.removeStoredMark(i)),{success:!0}},validate:function(e){var t,n;return null!==(t=e.state.tr.storedMarks)&&void 0!==t&&null!==(n=t.find)&&void 0!==n&&n.call(t,function(e){return e.type.name===w.textmedia})?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"当前光标不在图片范围"}}});export{C as ActionCommands,as as BreakCommands,ls as BreathCommands,is as CmdCommands,I as CommandErrorCode,R as ContentReadMode,wa as ContextMenuPlugin,rs as DataCommands,Bl as DataPlaceholderReg,va as EditorEvent,Sa as FloatingMenuPlugin,Do as HighlightCommands,Qo as HistoryCommands,E as LogLevel,Hl as MarkEditor,k as MarkTagType,Gl as NumberTipCommands,bs as PhonemeCommands,ts as PptCommands,ks as SayAsCommands,S as SayAsInterpretType,ns as SoundEventCommands,O as SpeechLanguageCommands,N as SpeechPitchCommands,M as SpeechRateCommands,T as SpeechVolumeCommands,Wl as TextExtractor,es as TextInputCommands,yc as TextMediaCommands,ss as WaitCommands,Ss as WordCommands,fc as WordmarkCommands,A as logger,D as registerCommand,Eo as registry};
5
+ const{entries:ja,setPrototypeOf:Da,isFrozen:Ra,getPrototypeOf:Ia,getOwnPropertyDescriptor:qa}=Object;let{freeze:Pa,seal:_a,create:La}=Object,{apply:Ba,construct:Fa}="undefined"!=typeof Reflect&&Reflect;Pa||(Pa=function(e){return e}),_a||(_a=function(e){return e}),Ba||(Ba=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return e.apply(t,i)}),Fa||(Fa=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return new e(...n)});const Va=il(Array.prototype.forEach),Wa=il(Array.prototype.lastIndexOf),$a=il(Array.prototype.pop),Ja=il(Array.prototype.push),Ua=il(Array.prototype.splice),Ha=il(String.prototype.toLowerCase),Ka=il(String.prototype.toString),Ga=il(String.prototype.match),Ya=il(String.prototype.replace),Xa=il(String.prototype.indexOf),Za=il(String.prototype.trim),Qa=il(Object.prototype.hasOwnProperty),el=il(RegExp.prototype.test),tl=(nl=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Fa(nl,t)});var nl;function il(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Ba(e,t,i)}}function rl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ha;Da&&Da(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(Ra(t)||(t[i]=e),r=e)}e[r]=!0}return e}function ol(e){for(let t=0;t<e.length;t++){Qa(e,t)||(e[t]=null)}return e}function sl(e){const t=La(null);for(const[n,i]of ja(e)){Qa(e,n)&&(Array.isArray(i)?t[n]=ol(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=sl(i):t[n]=i)}return t}function al(e,t){for(;null!==e;){const n=qa(e,t);if(n){if(n.get)return il(n.get);if("function"==typeof n.value)return il(n.value)}e=Ia(e)}return function(){return null}}const ll=Pa(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),cl=Pa(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),hl=Pa(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ul=Pa(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),dl=Pa(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),pl=Pa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fl=Pa(["#text"]),ml=Pa(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),gl=Pa(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),yl=Pa(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),vl=Pa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xl=_a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),bl=_a(/<%[\w\W]*|[\w\W]*%>/gm),wl=_a(/\$\{[\w\W]*/gm),kl=_a(/^data-[\-\w.\u00B7-\uFFFF]+$/),Sl=_a(/^aria-[\-\w]+$/),zl=_a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Cl=_a(/^(?:\w+script|data):/i),Ml=_a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Nl=_a(/^html$/i),Tl=_a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ol=Object.freeze({__proto__:null,ARIA_ATTR:Sl,ATTR_WHITESPACE:Ml,CUSTOM_ELEMENT:Tl,DATA_ATTR:kl,DOCTYPE_NAME:Nl,ERB_EXPR:bl,IS_ALLOWED_URI:zl,IS_SCRIPT_OR_DATA:Cl,MUSTACHE_EXPR:xl,TMPLIT_EXPR:wl});const El=1,Al=3,jl=7,Dl=8,Rl=9,Il=function(){return"undefined"==typeof window?null:window};var ql=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Il();const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||t.document.nodeType!==Rl||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const r=i,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:h,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:f}=t,m=c.prototype,g=al(m,"cloneNode"),y=al(m,"remove"),v=al(m,"nextSibling"),x=al(m,"childNodes"),b=al(m,"parentNode");if("function"==typeof a){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let w,k="";const{implementation:S,createNodeIterator:z,createDocumentFragment:C,getElementsByTagName:M}=i,{importNode:N}=r;let T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof ja&&"function"==typeof b&&S&&void 0!==S.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:E,TMPLIT_EXPR:A,DATA_ATTR:j,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:I,CUSTOM_ELEMENT:q}=Ol;let{IS_ALLOWED_URI:P}=Ol,_=null;const L=rl({},[...ll,...cl,...hl,...dl,...fl]);let B=null;const F=rl({},[...ml,...gl,...yl,...vl]);let V=Object.seal(La(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),W=null,$=null;const J=Object.seal(La(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let U=!0,H=!0,K=!1,G=!0,Y=!1,X=!0,Z=!1,Q=!1,ee=!1,te=!1,ne=!1,ie=!1,re=!0,oe=!1,se=!0,ae=!1,le={},ce=null;const he=rl({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const de=rl({},["audio","video","img","source","image","track"]);let pe=null;const fe=rl({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let ve=ye,xe=!1,be=null;const we=rl({},[me,ge,ye],Ka);let ke=rl({},["mi","mo","mn","ms","mtext"]),Se=rl({},["annotation-xml"]);const ze=rl({},["title","style","font","a","script"]);let Ce=null;const Me=["application/xhtml+xml","text/html"];let Ne=null,Te=null;const Oe=i.createElement("form"),Ee=function(e){return e instanceof RegExp||e instanceof Function},Ae=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Te||Te!==e){if(e&&"object"==typeof e||(e={}),e=sl(e),Ce=-1===Me.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ne="application/xhtml+xml"===Ce?Ka:Ha,_=Qa(e,"ALLOWED_TAGS")?rl({},e.ALLOWED_TAGS,Ne):L,B=Qa(e,"ALLOWED_ATTR")?rl({},e.ALLOWED_ATTR,Ne):F,be=Qa(e,"ALLOWED_NAMESPACES")?rl({},e.ALLOWED_NAMESPACES,Ka):we,pe=Qa(e,"ADD_URI_SAFE_ATTR")?rl(sl(fe),e.ADD_URI_SAFE_ATTR,Ne):fe,ue=Qa(e,"ADD_DATA_URI_TAGS")?rl(sl(de),e.ADD_DATA_URI_TAGS,Ne):de,ce=Qa(e,"FORBID_CONTENTS")?rl({},e.FORBID_CONTENTS,Ne):he,W=Qa(e,"FORBID_TAGS")?rl({},e.FORBID_TAGS,Ne):sl({}),$=Qa(e,"FORBID_ATTR")?rl({},e.FORBID_ATTR,Ne):sl({}),le=!!Qa(e,"USE_PROFILES")&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,H=!1!==e.ALLOW_DATA_ATTR,K=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,X=!1!==e.SAFE_FOR_XML,Z=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,ie=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,se=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,P=e.ALLOWED_URI_REGEXP||zl,ve=e.NAMESPACE||ye,ke=e.MATHML_TEXT_INTEGRATION_POINTS||ke,Se=e.HTML_INTEGRATION_POINTS||Se,V=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ee(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ee(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(V.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(H=!1),ne&&(te=!0),le&&(_=rl({},fl),B=[],!0===le.html&&(rl(_,ll),rl(B,ml)),!0===le.svg&&(rl(_,cl),rl(B,gl),rl(B,vl)),!0===le.svgFilters&&(rl(_,hl),rl(B,gl),rl(B,vl)),!0===le.mathMl&&(rl(_,dl),rl(B,yl),rl(B,vl))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?J.tagCheck=e.ADD_TAGS:(_===L&&(_=sl(_)),rl(_,e.ADD_TAGS,Ne))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?J.attributeCheck=e.ADD_ATTR:(B===F&&(B=sl(B)),rl(B,e.ADD_ATTR,Ne))),e.ADD_URI_SAFE_ATTR&&rl(pe,e.ADD_URI_SAFE_ATTR,Ne),e.FORBID_CONTENTS&&(ce===he&&(ce=sl(ce)),rl(ce,e.FORBID_CONTENTS,Ne)),e.ADD_FORBID_CONTENTS&&(ce===he&&(ce=sl(ce)),rl(ce,e.ADD_FORBID_CONTENTS,Ne)),se&&(_["#text"]=!0),Z&&rl(_,["html","head","body"]),_.table&&(rl(_,["tbody"]),delete W.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw tl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw tl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,k=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(f,o)),null!==w&&"string"==typeof k&&(k=w.createHTML(""));Pa&&Pa(e),Te=e}},je=rl({},[...cl,...hl,...ul]),De=rl({},[...dl,...pl]),Re=function(e){Ja(n.removed,{element:e});try{b(e).removeChild(e)}catch(t){y(e)}},Ie=function(e,t){try{Ja(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ja(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Re(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},qe=function(e){let t=null,n=null;if(ee)e="<remove></remove>"+e;else{const t=Ga(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ce&&ve===ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=w?w.createHTML(e):e;if(ve===ye)try{t=(new p).parseFromString(r,Ce)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(ve,"template",null);try{t.documentElement.innerHTML=xe?k:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),ve===ye?M.call(t,Z?"html":"body")[0]:Z?t.documentElement:o},Pe=function(e){return z.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},_e=function(e){return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof u)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Le=function(e){return"function"==typeof l&&e instanceof l};function Be(e,t,i){Va(e,e=>{e.call(n,t,i,Te)})}const Fe=function(e){let t=null;if(Be(T.beforeSanitizeElements,e,null),_e(e))return Re(e),!0;const i=Ne(e.nodeName);if(Be(T.uponSanitizeElement,e,{tagName:i,allowedTags:_}),X&&e.hasChildNodes()&&!Le(e.firstElementChild)&&el(/<[/\w!]/g,e.innerHTML)&&el(/<[/\w!]/g,e.textContent))return Re(e),!0;if(e.nodeType===jl)return Re(e),!0;if(X&&e.nodeType===Dl&&el(/<[/\w]/g,e.data))return Re(e),!0;if(!(J.tagCheck instanceof Function&&J.tagCheck(i))&&(!_[i]||W[i])){if(!W[i]&&We(i)){if(V.tagNameCheck instanceof RegExp&&el(V.tagNameCheck,i))return!1;if(V.tagNameCheck instanceof Function&&V.tagNameCheck(i))return!1}if(se&&!ce[i]){const t=b(e)||e.parentNode,n=x(e)||e.childNodes;if(n&&t){for(let i=n.length-1;i>=0;--i){const r=g(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,v(e))}}}return Re(e),!0}return e instanceof c&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:ve,tagName:"template"});const n=Ha(e.tagName),i=Ha(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===ye?"svg"===n:t.namespaceURI===me?"svg"===n&&("annotation-xml"===i||ke[i]):Boolean(je[n]):e.namespaceURI===me?t.namespaceURI===ye?"math"===n:t.namespaceURI===ge?"math"===n&&Se[i]:Boolean(De[n]):e.namespaceURI===ye?!(t.namespaceURI===ge&&!Se[i])&&!(t.namespaceURI===me&&!ke[i])&&!De[n]&&(ze[n]||!je[n]):!("application/xhtml+xml"!==Ce||!be[e.namespaceURI]))}(e)?(Re(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!el(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===Al&&(t=e.textContent,Va([O,E,A],e=>{t=Ya(t,e," ")}),e.textContent!==t&&(Ja(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(T.afterSanitizeElements,e,null),!1):(Re(e),!0)},Ve=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in i||n in Oe))return!1;if(H&&!$[t]&&el(j,t));else if(U&&el(D,t));else if(J.attributeCheck instanceof Function&&J.attributeCheck(t,e));else if(!B[t]||$[t]){if(!(We(e)&&(V.tagNameCheck instanceof RegExp&&el(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&el(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t,e))||"is"===t&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&el(V.tagNameCheck,n)||V.tagNameCheck instanceof Function&&V.tagNameCheck(n))))return!1}else if(pe[t]);else if(el(P,Ya(n,I,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Xa(n,"data:")||!ue[e]){if(K&&!el(R,Ya(n,I,"")));else if(n)return!1}else;return!0},We=function(e){return"annotation-xml"!==e&&Ga(e,q)},$e=function(e){Be(T.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||_e(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0};let r=t.length;for(;r--;){const o=t[r],{name:s,namespaceURI:a,value:l}=o,c=Ne(s),h=l;let u="value"===s?h:Za(h);if(i.attrName=c,i.attrValue=u,i.keepAttr=!0,i.forceKeepAttr=void 0,Be(T.uponSanitizeAttribute,e,i),u=i.attrValue,!oe||"id"!==c&&"name"!==c||(Ie(s,e),u="user-content-"+u),X&&el(/((--!?|])>)|<\/(style|title|textarea)/i,u)){Ie(s,e);continue}if("attributename"===c&&Ga(u,"href")){Ie(s,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Ie(s,e);continue}if(!G&&el(/\/>/i,u)){Ie(s,e);continue}Y&&Va([O,E,A],e=>{u=Ya(u,e," ")});const d=Ne(e.nodeName);if(Ve(d,c,u)){if(w&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(a);else switch(f.getAttributeType(d,c)){case"TrustedHTML":u=w.createHTML(u);break;case"TrustedScriptURL":u=w.createScriptURL(u)}if(u!==h)try{a?e.setAttributeNS(a,s,u):e.setAttribute(s,u),_e(e)?Re(e):$a(n.removed)}catch(t){Ie(s,e)}}else Ie(s,e)}Be(T.afterSanitizeAttributes,e,null)},Je=function e(t){let n=null;const i=Pe(t);for(Be(T.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Be(T.uponSanitizeShadowNode,n,null),Fe(n),$e(n),n.content instanceof s&&e(n.content);Be(T.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,a=null,c=null;if(xe=!e,xe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Le(e)){if("function"!=typeof e.toString)throw tl("toString is not a function");if("string"!=typeof(e=e.toString()))throw tl("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Q||Ae(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Ne(e.nodeName);if(!_[t]||W[t])throw tl("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)i=qe("\x3c!----\x3e"),o=i.ownerDocument.importNode(e,!0),o.nodeType===El&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!te&&!Y&&!Z&&-1===e.indexOf("<"))return w&&ie?w.createHTML(e):e;if(i=qe(e),!i)return te?null:ie?k:""}i&&ee&&Re(i.firstChild);const h=Pe(ae?e:i);for(;a=h.nextNode();)Fe(a),$e(a),a.content instanceof s&&Je(a.content);if(ae)return e;if(te){if(ne)for(c=C.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(B.shadowroot||B.shadowrootmode)&&(c=N.call(r,c,!0)),c}let u=Z?i.outerHTML:i.innerHTML;return Z&&_["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&el(Nl,i.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+u),Y&&Va([O,E,A],e=>{u=Ya(u,e," ")}),w&&ie?w.createHTML(u):u},n.setConfig=function(){Ae(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Q=!0},n.clearConfig=function(){Te=null,Q=!1},n.isValidAttribute=function(e,t,n){Te||Ae({});const i=Ne(e),r=Ne(t);return Ve(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&Ja(T[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Wa(T[e],t);return-1===n?void 0:Ua(T[e],n,1)[0]}return $a(T[e])},n.removeHooks=function(e){T[e]=[]},n.removeAllHooks=function(){T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Pl=function(){return o(function e(){i(this,e)},null,[{key:"transform",value:function(e){if(!e)return"";var t=ql.sanitize(e,{FORBID_TAGS:["script","style","link","iframe","video","audio","img"],FORBID_ATTR:["onclick","onload","onerror"]});return t=this.transformNumberRange(t),t=this.transformProsodyRanges(t),t=this.transformAvatarLayout(t)}},{key:"transformNumberRange",value:function(e){return e.replace(/<i(?=[^>]*\bmark-range-start\b)(?=[^>]*data-type="number")[^>]*data-tts="(\d+)"[^>]*>.*?<\/i>([\s\S]*?)<i(?=[^>]*\bmark-range-end\b)[^>]*data-tts="\1"[^>]*>.*?<\/i>/gi,function(e,t,n){var i=n.replace(/<[^>]+>/g,"").trim();return i?'<b class="'.concat(wo," ").concat(wo,'-number" data-value="').concat(t,'" data-text="').concat(i,'">').concat(i,"</b>"):e})}},{key:"transformProsodyRanges",value:function(e){var t={speed:"speed",intonation:"pitch",volume:"volume"},n=e;return Object.keys(t).forEach(function(e){var i=t[e],r=new RegExp('<i(?=[^>]*\\bmark-range-start\\b)(?=[^>]*data-type="'.concat(e,'")[^>]*data-tts="(\\d+)"[^>]*>.*?<\\/i>([\\s\\S]*?)<i(?=[^>]*\\bmark-range-end\\b)[^>]*data-tts="\\1"[^>]*>.*?<\\/i>'),"gi");n=n.replace(r,function(e,t,n){return'<span class="'.concat(ko," ").concat(ko,"-").concat(i,'" data-type="').concat(i,'" data-value="').concat(t,'">').concat(n,"</span>")})}),n}},{key:"transformAvatarLayout",value:function(e){return e.replace(/(<p([^>]*class="[^"]*tts-content-paragraph[^"]*"[^>]*)>)([^]*?)(<i\s[^>]*class="[^"]*\btts-mark-avatar\b[^"]*"[^>]*>[^]*?<\/i>)([^]*?)(<\/p>)/gi,"<div>$4$1$3$5$6</div>")}}])}(),_l=function(){return o(function e(){i(this,e)},null,[{key:"ssmlToDOM",value:function(e){var t=new DOMParser,n=e.trim();n.startsWith("<speak")||(n="<speak>".concat(n,"</speak>"));var i=t.parseFromString(n,"text/xml"),r=i.getElementsByTagName("parsererror");if(r.length>0){A.error("XSSML Parse Error:",r[0].textContent);var o=document.createElement("div");return o.textContent=e,o}var s=i.getElementsByTagName("speak")[0],a=document.createElement("div");return this.processChildren(s,a),a}},{key:"processChildren",value:function(e,t){var n=this;e.childNodes.forEach(function(e){if(e.nodeType===Node.TEXT_NODE)t.appendChild(document.createTextNode(e.textContent||""));else if(e.nodeType===Node.ELEMENT_NODE){var i=e,r=i.tagName.toLowerCase(),o=document.createElement(r);Array.from(i.attributes).forEach(function(e){o.setAttribute(e.name,e.value)}),n.processChildren(i,o),t.appendChild(o)}})}}])}(),Ll=/\[((\w+\d*:?-?\d*)|(act-[^\]]+))\]/g,Bl={",":10,";":10,":":10,"、":5},Fl=/\[\[data=(.*?)\]\]/;function Vl(e){return e?"[[data=".concat(e,"]]"):""}function Wl(e){var t=e.replace(Ll,"").replace(/\[\[action=(.*?)\]\]/g,"").replace(Fl,"").replace(/\[\[cmd=.*?\]\]/g,"").replace(/[“”"‘’'()\(\)\[\]\{\}、,。!?;:\s\n\t]/g,"").trim();return/([A-Za-z0-9])|([\u4e00-\u9fa5])/.test(t)}var $l=function(){function e(){i(this,e),s(this,"currentPosition",0),s(this,"textRegExps",{}),s(this,"config",{CN_MAJOR_DELIMITERS:["。","!",";","?","……"],CN_MINOR_DELIMITERS:[",",":","、"],EN_MAJOR_DELIMITERS:["\\.","!",";","\\?"],EN_MINOR_DELIMITERS:[",",":"],CN_TARGET_MIN:5,CN_TARGET_MAX:25,EN_TARGET_MIN:5,EN_TARGET_MAX:40,MAX_CHAR_CN:100,MAX_CHAR_EN:150}),s(this,"ATOMIC_NODE_TYPES",["break","breath","word","phoneme","command","data","action","say-as","wait","ppt_control","range_anchor","soundEvent","sub"]),s(this,"SPLITED_NODE_TYPES",["command","data","ppt_control"]),s(this,"curParagraphLastRangeEvents",new Map)}return o(e,[{key:"setConfig",value:function(e){Object.assign(this.config,e)}},{key:"extractSentences",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||!e.content)throw new Error("Invalid document format: content is missing");this.currentPosition=t;var n=this.extractWithPosition(e.content),i=this.splitIntoSentences(n);return this.curParagraphLastRangeEvents.clear(),i}},{key:"splitIntoSentences",value:function(e){if(!e.length)return[];var t=[],n=[],i=[],r="",o=0,s=["speed","pitch","volume","lang"],a=[],l=function(e){var t=[];return s.forEach(function(n){var i=null==e?void 0:e.find(function(e){return e.type===n});i&&t.push({type:i.type,attrs:i.attrs})}),t},c=function(e,t){return e.length===t.length&&e.every(function(e,n){return e.type===t[n].type&&JSON.stringify(e.attrs)===JSON.stringify(t[n].attrs)})},h=function(e){return Wl(e)||/\[p\d+\]/.test(e)};this.textRegExps.CN_MAJOR||(this.textRegExps.CN_MAJOR=new RegExp("(".concat(this.config.CN_MAJOR_DELIMITERS.join("|"),")")),this.textRegExps.CN_MINOR=new RegExp("(".concat(this.config.CN_MINOR_DELIMITERS.join("|"),")")),this.textRegExps.EN_MAJOR=new RegExp("(".concat(this.config.EN_MAJOR_DELIMITERS.join("|"),")")),this.textRegExps.EN_MINOR=new RegExp("(".concat(this.config.EN_MINOR_DELIMITERS.join("|"),")")));for(var u="",p=[],f=[],m=function(){var e,s,l,c,h=arguments.length>0&&void 0!==arguments[0]&&arguments[0],m=u+r,g=[].concat(y(p),y(n)),v=[].concat(y(f.map(function(e){return d(d({},e),{},{charOffset:e.charOffset})})),y(i.map(function(e){return d(d({},e),{},{charOffset:e.charOffset+u.length})})));if(0!==g.length){var x=Wl(m)||/\[p\d+\]/.test(m);if(!x&&!h)return u=m,p=g,f=v,n=[],i=[],r="",void(o=0);if(!x&&h){if(t.length>0){var b=t[t.length-1];if(b&&"text"===b.taskType){var w,k,S=b.text.length;return b.text+=m,b.end=null!==(w=null===(k=g[g.length-1])||void 0===k?void 0:k.end)&&void 0!==w?w:b.end,v.forEach(function(e){b.events.push(d(d({},e),{},{trigger:"after",charOffset:S+e.charOffset}))}),u="",p=[],f=[],n=[],i=[],r="",void(o=0)}}if(!x)return u="",p=[],f=[],n=[],i=[],r="",void(o=0)}t.push({text:m,start:null!==(e=null===(s=g[0])||void 0===s?void 0:s.start)&&void 0!==e?e:0,end:null!==(l=null===(c=g[g.length-1])||void 0===c?void 0:c.end)&&void 0!==l?l:0,events:v,marks:y(a),taskType:"text"}),u="",p=[],f=[],n=[],i=[],r="",o=0}},g=function(e){m(!0),t.push(d({text:"[p10]"},e))},v=0;v<e.length;v+=1){var x=e[v],b=x.text,w=x.type,k=l(x.marks);if(n.length>0&&!c(a,k)&&h(r)&&m(!0),a=k,"command"===w||"ppt_control"===w){var S,z=!(null!==(S=r)&&void 0!==S&&S.trim());i.push({type:w,attrs:x.attrs,trigger:z?"before":"inner",charOffset:z?0:o})}else if("wait"===w)g({taskType:"wait",data:x.attrs||{}});else if("soundEvent"===w)m(!0),t.push({text:x.text,start:x.start,end:x.end,events:[],marks:y(a),taskType:"soundEvent"});else{var C,M,N=b,T=null===(C=x.marks)||void 0===C?void 0:C.find(function(e){return"textmedia"===e.type}),O=this.curParagraphLastRangeEvents.get("textmedia");if(T){if((null==O||null===(M=O.attrs)||void 0===M?void 0:M.src)!==T.attrs.src||"start"!==(null==O?void 0:O.eventLifeType)){var E=0===o;i.push({type:"textmedia",attrs:T.attrs,trigger:E?"before":"inner",charOffset:E?0:o,eventLifeType:"start"}),this.curParagraphLastRangeEvents.set("textmedia",i[i.length-1])}}else O&&"start"===O.eventLifeType&&(i.push(d(d({},O),{},{trigger:"inner",charOffset:o,eventLifeType:"stop"})),this.curParagraphLastRangeEvents.set("textmedia",i[i.length-1]));if("text"===w&&N){for(var A="",j=x.start,D=-1,R=0;R<N.length;R+=1){var I=N[R];if("\n"===I){if(A&&(r+=A,o+=A.length,n.push(d(d({},x),{},{text:A,start:j,end:x.start+R})),A=""),""===r&&0===n.length&&t.length>0){var q=t[t.length-1];q&&"text"===q.taskType?(q.text+=I,q.end+=1):r+=I}else{var P=h(r);r+=I,n.push(d(d({},x),{},{text:I,start:x.start+R,end:x.start+R+1})),P&&m(!0)}j=x.start+R+1,D=-1}else{var _=o+(A+=I).length,L=this.textRegExps.CN_MAJOR.test(I),B=this.textRegExps.EN_MAJOR.test(I),F=this.textRegExps.CN_MINOR.test(I),V=this.textRegExps.EN_MINOR.test(I),W=/[\u4e00-\u9fa5]|[\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF]|[\u1100-\u11FF\u3130-\u318F\uAC00-\uD7A3]/.test(I);if((F||V)&&_>=this.config.CN_TARGET_MIN){var $=Bl[I]||(V?10:1),J=-1!==D?N[D]:"";$>=(J?Bl[J]||(this.textRegExps.EN_MINOR.test(J)?10:1):-1)&&(D=R)}var U=!1;if(L||B){if(!("."===I&&R+1<N.length&&/\d/.test(N[R+1]))){for(var H=0,K=/[”"“)\)(\(「』」『【】> \n\s]/;R+1+H<N.length;){var G=N[R+1+H];if(!K.test(G))break;if(H++,"\n"===G)break}R+=H,U=!0}}else if(_>=this.config.CN_TARGET_MAX)if(F||V){for(var Y=0,X=/[”"“)\)(\(「』」『【】> \n\s]/;R+1+Y<N.length;){var Z=N[R+1+Y];if(!X.test(Z))break;if(Y++,"\n"===Z)break}R+=Y,U=!0}else _>1*this.config.CN_TARGET_MAX&&-1!==D&&(R=D,U=!0);else _>=(W?this.config.MAX_CHAR_CN:this.config.MAX_CHAR_EN)&&(U=!0);if(U&&h(r+A)){var Q=N.slice(j-x.start,R+1);r+=Q,o+=Q.length,n.push(d(d({},x),{},{text:Q,start:j,end:x.start+R+1})),m(),A="",j=x.start+R+1,D=-1}}}A&&(r+=A,o+=A.length,n.push(d(d({},x),{},{text:A,start:j,end:x.end})))}else{var ee;if("data"===w)r+=Vl(N);else r+=N,["phoneme","say-as","sub","word"].includes(w)&&null!==(ee=x.attrs)&&void 0!==ee&&ee.text&&(o+=x.attrs.text.length);n.push(x)}}v===e.length-1&&m(!0)}return t}},{key:"isAtomicNode",value:function(e){return this.ATOMIC_NODE_TYPES.includes(e.type)}},{key:"isSplitedNode",value:function(e){return this.SPLITED_NODE_TYPES.includes(e.type)}},{key:"getNodeSize",value:function(e){var t,n,i=this;if(!e)return 0;if(this.isAtomicNode(e))return 1;if("text"===e.type)return(null===(t=e.text)||void 0===t?void 0:t.length)||0;var r=2;return null!==(n=e.content)&&void 0!==n&&n.length&&(r+=e.content.reduce(function(e,t){return e+i.getNodeSize(t)},0)),r}},{key:"extractWithPosition",value:function(t){for(var n=[],i=!1,r=0;r<t.length;r+=1){var o=t[r],s=this.currentPosition;if("text"===o.type){var a=o.text||"";this.currentPosition+=this.getNodeSize(o),a&&n.push(e.createNodePosition("text",s,this.currentPosition,a,void 0,o.marks))}else if(this.isAtomicNode(o))if(this.currentPosition+=1,this.isSplitedNode(o)){var l;n.push(e.createNodePosition(o.type,s,this.currentPosition,(null===(l=o.attrs)||void 0===l?void 0:l.value)||"",o.attrs,o.marks))}else{var c=e.handleSpecialNode(o.type,o.attrs);n.push(e.createNodePosition(o.type,s,this.currentPosition,c,o.attrs,o.marks))}else"paragraph"===o.type&&(i&&n.push(e.createNodePosition("text",this.currentPosition,this.currentPosition,"\n")),this.currentPosition+=1,o.content&&n.push.apply(n,y(this.extractWithPosition(o.content))),this.currentPosition+=1);i="paragraph"===o.type}return n}},{key:"extractParagraphizedSentences",value:function(t){if(null==t||!t.content)throw new Error("Invalid document format: content is missing");var n=[],i=0;this.currentPosition=0;for(var r=0;r<t.content.length;r+=1){var o=t.content[r];if("paragraph"===o.type){var s=this.extractWithPosition([o]),a=this.splitIntoSentences(s),l=e.collectPreProcesss(o);n.push({index:i,preProcess:l,sentences:a}),i+=1}}for(var c,h=[],u=[],p=0;p<n.length;p+=1){var f,m=n[p];(f=u).push.apply(f,y(m.preProcess)),m.sentences.length>0&&(h.push(d(d({},m),{},{preProcess:u,index:h.length})),u=[])}u.length>0&&h.length>0?(c=h[h.length-1].preProcess).push.apply(c,y(u)):u.length>0&&0===h.length&&n.length>0&&h.push(d(d({},n[0]),{},{preProcess:u,sentences:[],index:0}));var g=this.curParagraphLastRangeEvents.get("textmedia");if(g&&"stop"!==g.eventLifeType){for(var v,x=h[h.length-1],b=x?x.sentences:[],w=b.length-1;w>=0;w-=1){var k;if("text"===(null===(k=b[w])||void 0===k?void 0:k.taskType)){v=b[w];break}}v&&v.events.push(d(d({},g),{},{trigger:"after",charOffset:v.text.length,eventLifeType:"stop"}))}return this.curParagraphLastRangeEvents.clear(),{paragraphs:h}}}],[{key:"createNodePosition",value:function(e,t,n,i,r,o){return{type:e,start:t,end:n,text:i,attrs:r,marks:o}}},{key:"handleSpecialNode",value:function(e,t){var n,i={break:function(e){return"[p".concat(null==e?void 0:e.value,"]")},breath:function(e){return(null==e?void 0:e.value)||""},word:function(e){return(null==e?void 0:e.value)||""},phoneme:function(e){return"".concat(null==e?void 0:e.text,"[=").concat(null==e?void 0:e.value,"]")},command:function(e){return"[[cmd=CUSTOM_EVENT;op=command;value=".concat(null==e?void 0:e.value,"]]")},data:function(e){return null!=e&&e.value?e.value:""},action:function(e){return"[[action=".concat(null==e?void 0:e.value,"]]")},number:function(e){return"[n".concat(null==e?void 0:e.value,"]").concat((null==e?void 0:e.text)||"","[n0]")},"say-as":function(e){var t,n=null!==(t=z[(null==e?void 0:e.interpretAs)||(null==e?void 0:e.value)||""])&&void 0!==t?t:(null==e?void 0:e.interpretAs)||(null==e?void 0:e.value)||"",i=(null==e?void 0:e.text)||"";return"[n".concat(n,"]").concat(i,"[n0]")},soundEvent:function(e){return"".concat(null==e?void 0:e.value)},range_anchor:function(){return""},sub:function(e){return(null==e?void 0:e.alias)||(null==e?void 0:e.value)||""}};return(null===(n=i[e])||void 0===n?void 0:n.call(i,t))||""}},{key:"collectPreProcesss",value:function(e){var t=[],n=function(e){var i;"data"===e.type&&t.push({type:"data",value:(null===(i=e.attrs)||void 0===i?void 0:i.value)||""});e.content&&e.content.forEach(n)};return n(e),t}}])}(),Jl=function(e){if(!e||"object"!==x(e))return e;var t={number:"say-as",alias:"sub",sayas:"say-as",cmd:"command"};return e.type&&t[e.type]&&(e.type=t[e.type]),e.content&&Array.isArray(e.content)&&e.content.forEach(Jl),e.marks&&Array.isArray(e.marks)&&e.marks.forEach(function(e){e.type&&t[e.type]&&(e.type=t[e.type])}),e},Ul=function(e){var t={type:"doc",content:[]};if(!e)return t;try{if("".concat(e).trim()){var n=JSON.parse(e);"doc"===(n=Jl(n)).type?t=n:"[object Array]"===Object.prototype.toString.call(n)?t.content=n:"[object Object]"===Object.prototype.toString.call(n)&&(t.content=[n])}}catch(n){A.warn("invalid editor content, upsert as plain text",n);var i="".concat(e).split("\n");t.content=i.map(function(e){return{type:"paragraph",content:e?[{type:"text",text:e}]:[]}})}return t},Hl=1e4,Kl=function(){function e(t){var r,o,a;i(this,e),s(o=n(this,e),"wordcount",0),s(o,"maxWordCount",Hl),s(o,"defaultPlugins",[Go(),(a={placeholder:"请输入内容..."},new Xt({key:Ta,state:{init:function(){return{placeholder:a.placeholder||"请输入内容..."}},apply:function(e,t){var n=e.getMeta(Ta);return n?d(d({},t),n):t}},props:{decorations:function(e){var t=e.doc;return this.spec.isEmpty(t)?Fr.create(t,[_r.widget(0,function(){var e=document.createElement("div");return e.classList.add("ssml-editor-placeholder"),e.textContent="请输入内容...",e})]):Fr.empty}},isEmpty:function(e){return 1===e.childCount&&2===e.content.size}})),ga({"Mod-z":Xo,"Mod-y":Zo}),ga(oa),new Na(o,{maxLength:Hl})]),s(o,"isEmptyContentSize",function(e){return 2===e}),o.editorStateStore=new Oa,o.on(xa.WordCount,function(e){o.wordcount=e.count}),o.config=e.mergeConfig(t),o.registry=Eo.clone(),o.commandRegister=j.clone(),o.maxWordCount=null!==(r=t.maxWordCount)&&void 0!==r?r:Hl;var l=[].concat(y(o.defaultPlugins),y(o.registry.getPlugins(o.editorStateStore)));o.config.floatingMenu&&l.push(new za(o,o.config.floatingMenu)),o.config.contextMenu&&l.push(new ka(o,o.config.contextMenu));var c=l.find(function(e){return e.spec.key===Ma});return c&&(c.maxLength=o.maxWordCount),l.forEach(function(e){e.spec.emitEvent=function(e,t){e.startsWith("plugin.")?o.emit(e,t):o.emit("plugin.".concat(e),t)}}),o.view=o.createView(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!t)return Gt.create({schema:e,plugins:n});var i=e.nodeFromJSON(Ul(t));return Gt.create({doc:i,schema:e,plugins:n})}(function(e){return new Te({nodes:d(d({},e.getNodes()),{},{doc:{content:"paragraph+"},paragraph:{group:"block",content:"inline*",parseDOM:[{tag:"p"}],toDOM:function(){return["p",0]}},text:{group:"inline"}}),marks:e.getMarks()})}(o.registry),o.config.content,l)),o.mount(),o}return c(e,va),o(e,[{key:"editable",get:function(){return this.editorStateStore.editable},set:function(e){this.editorStateStore.editable=e,this.view.setProps({editable:function(){return e}}),e?this.view.dom.classList.remove("readonly"):(this.view.dom.blur(),this.view.dom.classList.add("readonly"))}},{key:"getCurrentState",value:function(){var e=this,t=this.commandRegister.getAll();return Object.entries(t).reduce(function(t,n){var i=g(n,2),r=i[0],o=i[1];if(!o.validate)return t[r]={available:!0},t;var s=o.validate({view:e.view,state:e.view.state,dispatch:e.view.dispatch}),a=s.available,l=s.reason,c=s.code;return t[r]={available:a,reason:l,code:c},t},{})}},{key:"createView",value:function(e){var t=this;return new po(null,{state:e,attributes:{class:"ssml-editor"},editable:function(){return t.editorStateStore.editable},handleKeyDown:function(e,t){if(("Backspace"===t.key||"Delete"===t.key)&&function(e,t){var n=e.selection,i=e.doc,r=n.from,o=n.to;if(!n.empty){var s=e.tr.delete(r,o);return t&&t(s),!0}var a=i.resolve(r),l=a.nodeBefore;if(l&&l.type.isInline&&(Ea(l)||Aa(l))){var c=e.tr,h=r-l.nodeSize,u=r;if(Aa(l))return c.delete(h,u),t&&t(c),!0;if(Ea(l)){var d=l.attrs.text||"";c.replaceWith(h,u,e.schema.text(d));var p=h+d.length;return c.setSelection(qt.create(c.doc,p)),t&&t(c),!0}}var f=a.nodeAfter;if(f&&f.type.isInline&&(Ea(f)||Aa(f))){var m=e.tr,g=r,y=r+f.nodeSize;if(Aa(f))return m.delete(g,y),t&&t(m),!0;if(Ea(f)){var v=f.textContent;m.replaceWith(g,y,e.schema.text(v));var x=g+v.length;return m.setSelection(qt.create(m.doc,x)),t&&t(m),!0}}return!1}(e.state,e.dispatch))return t.preventDefault(),!0;return!1},handleClickOn:function(e,t,n,i,r){return!!n.type.spec.handleClickOn&&n.type.spec.handleClickOn(e,t,n,i,r)},handleDOMEvents:{focus:function(e,n){return t.editable?(e.dom.classList.add(bo),requestIdleCallback(function(){return e.dom.classList.remove("ProseMirror-focused")}),t.emit(xa.Focus,{focused:!0}),!1):(e.dom.blur(),!0)},blur:function(e,n){return e.dom.classList.remove(bo),t.emit(xa.Focus,{focused:!1}),!1}},transformPastedHTML:function(e,t){return Pl.transform(e)},dispatchTransaction:function(e){var n=t.view.state.apply(e);e.docChanged,t.view.updateState(n),(e.selectionSet||e.docChanged||e.storedMarksSet)&&(clearTimeout(t.stateCollect),t.stateCollect=setTimeout(function(){var e=t.getCurrentState();t.emit(xa.StateChange,{commands:e})},100))}})}},{key:"getSelection",value:function(){var e=this.view.state,t=e.selection,n=e.doc;return{from:t.from,to:t.to,text:vs(n.textBetween(t.from,t.to," "))}}},{key:"mount",value:function(){this.config.parent&&function(e){if(1==!!e.replaceChildren)e.replaceChildren();else for(;e.lastChild;)e.removeChild(e.lastChild)}(this.config.parent),this.view.dom.classList.remove("ProseMirror"),this.config.parent.appendChild(this.view.dom)}},{key:"getPlainText",value:function(e){var t=this.view.state,n=t.doc,i=t.selection,r="";switch((null==e?void 0:e.contentMode)||R.all){case R.selection:r=n.textBetween(i.from,i.to," ");break;case R.cursorRight:r=n.textBetween(i.$to.pos,n.content.size," ");break;case R.all:default:r=n.textContent}return vs(r)}},{key:"getPlaybackSegments",value:function(e){var t=this.view.state,n=t.selection,i=(null==e?void 0:e.contentMode)||R.all,r=0,o=t.doc.content.size;if(i===R.selection?(r=n.from,o=n.to):i===R.cursorRight&&(r=n.to,o=t.doc.content.size),r===o&&i!==R.all)return[];var s={type:"doc",content:t.doc.slice(r,o).content.toJSON()};return(new $l).extractSentences(s,r).filter(function(e){return"text"===e.taskType||"soundEvent"===e.taskType}).map(function(e){return{type:e.taskType,text:vs(e.text),from:e.start,to:e.end,events:e.events,marks:e.marks}})}},{key:"execute",value:function(e){var t=this.commandRegister.get(e);if(!t)return{success:!1,code:I.CommandNotFound,reason:"Command ".concat(e," not found")};if(!this.editorStateStore.editable&&![Do.clearHighlight,Do.highlight].includes(e))return{success:!1,code:I.StateError,reason:"编辑器处于只读模式,无法执行命令"};try{this.view.focus();for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];if(t.validate){var o=t.validate.apply(t,[{state:this.view.state,dispatch:this.view.dispatch,view:this.view,editor:this}].concat(i));if(o&&!o.available)return{success:!1,code:o.code||I.ParamsInvalid,reason:o.reason}}return t.execute.apply(t,[{state:this.view.state,dispatch:this.view.dispatch,view:this.view,editor:this}].concat(i))}catch(e){return{success:!1,code:I.ExecutionError,reason:e instanceof Error?e.message:String(e)}}}},{key:"setContent",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.view,i=n.dispatch,r=n.state;if(null!=e&&e.trim()){var o=r.schema.nodeFromJSON(Ul(e));if(i)i(r.tr.replaceWith(0,r.doc.content.size,o).scrollIntoView()),t&&this.execute(Qo.clear)}else{i&&(i(r.tr.delete(0,r.doc.content.size)),t&&this.execute(Qo.clear))}}},{key:"count",get:function(){return this.wordcount}},{key:"toJSON",value:function(){var e=this.view.state.toJSON(),t=function(e){if(!e||"object"!==x(e))return e;if(Array.isArray(e))return e.map(t);var n={};return Object.keys(e).forEach(function(i){var r=e[i];r="text"===i&&"string"==typeof r?vs(r):t(r),n[i]=r}),n};return t(e)}},{key:"setContentFromSSML",value:function(e){var t=_l.ssmlToDOM(e),n=this.view.state.schema,i=Ee.fromSchema(n).parse(t),r=this.view.state.tr.replaceWith(0,this.view.state.doc.content.size,i);this.view.dispatch(r)}},{key:"setContentFromHTML",value:function(e){var t=Pl.transform(e),n=this.view.state.schema,i=(new DOMParser).parseFromString(t,"text/html").body,r=Ee.fromSchema(n).parse(i),o=this.view.state.tr.replaceWith(0,this.view.state.doc.content.size,r);this.view.dispatch(o.scrollIntoView())}},{key:"destroy",value:function(){var t,n,i,r;(n="removeAllListeners",i=this,"function"==typeof(r=a(l(e.prototype),n,i))?function(e){return r.apply(i,e)}:r)([]),this.view.destroy(),(null===(t=this.view.dom)||void 0===t?void 0:t.parentNode)===this.config.parent&&this.config.parent.removeChild(this.view.dom)}}],[{key:"mergeConfig",value:function(e){var t;return d(d({},e),{},{maxWordCount:null!==(t=e.maxWordCount)&&void 0!==t?t:Hl})}}])}(),Gl=new en("numberTip"),Yl={switchNumberTipMode:"switchNumberTipMode"};D({name:Yl.switchNumberTipMode,description:"切换数字读法标注模式",execute:function(e,t){var n=e.state,i=e.dispatch,r=t;return i?(i(n.tr.setMeta(Gl,{active:!(null==r||!r.active)})),{success:!0}):{success:!0}}});var Xl=/[+-]?(?:(?:\d{1,3}(?:,\d{3})+)|(?:\d+))(?:\.\d+)?/g;var Zl=new Xt({key:Gl,state:{init:function(){return{active:!1,decorations:Fr.empty}},apply:function(e,t,n,i){var r,o=e.getMeta(Gl),s=null!==(r=null==o?void 0:o.active)&&void 0!==r?r:t.active,a=Fr.empty;return s&&(a=!t.active||e.docChanged?function(e){var t=[];return e.descendants(function(e,n){var i;if(e.isText&&e.text)for(Xl.lastIndex=0;null!==(i=Xl.exec(e.text));){var r=i.index,o=i.index+i[0].length,s=i[0],a=ms(4);t.push(_r.inline(n+r,n+o,{class:zo,"data-number-tip-text":s,"data-deco-id":a},{decoId:a,text:s}))}else if(e.type.name===k.SayAs){var l=ms(4);t.push(_r.inline(n,n+e.nodeSize,{class:zo,"data-number-tip-text":e.attrs.text,"data-deco-id":l,"data-is-node":"true"},{decoId:l,text:e.attrs.text,isNode:!0}))}}),Fr.create(e,t)}(i.doc):t.decorations.map(e.mapping,e.doc)),{active:s,decorations:a}}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations},handleClick:function(e,t,n){var i=Zl.getState(e.state),r=n.target,o=r.closest(".".concat(zo)),s=r.closest('[data-type="'.concat(k.SayAs,'"]'));if(!o&&!s)return!1;var a="",l=-1,c=-1,h=!1;if(o){if(null==i||!i.active)return!1;var u=o.dataset.decoId,d=i.decorations.find(t,t),p=null;if(d.forEach(function(e){e.spec.decoId===u&&(p=e)}),!p)return!1;a=p.spec.text,l=p.from,c=p.to,h=!!p.spec.isNode}else{var f=e.state.doc.resolve(e.posAtDOM(s,0)),m=f.nodeAfter;if(!m||m.type.name!==k.SayAs)return!1;a=m.attrs.text,l=f.pos,c=f.pos+m.nodeSize,h=!0}var g,y,v=(g=new cs("ssml-editor-number-tip__list","ssml-editor-number-tip__item"),y=[{label:"读数字",value:S.digits},{label:"读数值",value:S.cardinal},{label:"移除/还原",value:""}],g.render(y));ds.show(v,{x:n.clientX,y:n.clientY},{rootClassName:"ssml-editor-number-tip__popover"}).then(function(){v.removeEventListener("click",x)}),e.dispatch(e.state.tr.setSelection(qt.create(e.state.doc,l,c)).setMeta(Mo,!0));var x=function(t){var n=t.target.closest(".ssml-editor-number-tip__item");if(n){var i=n.dataset.value,r=e.state.tr.setSelection(qt.create(e.state.doc,l,c));i?r=r.replaceSelectionWith(e.state.schema.nodes[k.SayAs].create({interpretAs:i,text:a,type:k.SayAs})):h&&(r=r.replaceSelectionWith(e.state.schema.text(a))),e.dispatch(r.setSelection(qt.near(r.doc.resolve(l)))),ds.hide()}};return v.addEventListener("click",x),!0}}});Eo.registerPlugin("number-tip",Zl);var Ql=new en("rangeBoundary");Eo.registerPlugin("rangeBoundary",new Xt({key:Ql,appendTransaction:function(e,t,n){if(!e.some(function(e){return e.selectionSet})||!n.selection.empty)return null;var i=n.selection.$from,r=n.tr,o=i.nodeBefore,s=i.nodeAfter;if(s&&s.type.name===k.RangeAnchor&&"start"===s.attrs.anchorType){var a=s.attrs.tagType,l=r.storedMarks||n.storedMarks||[];if(l.some(function(e){return e.type.name===a}))return r.setStoredMarks(l.filter(function(e){return e.type.name!==a})),r}if(o&&o.type.name===k.RangeAnchor&&"start"===o.attrs.anchorType){var c=o.attrs,h=c.tagType,u=c.value,d=c.tagId,p=n.schema.marks[h],f=r.storedMarks||n.storedMarks||[];if(!f.some(function(e){return e.type.name===h&&e.attrs.tagId===d}))return r.setStoredMarks([].concat(y(f),[p.create({value:u,tagId:d})])),r}if(s&&s.type.name===k.RangeAnchor&&"end"===s.attrs.anchorType){var m=s.attrs,g=m.tagType,v=m.value,x=m.tagId,b=n.schema.marks[g],w=r.storedMarks||n.storedMarks||[];if(!w.some(function(e){return e.type.name===g&&e.attrs.tagId===x}))return r.setStoredMarks([].concat(y(w),[b.create({value:v,tagId:x})])),r}if(o&&o.type.name===k.RangeAnchor&&"end"===o.attrs.anchorType){var S=o.attrs.tagType,z=r.storedMarks||n.storedMarks||[];if(z.some(function(e){return e.type.name===S}))return r.setStoredMarks(z.filter(function(e){return e.type.name!==S})),r}if(o&&o.type.name===k.RangeAnchor&&"end"===o.attrs.anchorType&&i.parentOffset===i.parent.content.size)return r.insertText("​",i.pos),r.setStoredMarks([]),r;var C=!1;return n.doc.nodesBetween(i.before(),i.after(),function(e,t){if(e.isText&&e.text&&e.text.includes("​")&&e.text.length>1){var i=e.text.replace(/\u200b/g,"");i!==e.text&&(r.replaceWith(t,t+e.nodeSize,n.schema.text(i,e.marks)),C=!0)}return!0}),C?r:null},props:{handleKeyDown:function(e,t){if("Backspace"===t.key&&e.state.selection.empty){var n=e.state.selection.$from,i=n.nodeBefore;if(i&&i.type.name===k.RangeAnchor&&"end"===i.attrs.anchorType){var r=n.pos-i.nodeSize,o=e.state.tr;if(e.state.doc.nodeAt(r-1))return o.delete(r-1,r),e.dispatch(o),!0}if(i&&i.type.name===k.RangeAnchor&&"start"===i.attrs.anchorType){var s=n.pos-i.nodeSize,a=e.state.tr;if(s>0)return a.delete(s-1,s),e.dispatch(a),!0}}if("ArrowRight"===t.key&&e.state.selection.empty){var l=e.state.selection.$from,c=l.nodeAfter;if(c&&c.type.name===k.RangeAnchor&&"end"===c.attrs.anchorType){var h=l.pos+c.nodeSize,u=e.state.doc.resolve(h);if(u.parentOffset===u.parent.content.size){var d=e.state.tr;return d.setSelection(qt.create(e.state.doc,u.pos)),d.setStoredMarks([]),e.dispatch(d),!0}}}return!1},handleClick:function(e,t,n){var i=e.state.doc.resolve(t),r=i.nodeBefore;if(r&&r.type.name===k.RangeAnchor&&"end"===r.attrs.anchorType&&i.parentOffset===i.parent.content.size){var o=e.state.tr;return o.insertText("​",i.pos),o.setSelection(qt.create(o.doc,i.pos)),o.setStoredMarks([]),e.dispatch(o),!0}return!1}}}));var ec,tc=new en("rangeSync");Eo.registerPlugin("rangeSync",(ec=[k.SpeechRate,k.SpeechPitch,k.SpeechVolume,k.SpeechLanguage],new Xt({key:tc,appendTransaction:function(e,t,n){if(!e.some(function(e){return e.docChanged}))return null;var i=n.tr,r=!1,o=new Set,s=new Map;n.doc.descendants(function(e,t){ec.forEach(function(n){var i=e.marks.find(function(e){return e.type.name===n});if(i){var r=i.attrs.tagId;o.add(r),s.has(r)||s.set(r,[]);var a=s.get(r),l=a[a.length-1];(!l||t>=l.pos+l.size)&&a.push({pos:t,size:e.nodeSize,attrs:i.attrs,type:n})}})});var a=[];s.forEach(function(e,t){if(0!==e.length){for(var i={type:e[0].type,attrs:e[0].attrs,from:e[0].pos,to:e[0].pos+e[0].size},r=function(){var t=e[o],r=i.to,s=t.pos,l=!0,c=n.doc.resolve(i.from),h=n.doc.resolve(t.pos);c.parent!==h.parent?l=!1:s>r&&n.doc.nodesBetween(r,s,function(e,t){return t>=r&&t<s&&(e.isText||e.type.name!==k.RangeAnchor)&&(l=!1),l}),l?i.to=t.pos+t.size:(a.push(d({},i)),i={type:t.type,attrs:t.attrs,from:t.pos,to:t.pos+t.size})},o=1;o<e.length;o+=1)r();a.push(i)}});var l=[];a.forEach(function(e){var t=i.mapping.map(e.from),n=i.mapping.map(e.to);!Number.isNaN(t)&&t>=0&&l.push({pos:t,type:k.RangeAnchor,attrs:{anchorType:"start",tagType:e.type,value:e.attrs.value,tagId:e.attrs.tagId}}),!Number.isNaN(n)&&n>=0&&l.push({pos:n,type:k.RangeAnchor,attrs:{anchorType:"end",tagType:e.type,value:e.attrs.value,tagId:e.attrs.tagId}})});var c=[],h=new Set;i.doc.descendants(function(e,t){if(e.type.name===k.RangeAnchor){var n=l.findIndex(function(n,i){return!h.has(i)&&n.pos===t&&e.attrs.tagId===n.attrs.tagId&&e.attrs.anchorType===n.attrs.anchorType});-1!==n?h.add(n):c.push({pos:t,size:e.nodeSize})}});for(var u=c.length-1;u>=0;u-=1){var p=c[u],f=p.pos,m=p.size;i.delete(f,f+m),r=!0}return l.filter(function(e,t){return!h.has(t)}).sort(function(e,t){return t.pos-e.pos}).forEach(function(e){var t=i.mapping.map(e.pos);t>=0&&(i.insert(t,n.schema.nodes[k.RangeAnchor].create(e.attrs)),r=!0)}),r?(i.setMeta("addToHistory",!1),i):null},props:{transformPasted:function(e){var t=new Map,n=function(e){var i=e.marks.map(function(e){if(ec.includes(e.type.name)){var n=e.attrs.tagId;return t.has(n)||t.set(n,ms(6)),e.type.create(d(d({},e.attrs),{},{tagId:t.get(n)}))}return e});if(e.type.name===k.RangeAnchor){var r=e.attrs.tagId;return t.has(r)||t.set(r,ms(6)),e.type.create(d(d({},e.attrs),{},{tagId:t.get(r)}))}if(e.content.size>0){var o=[];return e.content.forEach(function(e){return o.push(n(e))}),e.copy(L.from(o)).mark(i)}return e.mark(i)},i=[];return e.content.forEach(function(e){return i.push(n(e))}),new J(L.from(i),e.openStart,e.openEnd)}}})));var nc=new en("readOnly");Eo.registerPlugin("readOnly",function(e){return new Xt({key:nc,state:{init:function(){return Fr.empty},apply:function(e,t,n){return t.map(e.mapping,e.doc)}},props:{attributes:function(){var t;return{class:null===(t=null==e?void 0:e.editable)||void 0===t||t?"":"ssml-editor_readonly"}},editable:function(){var t;return null===(t=null==e?void 0:e.editable)||void 0===t||t}},filterTransaction:function(t){var n;return A.debug("filterTransaction",t),!(null==e||!e.editable)||!(null!==(n=t.steps)&&void 0!==n&&n.length||!t.selection)}})});var ic=new en("speechLanguage");Eo.registerPlugin("speechLanguage",new Xt({key:ic,state:{init:function(){return null},apply:function(e,t){return e.getMeta(ic)||t}}}));var rc=new en("speechPitch");function oc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===k.SpeechPitch});i&&n.push({from:t,to:t+e.nodeSize,value:i.attrs.value})});var i=[];return n.forEach(function(e){var t=i[i.length-1];t&&t.to===e.from?t.to=e.to:i.push(d({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(_r.inline(n,i,{class:"range-annotation-content speech-pitch-content","data-pitch":String(r)}))}),Fr.create(e.doc,t)}function sc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===k.SpeechRate});i&&n.push({from:t,to:t+e.nodeSize,value:i.attrs.value})});var i=[];return n.forEach(function(e){var t=i[i.length-1];t&&t.to===e.from?t.to=e.to:i.push(d({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(_r.inline(n,i,{class:"range-annotation-content speech-rate-content","data-rate":String(r)}))}),Fr.create(e.doc,t)}Eo.registerPlugin("speechPitch",new Xt({key:rc,state:{init:function(e,t){return{decorations:oc(t)}},apply:function(e,t,n,i){return e.docChanged?{decorations:oc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}}));var ac=new en("speechRate");Eo.registerPlugin("speechRate",new Xt({key:ac,state:{init:function(e,t){return{decorations:sc(t)}},apply:function(e,t,n,i){return e.docChanged?{decorations:sc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}}));var lc=new en("speechVolume");function cc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===k.SpeechVolume});i&&n.push({from:t,to:t+e.nodeSize,value:i.attrs.value})});var i=[];return n.forEach(function(e){var t=i[i.length-1];t&&t.to===e.from?t.to=e.to:i.push(d({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(_r.inline(n,i,{class:"range-annotation-content speech-volume-content","data-volume":String(r)}))}),Fr.create(e.doc,t)}Eo.registerPlugin("speechVolume",new Xt({key:lc,state:{init:function(e,t){return{decorations:cc(t)}},apply:function(e,t,n,i){return e.docChanged?{decorations:cc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}}));var hc="thumbnail-icon";function uc(e){var t=[],n=[],i=!0;return e.doc.descendants(function(e,t){var r,o=e.marks.find(function(e){return e.type.name===w.textmedia});o?!i&&null!==(r=n[n.length-1])&&void 0!==r&&null!==(r=r.mark)&&void 0!==r&&r.eq(o)?n[n.length-1].to=t+e.nodeSize:(n.push({mark:o,from:t,to:t+e.nodeSize}),i=!1):i=!0}),n.forEach(function(e){var n=e.mark,i=e.from;t.push(_r.widget(i,function(e,t,n){var i=document.createElement("b");i.className="".concat(Co," ").concat(Co,"__").concat(e),i.dataset.id=t,i.dataset.type=e;var r=document.createElement("span");r.classList.add(hc);var o=document.createElement("img");return o.src=n.src,o.style.maxHeight="1em",r.appendChild(o),i.append(r,Cs()),i}("start",n.attrs.tagId,n.attrs),{side:1,key:"start-".concat(n.attrs.tagId)}))}),Fr.create(e.doc,t)}var dc=new en("textMedia");Eo.registerPlugin("textMedia",new Xt({key:dc,state:{init:function(e,t){return{decorations:uc(t)}},apply:function(e,t,n,i){return e.docChanged||e.getMeta("text-media-update")?{decorations:uc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations},handleClick:function(e,t,n){var i,r,o=null===(i=n.target)||void 0===i||null===(r=i.closest)||void 0===r?void 0:r.call(i,".".concat(Co));if(!o)return!1;var s=o.dataset,a=s.id,l=s.type;if(!a)return!1;if("start"===l)if(Ms(n)){var c=e.state,h=c.doc,u=c.tr,d=!1,p=!1;if(h.descendants(function(e,n){if(!(n<t||p))for(var i=0,r=e.marks.length;i<r;i+=1){var o=e.marks[i];if(o.type.name===w.textmedia){if(o.attrs.tagId!==a){p=!0;break}u.removeMark(t,t+e.nodeSize,o.type),d=!0}}}),d)return e.dispatch(u),!0}else if(function(e){var t;return null==e||null===(t=e.closest)||void 0===t?void 0:t.call(e,".".concat(hc))}(n.target)){var f,m,g=e.state.plugins.find(function(e){return e.spec.key===dc}),y=[];e.state.doc.nodesBetween(t,t+1,function(e){var t,n=null===(t=e.marks)||void 0===t?void 0:t.find(function(e){return e.type.name===w.textmedia});n&&y.push(null==n?void 0:n.attrs)}),y.length&&(null===(f=(m=g.spec).emitEvent)||void 0===f||f.call(m,xa.PluginTextMediaClick,y[0]))}return!1}}}));var pc=o(function e(t){i(this,e),this.name=t.name,this.description=t.description,this.execute=t.execute}),fc=new en("wordmark"),mc=function(e){return e.markWord="markWord",e.clearWordMark="clearWordMark",e}({});function gc(e,t){var n=[];return t?(e.descendants(function(e,i){if(e.isText&&e.text)for(var r=0,o=e.text.indexOf(t,r);-1!==o;){var s=i+o,a=s+t.length;n.push(_r.inline(s,a,{class:"ssml-word-mark"})),r=o+t.length,o=e.text.indexOf(t,r)}}),Fr.create(e,n)):Fr.empty}var yc=new Xt({key:fc,state:{init:function(){return{word:"",decorations:Fr.empty}},apply:function(e,t,n,i){var r=e.getMeta(fc),o=t.word;return r&&"string"==typeof r.word&&(o=r.word),o!==t.word||e.docChanged?{word:o,decorations:gc(i.doc,o)}:{word:o,decorations:t.decorations.map(e.mapping,e.doc)}}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}});D(new pc({name:mc.markWord,execute:function(e,t){if("string"!=typeof t||!t)return{success:!1,code:t?I.ParamsInvalid:I.ParamsMissing,reason:"Invalid word"};var n=e.state.tr.setMeta(fc,{word:t});return e.dispatch(n),{success:!0}}})),D(new pc({name:mc.clearWordMark,execute:function(e){var t=e.state.tr.setMeta(fc,{word:""});return e.dispatch(t),{success:!0}}})),Eo.registerPlugin("wordmark",yc);var vc={setTextMedia:"setTextMedia",resetTextMediaStoredMark:"resetTextMediaStoredMark"};D({name:vc.setTextMedia,description:"设置当前文案媒体",execute:function(e,t){var n=t,i=e.state,r=e.dispatch,o=i.selection;return null==r||r(i.tr.addMark(o.from,o.to,i.schema.marks[w.textmedia].create(d({tagId:ms(6)},n))).scrollIntoView()),{success:!0}},validate:function(e,t){return e.state.selection.empty?{available:!1,code:I.SelectionInvalid,reason:"选中文本设置媒体"}:{available:!0}}}),D({name:vc.resetTextMediaStoredMark,description:"重置当前光标文案媒体",execute:function(e){var t=e.state,n=e.dispatch,i=t.schema.marks[w.textmedia];return null==n||n(t.tr.removeStoredMark(i)),{success:!0}},validate:function(e){var t,n;return null!==(t=e.state.tr.storedMarks)&&void 0!==t&&null!==(n=t.find)&&void 0!==n&&n.call(t,function(e){return e.type.name===w.textmedia})?{available:!0}:{available:!1,code:I.CursorInvalid,reason:"当前光标不在图片范围"}}});export{C as ActionCommands,as as BreakCommands,ls as BreathCommands,is as CmdCommands,I as CommandErrorCode,R as ContentReadMode,ka as ContextMenuPlugin,rs as DataCommands,Fl as DataPlaceholderReg,xa as EditorEvent,za as FloatingMenuPlugin,Do as HighlightCommands,Qo as HistoryCommands,E as LogLevel,Kl as MarkEditor,k as MarkTagType,Yl as NumberTipCommands,ws as PhonemeCommands,ts as PptCommands,Ss as SayAsCommands,S as SayAsInterpretType,ns as SoundEventCommands,O as SpeechLanguageCommands,N as SpeechPitchCommands,M as SpeechRateCommands,T as SpeechVolumeCommands,$l as TextExtractor,es as TextInputCommands,vc as TextMediaCommands,ss as WaitCommands,zs as WordCommands,mc as WordmarkCommands,A as logger,D as registerCommand,Eo as registry};