@siliconoid/xssml-editor 1.0.1 → 1.0.3
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.css +16 -9
- package/dist/index.esm.js +2 -2
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).XSSMLEditor={})}(this,function(e){"use strict";function t(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 n(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 i(e,t,n){return t=c(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,u()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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,x(i.key),i)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=c(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}},l.apply(null,arguments)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function h(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&&g(e,t)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function d(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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f(){
|
|
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 m(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]())):(m(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,m(e,r,"GeneratorFunction")),e.prototype=Object.create(u),e}return l.prototype=c,m(u,"constructor",c),m(c,"constructor",l),l.displayName="GeneratorFunction",m(c,r,"GeneratorFunction"),m(u),m(u,r,"Generator"),m(u,i,function(){return this}),m(u,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:d}})()}function m(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}m=function(e,t,n,i){function o(t,n){m(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))},m(e,t,n,i)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function y(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)||w(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 v(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(e)||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 x(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 b(e){return b="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},b(e)}function w(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}var k=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}({}),S=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}({}),z=function(e){return e.auto="auto",e.cardinal="cardinal",e.digits="digits",e}({}),C=function(e){return e[e.auto=0]="auto",e[e.digits=1]="digits",e[e.cardinal=2]="cardinal",e}({}),M=function(e){return e.insertAction="insertAction",e.clearAction="clearAction",e}({}),T=function(e){return e.setSpeechRate="setSpeechRate",e}({}),N=function(e){return e.setSpeechPitch="setSpeechPitch",e}({}),O=function(e){return e.setSpeechVolume="setSpeechVolume",e}({}),E=function(e){return e.setSpeechLanguage="setSpeechLanguage",e}({}),A=function(e){return e[e.ERROR=0]="ERROR",e[e.WARN=1]="WARN",e[e.INFO=2]="INFO",e[e.DEBUG=3]="DEBUG",e}({}),j=function(){return s(function e(){r(this,e),a(this,"level",A.WARN),a(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>=A.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>=A.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>=A.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>=A.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))}}}])}(),D=new j,R=function(){function e(){r(this,e),a(this,"commands",new Map)}return s(e,[{key:"register",value:function(e){var t=e.name;this.commands.has(t)&&D.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}}])}(),I=new R;function q(e){I.register(e)}var P=function(e){return e.all="all",e.selection="selection",e.cursorRight="cursor_right",e}({}),_=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 L(e){this.content=e}function B(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=B(r.content,o.content,n+1);if(null!=e)return e}n+=r.nodeSize}else n+=r.nodeSize}}function F(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=F(s.content,a.content,n-1,i-1);if(e)return e}n-=l,i-=l}else n-=l,i-=l}}q({name:M.insertAction,description:"插入动作",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Action].create(p(p({},n),{},{type:S.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[S.Action])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"光标处插入设置动作"}}}),q({name:M.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[S.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}}}),L.prototype={constructor:L,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 L(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 L(n)},addToStart:function(e,t){return new L([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new L(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 L(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=L.from(e)).size?new L(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=L.from(e)).size?new L(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=L.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}},L.from=function(e){if(e instanceof L)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new L(t)};class V{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 V(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 V(n,i)}cutByIndex(e,t){return e==t?V.empty:0==e&&t==this.content.length?this:new V(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 V(i,r)}addToStart(e){return new V([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new V(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 B(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return F(this,e,t,n)}findIndex(e){if(0==e)return $(0,e);if(e==this.size)return $(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?$(t+1,i):$(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 V.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new V(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return V.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 V(t||e,n)}static from(e){if(!e)return V.empty;if(e instanceof V)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new V([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}V.empty=new V([],0);const W={index:0,offset:0};function $(e,t){return W.index=e,W.offset=t,W}function J(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(!J(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!J(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class H{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&&J(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 H.none;if(e instanceof H)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}H.none=[];class U extends Error{}class K{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=Y(this.content,e+this.openStart,t);return n&&new K(n,this.openStart,this.openEnd)}removeBetween(e,t){return new K(G(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 K.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 K(V.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 K(e,n,i)}}function G(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(G(o.content,t-r-1,n-r-1)))}function Y(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=Y(s.content,t-o-1,n,s);return a&&e.replaceChild(r,s.copy(a))}function X(e,t,n){if(n.openStart>e.depth)throw new U("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new U("Inconsistent open depths");return Z(e,t,n,0)}function Z(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=Z(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(V.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(n,e);return ie(o,re(e,r,s,t,i))}{let i=e.parent,r=i.content;return ie(i,r.cut(0,e.parentOffset).append(n.content).append(r.cut(t.parentOffset)))}}return ie(o,oe(e,t,i))}function Q(e,t){if(!t.type.compatibleContent(e.type))throw new U("Cannot join "+t.type.name+" onto "+e.type.name)}function ee(e,t,n){let i=e.node(n);return Q(i,t.node(n)),i}function te(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 ne(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&&(te(e.nodeAfter,i),o++));for(let e=o;e<s;e++)te(r.child(e),i);t&&t.depth==n&&t.textOffset&&te(t.nodeBefore,i)}function ie(e,t){return e.type.checkContent(t),e.copy(t)}function re(e,t,n,i,r){let o=e.depth>r&&ee(e,t,r+1),s=i.depth>r&&ee(n,i,r+1),a=[];return ne(null,e,r,a),o&&s&&t.index(r)==n.index(r)?(Q(o,s),te(ie(o,re(e,t,n,i,r+1)),a)):(o&&te(ie(o,oe(e,t,r+1)),a),ne(t,n,r,a),s&&te(ie(s,oe(n,i,r+1)),a)),ne(i,null,r,a),new V(a)}function oe(e,t,n){let i=[];if(ne(null,e,n,i),e.depth>n){te(ie(ee(e,t,n+1),oe(e,t,n+1)),i)}return ne(t,null,n,i),new V(i)}K.empty=new K(V.empty,0,0);class se{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 H.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 he(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 se(t,n,r)}static resolveCached(e,t){let n=ce.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 ce.set(e,n=new ae);let i=n.elts[n.i]=se.resolve(e,t);return n.i=(n.i+1)%le,i}}class ae{constructor(){this.elts=[],this.i=0}}const le=12,ce=new WeakMap;class he{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 ue=Object.create(null);let de=class e{constructor(e,t,n,i=H.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||V.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&&J(this.attrs,t||e.defaultAttrs||ue)&&H.sameSet(this.marks,n||H.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 K.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 K(a,i.depth-o,r.depth-o)}replace(e,t,n){return X(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 se.resolveCached(this,e)}resolveNoCache(e){return se.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()+")"),fe(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=V.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=H.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(!H.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=V.fromJSON(e,t.content),r=e.nodeType(t.type).create(t.attrs,i,n);return r.type.checkAttrs(r.attrs),r}};de.prototype.text=void 0;class pe extends de{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):fe(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 pe(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new pe(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 fe(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class me{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new ge(e,t);if(null==n.next)return me.empty;let i=ye(n);n.next&&n.err("Unexpected trailing text");let r=function(e){let t=Object.create(null);return n(Se(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]);Se(e,n).forEach(e=>{i||r.push([t,i=[]]),-1==i.indexOf(e)&&i.push(e)})})});let o=t[i.join(",")]=new me(i.indexOf(e.length-1)>-1);for(let e=0;e<r.length;e++){let i=r[e][1].sort(ke);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 V.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")}}me.empty=new me(!0);class ge{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 ye(e){let t=[];do{t.push(ve(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function ve(e){let t=[];do{t.push(xe(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function xe(e){let t=function(e){if(e.eat("(")){let t=ye(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=we(e,t)}return t}function be(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function we(e,t){let n=be(e),i=n;return e.eat(",")&&(i="}"!=e.next?be(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function ke(e,t){return t-e}function Se(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(ke)}function ze(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 Ce(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 Me(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 Te(e,t){let n=Object.create(null);if(t)for(let i in t)n[i]=new Oe(e,i,t[i]);return n}let Ne=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=Te(e,n.attrs),this.defaultAttrs=ze(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==me.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:Ce(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new de(this,this.computeAttrs(e),V.from(t),H.setFrom(n))}createChecked(e=null,t,n){return t=V.from(t),this.checkContent(t),new de(this,this.computeAttrs(e),t,H.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=V.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(V.empty,!0);return r?new de(this,e,t.append(r),H.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){Me(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:H.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 Oe{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 Ee{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Te(e,i.attrs),this.excluded=null;let r=ze(this.attrs);this.instance=r?new H(this,r):null}create(e=null){return!e&&this.instance?this.instance:new H(this,Ce(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((e,r)=>n[e]=new Ee(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){Me(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Ae{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=L.from(e.nodes),t.marks=L.from(e.marks||{}),this.nodes=Ne.compile(this.spec.nodes,this),this.marks=Ee.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]=me.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?je(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?[]:je(this,n.split(" "))}this.nodeFromJSON=e=>de.fromJSON(this,e),this.markFromJSON=e=>H.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 Ne))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 pe(n,n.defaultAttrs,e,H.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 je(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 De=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 Le(this,t,!1);return n.addAll(e,H.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Le(this,t,!0);return n.addAll(e,H.none,t.from,t.to),K.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(Be(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=Fe(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=Fe(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 Re={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},Ie={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},qe={ol:!0,ul:!0};function Pe(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class _e{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=H.none,this.match=r||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(V.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=V.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(V.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&&!Re.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Le{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=Pe(null,t.preserveWhitespace,0)|(n?4:0);i=r?new _e(r.type,r.attrs,H.none,!0,t.topMatch||r.type.contentMatch,o):new _e(n?null:e.schema.topNodeType,null,H.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();qe.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&&qe.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:Ie.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(Re.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=H.none;for(let r of i.concat(e.marks))(t.type?t.type.allowsMarkType(r.type):Ve(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=Pe(e,r,o.options);4&o.options&&0==o.content.length&&(s|=4);let a=H.none;return n=n.filter(t=>!(o.type?o.type.allowsMarkType(t.type):Ve(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new _e(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 Be(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Fe(e){let t={};for(let n in e)t[n]=e[n];return t}function Ve(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 We{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Je(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}=Ke(Je(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&&Ke(Je(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return Ke(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new We(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=$e(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return $e(e.marks)}}function $e(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Je(e){return e.document||window.document}const He=new WeakMap;function Ue(e){let t=He.get(e);return void 0===t&&He.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 Ke(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=Ue(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}=Ke(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 Ge=Math.pow(2,16);function Ye(e,t){return e+t*Ge}function Xe(e){return 65535&e}class Ze{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 Qe{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Qe.empty)return Qe.empty}recover(e){let t=0,n=Xe(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))/Ge}(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:Ye(s/3,e-a),u=e==a?2:e==h?1:4;return(t<0?e!=a:e!=h)&&(u|=8),new Ze(r,u,o)}i+=c-l}return n?e+i:new Ze(e+i,0,null)}touches(e,t){let n=0,i=Xe(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 Qe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Qe.empty:new Qe(e<0?[0,-e,0]:[0,0,e])}}Qe.empty=new Qe([]);class et{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 et(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 et;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 Ze(e,i,null)}}const tt=Object.create(null);class nt{getMap(){return Qe.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=tt[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 tt)throw new RangeError("Duplicate use of step JSON ID "+e);return tt[e]=t,t.prototype.jsonID=e,t}}class it{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new it(e,null)}static fail(e){return new it(null,e)}static fromReplace(e,t,n,i){try{return it.ok(e.replace(t,n,i))}catch(e){if(e instanceof U)return it.fail(e.message);throw e}}}function rt(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let o=e.child(r);o.content.size&&(o=o.copy(rt(o.content,t,o))),o.isInline&&(o=t(o,n,r)),i.push(o)}return V.fromArray(i)}class ot extends nt{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 K(rt(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 it.fromReplace(e,this.from,this.to,r)}invert(){return new st(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 ot(t.pos,n.pos,this.mark)}merge(e){return e instanceof ot&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ot(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 ot(t.from,t.to,e.markFromJSON(t.mark))}}nt.jsonID("addMark",ot);class st extends nt{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 K(rt(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return it.fromReplace(e,this.from,this.to,n)}invert(){return new ot(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 st(t.pos,n.pos,this.mark)}merge(e){return e instanceof st&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new st(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 st(t.from,t.to,e.markFromJSON(t.mark))}}nt.jsonID("removeMark",st);class at extends nt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return it.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return it.fromReplace(e,this.pos,this.pos+1,new K(V.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 at(this.pos,t.marks[n]);return new at(this.pos,this.mark)}}return new lt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new at(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 at(t.pos,e.markFromJSON(t.mark))}}nt.jsonID("addNodeMark",at);class lt extends nt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return it.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return it.fromReplace(e,this.pos,this.pos+1,new K(V.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new at(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new lt(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 lt(t.pos,e.markFromJSON(t.mark))}}nt.jsonID("removeNodeMark",lt);class ct extends nt{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&ut(e,this.from,this.to)?it.fail("Structure replace would overwrite content"):it.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Qe([this.from,this.to-this.from,this.slice.size])}invert(e){return new ct(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 ct(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ct)||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?K.empty:new K(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ct(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?K.empty:new K(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ct(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 ct(t.from,t.to,K.fromJSON(e,t.slice),!!t.structure)}}nt.jsonID("replace",ct);class ht extends nt{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&&(ut(e,this.from,this.gapFrom)||ut(e,this.gapTo,this.to)))return it.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return it.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?it.fromReplace(e,this.from,this.to,n):it.fail("Content does not fit in gap")}getMap(){return new Qe([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 ht(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 ht(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 ht(t.from,t.to,t.gapFrom,t.gapTo,K.fromJSON(e,t.slice),t.insert,!!t.structure)}}function ut(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 dt(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 st(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 K(V.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new ct(a+e.index,a+e.index+e[0].length,t))}}else s.push(new ct(a,c,K.empty));a=c}if(!i.validEnd){let t=i.fillBefore(V.empty,!0);e.replace(a,a,new K(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function pt(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ft(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||!pt(o,s,a))break;s&&(i=1),a<o.childCount&&(r=1)}return null}function mt(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 gt(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 yt(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 vt(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 xt(e,t,n=t,i=K.empty){if(t==n&&!i.size)return null;let r=e.resolve(t),o=e.resolve(n);return bt(r,o,i)?new ct(t,n,i):new wt(r,o,i).fit()}function bt(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}nt.jsonID("replaceAround",ht);class wt{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=V.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=V.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 K(r,o,s);return e>-1?new ht(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new ct(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=zt(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(V.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=zt(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new K(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=zt(e,t);if(i.childCount<=1&&t>0){let r=e.size-t<=t+i.size;this.unplaced=new K(kt(e,t-1,1),t-1,r?t-1:n)}else this.unplaced=new K(kt(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(Ct(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=St(this.placed,t,V.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?K.empty:new K(kt(o.content,e-1,1),e-1,d<0?o.openEnd:e-1):new K(kt(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||!Mt(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=Mt(e,t,i,n,r);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:i}=this.frontier[n],r=Mt(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=St(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=St(this.placed,this.depth,V.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(V.empty,!0);e.childCount&&(this.placed=St(this.placed,this.frontier.length,e))}}function kt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(kt(e.firstChild.content,t-1,n)))}function St(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(St(e.lastChild.content,t-1,n)))}function zt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Ct(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,Ct(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(V.empty,!0)))),e.copy(i)}function Mt(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 Tt(e){return e.spec.defining||e.spec.definingForContent}function Nt(e,t,n,i,r){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(Nt(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(V.empty,!0))}return e}function Ot(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 Et extends nt{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 it.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 it.fromReplace(e,this.pos,this.pos+1,new K(V.from(i),0,t.isLeaf?0:1))}getMap(){return Qe.empty}invert(e){return new Et(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 Et(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 Et(t.pos,t.attr,t.value)}}nt.jsonID("attr",Et);class At extends nt{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 it.ok(n)}getMap(){return Qe.empty}invert(e){return new At(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 At(t.attr,t.value)}}nt.jsonID("docAttr",At);let jt=class extends Error{};jt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(jt.prototype=Object.create(Error.prototype)).constructor=jt,jt.prototype.name="TransformError";class Dt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new et}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new jt(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=K.empty){let i=xt(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new K(V.from(n),0,0))}delete(e,t){return this.replace(e,t,K.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(bt(r,o,i))return e.step(new ct(t,n,i));let s=Ot(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=Tt(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 K(Nt(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 K(V.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=Ot(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=V.empty,u=0;for(let e=o,t=!1;e>n;e--)t||i.index(e)>0?(t=!0,h=V.from(i.node(e).copy(h)),u++):l--;let d=V.empty,p=0;for(let e=o,t=!1;e>n;e--)t||r.after(e+1)<r.end(e)?(t=!0,d=V.from(r.node(e).copy(d)),p++):c++;e.step(new ht(l,c,s,a,new K(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);gt(e,i.node(),i.before(),a)}s.inlineContent&&dt(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 ct(c,l.map(t+n,-1),K.empty,!0)),!0===i){let t=e.doc.resolve(c);mt(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let i=V.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=V.from(n[e].type.create(n[e].attrs,i))}let r=t.start,o=t.end;e.step(new ht(r,o,r,o,new K(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&>(e,t,n,o),dt(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 ht(l,c,l+1,c-1,new K(V.from(i.create(s,null,t.marks)),0,0),1,!0)),!0===r&&mt(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 ht(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new K(V.from(s),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Et(e,t,n)),this}setDocAttribute(e,t){return this.step(new At(e,t)),this}addNodeMark(e,t){return this.step(new at(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 H)t.isInSet(n.marks)&&this.step(new lt(e,t));else{let i,r=n.marks,o=[];for(;i=t.isInSet(r);)o.push(new lt(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=V.empty,s=V.empty;for(let e=r.depth,t=r.depth-n,a=n-1;e>t;e--,a--){o=V.from(r.node(e).copy(o));let t=i&&i[a];s=V.from(t?t.type.create(t.attrs,s):r.node(e).copy(s))}e.step(new ct(t,t,new K(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 st(c,u,h[e])));o&&o.to==c?o.to=u:a.push(o=new ot(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 Ee){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 st(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return dt(this,e,t,n),this}}const Rt=Object.create(null);class It{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new qt(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=K.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?K.empty:t),0==s&&Ht(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),Ht(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new Lt(e):Jt(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?Jt(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):Jt(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 Wt(e.node(0))}static atStart(e){return Jt(e,e,0,0,1)||new Wt(e)}static atEnd(e){return Jt(e,e,e.content.size,e.childCount,-1)||new Wt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Rt[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 Rt)throw new RangeError("Duplicate use of selection JSON ID "+e);return Rt[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Lt.between(this.$anchor,this.$head).getBookmark()}}It.prototype.visible=!0;class qt{constructor(e,t){this.$from=e,this.$to=t}}let Pt=!1;function _t(e){Pt||e.parent.inlineContent||(Pt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Lt extends It{constructor(e,t=e){_t(e),_t(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 It.near(n);let i=e.resolve(t.map(this.anchor));return new Lt(i.parent.inlineContent?i:n,n)}replace(e,t=K.empty){if(super.replace(e,t),t==K.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Lt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Bt(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 Lt(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=It.findFrom(t,n,!0)||It.findFrom(t,-n,!0);if(!e)return It.near(t,n);t=e.$head}return e.parent.inlineContent||(0==i||(e=(It.findFrom(e,-n,!0)||It.findFrom(e,n,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new Lt(e,t)}}It.jsonID("text",Lt);class Bt{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Bt(e.map(this.anchor),e.map(this.head))}resolve(e){return Lt.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ft extends It{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?It.near(r):new Ft(r)}content(){return new K(V.from(this.node),0,0)}eq(e){return e instanceof Ft&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Vt(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ft(e.resolve(t.anchor))}static create(e,t){return new Ft(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Ft.prototype.visible=!1,It.jsonID("node",Ft);class Vt{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Bt(n,n):new Vt(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Ft.isSelectable(n)?new Ft(t):It.near(t)}}class Wt extends It{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=K.empty){if(t==K.empty){e.delete(0,e.doc.content.size);let t=It.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Wt(e)}map(e){return new Wt(e)}eq(e){return e instanceof Wt}getBookmark(){return $t}}It.jsonID("all",Wt);const $t={map(){return this},resolve:e=>new Wt(e)};function Jt(e,t,n,i,r,o=!1){if(t.inlineContent)return Lt.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&&Ft.isSelectable(i))return Ft.create(e,n-(r<0?i.nodeSize:0))}else{let t=Jt(e,i,n+r,r<0?i.childCount:0,r,o);if(t)return t}n+=i.nodeSize*r}return null}function Ht(e,t,n){let i=e.steps.length-1;if(i<t)return;let r,o=e.steps[i];(o instanceof ct||o instanceof ht)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(It.near(e.doc.resolve(r),n)))}class Ut extends Dt{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 H.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)||H.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(It.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 Kt(e,t){return t&&e?e.bind(t):e}class Gt{constructor(e,t,n){this.name=e,this.init=Kt(t.init,n),this.apply=Kt(t.apply,n)}}const Yt=[new Gt("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Gt("selection",{init:(e,t)=>e.selection||It.atStart(t.doc),apply:e=>e.selection}),new Gt("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,i)=>i.selection.$cursor?e.storedMarks:null}),new Gt("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Xt{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Yt.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 Gt(e.key,e.spec.state,e))})}}class Zt{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 Zt(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 Ut(this)}static create(e){let t=new Xt(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Zt(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 Xt(this.schema,e.plugins),n=t.fields,i=new Zt(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 Xt(e.schema,e.plugins),r=new Zt(i);return i.fields.forEach(i=>{if("doc"==i.name)r.doc=de.fromJSON(e.schema,t.doc);else if("selection"==i.name)r.selection=It.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 Qt(e,t,n){for(let i in e){let r=e[i];r instanceof Function?r=r.bind(t):"handleDOMEvents"==i&&(r=Qt(r,t,{})),n[i]=r}return n}class en{constructor(e){this.spec=e,this.props={},e.props&&Qt(e.props,this,this.props),this.key=e.key?e.key.key:nn("plugin")}getState(e){return e[this.key]}}const tn=Object.create(null);function nn(e){return e in tn?e+"$"+ ++tn[e]:(tn[e]=0,e+"$")}class rn{constructor(e="key"){this.key=nn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const on=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},sn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let an=null;const ln=function(e,t,n){let i=an||(an=document.createRange());return i.setEnd(e,null==n?e.nodeValue.length:n),i.setStart(e,t||0),i},cn=function(e,t,n,i){return n&&(un(e,t,n,i,-1)||un(e,t,n,i,1))},hn=/^(img|br|input|textarea|hr)$/i;function un(e,t,n,i,r){for(var o;;){if(e==n&&t==i)return!0;if(t==(r<0?0:dn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||pn(e)||hn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=on(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?dn(e):0}}}}function dn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function pn(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 fn=function(e){return e.focusNode&&cn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function mn(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const gn="undefined"!=typeof navigator?navigator:null,yn="undefined"!=typeof document?document:null,vn=gn&&gn.userAgent||"",xn=/Edge\/(\d+)/.exec(vn),bn=/MSIE \d/.exec(vn),wn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(vn),kn=!!(bn||wn||xn),Sn=bn?document.documentMode:wn?+wn[1]:xn?+xn[1]:0,zn=!kn&&/gecko\/(\d+)/i.test(vn);zn&&(/Firefox\/(\d+)/.exec(vn)||[0,0])[1];const Cn=!kn&&/Chrome\/(\d+)/.exec(vn),Mn=!!Cn,Tn=Cn?+Cn[1]:0,Nn=!kn&&!!gn&&/Apple Computer/.test(gn.vendor),On=Nn&&(/Mobile\/\w+/.test(vn)||!!gn&&gn.maxTouchPoints>2),En=On||!!gn&&/Mac/.test(gn.platform),An=!!gn&&/Win/.test(gn.platform),jn=/Android \d/.test(vn),Dn=!!yn&&"webkitFontSmoothing"in yn.documentElement.style,Rn=Dn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function In(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 qn(e,t){return"number"==typeof e?e:e[t]}function Pn(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 _n(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=sn(s);continue}let e=s,n=e==o.body,a=n?In(o):Pn(e),l=0,c=0;if(t.top<a.top+qn(i,"top")?c=-(a.top-t.top+qn(r,"top")):t.bottom>a.bottom-qn(i,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+qn(r,"top")-a.top:t.bottom-a.bottom+qn(r,"bottom")),t.left<a.left+qn(i,"left")?l=-(a.left-t.left+qn(r,"left")):t.right>a.right-qn(i,"right")&&(l=t.right-a.right+qn(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:sn(s)}}function Ln(e){let t=[],n=e.ownerDocument;for(let i=e;i&&(t.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),e!=n);i=sn(i));return t}function Bn(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 Fn=null;function Vn(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=ln(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=Un(r,1);if(i.top!=i.bottom&&Wn(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}:Vn(n,i)}function Wn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function $n(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(Wn(t,r))return $n(n,t,r)}}if((o=(o+1)%i)==r)break}return e}function Jn(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(dn(i.offsetNode),i.offset)}}catch(e){}if(e.caretRangeFromPoint){let i=e.caretRangeFromPoint(t,n);if(i)return{node:i.startContainer,offset:Math.min(dn(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(!Wn(t,n))return null;if(a=$n(e.dom,t,n),!a)return null}if(Nn)for(let e=a;n&&e;e=sn(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(zn&&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;Dn&&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}=Vn(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 Hn(e){return e.top<e.bottom||e.left<e.right}function Un(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Hn(e))return e}return Array.prototype.find.call(n,Hn)||e.getBoundingClientRect()}const Kn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Gn(e,t,n){let{node:i,offset:r,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=Dn||zn;if(3==i.nodeType){if(!s||!Kn.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++,Yn(Un(ln(i,e,t),o),o<0)}{let e=Un(ln(i,r,r),n);if(zn&&r&&/\s/.test(i.nodeValue[r-1])&&r<i.nodeValue.length){let t=Un(ln(i,r-1,r-1),-1);if(t.top==e.top){let n=Un(ln(i,r,r+1),-1);if(n.top!=e.top)return Yn(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&r&&(n<0||r==dn(i))){let e=i.childNodes[r-1];if(1==e.nodeType)return Xn(e.getBoundingClientRect(),!1)}if(null==o&&r<dn(i)){let e=i.childNodes[r];if(1==e.nodeType)return Xn(e.getBoundingClientRect(),!0)}return Xn(i.getBoundingClientRect(),n>=0)}if(null==o&&r&&(n<0||r==dn(i))){let e=i.childNodes[r-1],t=3==e.nodeType?ln(e,dn(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Yn(Un(t,1),!1)}if(null==o&&r<dn(i)){let e=i.childNodes[r];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?ln(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Yn(Un(t,-1),!0)}return Yn(Un(3==i.nodeType?ln(i):i,-n),n>=0)}function Yn(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 Xn(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 Zn(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 Qn=/[\u0590-\u08ac]/;let ei=null,ti=null,ni=!1;function ii(e,t,n){return ei==t&&ti==n?ni:(ei=t,ti=n,ni="up"==n||"down"==n?function(e,t,n){let i=t.selection,r="up"==n?i.$from:i.$to;return Zn(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=Gn(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=ln(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?Qn.test(i.parent.textContent)&&a.modify?Zn(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 ri{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>on(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 ui){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 oi&&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?on(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?on(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=on(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=on(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((zn||Nn)&&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:on(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(zn&&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&&Nn)&&cn(s.node,s.offset,c.anchorNode,c.anchorOffset)&&cn(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((l.extend||e==t)&&(!h||!zn)){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 oi extends ri{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 si extends ri{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 ai extends ri{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=We.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new ai(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=ai.create(this.parent,this.mark,!0,n),r=this.children,o=this.size;t<o&&(r=zi(r,t,o,n)),e>0&&(r=zi(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 li extends ri{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=We.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=xi(c,n,t),l?s=new di(e,t,n,i,c,h||null,u,l,r,o+1):t.isText?new hi(e,t,n,i,c,u,r):new li(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=()=>V.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)&&bi(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 ki(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(Si);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?H.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),pi(this.contentDOM,this.children,e),On&&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 Lt)||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 si(this,r,t,i);e.input.compositionNodes.push(o),this.children=zi(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(bi(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=yi(this.dom,this.nodeDOM,gi(this.outerDeco,this.node,t),gi(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 ci(e,t,n,i,r){xi(i,t,e);let o=new li(void 0,e,t,n,i,i,i,r,0);return o.contentDOM&&o.updateChildren(r,0),o}class hi extends li{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 hi(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 ui extends ri{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 di extends li{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 pi(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=wi(i),r=!0;i=i.nextSibling}else r=!0,e.insertBefore(a,i);if(s instanceof ai){let t=i?i.previousSibling:e.lastChild;pi(s.contentDOM,s.children,n),i=t?t.nextSibling:e.firstChild}}for(;i;)i=wi(i),r=!0;r&&n.trackWrites==e&&(n.trackWrites=null)}const fi=function(e){e&&(this.nodeName=e)};fi.prototype=Object.create(null);const mi=[new fi];function gi(e,t,n){if(0==e.length)return mi;let i=n?mi[0]:new fi,r=[i];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&r.push(i=new fi(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==r.length&&r.push(i=new fi(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 yi(e,t,n,i){if(n==mi&&i==mi)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=mi[0]),r=t}vi(r,s||mi[0],o)}return r}function vi(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 xi(e,t,n){return yi(e,e,mi,gi(t,n,1!=e.nodeType))}function bi(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 wi(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ki{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 ai)){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=ai.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 li){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&&bi(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)||!bi(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let s=li.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=li.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 oi(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 ai;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof hi)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Nn||Mn)&&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 ui(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 Si(e,t){return e.type.side-t.type.side}function zi(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 Ci(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(fn(n)){for(a=s;r&&!r.node;)r=r.parent;let e=r.node;if(r&&e.isAtom&&Ft.isSelectable(e)&&r.parent&&(!e.isInline||!function(e,t,n){for(let i=0==t,r=t==dn(e);i||r;){if(e==n)return!0;let t=on(e);if(!(e=e.parentNode))return!1;i=i&&0==t,r=r&&t==dn(e)}}(n.focusNode,n.focusOffset,r.dom))){let e=r.posBefore;l=new Ft(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=Ri(e,h,c,"pointer"==t||e.state.selection.head<c.pos&&!o?1:-1)}return l}function Mi(e){return e.editable?e.hasFocus():qi(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ti(e,t=!1){let n=e.state.selection;if(ji(e,n),Mi(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Mn){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&cn(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,on(n)+1):t.collapse(n,0);!i&&!e.state.selection.visible&&kn&&Sn<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let i,r,{anchor:o,head:s}=n;!Ni||n instanceof Lt||(n.$from.parent.inlineContent||(i=Oi(e,n.from)),n.empty||n.$from.parent.inlineContent||(r=Oi(e,n.to))),e.docView.setSelection(o,s,e,t),Ni&&(i&&Ai(i),r&&Ai(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(()=>{Mi(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ni=Nn||Mn&&Tn<63;function Oi(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(Nn&&r&&"false"==r.contentEditable)return Ei(r);if(!(r&&"false"!=r.contentEditable||o&&"false"!=o.contentEditable)){if(r)return Ei(r);if(o)return Ei(o)}}function Ei(e){return e.contentEditable="true",Nn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ai(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ji(e,t){if(t instanceof Ft){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Di(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Di(e)}function Di(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Ri(e,t,n,i){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Lt.between(t,n,i)}function Ii(e){return!(e.editable&&!e.hasFocus())&&qi(e)}function qi(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 Pi(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&&It.findFrom(o,t)}function _i(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Li(e,t,n){let i=e.state.selection;if(!(i instanceof Lt)){if(i instanceof Ft&&i.node.isInline)return _i(e,new Lt(t>0?i.$to:i.$from));{let n=Pi(e.state,t);return!!n&&_i(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 _i(e,new Lt(i.$anchor,o))}if(!i.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Pi(e.state,t);return!!(n&&n instanceof Ft)&&_i(e,n)}if(!(En&&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)&&(Ft.isSelectable(o)?_i(e,new Ft(t<0?e.state.doc.resolve(r.pos-o.nodeSize):r)):!!Dn&&_i(e,new Lt(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function Bi(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Fi(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function Vi(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;zn&&1==n.nodeType&&i<Bi(n)&&Fi(n.childNodes[i],-1)&&(s=!0);for(;;)if(i>0){if(1!=n.nodeType)break;{let e=n.childNodes[i-1];if(Fi(e,-1))r=n,o=--i;else{if(3!=e.nodeType)break;n=e,i=n.nodeValue.length}}}else{if(Wi(n))break;{let t=n.previousSibling;for(;t&&Fi(t,-1);)r=n.parentNode,o=on(t),t=t.previousSibling;if(t)n=t,i=Bi(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}s?$i(e,n,i):r&&$i(e,r,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,o,s=Bi(n);for(;;)if(i<s){if(1!=n.nodeType)break;if(!Fi(n.childNodes[i],1))break;r=n,o=++i}else{if(Wi(n))break;{let t=n.nextSibling;for(;t&&Fi(t,1);)r=t.parentNode,o=on(t)+1,t=t.nextSibling;if(t)n=t,i=0,s=Bi(n);else{if(n=n.parentNode,n==e.dom)break;i=s=0}}}r&&$i(e,r,o)}(e)}function Wi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function $i(e,t,n){if(3!=t.nodeType){let e,i;(i=function(e,t){for(;e&&t==e.childNodes.length&&!pn(e);)t=on(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&&!pn(e);)t=on(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(fn(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&&Ti(e)},50)}function Ji(e,t){let n=e.state.doc.resolve(t);if(!Mn&&!An&&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 Hi(e,t,n){let i=e.state.selection;if(i instanceof Lt&&!i.empty||n.indexOf("s")>-1)return!1;if(En&&n.indexOf("m")>-1)return!1;let{$from:r,$to:o}=i;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Pi(e.state,t);if(n&&n instanceof Ft)return _i(e,n)}if(!r.parent.inlineContent){let n=t<0?r:o,s=i instanceof Wt?It.near(n,t):It.findFrom(n,t);return!!s&&_i(e,s)}return!1}function Ui(e,t){if(!(e.state.selection instanceof Lt))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 Ki(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Gi(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||En&&72==n&&"c"==i)return Ui(e,-1)||Vi(e,-1);if(46==n&&!t.shiftKey||En&&68==n&&"c"==i)return Ui(e,1)||Vi(e,1);if(13==n||27==n)return!0;if(37==n||En&&66==n&&"c"==i){let t=37==n?"ltr"==Ji(e,e.state.selection.from)?-1:1:-1;return Li(e,t,i)||Vi(e,t)}if(39==n||En&&70==n&&"c"==i){let t=39==n?"ltr"==Ji(e,e.state.selection.from)?1:-1:1;return Li(e,t,i)||Vi(e,t)}return 38==n||En&&80==n&&"c"==i?Hi(e,-1,i)||Vi(e,-1):40==n||En&&78==n&&"c"==i?function(e){if(!Nn||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;Ki(e,n,"true"),setTimeout(()=>Ki(e,n,"false"),20)}return!1}(e)||Hi(e,1,i)||Vi(e,1):i==(En?"m":"c")&&(66==n||73==n||89==n||90==n)}function Yi(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")||We.fromSchema(e.state.schema),a=sr(),l=a.createElement("div");l.appendChild(s.serializeFragment(i,{document:a}));let c,h=l.firstChild,u=0;for(;h&&1==h.nodeType&&(c=rr[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 Xi(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 K(V.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=We.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=sr().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e);(n=r&&rr[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;ar||(ar=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return ar.createHTML(e)}(e),n)for(let e=0;e<n.length;e++)i=i.querySelector(n[e])||i;return i}(n),Dn&&function(e){let t=e.querySelectorAll(Mn?"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")||De.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!h),context:r,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Zi.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=V.from(t.create(n[e+1],r)),o++,s++}return new K(r,o,s)}(ir(s,+h[1],+h[2]),h[4]);else if(s=K.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&&er(n,i,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=tr(o[o.length-1],i.length));let t=Qi(e,n);o.push(t),r=r.matchType(t.type),i=n}}),o)return V.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=ir(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,l)}),s}const Zi=/^(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 Qi(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,V.from(e));return e}function er(e,t,n,i,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let o=er(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(V.from(Qi(n,e,r+1))))}}function tr(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,tr(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(V.empty,!0);return e.copy(n.append(i))}function nr(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=nr(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(V.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function ir(e,t,n){return t<e.openStart&&(e=new K(nr(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new K(nr(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const rr={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 or=null;function sr(){return or||(or=document.implementation.createHTMLDocument("title"))}let ar=null;const lr={},cr={},hr={touchstart:!0,touchmove:!0};class ur{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 dr(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function pr(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>fr(e,t))})}function fr(e,t){return e.someProp("handleDOMEvents",n=>{let i=n[t.type];return!!i&&(i(e,t)||t.defaultPrevented)})}function mr(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 gr(e){return{left:e.clientX,top:e.clientY}}function yr(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 vr(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 xr(e,t,n,i,r){return yr(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 Ft&&(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(Ft.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&&(vr(e,Ft.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&&Ft.isSelectable(i))&&(vr(e,new Ft(n)),!0)}(e,n))}function br(e,t,n,i){return yr(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",n=>n(e,t,i))}function wr(e,t,n,i){return yr(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&&(vr(e,Lt.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)vr(e,Lt.create(i,o+1,o+1+n.content.size));else{if(!Ft.isSelectable(n))continue;vr(e,Ft.create(i,o))}return!0}}(e,n,i)}function kr(e){return Er(e)}cr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Cr(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!jn||!Mn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!On||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||Gi(e,n)?n.preventDefault():dr(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,mn(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},cr.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},cr.keypress=(e,t)=>{let n=t;if(Cr(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||En&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof Lt&&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 Sr=En?"metaKey":"ctrlKey";lr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=kr(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[Sr]&&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(gr(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new zr(e,s,n,!!i)):("doubleClick"==o?br:wr)(e,s.pos,s.inside,n)?n.preventDefault():dr(e,"pointer"))};class zr{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[Sr],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 Ft&&l.from<=o&&l.to>o)&&(this.mightDrag={node:r,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!zn||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)),dr(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(()=>Ti(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(gr(e))),this.updateAllowDefault(e),this.allowDefault||!t?dr(this.view,"pointer"):xr(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Nn&&this.mightDrag&&!this.mightDrag.node.isAtom||Mn&&!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)?(vr(this.view,It.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):dr(this.view,"pointer")}move(e){this.updateAllowDefault(e),dr(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 Cr(e,t){return!!e.composing||!!(Nn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}lr.touchstart=e=>{e.input.lastTouch=Date.now(),kr(e),dr(e,"pointer")},lr.touchmove=e=>{e.input.lastTouch=Date.now(),dr(e,"pointer")},lr.contextmenu=e=>kr(e);const Mr=jn?5e3:-1;function Tr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Er(e),t))}function Nr(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 Or(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=dn(e=e.childNodes[t-1])}else{if(!e.parentNode||pn(e))return null;t=on(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||pn(e))return null;t=on(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 Er(e,t=!1){if(!(jn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Nr(e),t||e.docView&&e.docView.dirty){let n=Ci(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}}cr.compositionstart=cr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Lt&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||Mn&&An&&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(),Er(e,!0),e.markCursor=null;else if(Er(e,!t.selection.empty),zn&&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}Tr(e,Mr)},cr.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++,Tr(e,20))};const Ar=kn&&Sn<15||On&&Rn<604;function jr(e,t,n,i,r){let o=Xi(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,r,o||K.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 Dr(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," "):""}lr.copy=cr.cut=(e,t)=>{let n=t,i=e.state.selection,r="cut"==n.type;if(i.empty)return;let o=Ar?null:n.clipboardData,s=i.content(),{dom:a,text:l}=Yi(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"))},cr.paste=(e,t)=>{let n=t;if(e.composing&&!jn)return;let i=Ar?null:n.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;i&&jr(e,Dr(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?jr(e,i.value,null,r,t):jr(e,i.textContent,i.innerHTML,r,t)},50)}(e,n)};class Rr{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const Ir=En?"altKey":"ctrlKey";function qr(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[Ir]}lr.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(gr(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof Ft?o.to-1:o.to));else if(i&&i.mightDrag)r=Ft.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=Ft.create(e.state.doc,t.posBefore))}let a=(r||e.state.selection).content(),{dom:l,text:c,slice:h}=Yi(e,a);(!n.dataTransfer.files.length||!Mn||Tn>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ar?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ar||n.dataTransfer.setData("text/plain",c),e.dragging=new Rr(h,qr(e,n),r)},lr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},cr.dragover=cr.dragenter=(e,t)=>t.preventDefault(),cr.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(gr(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=Xi(e,Dr(t.dataTransfer),Ar?null:t.dataTransfer.getData("text/html"),!1,r);let s=!(!n||!qr(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||K.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&&Ft.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new Ft(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(Ri(e,d,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},lr.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())&&Ti(e)},20))},lr.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)},lr.beforeinput=(e,t)=>{if(Mn&&jn&&"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,mn(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 cr)lr[e]=cr[e];function Pr(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 _r{constructor(e,t){this.toDOM=e,this.spec=t||Wr,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 Fr(r-n,r-n,this)}valid(){return!0}eq(e){return this==e||e instanceof _r&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Pr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Lr{constructor(e,t){this.attrs=e,this.spec=t||Wr}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 Fr(r,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Lr&&Pr(this.attrs,e.attrs)&&Pr(this.spec,e.spec)}static is(e){return e.type instanceof Lr}destroy(){}}class Br{constructor(e,t){this.attrs=e,this.spec=t||Wr}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 Fr(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 Br&&Pr(this.attrs,e.attrs)&&Pr(this.spec,e.spec)}destroy(){}}class Fr{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Fr(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 Fr(e,e,new _r(t,n))}static inline(e,t,n,i){return new Fr(e,t,new Lr(n,i))}static node(e,t,n,i){return new Fr(e,t,new Br(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Lr}get widget(){return this.type instanceof _r}}const Vr=[],Wr={};class $r{constructor(e,t){this.local=e.length?e:Vr,this.children=t.length?t:Vr}static create(e,t){return t.length?Yr(t,e,0,Wr):Jr}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==Jr||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Wr)}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!=Jr?(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=Yr(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 $r(t.sort(Xr),a)}(this.children,o||[],e,t,n,i,r):o?new $r(o.sort(Xr),Vr):Jr}add(e,t){return t.length?this==Jr?$r.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=Kr(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,Yr(s,e,a+1,Wr)),r+=3}});let o=Ur(r?Gr(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new $r(o.length?this.local.concat(o).sort(Xr):this.local,i||this.children)}remove(e){return 0==e.length||this==Jr?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!=Jr?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 $r(i,n):Jr}forChild(e,t){if(this==Jr)return this;if(t.isLeaf)return $r.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 Lr){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 $r(i.sort(Xr),Vr);return n?new Hr([e,n]):e}return n||Jr}eq(e){if(this==e)return!0;if(!(e instanceof $r)||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 Zr(this.localsInner(e))}localsInner(e){if(this==Jr)return Vr;if(e.inlineContent||!this.local.some(Lr.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Lr||t.push(this.local[e]);return t}forEachSet(e){e(this)}}$r.empty=new $r([],[]),$r.removeOverlap=Zr;const Jr=$r.empty;class Hr{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,Wr));return Hr.from(n)}forChild(e,t){if(t.isLeaf)return $r.empty;let n=[];for(let i=0;i<this.members.length;i++){let r=this.members[i].forChild(e,t);r!=Jr&&(r instanceof Hr?n=n.concat(r.members):n.push(r))}return Hr.from(n)}eq(e){if(!(e instanceof Hr)||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?Zr(n?t:t.sort(Xr)):Vr}static from(e){switch(e.length){case 0:return Jr;case 1:return e[0];default:return new Hr(e.every(e=>e instanceof $r)?e:e.reduce((e,t)=>e.concat(t instanceof $r?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Ur(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 Fr(r.from+t,r.to+t,r.type))}return n}function Kr(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 Gr(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Yr(e,t,n,i){let r=[],o=!1;t.forEach((t,s)=>{let a=Kr(e,t,s+n);if(a){o=!0;let e=Yr(a,t,n+s+1,i);e!=Jr&&r.push(s,s+t.nodeSize,e)}});let s=Ur(o?Gr(e):e,-n).sort(Xr);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 $r(s,r):Jr}function Xr(e,t){return e.from-t.from||e.to-t.to}function Zr(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),Qr(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),Qr(t,r+1,o.copy(i.to,o.to)))}}return t}function Qr(e,t,n){for(;t<e.length&&Xr(n,e[t])>0;)t++;e.splice(t,0,n)}function eo(e){let t=[];return e.someProp("decorations",n=>{let i=n(e.state);i&&i!=Jr&&t.push(i)}),e.cursorWrapper&&t.push($r.create(e.state.doc,[e.cursorWrapper.deco])),Hr.from(t)}const to={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},no=kn&&Sn<=11;class io{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 ro{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new io,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]);kn&&Sn<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Nn&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),no&&(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,to)),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(Ii(this.view)){if(this.suppressingSelectionUpdates)return Ti(this.view);if(kn&&Sn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&cn(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=sn(t))n.add(t);for(let i=e.anchorNode;i;i=sn(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)&&Ii(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(zn&&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&&lo(e,n)==t||i.remove()}}}else if((Mn||Nn)&&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&&fn(n)&&(l=Ci(e))&&l.eq(It.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ti(e),this.currentSelection.set(n),e.scrollToSelection()):(r>-1||i)&&(r>-1&&(e.docView.markDirty(r,o),function(e){if(oo.has(e))return;if(oo.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=zn,so)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."),so=!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)||Ti(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(kn&&Sn<=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?on(i)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=r&&r.parentNode==e.target?on(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 oo=new WeakMap,so=!1;function ao(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return cn(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}function lo(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 co(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Nn&&/^(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||Nn&&/^(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 ho=/^(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 uo(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=Ci(e,t);if(n&&!e.state.selection.eq(n)){if(Mn&&jn&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,mn(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}],fn(c)||i.push({node:c.focusNode,offset:c.focusOffset})),Mn&&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")||De.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:co,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&&mo(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&&mo(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++,(On&&e.input.lastIOSEnter>Date.now()-225||jn)&&r.some(e=>1==e.nodeType&&!ho.test(e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",t=>t(e,mn(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!f){if(!(i&&h instanceof Lt&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=po(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 Lt&&(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)),kn&&Sn<=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((On&&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,mn(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||fo(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(fo(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||fo(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,mn(8,"Backspace"))))return void(jn&&Mn&&e.domObserver.suppressSelectionUpdates());Mn&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),jn&&!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,mn(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=po(e,n.doc,u.sel);t&&!(Mn&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==b||t.head==n.mapping.map(w)-1)||kn&&t.empty&&t.head==b)&&n.setSelection(t)}return o&&n.setMeta("composition",o),n.scrollIntoView()};if(v)if(m.pos==g.pos){kn&&Sn<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ti(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(V.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 po(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Ri(e,t.resolve(n.anchor),t.resolve(n.head))}function fo(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 mo(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 go{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 ur,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(wo),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=xo(this),vo(this),this.nodeViews=bo(this),this.docView=ci(this.state.doc,yo(this),eo(this),this.dom,this),this.domObserver=new ro(this,(e,t,n,i)=>uo(this,e,t,n,i)),this.domObserver.start(),function(e){for(let t in lr){let n=lr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!mr(e,t)||fr(e,t)||!e.editable&&t.type in cr||n(e,t)},hr[t]?{passive:!0}:void 0)}Nn&&e.dom.addEventListener("input",()=>null),pr(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&&pr(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(wo),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&&(Nr(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=bo(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)&&pr(this),this.editable=xo(this),vo(this);let a=eo(this),l=yo(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:Ln(e.dom)}}(this);if(o){this.domObserver.stop();let t=h&&(kn||Mn)&&!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=Mn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Or(this)),!r&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=ci(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 cn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Ti(this,t):(ji(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;Bn(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 Ft){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&_n(this,t.getBoundingClientRect(),e)}else _n(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 Rr(e.slice,e.move,i<0?void 0:Ft.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(kn){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(Fn)return e.focus(Fn);let t=Ln(e);e.focus(null==Fn?{get preventScroll(){return Fn={preventScroll:!0},!0}}:void 0),Fn||(Fn=!1,Bn(t,0))}(this.dom),Ti(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 Jn(this,e)}coordsAtPos(e,t=1){return Gn(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 ii(this,t||this.state,e)}pasteHTML(e,t){return jr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return jr(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Yi(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,[],eo(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,an=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){fr(e,t)||!lr[t.type]||!e.editable&&t.type in cr||lr[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?Nn&&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 ao(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?ao(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function yo(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"),[Fr.node(0,e.state.doc.content.size,t)]}function vo(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:Fr.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function xo(e){return!e.someProp("editable",t=>!1===t(e.state))}function bo(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 wo(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 ko;go.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};var So="ssml-editor-focused",zo="ssml-tag",Co="ssml-text-mark",Mo="ssml-editor-phoneme__char",To="ssml-editor-number-tip__char",No="ssml-editor-text-media__mark",Oo="preventFloatingMenu",Eo=(a(a(a(a(a(a(a(a(a(a(ko={},S.Word,"连读"),S.Breath,"换气"),S.Break,"停顿"),S.Phoneme,"多音字"),S.Speaker,"发音人"),S.SpeechRate,"语速"),S.SpeechPitch,"语调"),S.SpeechVolume,"音量"),S.SpeechLanguage,"语种"),S.Action,"动作"),a(a(a(a(a(a(a(ko,S.Avatar,"主播"),S.Emotion,"表情"),S.SayAs,a(a(a(a(a(a({},z.auto,"自动"),z.digits,"读数字"),z.cardinal,"读数值"),0,"自动"),1,"读数字"),2,"读数值")),S.Command,"指令"),S.Wait,"等待"),S.PptControl,"PPT控制"),S.SoundEvent,"音效")),Ao=a(a(a({},S.Word,"[w0]"),S.Breath,"[w3]"),S.SayAs,a(a(a({},z.auto,"[n0]"),z.digits,"[n1]"),z.cardinal,"[n2]")),jo=function(){function e(){r(this,e),a(this,"nodes",{}),a(this,"marks",{}),a(this,"plugins",{})}return s(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 p({},this.nodes)}},{key:"getMarks",value:function(){return p({},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 en?t:t(e)})}},{key:"clone",value:function(){var t=new e;return Object.entries(this.nodes).forEach(function(e){var n=y(e,2),i=n[0],r=n[1];return t.registerNode(i,r)}),Object.entries(this.marks).forEach(function(e){var n=y(e,2),i=n[0],r=n[1];return t.registerMark(i,r)}),Object.entries(this.plugins).forEach(function(e){var n=y(e,2),i=n[0],r=n[1];return t.registerPlugin(i,r)}),t}}])}(),Do=new jo,Ro="highlight";var Io=new en({key:new rn(Ro),state:{init:function(){return $r.empty},apply:function(e,t,n,i){var r=e.getMeta(Ro);return null!=r&&r.active?function(e,t,n){var i=[];return i.push(Fr.inline(t,n,{class:"ssml-text-highlight"})),$r.create(e,i)}(i.doc,r.from,r.to):!1===(null==r?void 0:r.active)?$r.empty:t.map(e.mapping,e.doc)}},props:{decorations:function(e){return this.getState(e)}}});Do.registerPlugin(Ro,Io);var qo={highlight:"highlight",clearHighlight:"clearHighlight"};q({name:qo.highlight,description:"高亮",execute:function(e,t){var n=e.state,i=e.dispatch;return i&&i(n.tr.setMeta(Ro,t)),{success:!0}},validate:function(e){return{available:!0}}}),q({name:qo.clearHighlight,description:"清除高亮",execute:function(e){var t=e.state,n=e.dispatch;return n&&n(t.tr.setMeta(Ro,{from:0,to:0,active:!1})),{success:!0}},validate:function(e){return{available:!0}}});var Po=200,_o=function(){};_o.prototype.append=function(e){return e.length?(e=_o.from(e),!this.length&&e||e.length<Po&&this.leafAppend(e)||this.length<Po&&e.leafPrepend(this)||this.appendInner(e)):this},_o.prototype.prepend=function(e){return e.length?_o.from(e).append(this):this},_o.prototype.appendInner=function(e){return new Bo(this,e)},_o.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?_o.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},_o.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},_o.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)},_o.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},_o.from=function(e){return e instanceof _o?e:e&&e.length?new Lo(e):_o.empty};var Lo=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<=Po)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Po)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}(_o);_o.empty=new Lo([]);var Bo=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}(_o);class Fo{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 Vo(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 Vo(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 Fo(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 Vo(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>$o&&(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 Fo(s.append(r),o)}remapping(e,t){let n=new et;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 Fo(this.items.append(e.map(e=>new Vo(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 Vo(l,o,c))}else n.push(new Vo(l))},i);let l=[];for(let e=t;e<o;e++)l.push(new Vo(r.maps[e]));let c=this.items.slice(0,i).append(l).append(n),h=new Fo(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 Vo(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 Fo(_o.from(i.reverse()),r)}}Fo.empty=new Fo(_o.empty,0);class Vo{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 Vo(t.getMap().invert(),t,this.selection)}}}class Wo{constructor(e,t,n,i,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=r}}const $o=20;function Jo(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 Ho(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 Uo=!1,Ko=null;function Go(e){let t=e.plugins;if(Ko!=t){Uo=!1,Ko=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Uo=!0;break}}return Uo}const Yo=new rn("history"),Xo=new rn("closeHistory");function Zo(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new en({key:Yo,state:{init:()=>new Wo(Fo.empty,Fo.empty,null,0,-1),apply:(t,n,i)=>function(e,t,n,i){let r,o=n.getMeta(Yo);if(o)return o.historyState;n.getMeta(Xo)&&(e=new Wo(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Yo))return s.getMeta(Yo).redo?new Wo(e.done.addTransform(n,void 0,i,Go(t)),e.undone,Jo(n.mapping.maps),e.prevTime,e.prevComposition):new Wo(e.done,e.undone.addTransform(n,void 0,i,Go(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new Wo(e.done.rebased(n,r),e.undone.rebased(n,r),Ho(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Wo(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Ho(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?Ho(e.prevRanges,n.mapping):Jo(n.mapping.maps);return new Wo(e.done.addTransform(n,o?t.selection.getBookmark():void 0,i,Go(t)),Fo.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?es:"historyRedo"==n?ts:null;return!(!i||!e.editable)&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}function Qo(e,t){return(n,i)=>{let r=Yo.getState(n);if(!r||0==(e?r.undone:r.done).eventCount)return!1;if(i){let o=function(e,t,n){let i=Go(t),r=Yo.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 Wo(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Yo,{redo:n,historyState:l})}(r,n,e);o&&i(t?o.scrollIntoView():o)}return!0}}const es=Qo(!1,!0),ts=Qo(!0,!0);var ns={undo:"undo",redo:"redo",clear:"clear"};q({name:ns.undo,description:"撤销",execute:function(e){var t=e.state,n=e.dispatch;return n&&es(t,n),{success:!0}},validate:function(e){return function(e){let t=Yo.getState(e);return t?t.done.eventCount:0}(e.state)<=0?{available:!1,reason:"历史栈为空"}:{available:!0}}}),q({name:ns.clear,description:"清空历史栈",execute:function(e){var t=e.state,n=e.view,i=e.editor,r=Zo(),o=Zt.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}}}),q({name:ns.redo,description:"重做",execute:function(e){var t=e.state,n=e.dispatch;return n&&ts(t,n),{success:!0}},validate:function(e){return function(e){let t=Yo.getState(e);return t?t.undone.eventCount:0}(e.state)<=0?{available:!1,reason:"重做栈为空"}:{available:!0}}});var is={inputText:"inputText",replaceRange:"replaceRange"};q({name:is.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 K(V.from(u),1,1),p=(h=h.replace(a,a,d)).mapping.map(a,1);return h.setSelection(Lt.near(h.doc.resolve(p))),i(h.scrollIntoView()),{success:!0}}return{success:!1,code:_.ParamsMissing,reason:"缺少内容"}},validate:function(e){return{available:!0}}}),q({name:is.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 K(V.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(Lt.near(f.doc.resolve(m))),i(f.scrollIntoView()),{success:!0}}return{success:!1,code:_.ParamsMissing,reason:"参数缺失"}},validate:function(e){return{available:!0}}});var rs={insertPptControl:"insertPptControl"};q({name:rs.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[S.PptControl].create(p(p({},n),{},{type:S.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[S.PptControl])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"文本光标处插入Ppt控制"}}});var ss={insertSoundEvent:"insertSoundEvent"};q({name:ss.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[S.SoundEvent].create(p(p({},i),{},{type:S.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[S.SoundEvent])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"当前位置无法插入音效节点"}}});var as={insertCommand:"insertCommand"};q({name:as.insertCommand,description:"插入指令",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Command].create(p(p({},n),{},{type:S.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[S.Command])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"文本光标处插入指令"}}});var ls={insertData:"insertData"};q({name:ls.insertData,description:"插入数据",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Data].create(p(p({},n),{},{type:S.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[S.Data])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"文本光标处插入数据槽位"}}});var cs={insertWait:"insertWait"};q({name:cs.insertWait,description:"插入等待",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Wait].create(p(p({},n),{},{type:S.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[S.Wait])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"文本光标处插入等待"}}});var hs={insertBreak:"insertBreak"};q({name:hs.insertBreak,description:"插入停顿节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Break].create(p(p({},n),{},{type:S.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[S.Break])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"光标插入文本设置停顿时长"}}});var us={insertBreath:"insertBreath"};q({name:us.insertBreath,description:"插入换气节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Breath].create(p(p({},n),{},{type:S.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[S.Breath])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"光标插入文本设置换气"}}});var ds={"的":["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ā"]},ps="editor-popover",fs=function(){return s(function e(){var t=this;r(this,e),a(this,"tooltip",null),a(this,"root",null),a(this,"popoverController",null),a(this,"clickEvent",function(e){var n;null!==(n=e.target)&&void 0!==n&&n.closest(".".concat(ps))||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(ps),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=p({},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=f().m(function e(t,n,i){var r,o=this;return f().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)}),t=function(){var t=this,i=arguments;return new Promise(function(r,o){var s=e.apply(t,i);function a(e){n(s,r,o,a,l,"next",e)}function l(e){n(s,r,o,a,l,"throw",e)}a(void 0)})},function(e,n,i){return t.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,t}(),ms=new fs,gs={"ā":"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 ys=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 vs(e){return e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}function xs(e){return e?e.replace(/'/g,"'").replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&"):""}function bs(e){return e.replace(/\u200b/g,"")}var ws=new rn("polyphoneTip");function ks(e,t){var n=document.createElement("div");return n.classList.add("ssml-editor-phoneme__list"),[].concat(v(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),gs[e]||e}))+t}(e)),t.textContent=e||"移除",n.appendChild(t)}),n}var Ss=new en({key:ws,state:{init:function(){return{active:!1,decorations:$r.empty}},apply:function(e,t,n,i){var r,o=e.getMeta(ws),s=null!==(r=null==o?void 0:o.active)&&void 0!==r?r:t.active,a=$r.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=ys(4);n.push(Fr.inline(r+o,r+o+1,{class:Mo,"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===S.Phoneme&&(o=e.attrs.text,t[o]&&i({pos:n,index:0,char:o}))}),$r.create(e,n)}(i.doc,ds):t.decorations.map(e.mapping,e.doc)),p(p({},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=Ss.getState(e.state),r=n.target,o=r.closest(".".concat(Mo)),s=r.closest('[data-type="'.concat(S.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!==S.Phoneme)return!1;a=m.attrs.text,l=f.pos,c=f.pos+m.nodeSize}var g=ks(ds[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(Lt.create(e.state.doc,l,c));s=o?s.replaceSelectionWith(e.state.schema.nodes[S.Phoneme].create({value:o,text:a})):s.replaceSelectionWith(e.state.schema.text(a)),e.dispatch(s.setSelection(Lt.near(s.doc.resolve(l)))),ms.hide()}};return g.addEventListener("click",y),ms.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(Lt.create(e.state.doc,l,c)).setMeta(Oo,!0)),!0}}});Do.registerPlugin("phoneme",Ss);var zs={switchPhonemeMode:"switchPhonemeMode",insertPhoneme:"insertPhoneme"};q({name:zs.switchPhonemeMode,description:"切换多音字模式",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r&&r(i.tr.setMeta(ws,{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 Cs=/^[+-]?(?!0\d)\d{1,3}(?:,\d{3})*(?:\.\d+)?$|^[+-]?\d+(?:\.\d+)?$/,Ms={setSayAs:"setSayAs"};q({name:Ms.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)===S.SayAs&&(null===(i=u.nodeBefore)||void 0===i?void 0:i.type.name)===S.SayAs&&(d=h.nodeAfter.attrs.text||""),s?(s(o.tr.replaceSelectionWith(o.schema.nodes[S.SayAs].create({interpretAs:r.interpretAs,type:S.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:_.SelectionInvalid,reason:"请选择文本内容"};var h=r.doc.textBetween(s,a,"");return(null===(t=l.nodeAfter)||void 0===t?void 0:t.type.name)===S.SayAs&&(null===(n=c.nodeBefore)||void 0===n?void 0:n.type.name)===S.SayAs&&(h=l.nodeAfter.attrs.text||""),Cs.test(null===(i=h)||void 0===i?void 0:i.trim())?l.parent!==c.parent?{available:!1,code:_.SelectionInvalid,reason:"选区不能跨节点"}:{available:!0}:{available:!1,code:_.ParamsInvalid,reason:"请选择纯数字文本内容"}}}),q({name:E.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=ys(6),u=i.schema,d=u.marks,p=u.nodes,f=d[S.SpeechLanguage];if(l){if(r){var m=p[S.RangeAnchor].create({anchorType:"start",tagType:S.SpeechLanguage,value:n.value,tagId:h}),g=p[S.RangeAnchor].create({anchorType:"end",tagType:S.SpeechLanguage,value:n.value,tagId:h}),y=i.schema.text("",[f.create({value:n.value,tagId:h})]),v=V.from([m,y,g]);c.replaceWith(s,s,v);var x=s+m.nodeSize+y.nodeSize;c.setSelection(It.near(c.doc.resolve(x),-1)),r(c)}return{success:!0}}if(r){var b=f.create({value:n.value,tagId:h}),w=p[S.RangeAnchor].create({anchorType:"start",tagType:S.SpeechLanguage,value:n.value,tagId:h});c.insert(s,w);var k=p[S.RangeAnchor].create({anchorType:"end",tagType:S.SpeechLanguage,value:n.value,tagId:h});return c.insert(a+w.nodeSize,k),c.addMark(s+w.nodeSize,a+w.nodeSize,b),r(c),{success:!0}}return{success:!0}},validate:function(e){return{available:!0}}}),q({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:_.SelectionInvalid,reason:"请先选择文本"};if(r){var l=i.tr,c=ys(6),h=i.schema,u=h.marks,d=h.nodes,p=u[S.SpeechPitch].create({value:n.value,tagId:c}),f=d[S.RangeAnchor].create({anchorType:"start",tagType:S.SpeechPitch,value:n.value,tagId:c});l.insert(s,f);var m=d[S.RangeAnchor].create({anchorType:"end",tagType:S.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:_.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}}),q({name:T.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:_.SelectionInvalid,reason:"请先选择文本"};var l=[];if(i.doc.nodesBetween(s,a,function(e,t){var n=e.marks.find(function(e){return e.type.name===S.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=ys(6),u=i.schema,d=u.marks,p=u.nodes,f=d[S.SpeechRate].create({value:n.value,tagId:h}),m=p[S.RangeAnchor].create({anchorType:"start",tagType:S.SpeechRate,value:n.value,tagId:h});c.insert(s,m);var g=p[S.RangeAnchor].create({anchorType:"end",tagType:S.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:_.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}}),q({name:O.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:_.SelectionInvalid,reason:"请先选择文本"};if(r){var l=i.tr,c=ys(6),h=i.schema,u=h.marks,d=h.nodes,p=u[S.SpeechVolume].create({value:n.value,tagId:c}),f=d[S.RangeAnchor].create({anchorType:"start",tagType:S.SpeechVolume,value:n.value,tagId:c});l.insert(s,f);var m=d[S.RangeAnchor].create({anchorType:"end",tagType:S.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:_.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}});var Ts={insertWord:"insertWord"};function Ns(){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 Os(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")}q({name:Ts.insertWord,description:"插入连读节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Word].create(p(p({},n),{},{type:S.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[S.Word])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"光标插入文本设置连读"}}});var Es={group:"inline",attrs:{type:{default:S.Action,validate:"string"},value:{default:"",validate:"string"},label:{default:Eo[S.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(zo," ").concat(zo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label||"".concat(Eo[S.Action]).concat(e.attrs.value)],Ns()]},parseDOM:[{tag:"b[data-type='".concat(S.Action,"']"),getAttrs:function(e){var t=e.dataset,n=t.value;return{label:t.label||"".concat(Eo[S.Action]).concat(n),type:S.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(Eo[S.Action]).concat(o),type:S.Action,value:o}}}],handleClickOn:function(e,t,n,i,r){if(Os(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.Action,Es);var As={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":S.PptControl,"data-value":encodeURIComponent(vs(e.attrs.value||"")),class:"".concat(zo," ").concat(zo,"-").concat(S.PptControl),"data-ppt-action":e.attrs.pptAction},["span",{class:"ssml-tag-label"},"".concat(Eo[S.PptControl]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Ns()]},parseDOM:[{tag:"b[data-type='".concat(S.PptControl,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i,o=t.pptAction;return{type:S.PptControl,value:decodeURIComponent(xs(n||"")),label:r,pptAction:o}}}],handleClickOn:function(e,t,n,i,r){if(Os(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.PptControl,As);var js={group:"inline",attrs:{type:{default:S.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":S.SoundEvent,"data-value":e.attrs.value,"data-label":e.attrs.label,"data-volume":e.attrs.volume,class:"".concat(zo," ").concat(zo,"-soundEvent")},["span",{class:"ssml-tag-label"},"".concat(Eo[S.SoundEvent]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Ns()]},parseDOM:[{tag:"b[data-type='".concat(S.SoundEvent,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i,o=t.volume;return{type:S.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:S.SoundEvent,value:n,label:r,volume:Number.isNaN(Number(o))?100:Number(o)}}}],handleClickOn:function(e,t,n,i,r){if(Os(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.SoundEvent,js);var Ds={group:"inline",attrs:{value:{default:"",validate:"string"},label:{default:""}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-type":S.Command,"data-value":e.attrs.value,class:"".concat(zo," ").concat(zo,"-").concat(S.Command)},["span",{class:"ssml-tag-label"},"".concat(Eo[S.Command]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Ns()]},parseDOM:[{tag:"b[data-type='".concat(S.Command,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i;return{type:S.Command,value:n,label:r}}}],handleClickOn:function(e,t,n,i,r){if(Os(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.Command,Ds);var Rs={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":S.Data,"data-value":e.attrs.value,"data-label":e.attrs.name,class:"".concat(zo," ").concat(zo,"-").concat(S.Data)},["span",{class:"ssml-tag-label"},"{{ ".concat(null!==(t=e.attrs.label)&&void 0!==t?t:""," }}")],Ns()]},parseDOM:[{tag:"b[data-type='".concat(S.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:S.Data,value:i,label:o}}}],handleClickOn:function(e,t,n,i,r){if(Os(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.Data,Rs);var Is={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":S.Wait,"data-value":vs(e.attrs.value||""),class:"".concat(zo," ").concat(zo,"-").concat(S.Wait),"data-wait-type":e.attrs.waitType,"data-context":null!==(t=e.attrs.context)&&void 0!==t?t:""},["span",{class:"ssml-tag-label"},"".concat(Eo[S.Wait]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Ns()]},parseDOM:[{tag:"b[data-type='".concat(S.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:S.Wait,value:xs(n||""),label:r,waitType:o,context:null!=s?s:""}}}],handleClickOn:function(e,t,n,i,r){if(Os(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.Wait,Is);var qs={group:"inline",attrs:{anchorType:{default:"start"},tagType:{default:S.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=Eo[r]||r,l=document.createElement("b");l.setAttribute("contenteditable","false"),l.classList.add(zo),l.classList.add("".concat(zo,"-").concat(r)),l.classList.add("".concat(zo,"-anchor-").concat(i)),l.dataset.type=S.RangeAnchor,l.dataset.anchorType=i,l.dataset.tagType=r,l.dataset.value=String(o),l.dataset.tagId=s,r===S.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===S.SpeechLanguage?o.toUpperCase():o;c.innerText="".concat(a).concat(h),l.appendChild(c),l.appendChild(Ns())}else l.classList.add("range-anchor-end");return l},parseDOM:[{tag:"b[data-type='".concat(S.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(Os(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===S.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}};Do.registerNode(S.RangeAnchor,qs);var Ps={group:"inline",attrs:{type:{default:S.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":ys(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(zo," ").concat(zo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},t]]},parseDOM:[{tag:"b[data-type='".concat(S.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:S.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:S.Break,value:n}}}]};Do.registerNode(S.Break,Ps);var _s={group:"inline",attrs:{type:{default:S.Breath,validate:"string"},value:{default:Ao[S.Breath]},label:{default:Eo[S.Breath]}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-id":ys(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(zo," ").concat(zo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label]]},parseDOM:[{tag:"b[data-type='".concat(S.Breath,"']"),getAttrs:function(e){return{label:Eo[S.Breath],type:S.Breath,value:Ao[S.Breath]}}},{tag:"i.tts-mark-segmentation",getAttrs:function(e){return{label:Eo[S.Breath],type:S.Breath,value:Ao[S.Breath]}}}]};Do.registerNode(S.Breath,_s);var Ls={group:"inline",attrs:{type:{default:S.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(zo," ").concat(zo,"-").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(S.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:S.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:S.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}};Do.registerNode(S.Phoneme,Ls);var Bs={group:"inline",attrs:{type:{default:S.SayAs,validate:"string"},interpretAs:{default:z.digits},text:{default:"",validate:"string"}},inline:!0,draggable:!1,selectable:!0,atom:!0,toDOM:function(e){var t;return["b",{"data-type":S.SayAs,"data-interpret-as":e.attrs.interpretAs,"data-text":e.attrs.text,class:"".concat(zo," ").concat(zo,"-say-as")},["span",{class:"tag-text"},e.attrs.text],["span",{class:"ssml-tag-label"},"".concat((null===(t=Eo[S.SayAs])||void 0===t?void 0:t[e.attrs.interpretAs])||"读法")]]},parseDOM:[{tag:"b.".concat(zo,"-say-as"),getAttrs:function(e){var t,n,i=e.dataset.interpretAs||z.digits;return{text:(null===(t=e.dataset.text)||void 0===t||null===(n=t.trim)||void 0===n?void 0:n.call(t))||"",type:S.SayAs,interpretAs:i}}},{tag:"b.".concat(zo,"-number"),getAttrs:function(e){var t,n=e.dataset,i=n.value,r=n.text,o={0:z.auto,1:z.digits,2:z.cardinal};return{text:null==r||null===(t=r.trim)||void 0===t?void 0:t.call(r),type:S.SayAs,interpretAs:o[null!=i?i:"1"]||z.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(!Cs.test((null===(t=a)||void 0===t||null===(n=t.trim)||void 0===n?void 0:n.call(t))||""))return!1;var h={0:z.auto,1:z.digits,2:z.cardinal};return{text:null===(i=a)||void 0===i||null===(r=i.trim)||void 0===r?void 0:r.call(i),type:S.SayAs,interpretAs:h[null!=o?o:"1"]||z.digits}}}],leafText:function(e){return e.attrs.text}};Do.registerNode(S.SayAs,Bs);var Fs={group:"inline",attrs:{type:{default:S.Word,validate:"string"},value:{default:Ao[S.Word]},label:{default:Eo[S.Word]}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-id":ys(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(zo," ").concat(zo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label]]},parseDOM:[{tag:"b[data-type='".concat(S.Word,"']"),getAttrs:function(e){return{label:Eo[S.Word],type:S.Word,value:Ao[S.Word]}}},{tag:"i.tts-mark-continuity",getAttrs:function(e){return{label:Eo[S.Word],type:S.Word,value:Ao[S.Word]}}}]};Do.registerNode(S.Word,Fs);var Vs={attrs:{value:{default:"en-US"},tagId:{default:""}},inclusive:!0,group:k.textmedia,excludes:"".concat(S.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(Co," ").concat(Co,"-").concat(S.SpeechLanguage),"data-tag-id":r||ys(6),"data-type":S.SpeechLanguage,"data-value":i,dir:o?"rtl":"ltr"},0]},parseDOM:[{tag:"span[data-type='".concat(S.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?ys(6):r}}},{tag:"lang",getAttrs:function(e){return{value:e.getAttribute("xml:lang")||e.getAttribute("lang")||"en-US",tagId:ys(6)}}},{tag:"span[lang]",getAttrs:function(e){return{value:e.getAttribute("lang")||"en-US",tagId:ys(6)}}}]};Do.registerMark(S.SpeechLanguage,Vs);var Ws={attrs:{value:{default:50},tagId:{default:""}},inclusive:!0,group:k.textmedia,excludes:"".concat(S.SpeechPitch),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(Co," ").concat(Co,"-").concat(S.SpeechPitch),"data-tag-id":i||ys(6),"data-type":S.SpeechPitch,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(S.SpeechPitch,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"50":n,r=t.tagId,o=void 0===r?ys(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:ys(6)}}}]};Do.registerMark(S.SpeechPitch,Ws);var $s={attrs:{value:{default:70},tagId:{default:""}},inclusive:!0,group:k.textmedia,excludes:"".concat(S.SpeechRate),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(Co," ").concat(Co,"-").concat(S.SpeechRate),"data-tag-id":i||ys(6),"data-type":S.SpeechRate,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(S.SpeechRate,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"70":n,r=t.tagId,o=void 0===r?ys(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:ys(6)}}}]};Do.registerMark(S.SpeechRate,$s);var Js={attrs:{value:{default:50},tagId:{default:""}},inclusive:!0,group:k.textmedia,excludes:"".concat(S.SpeechVolume),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(Co," ").concat(Co,"-").concat(S.SpeechVolume),"data-tag-id":i||ys(6),"data-type":S.SpeechVolume,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(S.SpeechVolume,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"50":n,r=t.tagId,o=void 0===r?ys(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:ys(6)}}}]};Do.registerMark(S.SpeechVolume,Js);var Hs={attrs:{src:{default:""},mediaType:{default:"image"},extra:{default:""},name:{default:""},tagId:{default:""}},inclusive:!1,group:k.textmedia,excludes:k.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(Co," ").concat(Co,"-").concat(k.textmedia),"data-tag-id":o,"data-name":vs(r||""),"data-type":k.textmedia,"data-extra":vs("".concat(s||"")),"data-extra-type":a,"data-media-type":n,"data-media-src":vs("".concat(i||""))},0]},parseDOM:[{tag:"span[data-type='".concat(k.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=xs(h||"");if("json"===u)try{d=JSON.parse(d)}catch(e){D.warn("parse dataExtra fail",e)}return{tagId:a,src:o||"",name:xs(i),mediaType:c,extra:d}}}]};Do.registerMark(k.textmedia,Hs);const Us=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Ks(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 Gs(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 Ys(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 Xs(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 Zs=(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof Ft&&e.selection.node.isBlock)return!(!n.parentOffset||!yt(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=Xs(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 Lt||e.selection instanceof Wt)&&c.deleteSelection();let h=c.mapping.map(n.pos),u=yt(c.doc,h,s.length,s);if(u||(s[0]=o?{type:o}:null,u=yt(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 Qs(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&&!vt(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=V.empty;for(let e=r.length-1;e>=0;e--)o=V.from(r[e].create(null,o));o=V.from(s.copy(o));let l=e.tr.step(new ht(t.pos-1,i,t.pos,i,new K(o,1,0),r.length,!0)),c=l.doc.resolve(i+2*r.length);c.nodeAfter&&c.nodeAfter.type==s.type&&vt(l.doc,c.pos)&&l.join(c.pos),n(l.scrollIntoView())}return!0}let h=a.type.spec.isolating||i>0&&l?null:It.findFrom(t,1),u=h&&h.$from.blockRange(h.$to),d=u&&ft(u);if(null!=d&&d>=t.depth)return n&&n(e.tr.lift(u,d).scrollIntoView()),!0;if(c&&Ks(a,"start",!0)&&Ks(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=V.empty;for(let e=r.length-1;e>=0;e--)i=V.from(r[e].copy(i));n(e.tr.step(new ht(t.pos-r.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new K(i,r.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ea(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(Lt.create(t.doc,e<0?r.start(o):r.end(o)))),!0)}}const ta=ea(-1),na=ea(1);function ia(...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 ra=ia(Us,(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=Gs(i);if(!r){let n=i.blockRange(),r=n&&ft(n);return null!=r&&(t&&t(e.tr.lift(n,r).scrollIntoView()),!0)}let o=r.nodeBefore;if(Qs(e,r,t,-1))return!0;if(0==i.parent.content.size&&(Ks(o,"end")||Ft.isSelectable(o)))for(let n=i.depth;;n--){let s=xt(e.doc,i.before(n),i.after(n),K.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(Ks(o,"end")?It.findFrom(n.doc.resolve(n.mapping.map(r.pos,-1)),-1):Ft.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=Gs(i)}let s=o&&o.nodeBefore;return!(!s||!Ft.isSelectable(s))&&(t&&t(e.tr.setSelection(Ft.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)}),oa=ia(Us,(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=Ys(i);if(!r)return!1;let o=r.nodeAfter;if(Qs(e,r,t,1))return!0;if(0==i.parent.content.size&&(Ks(o,"start")||Ft.isSelectable(o))){let n=xt(e.doc,i.before(),i.after(),K.empty);if(n&&n.slice.size<n.to-n.from){if(t){let i=e.tr.step(n);i.setSelection(Ks(o,"start")?It.findFrom(i.doc.resolve(i.mapping.map(r.pos)),1):Ft.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=Ys(i)}let s=o&&o.nodeAfter;return!(!s||!Ft.isSelectable(s))&&(t&&t(e.tr.setSelection(Ft.create(e.doc,o.pos)).scrollIntoView()),!0)});const sa={Enter:ia((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 Wt||i.parent.inlineContent||r.parent.inlineContent)return!1;let o=Xs(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(Lt.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(yt(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),r=i&&ft(i);return null!=r&&(t&&t(e.tr.lift(i,r).scrollIntoView()),!0)},Zs),"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=Xs(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(It.near(r.doc.resolve(i),1)),t(r.scrollIntoView())}return!0},Backspace:ra,"Mod-Backspace":ra,"Shift-Backspace":ra,Delete:oa,"Mod-Delete":oa,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Wt(e.doc))),!0)},aa={"Ctrl-h":sa.Backspace,"Alt-Backspace":sa["Mod-Backspace"],"Ctrl-d":sa.Delete,"Ctrl-Alt-Backspace":sa["Mod-Delete"],"Alt-Delete":sa["Mod-Delete"],"Alt-d":sa["Mod-Delete"],"Ctrl-a":ta,"Ctrl-e":na};for(let e in sa)aa[e]=sa[e];const la=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?aa:sa;for(var ca={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:"'"},ha={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ua="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),da="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),pa=0;pa<10;pa++)ca[48+pa]=ca[96+pa]=String(pa);for(pa=1;pa<=24;pa++)ca[pa+111]="F"+pa;for(pa=65;pa<=90;pa++)ca[pa]=String.fromCharCode(pa+32),ha[pa]=String.fromCharCode(pa);for(var fa in ca)ha.hasOwnProperty(fa)||(ha[fa]=ca[fa]);const ma="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ga="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function ya(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);ma?r=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),r&&(s="Meta-"+s),i&&(s="Shift-"+s),s}function va(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 xa(e){return new en({props:{handleKeyDown:ba(e)}})}function ba(e){let t=function(e){let t=Object.create(null);for(let n in e)t[ya(n)]=e[n];return t}(e);return function(e,n){let i,r=function(e){var t=!(ua&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||da&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?ha:ca)[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[va(r,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==r.length&&" "!=r){if(n.shiftKey){let i=t[va(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(ga&&n.ctrlKey&&n.altKey)&&(i=ca[n.keyCode])&&i!=r){let r=t[va(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var wa=function(){return s(function e(){r(this,e),a(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()}}])}(),ka=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 Sa(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 za=new rn("contextMenu"),Ca=function(e){function t(e,n){r(this,t);var o=null;return i(this,t,[{key:za,props:{handleDOMEvents:{contextmenu:function(t,i){var r,s;i.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=t.posAtCoords({left:i.clientX,top:i.clientY}),l={left:i.clientX,top:i.clientY},c=Sa({left:i.clientX,right:i.clientX,top:i.clientY,bottom:i.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=t.state.doc.resolve(a.pos),d=u.nodeAfter||u.nodeBefore||u.parent;d&&(h={type:d.type.name,attrs:d.attrs})}var f=t.state.selection,m=!!a&&(a.pos>=f.from&&a.pos<=f.to),g={isActive:!0,event:i,pos:null!==(r=null==a?void 0:a.pos)&&void 0!==r?r:0,coords:l,node:h,selection:{from:f.from,to:f.to,text:t.state.doc.textBetween(f.from,f.to," "),content:t.state.doc.slice(f.from,f.to).toJSON(),isClickInside:!f.empty&&m},target:o};e.emit(ka.ContextMenu,g),null===(s=n.onRender)||void 0===s||s.call(n,o,g);var y=function(e){var t;if(null===(t=o)||void 0===t||!t.contains(e.target)){var i;if(o)null===(i=n.onRender)||void 0===i||i.call(n,o,p(p({},g),{},{isActive:!1}));window.removeEventListener("mousedown",y)}};return window.addEventListener("mousedown",y),!0}}},view:function(){return{destroy:function(){o&&o.remove()}}}}])}return h(t,e),s(t)}(en),Ma=new rn("floatingMenu"),Ta=function(e){function t(e,n){r(this,t);var o=!1,s=!1;return i(this,t,[{key:Ma,state:{init:function(){return{prevent:!1}},apply:function(e,t){var n=e.getMeta(Oo);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(t){return new Na(t,e,n,function(){return{isMouseDown:o,isContextMenuOpen:s,isPopoverVisible:ms.isVisible()}})}}])}return h(t,e),s(t)}(en),Na=function(){return s(function e(t,n,i,o){r(this,e),this.editor=n,this.options=i,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=Ma.getState(i);if(null!=a&&a.prevent&&(s=!1),r instanceof Ft){var l=r.node.type.name;l!==S.SayAs&&l!==S.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(ka.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=Sa(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(ka.SelectionUpdate,x)}},{key:"destroy",value:function(){this.mountPoint.remove()}}])}(),Oa=new rn("maxLength"),Ea=function(e){function t(e,n){var o;return r(this,t),a(o=i(this,t,[{key:Oa,state:{init:function(t,n){var i=o.calculateCount(n.doc);return e.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(t){o.isComposing=!1;var n=t.state,i=o.calculateCount(n.doc);if(i>o.config.maxLength){var r=n.tr;o.truncateDocument(r,n.doc,n.schema),t.dispatch(r),e.emit("wordCount",{count:o.config.maxLength,exceeded:!0})}else e.emit("wordCount",{count:i,exceeded:!1});return!1}}},filterTransaction:function(t,n){if(t.docChanged){if(o.isComposing)return!0;var i=t.doc,r=o.calculateCount(i);if(r>=o.config.maxLength){var s=o.calculateCount(n.doc);if(s>=o.config.maxLength&&r>s)return e.emit("wordCount",{count:o.config.maxLength,exceeded:!0}),!1}if(r>o.config.maxLength)return o.truncateDocument(t,i,n.schema),e.emit("wordCount",{count:o.config.maxLength,exceeded:!0}),!0;e.emit("wordCount",{count:r,exceeded:!1})}return!0}}]),"config",{countBreak:!0,countSpaces:!0,excludeNodes:["paragraph"],maxLength:2e4}),a(o,"isComposing",!1),o.config=p(p({},o.config),n),o}return h(t,e),s(t,[{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(Lt.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)===S.Phoneme?1:((null==s?void 0:s.type.name)===S.SayAs||(null==s?void 0:s.type.name)===S.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===S.Phoneme||i===S.SayAs||"sayas"===i||"number"===i?{count:!0,text:e.attrs.text||""}:i===S.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}}])}(en),Aa=new rn("placeholder");var ja=function(){return s(function e(){r(this,e),a(this,"editable",!0),this.editable=!0},[{key:"setEditable",value:function(e){this.editable=e}},{key:"getEditable",value:function(){return this.editable}}])}();function Da(e){return e.type.name===S.Phoneme||e.type.name===S.SayAs||e.type.name===S.Sub}function Ra(e){return e.type.name===S.Break||e.type.name===S.Word||e.type.name===S.Breath||e.type.name===S.Action||e.type.name===S.Emotion||e.type.name===S.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 m(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]())):(m(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,m(e,r,"GeneratorFunction")),e.prototype=Object.create(u),e}return l.prototype=c,m(u,"constructor",c),m(c,"constructor",l),l.displayName="GeneratorFunction",m(c,r,"GeneratorFunction"),m(u),m(u,r,"Generator"),m(u,i,function(){return this}),m(u,"toString",function(){return"[object Generator]"}),(f=function(){return{w:o,m:d}})()}function m(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}m=function(e,t,n,i){function o(t,n){m(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))},m(e,t,n,i)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function y(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)||w(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 v(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(e)||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 x(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 b(e){return b="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},b(e)}function w(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}var k=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}({}),S=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}({}),z=function(e){return e.auto="auto",e.cardinal="cardinal",e.digits="digits",e}({}),C=function(e){return e[e.auto=0]="auto",e[e.digits=1]="digits",e[e.cardinal=2]="cardinal",e}({}),M=function(e){return e.insertAction="insertAction",e.clearAction="clearAction",e}({}),T=function(e){return e.setSpeechRate="setSpeechRate",e}({}),N=function(e){return e.setSpeechPitch="setSpeechPitch",e}({}),O=function(e){return e.setSpeechVolume="setSpeechVolume",e}({}),E=function(e){return e.setSpeechLanguage="setSpeechLanguage",e}({}),A=function(e){return e[e.ERROR=0]="ERROR",e[e.WARN=1]="WARN",e[e.INFO=2]="INFO",e[e.DEBUG=3]="DEBUG",e}({}),j=function(){return s(function e(){r(this,e),a(this,"level",A.WARN),a(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>=A.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>=A.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>=A.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>=A.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))}}}])}(),D=new j,R=function(){function e(){r(this,e),a(this,"commands",new Map)}return s(e,[{key:"register",value:function(e){var t=e.name;this.commands.has(t)&&D.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}}])}(),I=new R;function q(e){I.register(e)}var P=function(e){return e.all="all",e.selection="selection",e.cursorRight="cursor_right",e}({}),_=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 L(e){this.content=e}function B(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=B(r.content,o.content,n+1);if(null!=e)return e}n+=r.nodeSize}else n+=r.nodeSize}}function F(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=F(s.content,a.content,n-1,i-1);if(e)return e}n-=l,i-=l}else n-=l,i-=l}}q({name:M.insertAction,description:"插入动作",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Action].create(p(p({},n),{},{type:S.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[S.Action])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"光标处插入设置动作"}}}),q({name:M.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[S.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}}}),L.prototype={constructor:L,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 L(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 L(n)},addToStart:function(e,t){return new L([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new L(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 L(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=L.from(e)).size?new L(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=L.from(e)).size?new L(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=L.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}},L.from=function(e){if(e instanceof L)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new L(t)};class V{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 V(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 V(n,i)}cutByIndex(e,t){return e==t?V.empty:0==e&&t==this.content.length?this:new V(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 V(i,r)}addToStart(e){return new V([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new V(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 B(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return F(this,e,t,n)}findIndex(e){if(0==e)return $(0,e);if(e==this.size)return $(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?$(t+1,i):$(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 V.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new V(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return V.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 V(t||e,n)}static from(e){if(!e)return V.empty;if(e instanceof V)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new V([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}V.empty=new V([],0);const W={index:0,offset:0};function $(e,t){return W.index=e,W.offset=t,W}function J(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(!J(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!J(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class H{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&&J(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 H.none;if(e instanceof H)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}H.none=[];class U extends Error{}class K{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=Y(this.content,e+this.openStart,t);return n&&new K(n,this.openStart,this.openEnd)}removeBetween(e,t){return new K(G(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 K.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 K(V.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 K(e,n,i)}}function G(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(G(o.content,t-r-1,n-r-1)))}function Y(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=Y(s.content,t-o-1,n,s);return a&&e.replaceChild(r,s.copy(a))}function X(e,t,n){if(n.openStart>e.depth)throw new U("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new U("Inconsistent open depths");return Z(e,t,n,0)}function Z(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=Z(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(V.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(n,e);return ie(o,re(e,r,s,t,i))}{let i=e.parent,r=i.content;return ie(i,r.cut(0,e.parentOffset).append(n.content).append(r.cut(t.parentOffset)))}}return ie(o,oe(e,t,i))}function Q(e,t){if(!t.type.compatibleContent(e.type))throw new U("Cannot join "+t.type.name+" onto "+e.type.name)}function ee(e,t,n){let i=e.node(n);return Q(i,t.node(n)),i}function te(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 ne(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&&(te(e.nodeAfter,i),o++));for(let e=o;e<s;e++)te(r.child(e),i);t&&t.depth==n&&t.textOffset&&te(t.nodeBefore,i)}function ie(e,t){return e.type.checkContent(t),e.copy(t)}function re(e,t,n,i,r){let o=e.depth>r&&ee(e,t,r+1),s=i.depth>r&&ee(n,i,r+1),a=[];return ne(null,e,r,a),o&&s&&t.index(r)==n.index(r)?(Q(o,s),te(ie(o,re(e,t,n,i,r+1)),a)):(o&&te(ie(o,oe(e,t,r+1)),a),ne(t,n,r,a),s&&te(ie(s,oe(n,i,r+1)),a)),ne(i,null,r,a),new V(a)}function oe(e,t,n){let i=[];if(ne(null,e,n,i),e.depth>n){te(ie(ee(e,t,n+1),oe(e,t,n+1)),i)}return ne(t,null,n,i),new V(i)}K.empty=new K(V.empty,0,0);class se{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 H.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 he(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 se(t,n,r)}static resolveCached(e,t){let n=ce.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 ce.set(e,n=new ae);let i=n.elts[n.i]=se.resolve(e,t);return n.i=(n.i+1)%le,i}}class ae{constructor(){this.elts=[],this.i=0}}const le=12,ce=new WeakMap;class he{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 ue=Object.create(null);let de=class e{constructor(e,t,n,i=H.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||V.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&&J(this.attrs,t||e.defaultAttrs||ue)&&H.sameSet(this.marks,n||H.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 K.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 K(a,i.depth-o,r.depth-o)}replace(e,t,n){return X(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 se.resolveCached(this,e)}resolveNoCache(e){return se.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()+")"),fe(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=V.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=H.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(!H.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=V.fromJSON(e,t.content),r=e.nodeType(t.type).create(t.attrs,i,n);return r.type.checkAttrs(r.attrs),r}};de.prototype.text=void 0;class pe extends de{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):fe(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 pe(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new pe(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 fe(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class me{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new ge(e,t);if(null==n.next)return me.empty;let i=ye(n);n.next&&n.err("Unexpected trailing text");let r=function(e){let t=Object.create(null);return n(Se(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]);Se(e,n).forEach(e=>{i||r.push([t,i=[]]),-1==i.indexOf(e)&&i.push(e)})})});let o=t[i.join(",")]=new me(i.indexOf(e.length-1)>-1);for(let e=0;e<r.length;e++){let i=r[e][1].sort(ke);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 V.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")}}me.empty=new me(!0);class ge{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 ye(e){let t=[];do{t.push(ve(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function ve(e){let t=[];do{t.push(xe(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function xe(e){let t=function(e){if(e.eat("(")){let t=ye(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=we(e,t)}return t}function be(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function we(e,t){let n=be(e),i=n;return e.eat(",")&&(i="}"!=e.next?be(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function ke(e,t){return t-e}function Se(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(ke)}function ze(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 Ce(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 Me(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 Te(e,t){let n=Object.create(null);if(t)for(let i in t)n[i]=new Oe(e,i,t[i]);return n}let Ne=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=Te(e,n.attrs),this.defaultAttrs=ze(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==me.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:Ce(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new de(this,this.computeAttrs(e),V.from(t),H.setFrom(n))}createChecked(e=null,t,n){return t=V.from(t),this.checkContent(t),new de(this,this.computeAttrs(e),t,H.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=V.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(V.empty,!0);return r?new de(this,e,t.append(r),H.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){Me(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:H.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 Oe{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 Ee{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Te(e,i.attrs),this.excluded=null;let r=ze(this.attrs);this.instance=r?new H(this,r):null}create(e=null){return!e&&this.instance?this.instance:new H(this,Ce(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((e,r)=>n[e]=new Ee(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){Me(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Ae{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=L.from(e.nodes),t.marks=L.from(e.marks||{}),this.nodes=Ne.compile(this.spec.nodes,this),this.marks=Ee.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]=me.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?je(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?[]:je(this,n.split(" "))}this.nodeFromJSON=e=>de.fromJSON(this,e),this.markFromJSON=e=>H.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 Ne))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 pe(n,n.defaultAttrs,e,H.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 je(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 De=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 Le(this,t,!1);return n.addAll(e,H.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Le(this,t,!0);return n.addAll(e,H.none,t.from,t.to),K.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(Be(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=Fe(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=Fe(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 Re={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},Ie={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},qe={ol:!0,ul:!0};function Pe(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class _e{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=H.none,this.match=r||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(V.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=V.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(V.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&&!Re.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Le{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=Pe(null,t.preserveWhitespace,0)|(n?4:0);i=r?new _e(r.type,r.attrs,H.none,!0,t.topMatch||r.type.contentMatch,o):new _e(n?null:e.schema.topNodeType,null,H.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();qe.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&&qe.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:Ie.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(Re.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=H.none;for(let r of i.concat(e.marks))(t.type?t.type.allowsMarkType(r.type):Ve(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=Pe(e,r,o.options);4&o.options&&0==o.content.length&&(s|=4);let a=H.none;return n=n.filter(t=>!(o.type?o.type.allowsMarkType(t.type):Ve(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new _e(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 Be(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Fe(e){let t={};for(let n in e)t[n]=e[n];return t}function Ve(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 We{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Je(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}=Ke(Je(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&&Ke(Je(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return Ke(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new We(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=$e(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return $e(e.marks)}}function $e(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Je(e){return e.document||window.document}const He=new WeakMap;function Ue(e){let t=He.get(e);return void 0===t&&He.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 Ke(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=Ue(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}=Ke(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 Ge=Math.pow(2,16);function Ye(e,t){return e+t*Ge}function Xe(e){return 65535&e}class Ze{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 Qe{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Qe.empty)return Qe.empty}recover(e){let t=0,n=Xe(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))/Ge}(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:Ye(s/3,e-a),u=e==a?2:e==h?1:4;return(t<0?e!=a:e!=h)&&(u|=8),new Ze(r,u,o)}i+=c-l}return n?e+i:new Ze(e+i,0,null)}touches(e,t){let n=0,i=Xe(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 Qe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Qe.empty:new Qe(e<0?[0,-e,0]:[0,0,e])}}Qe.empty=new Qe([]);class et{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 et(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 et;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 Ze(e,i,null)}}const tt=Object.create(null);class nt{getMap(){return Qe.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=tt[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 tt)throw new RangeError("Duplicate use of step JSON ID "+e);return tt[e]=t,t.prototype.jsonID=e,t}}class it{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new it(e,null)}static fail(e){return new it(null,e)}static fromReplace(e,t,n,i){try{return it.ok(e.replace(t,n,i))}catch(e){if(e instanceof U)return it.fail(e.message);throw e}}}function rt(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let o=e.child(r);o.content.size&&(o=o.copy(rt(o.content,t,o))),o.isInline&&(o=t(o,n,r)),i.push(o)}return V.fromArray(i)}class ot extends nt{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 K(rt(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 it.fromReplace(e,this.from,this.to,r)}invert(){return new st(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 ot(t.pos,n.pos,this.mark)}merge(e){return e instanceof ot&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ot(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 ot(t.from,t.to,e.markFromJSON(t.mark))}}nt.jsonID("addMark",ot);class st extends nt{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 K(rt(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return it.fromReplace(e,this.from,this.to,n)}invert(){return new ot(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 st(t.pos,n.pos,this.mark)}merge(e){return e instanceof st&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new st(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 st(t.from,t.to,e.markFromJSON(t.mark))}}nt.jsonID("removeMark",st);class at extends nt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return it.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return it.fromReplace(e,this.pos,this.pos+1,new K(V.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 at(this.pos,t.marks[n]);return new at(this.pos,this.mark)}}return new lt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new at(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 at(t.pos,e.markFromJSON(t.mark))}}nt.jsonID("addNodeMark",at);class lt extends nt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return it.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return it.fromReplace(e,this.pos,this.pos+1,new K(V.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new at(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new lt(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 lt(t.pos,e.markFromJSON(t.mark))}}nt.jsonID("removeNodeMark",lt);class ct extends nt{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&ut(e,this.from,this.to)?it.fail("Structure replace would overwrite content"):it.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Qe([this.from,this.to-this.from,this.slice.size])}invert(e){return new ct(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 ct(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ct)||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?K.empty:new K(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ct(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?K.empty:new K(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ct(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 ct(t.from,t.to,K.fromJSON(e,t.slice),!!t.structure)}}nt.jsonID("replace",ct);class ht extends nt{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&&(ut(e,this.from,this.gapFrom)||ut(e,this.gapTo,this.to)))return it.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return it.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?it.fromReplace(e,this.from,this.to,n):it.fail("Content does not fit in gap")}getMap(){return new Qe([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 ht(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 ht(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 ht(t.from,t.to,t.gapFrom,t.gapTo,K.fromJSON(e,t.slice),t.insert,!!t.structure)}}function ut(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 dt(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 st(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 K(V.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new ct(a+e.index,a+e.index+e[0].length,t))}}else s.push(new ct(a,c,K.empty));a=c}if(!i.validEnd){let t=i.fillBefore(V.empty,!0);e.replace(a,a,new K(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function pt(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ft(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||!pt(o,s,a))break;s&&(i=1),a<o.childCount&&(r=1)}return null}function mt(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 gt(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 yt(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 vt(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 xt(e,t,n=t,i=K.empty){if(t==n&&!i.size)return null;let r=e.resolve(t),o=e.resolve(n);return bt(r,o,i)?new ct(t,n,i):new wt(r,o,i).fit()}function bt(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}nt.jsonID("replaceAround",ht);class wt{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=V.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=V.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 K(r,o,s);return e>-1?new ht(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new ct(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=zt(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(V.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=zt(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new K(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=zt(e,t);if(i.childCount<=1&&t>0){let r=e.size-t<=t+i.size;this.unplaced=new K(kt(e,t-1,1),t-1,r?t-1:n)}else this.unplaced=new K(kt(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(Ct(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=St(this.placed,t,V.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?K.empty:new K(kt(o.content,e-1,1),e-1,d<0?o.openEnd:e-1):new K(kt(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||!Mt(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=Mt(e,t,i,n,r);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:i}=this.frontier[n],r=Mt(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=St(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=St(this.placed,this.depth,V.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(V.empty,!0);e.childCount&&(this.placed=St(this.placed,this.frontier.length,e))}}function kt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(kt(e.firstChild.content,t-1,n)))}function St(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(St(e.lastChild.content,t-1,n)))}function zt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Ct(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,Ct(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(V.empty,!0)))),e.copy(i)}function Mt(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 Tt(e){return e.spec.defining||e.spec.definingForContent}function Nt(e,t,n,i,r){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(Nt(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(V.empty,!0))}return e}function Ot(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 Et extends nt{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 it.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 it.fromReplace(e,this.pos,this.pos+1,new K(V.from(i),0,t.isLeaf?0:1))}getMap(){return Qe.empty}invert(e){return new Et(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 Et(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 Et(t.pos,t.attr,t.value)}}nt.jsonID("attr",Et);class At extends nt{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 it.ok(n)}getMap(){return Qe.empty}invert(e){return new At(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 At(t.attr,t.value)}}nt.jsonID("docAttr",At);let jt=class extends Error{};jt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(jt.prototype=Object.create(Error.prototype)).constructor=jt,jt.prototype.name="TransformError";class Dt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new et}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new jt(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=K.empty){let i=xt(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new K(V.from(n),0,0))}delete(e,t){return this.replace(e,t,K.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(bt(r,o,i))return e.step(new ct(t,n,i));let s=Ot(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=Tt(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 K(Nt(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 K(V.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=Ot(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=V.empty,u=0;for(let e=o,t=!1;e>n;e--)t||i.index(e)>0?(t=!0,h=V.from(i.node(e).copy(h)),u++):l--;let d=V.empty,p=0;for(let e=o,t=!1;e>n;e--)t||r.after(e+1)<r.end(e)?(t=!0,d=V.from(r.node(e).copy(d)),p++):c++;e.step(new ht(l,c,s,a,new K(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);gt(e,i.node(),i.before(),a)}s.inlineContent&&dt(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 ct(c,l.map(t+n,-1),K.empty,!0)),!0===i){let t=e.doc.resolve(c);mt(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let i=V.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=V.from(n[e].type.create(n[e].attrs,i))}let r=t.start,o=t.end;e.step(new ht(r,o,r,o,new K(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&>(e,t,n,o),dt(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 ht(l,c,l+1,c-1,new K(V.from(i.create(s,null,t.marks)),0,0),1,!0)),!0===r&&mt(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 ht(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new K(V.from(s),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Et(e,t,n)),this}setDocAttribute(e,t){return this.step(new At(e,t)),this}addNodeMark(e,t){return this.step(new at(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 H)t.isInSet(n.marks)&&this.step(new lt(e,t));else{let i,r=n.marks,o=[];for(;i=t.isInSet(r);)o.push(new lt(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=V.empty,s=V.empty;for(let e=r.depth,t=r.depth-n,a=n-1;e>t;e--,a--){o=V.from(r.node(e).copy(o));let t=i&&i[a];s=V.from(t?t.type.create(t.attrs,s):r.node(e).copy(s))}e.step(new ct(t,t,new K(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 st(c,u,h[e])));o&&o.to==c?o.to=u:a.push(o=new ot(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 Ee){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 st(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return dt(this,e,t,n),this}}const Rt=Object.create(null);class It{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new qt(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=K.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?K.empty:t),0==s&&Ht(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),Ht(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new Lt(e):Jt(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?Jt(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):Jt(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 Wt(e.node(0))}static atStart(e){return Jt(e,e,0,0,1)||new Wt(e)}static atEnd(e){return Jt(e,e,e.content.size,e.childCount,-1)||new Wt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Rt[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 Rt)throw new RangeError("Duplicate use of selection JSON ID "+e);return Rt[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Lt.between(this.$anchor,this.$head).getBookmark()}}It.prototype.visible=!0;class qt{constructor(e,t){this.$from=e,this.$to=t}}let Pt=!1;function _t(e){Pt||e.parent.inlineContent||(Pt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Lt extends It{constructor(e,t=e){_t(e),_t(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 It.near(n);let i=e.resolve(t.map(this.anchor));return new Lt(i.parent.inlineContent?i:n,n)}replace(e,t=K.empty){if(super.replace(e,t),t==K.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Lt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Bt(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 Lt(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=It.findFrom(t,n,!0)||It.findFrom(t,-n,!0);if(!e)return It.near(t,n);t=e.$head}return e.parent.inlineContent||(0==i||(e=(It.findFrom(e,-n,!0)||It.findFrom(e,n,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new Lt(e,t)}}It.jsonID("text",Lt);class Bt{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Bt(e.map(this.anchor),e.map(this.head))}resolve(e){return Lt.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ft extends It{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?It.near(r):new Ft(r)}content(){return new K(V.from(this.node),0,0)}eq(e){return e instanceof Ft&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Vt(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ft(e.resolve(t.anchor))}static create(e,t){return new Ft(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Ft.prototype.visible=!1,It.jsonID("node",Ft);class Vt{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Bt(n,n):new Vt(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Ft.isSelectable(n)?new Ft(t):It.near(t)}}class Wt extends It{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=K.empty){if(t==K.empty){e.delete(0,e.doc.content.size);let t=It.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Wt(e)}map(e){return new Wt(e)}eq(e){return e instanceof Wt}getBookmark(){return $t}}It.jsonID("all",Wt);const $t={map(){return this},resolve:e=>new Wt(e)};function Jt(e,t,n,i,r,o=!1){if(t.inlineContent)return Lt.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&&Ft.isSelectable(i))return Ft.create(e,n-(r<0?i.nodeSize:0))}else{let t=Jt(e,i,n+r,r<0?i.childCount:0,r,o);if(t)return t}n+=i.nodeSize*r}return null}function Ht(e,t,n){let i=e.steps.length-1;if(i<t)return;let r,o=e.steps[i];(o instanceof ct||o instanceof ht)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(It.near(e.doc.resolve(r),n)))}class Ut extends Dt{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 H.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)||H.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(It.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 Kt(e,t){return t&&e?e.bind(t):e}class Gt{constructor(e,t,n){this.name=e,this.init=Kt(t.init,n),this.apply=Kt(t.apply,n)}}const Yt=[new Gt("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Gt("selection",{init:(e,t)=>e.selection||It.atStart(t.doc),apply:e=>e.selection}),new Gt("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,i)=>i.selection.$cursor?e.storedMarks:null}),new Gt("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Xt{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Yt.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 Gt(e.key,e.spec.state,e))})}}class Zt{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 Zt(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 Ut(this)}static create(e){let t=new Xt(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Zt(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 Xt(this.schema,e.plugins),n=t.fields,i=new Zt(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 Xt(e.schema,e.plugins),r=new Zt(i);return i.fields.forEach(i=>{if("doc"==i.name)r.doc=de.fromJSON(e.schema,t.doc);else if("selection"==i.name)r.selection=It.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 Qt(e,t,n){for(let i in e){let r=e[i];r instanceof Function?r=r.bind(t):"handleDOMEvents"==i&&(r=Qt(r,t,{})),n[i]=r}return n}class en{constructor(e){this.spec=e,this.props={},e.props&&Qt(e.props,this,this.props),this.key=e.key?e.key.key:nn("plugin")}getState(e){return e[this.key]}}const tn=Object.create(null);function nn(e){return e in tn?e+"$"+ ++tn[e]:(tn[e]=0,e+"$")}class rn{constructor(e="key"){this.key=nn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const on=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},sn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let an=null;const ln=function(e,t,n){let i=an||(an=document.createRange());return i.setEnd(e,null==n?e.nodeValue.length:n),i.setStart(e,t||0),i},cn=function(e,t,n,i){return n&&(un(e,t,n,i,-1)||un(e,t,n,i,1))},hn=/^(img|br|input|textarea|hr)$/i;function un(e,t,n,i,r){for(var o;;){if(e==n&&t==i)return!0;if(t==(r<0?0:dn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||pn(e)||hn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=on(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?dn(e):0}}}}function dn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function pn(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 fn=function(e){return e.focusNode&&cn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function mn(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const gn="undefined"!=typeof navigator?navigator:null,yn="undefined"!=typeof document?document:null,vn=gn&&gn.userAgent||"",xn=/Edge\/(\d+)/.exec(vn),bn=/MSIE \d/.exec(vn),wn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(vn),kn=!!(bn||wn||xn),Sn=bn?document.documentMode:wn?+wn[1]:xn?+xn[1]:0,zn=!kn&&/gecko\/(\d+)/i.test(vn);zn&&(/Firefox\/(\d+)/.exec(vn)||[0,0])[1];const Cn=!kn&&/Chrome\/(\d+)/.exec(vn),Mn=!!Cn,Tn=Cn?+Cn[1]:0,Nn=!kn&&!!gn&&/Apple Computer/.test(gn.vendor),On=Nn&&(/Mobile\/\w+/.test(vn)||!!gn&&gn.maxTouchPoints>2),En=On||!!gn&&/Mac/.test(gn.platform),An=!!gn&&/Win/.test(gn.platform),jn=/Android \d/.test(vn),Dn=!!yn&&"webkitFontSmoothing"in yn.documentElement.style,Rn=Dn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function In(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 qn(e,t){return"number"==typeof e?e:e[t]}function Pn(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 _n(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=sn(s);continue}let e=s,n=e==o.body,a=n?In(o):Pn(e),l=0,c=0;if(t.top<a.top+qn(i,"top")?c=-(a.top-t.top+qn(r,"top")):t.bottom>a.bottom-qn(i,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+qn(r,"top")-a.top:t.bottom-a.bottom+qn(r,"bottom")),t.left<a.left+qn(i,"left")?l=-(a.left-t.left+qn(r,"left")):t.right>a.right-qn(i,"right")&&(l=t.right-a.right+qn(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:sn(s)}}function Ln(e){let t=[],n=e.ownerDocument;for(let i=e;i&&(t.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),e!=n);i=sn(i));return t}function Bn(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 Fn=null;function Vn(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=ln(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=Un(r,1);if(i.top!=i.bottom&&Wn(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}:Vn(n,i)}function Wn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function $n(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(Wn(t,r))return $n(n,t,r)}}if((o=(o+1)%i)==r)break}return e}function Jn(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(dn(i.offsetNode),i.offset)}}catch(e){}if(e.caretRangeFromPoint){let i=e.caretRangeFromPoint(t,n);if(i)return{node:i.startContainer,offset:Math.min(dn(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(!Wn(t,n))return null;if(a=$n(e.dom,t,n),!a)return null}if(Nn)for(let e=a;n&&e;e=sn(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(zn&&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;Dn&&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}=Vn(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 Hn(e){return e.top<e.bottom||e.left<e.right}function Un(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Hn(e))return e}return Array.prototype.find.call(n,Hn)||e.getBoundingClientRect()}const Kn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Gn(e,t,n){let{node:i,offset:r,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=Dn||zn;if(3==i.nodeType){if(!s||!Kn.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++,Yn(Un(ln(i,e,t),o),o<0)}{let e=Un(ln(i,r,r),n);if(zn&&r&&/\s/.test(i.nodeValue[r-1])&&r<i.nodeValue.length){let t=Un(ln(i,r-1,r-1),-1);if(t.top==e.top){let n=Un(ln(i,r,r+1),-1);if(n.top!=e.top)return Yn(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&r&&(n<0||r==dn(i))){let e=i.childNodes[r-1];if(1==e.nodeType)return Xn(e.getBoundingClientRect(),!1)}if(null==o&&r<dn(i)){let e=i.childNodes[r];if(1==e.nodeType)return Xn(e.getBoundingClientRect(),!0)}return Xn(i.getBoundingClientRect(),n>=0)}if(null==o&&r&&(n<0||r==dn(i))){let e=i.childNodes[r-1],t=3==e.nodeType?ln(e,dn(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Yn(Un(t,1),!1)}if(null==o&&r<dn(i)){let e=i.childNodes[r];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?ln(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Yn(Un(t,-1),!0)}return Yn(Un(3==i.nodeType?ln(i):i,-n),n>=0)}function Yn(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 Xn(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 Zn(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 Qn=/[\u0590-\u08ac]/;let ei=null,ti=null,ni=!1;function ii(e,t,n){return ei==t&&ti==n?ni:(ei=t,ti=n,ni="up"==n||"down"==n?function(e,t,n){let i=t.selection,r="up"==n?i.$from:i.$to;return Zn(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=Gn(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=ln(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?Qn.test(i.parent.textContent)&&a.modify?Zn(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 ri{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>on(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 ui){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 oi&&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?on(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?on(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=on(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=on(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((zn||Nn)&&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:on(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(zn&&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&&Nn)&&cn(s.node,s.offset,c.anchorNode,c.anchorOffset)&&cn(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((l.extend||e==t)&&(!h||!zn)){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 oi extends ri{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 si extends ri{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 ai extends ri{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=We.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new ai(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=ai.create(this.parent,this.mark,!0,n),r=this.children,o=this.size;t<o&&(r=zi(r,t,o,n)),e>0&&(r=zi(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 li extends ri{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=We.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=xi(c,n,t),l?s=new di(e,t,n,i,c,h||null,u,l,r,o+1):t.isText?new hi(e,t,n,i,c,u,r):new li(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=()=>V.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)&&bi(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 ki(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(Si);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?H.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),pi(this.contentDOM,this.children,e),On&&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 Lt)||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 si(this,r,t,i);e.input.compositionNodes.push(o),this.children=zi(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(bi(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=yi(this.dom,this.nodeDOM,gi(this.outerDeco,this.node,t),gi(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 ci(e,t,n,i,r){xi(i,t,e);let o=new li(void 0,e,t,n,i,i,i,r,0);return o.contentDOM&&o.updateChildren(r,0),o}class hi extends li{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 hi(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 ui extends ri{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 di extends li{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 pi(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=wi(i),r=!0;i=i.nextSibling}else r=!0,e.insertBefore(a,i);if(s instanceof ai){let t=i?i.previousSibling:e.lastChild;pi(s.contentDOM,s.children,n),i=t?t.nextSibling:e.firstChild}}for(;i;)i=wi(i),r=!0;r&&n.trackWrites==e&&(n.trackWrites=null)}const fi=function(e){e&&(this.nodeName=e)};fi.prototype=Object.create(null);const mi=[new fi];function gi(e,t,n){if(0==e.length)return mi;let i=n?mi[0]:new fi,r=[i];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&r.push(i=new fi(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==r.length&&r.push(i=new fi(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 yi(e,t,n,i){if(n==mi&&i==mi)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=mi[0]),r=t}vi(r,s||mi[0],o)}return r}function vi(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 xi(e,t,n){return yi(e,e,mi,gi(t,n,1!=e.nodeType))}function bi(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 wi(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ki{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 ai)){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=ai.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 li){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&&bi(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)||!bi(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let s=li.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=li.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 oi(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 ai;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof hi)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Nn||Mn)&&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 ui(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 Si(e,t){return e.type.side-t.type.side}function zi(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 Ci(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(fn(n)){for(a=s;r&&!r.node;)r=r.parent;let e=r.node;if(r&&e.isAtom&&Ft.isSelectable(e)&&r.parent&&(!e.isInline||!function(e,t,n){for(let i=0==t,r=t==dn(e);i||r;){if(e==n)return!0;let t=on(e);if(!(e=e.parentNode))return!1;i=i&&0==t,r=r&&t==dn(e)}}(n.focusNode,n.focusOffset,r.dom))){let e=r.posBefore;l=new Ft(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=Ri(e,h,c,"pointer"==t||e.state.selection.head<c.pos&&!o?1:-1)}return l}function Mi(e){return e.editable?e.hasFocus():qi(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ti(e,t=!1){let n=e.state.selection;if(ji(e,n),Mi(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Mn){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&cn(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,on(n)+1):t.collapse(n,0);!i&&!e.state.selection.visible&&kn&&Sn<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let i,r,{anchor:o,head:s}=n;!Ni||n instanceof Lt||(n.$from.parent.inlineContent||(i=Oi(e,n.from)),n.empty||n.$from.parent.inlineContent||(r=Oi(e,n.to))),e.docView.setSelection(o,s,e,t),Ni&&(i&&Ai(i),r&&Ai(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(()=>{Mi(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ni=Nn||Mn&&Tn<63;function Oi(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(Nn&&r&&"false"==r.contentEditable)return Ei(r);if(!(r&&"false"!=r.contentEditable||o&&"false"!=o.contentEditable)){if(r)return Ei(r);if(o)return Ei(o)}}function Ei(e){return e.contentEditable="true",Nn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ai(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ji(e,t){if(t instanceof Ft){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Di(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Di(e)}function Di(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Ri(e,t,n,i){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Lt.between(t,n,i)}function Ii(e){return!(e.editable&&!e.hasFocus())&&qi(e)}function qi(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 Pi(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&&It.findFrom(o,t)}function _i(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Li(e,t,n){let i=e.state.selection;if(!(i instanceof Lt)){if(i instanceof Ft&&i.node.isInline)return _i(e,new Lt(t>0?i.$to:i.$from));{let n=Pi(e.state,t);return!!n&&_i(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 _i(e,new Lt(i.$anchor,o))}if(!i.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Pi(e.state,t);return!!(n&&n instanceof Ft)&&_i(e,n)}if(!(En&&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)&&(Ft.isSelectable(o)?_i(e,new Ft(t<0?e.state.doc.resolve(r.pos-o.nodeSize):r)):!!Dn&&_i(e,new Lt(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function Bi(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Fi(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function Vi(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;zn&&1==n.nodeType&&i<Bi(n)&&Fi(n.childNodes[i],-1)&&(s=!0);for(;;)if(i>0){if(1!=n.nodeType)break;{let e=n.childNodes[i-1];if(Fi(e,-1))r=n,o=--i;else{if(3!=e.nodeType)break;n=e,i=n.nodeValue.length}}}else{if(Wi(n))break;{let t=n.previousSibling;for(;t&&Fi(t,-1);)r=n.parentNode,o=on(t),t=t.previousSibling;if(t)n=t,i=Bi(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}s?$i(e,n,i):r&&$i(e,r,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,o,s=Bi(n);for(;;)if(i<s){if(1!=n.nodeType)break;if(!Fi(n.childNodes[i],1))break;r=n,o=++i}else{if(Wi(n))break;{let t=n.nextSibling;for(;t&&Fi(t,1);)r=t.parentNode,o=on(t)+1,t=t.nextSibling;if(t)n=t,i=0,s=Bi(n);else{if(n=n.parentNode,n==e.dom)break;i=s=0}}}r&&$i(e,r,o)}(e)}function Wi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function $i(e,t,n){if(3!=t.nodeType){let e,i;(i=function(e,t){for(;e&&t==e.childNodes.length&&!pn(e);)t=on(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&&!pn(e);)t=on(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(fn(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&&Ti(e)},50)}function Ji(e,t){let n=e.state.doc.resolve(t);if(!Mn&&!An&&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 Hi(e,t,n){let i=e.state.selection;if(i instanceof Lt&&!i.empty||n.indexOf("s")>-1)return!1;if(En&&n.indexOf("m")>-1)return!1;let{$from:r,$to:o}=i;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Pi(e.state,t);if(n&&n instanceof Ft)return _i(e,n)}if(!r.parent.inlineContent){let n=t<0?r:o,s=i instanceof Wt?It.near(n,t):It.findFrom(n,t);return!!s&&_i(e,s)}return!1}function Ui(e,t){if(!(e.state.selection instanceof Lt))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 Ki(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Gi(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||En&&72==n&&"c"==i)return Ui(e,-1)||Vi(e,-1);if(46==n&&!t.shiftKey||En&&68==n&&"c"==i)return Ui(e,1)||Vi(e,1);if(13==n||27==n)return!0;if(37==n||En&&66==n&&"c"==i){let t=37==n?"ltr"==Ji(e,e.state.selection.from)?-1:1:-1;return Li(e,t,i)||Vi(e,t)}if(39==n||En&&70==n&&"c"==i){let t=39==n?"ltr"==Ji(e,e.state.selection.from)?1:-1:1;return Li(e,t,i)||Vi(e,t)}return 38==n||En&&80==n&&"c"==i?Hi(e,-1,i)||Vi(e,-1):40==n||En&&78==n&&"c"==i?function(e){if(!Nn||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;Ki(e,n,"true"),setTimeout(()=>Ki(e,n,"false"),20)}return!1}(e)||Hi(e,1,i)||Vi(e,1):i==(En?"m":"c")&&(66==n||73==n||89==n||90==n)}function Yi(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")||We.fromSchema(e.state.schema),a=sr(),l=a.createElement("div");l.appendChild(s.serializeFragment(i,{document:a}));let c,h=l.firstChild,u=0;for(;h&&1==h.nodeType&&(c=rr[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 Xi(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 K(V.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=We.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=sr().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e);(n=r&&rr[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;ar||(ar=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return ar.createHTML(e)}(e),n)for(let e=0;e<n.length;e++)i=i.querySelector(n[e])||i;return i}(n),Dn&&function(e){let t=e.querySelectorAll(Mn?"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")||De.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!h),context:r,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Zi.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=V.from(t.create(n[e+1],r)),o++,s++}return new K(r,o,s)}(ir(s,+h[1],+h[2]),h[4]);else if(s=K.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&&er(n,i,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=tr(o[o.length-1],i.length));let t=Qi(e,n);o.push(t),r=r.matchType(t.type),i=n}}),o)return V.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=ir(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,l)}),s}const Zi=/^(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 Qi(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,V.from(e));return e}function er(e,t,n,i,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let o=er(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(V.from(Qi(n,e,r+1))))}}function tr(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,tr(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(V.empty,!0);return e.copy(n.append(i))}function nr(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=nr(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(V.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function ir(e,t,n){return t<e.openStart&&(e=new K(nr(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new K(nr(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const rr={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 or=null;function sr(){return or||(or=document.implementation.createHTMLDocument("title"))}let ar=null;const lr={},cr={},hr={touchstart:!0,touchmove:!0};class ur{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 dr(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function pr(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>fr(e,t))})}function fr(e,t){return e.someProp("handleDOMEvents",n=>{let i=n[t.type];return!!i&&(i(e,t)||t.defaultPrevented)})}function mr(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 gr(e){return{left:e.clientX,top:e.clientY}}function yr(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 vr(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 xr(e,t,n,i,r){return yr(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 Ft&&(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(Ft.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&&(vr(e,Ft.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&&Ft.isSelectable(i))&&(vr(e,new Ft(n)),!0)}(e,n))}function br(e,t,n,i){return yr(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",n=>n(e,t,i))}function wr(e,t,n,i){return yr(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&&(vr(e,Lt.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)vr(e,Lt.create(i,o+1,o+1+n.content.size));else{if(!Ft.isSelectable(n))continue;vr(e,Ft.create(i,o))}return!0}}(e,n,i)}function kr(e){return Er(e)}cr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Cr(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!jn||!Mn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!On||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||Gi(e,n)?n.preventDefault():dr(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,mn(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},cr.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},cr.keypress=(e,t)=>{let n=t;if(Cr(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||En&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof Lt&&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 Sr=En?"metaKey":"ctrlKey";lr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=kr(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[Sr]&&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(gr(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new zr(e,s,n,!!i)):("doubleClick"==o?br:wr)(e,s.pos,s.inside,n)?n.preventDefault():dr(e,"pointer"))};class zr{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[Sr],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 Ft&&l.from<=o&&l.to>o)&&(this.mightDrag={node:r,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!zn||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)),dr(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(()=>Ti(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(gr(e))),this.updateAllowDefault(e),this.allowDefault||!t?dr(this.view,"pointer"):xr(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Nn&&this.mightDrag&&!this.mightDrag.node.isAtom||Mn&&!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)?(vr(this.view,It.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):dr(this.view,"pointer")}move(e){this.updateAllowDefault(e),dr(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 Cr(e,t){return!!e.composing||!!(Nn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}lr.touchstart=e=>{e.input.lastTouch=Date.now(),kr(e),dr(e,"pointer")},lr.touchmove=e=>{e.input.lastTouch=Date.now(),dr(e,"pointer")},lr.contextmenu=e=>kr(e);const Mr=jn?5e3:-1;function Tr(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Er(e),t))}function Nr(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 Or(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=dn(e=e.childNodes[t-1])}else{if(!e.parentNode||pn(e))return null;t=on(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||pn(e))return null;t=on(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 Er(e,t=!1){if(!(jn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Nr(e),t||e.docView&&e.docView.dirty){let n=Ci(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}}cr.compositionstart=cr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Lt&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||Mn&&An&&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(),Er(e,!0),e.markCursor=null;else if(Er(e,!t.selection.empty),zn&&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}Tr(e,Mr)},cr.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++,Tr(e,20))};const Ar=kn&&Sn<15||On&&Rn<604;function jr(e,t,n,i,r){let o=Xi(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,r,o||K.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 Dr(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," "):""}lr.copy=cr.cut=(e,t)=>{let n=t,i=e.state.selection,r="cut"==n.type;if(i.empty)return;let o=Ar?null:n.clipboardData,s=i.content(),{dom:a,text:l}=Yi(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"))},cr.paste=(e,t)=>{let n=t;if(e.composing&&!jn)return;let i=Ar?null:n.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;i&&jr(e,Dr(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?jr(e,i.value,null,r,t):jr(e,i.textContent,i.innerHTML,r,t)},50)}(e,n)};class Rr{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const Ir=En?"altKey":"ctrlKey";function qr(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[Ir]}lr.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(gr(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof Ft?o.to-1:o.to));else if(i&&i.mightDrag)r=Ft.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=Ft.create(e.state.doc,t.posBefore))}let a=(r||e.state.selection).content(),{dom:l,text:c,slice:h}=Yi(e,a);(!n.dataTransfer.files.length||!Mn||Tn>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ar?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ar||n.dataTransfer.setData("text/plain",c),e.dragging=new Rr(h,qr(e,n),r)},lr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},cr.dragover=cr.dragenter=(e,t)=>t.preventDefault(),cr.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(gr(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=Xi(e,Dr(t.dataTransfer),Ar?null:t.dataTransfer.getData("text/html"),!1,r);let s=!(!n||!qr(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||K.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&&Ft.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new Ft(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(Ri(e,d,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},lr.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())&&Ti(e)},20))},lr.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)},lr.beforeinput=(e,t)=>{if(Mn&&jn&&"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,mn(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 cr)lr[e]=cr[e];function Pr(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 _r{constructor(e,t){this.toDOM=e,this.spec=t||Wr,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 Fr(r-n,r-n,this)}valid(){return!0}eq(e){return this==e||e instanceof _r&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Pr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Lr{constructor(e,t){this.attrs=e,this.spec=t||Wr}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 Fr(r,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Lr&&Pr(this.attrs,e.attrs)&&Pr(this.spec,e.spec)}static is(e){return e.type instanceof Lr}destroy(){}}class Br{constructor(e,t){this.attrs=e,this.spec=t||Wr}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 Fr(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 Br&&Pr(this.attrs,e.attrs)&&Pr(this.spec,e.spec)}destroy(){}}class Fr{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Fr(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 Fr(e,e,new _r(t,n))}static inline(e,t,n,i){return new Fr(e,t,new Lr(n,i))}static node(e,t,n,i){return new Fr(e,t,new Br(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Lr}get widget(){return this.type instanceof _r}}const Vr=[],Wr={};class $r{constructor(e,t){this.local=e.length?e:Vr,this.children=t.length?t:Vr}static create(e,t){return t.length?Yr(t,e,0,Wr):Jr}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==Jr||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Wr)}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!=Jr?(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=Yr(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 $r(t.sort(Xr),a)}(this.children,o||[],e,t,n,i,r):o?new $r(o.sort(Xr),Vr):Jr}add(e,t){return t.length?this==Jr?$r.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=Kr(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,Yr(s,e,a+1,Wr)),r+=3}});let o=Ur(r?Gr(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new $r(o.length?this.local.concat(o).sort(Xr):this.local,i||this.children)}remove(e){return 0==e.length||this==Jr?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!=Jr?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 $r(i,n):Jr}forChild(e,t){if(this==Jr)return this;if(t.isLeaf)return $r.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 Lr){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 $r(i.sort(Xr),Vr);return n?new Hr([e,n]):e}return n||Jr}eq(e){if(this==e)return!0;if(!(e instanceof $r)||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 Zr(this.localsInner(e))}localsInner(e){if(this==Jr)return Vr;if(e.inlineContent||!this.local.some(Lr.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Lr||t.push(this.local[e]);return t}forEachSet(e){e(this)}}$r.empty=new $r([],[]),$r.removeOverlap=Zr;const Jr=$r.empty;class Hr{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,Wr));return Hr.from(n)}forChild(e,t){if(t.isLeaf)return $r.empty;let n=[];for(let i=0;i<this.members.length;i++){let r=this.members[i].forChild(e,t);r!=Jr&&(r instanceof Hr?n=n.concat(r.members):n.push(r))}return Hr.from(n)}eq(e){if(!(e instanceof Hr)||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?Zr(n?t:t.sort(Xr)):Vr}static from(e){switch(e.length){case 0:return Jr;case 1:return e[0];default:return new Hr(e.every(e=>e instanceof $r)?e:e.reduce((e,t)=>e.concat(t instanceof $r?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Ur(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 Fr(r.from+t,r.to+t,r.type))}return n}function Kr(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 Gr(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Yr(e,t,n,i){let r=[],o=!1;t.forEach((t,s)=>{let a=Kr(e,t,s+n);if(a){o=!0;let e=Yr(a,t,n+s+1,i);e!=Jr&&r.push(s,s+t.nodeSize,e)}});let s=Ur(o?Gr(e):e,-n).sort(Xr);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 $r(s,r):Jr}function Xr(e,t){return e.from-t.from||e.to-t.to}function Zr(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),Qr(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),Qr(t,r+1,o.copy(i.to,o.to)))}}return t}function Qr(e,t,n){for(;t<e.length&&Xr(n,e[t])>0;)t++;e.splice(t,0,n)}function eo(e){let t=[];return e.someProp("decorations",n=>{let i=n(e.state);i&&i!=Jr&&t.push(i)}),e.cursorWrapper&&t.push($r.create(e.state.doc,[e.cursorWrapper.deco])),Hr.from(t)}const to={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},no=kn&&Sn<=11;class io{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 ro{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new io,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]);kn&&Sn<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Nn&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),no&&(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,to)),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(Ii(this.view)){if(this.suppressingSelectionUpdates)return Ti(this.view);if(kn&&Sn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&cn(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=sn(t))n.add(t);for(let i=e.anchorNode;i;i=sn(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)&&Ii(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(zn&&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&&lo(e,n)==t||i.remove()}}}else if((Mn||Nn)&&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&&fn(n)&&(l=Ci(e))&&l.eq(It.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ti(e),this.currentSelection.set(n),e.scrollToSelection()):(r>-1||i)&&(r>-1&&(e.docView.markDirty(r,o),function(e){if(oo.has(e))return;if(oo.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=zn,so)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."),so=!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)||Ti(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(kn&&Sn<=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?on(i)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=r&&r.parentNode==e.target?on(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 oo=new WeakMap,so=!1;function ao(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return cn(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}function lo(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 co(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Nn&&/^(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||Nn&&/^(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 ho=/^(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 uo(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=Ci(e,t);if(n&&!e.state.selection.eq(n)){if(Mn&&jn&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,mn(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}],fn(c)||i.push({node:c.focusNode,offset:c.focusOffset})),Mn&&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")||De.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:co,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&&mo(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&&mo(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++,(On&&e.input.lastIOSEnter>Date.now()-225||jn)&&r.some(e=>1==e.nodeType&&!ho.test(e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",t=>t(e,mn(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!f){if(!(i&&h instanceof Lt&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=po(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 Lt&&(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)),kn&&Sn<=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((On&&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,mn(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||fo(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(fo(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||fo(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,mn(8,"Backspace"))))return void(jn&&Mn&&e.domObserver.suppressSelectionUpdates());Mn&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),jn&&!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,mn(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=po(e,n.doc,u.sel);t&&!(Mn&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==b||t.head==n.mapping.map(w)-1)||kn&&t.empty&&t.head==b)&&n.setSelection(t)}return o&&n.setMeta("composition",o),n.scrollIntoView()};if(v)if(m.pos==g.pos){kn&&Sn<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ti(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(V.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 po(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Ri(e,t.resolve(n.anchor),t.resolve(n.head))}function fo(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 mo(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 go{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 ur,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(wo),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=xo(this),vo(this),this.nodeViews=bo(this),this.docView=ci(this.state.doc,yo(this),eo(this),this.dom,this),this.domObserver=new ro(this,(e,t,n,i)=>uo(this,e,t,n,i)),this.domObserver.start(),function(e){for(let t in lr){let n=lr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!mr(e,t)||fr(e,t)||!e.editable&&t.type in cr||n(e,t)},hr[t]?{passive:!0}:void 0)}Nn&&e.dom.addEventListener("input",()=>null),pr(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&&pr(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(wo),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&&(Nr(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=bo(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)&&pr(this),this.editable=xo(this),vo(this);let a=eo(this),l=yo(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:Ln(e.dom)}}(this);if(o){this.domObserver.stop();let t=h&&(kn||Mn)&&!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=Mn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Or(this)),!r&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=ci(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 cn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Ti(this,t):(ji(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;Bn(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 Ft){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&_n(this,t.getBoundingClientRect(),e)}else _n(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 Rr(e.slice,e.move,i<0?void 0:Ft.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(kn){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(Fn)return e.focus(Fn);let t=Ln(e);e.focus(null==Fn?{get preventScroll(){return Fn={preventScroll:!0},!0}}:void 0),Fn||(Fn=!1,Bn(t,0))}(this.dom),Ti(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 Jn(this,e)}coordsAtPos(e,t=1){return Gn(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 ii(this,t||this.state,e)}pasteHTML(e,t){return jr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return jr(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Yi(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,[],eo(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,an=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){fr(e,t)||!lr[t.type]||!e.editable&&t.type in cr||lr[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?Nn&&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 ao(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?ao(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function yo(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"),[Fr.node(0,e.state.doc.content.size,t)]}function vo(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:Fr.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function xo(e){return!e.someProp("editable",t=>!1===t(e.state))}function bo(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 wo(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 ko;go.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};var So="ssml-editor-focused",zo="ssml-tag",Co="ssml-text-mark",Mo="ssml-editor-phoneme__char",To="ssml-editor-number-tip__char",No="ssml-editor-text-media__mark",Oo="preventFloatingMenu",Eo=(a(a(a(a(a(a(a(a(a(a(ko={},S.Word,"连读"),S.Breath,"换气"),S.Break,"停顿"),S.Phoneme,"多音字"),S.Speaker,"发音人"),S.SpeechRate,"语速"),S.SpeechPitch,"语调"),S.SpeechVolume,"音量"),S.SpeechLanguage,"语种"),S.Action,"动作"),a(a(a(a(a(a(a(ko,S.Avatar,"主播"),S.Emotion,"表情"),S.SayAs,a(a(a(a(a(a({},z.auto,"自动"),z.digits,"读数字"),z.cardinal,"读数值"),0,"自动"),1,"读数字"),2,"读数值")),S.Command,"指令"),S.Wait,"等待"),S.PptControl,"PPT控制"),S.SoundEvent,"音效")),Ao=a(a(a({},S.Word,"[w0]"),S.Breath,"[w3]"),S.SayAs,a(a(a({},z.auto,"[n0]"),z.digits,"[n1]"),z.cardinal,"[n2]")),jo=function(){function e(){r(this,e),a(this,"nodes",{}),a(this,"marks",{}),a(this,"plugins",{})}return s(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 p({},this.nodes)}},{key:"getMarks",value:function(){return p({},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 en?t:t(e)})}},{key:"clone",value:function(){var t=new e;return Object.entries(this.nodes).forEach(function(e){var n=y(e,2),i=n[0],r=n[1];return t.registerNode(i,r)}),Object.entries(this.marks).forEach(function(e){var n=y(e,2),i=n[0],r=n[1];return t.registerMark(i,r)}),Object.entries(this.plugins).forEach(function(e){var n=y(e,2),i=n[0],r=n[1];return t.registerPlugin(i,r)}),t}}])}(),Do=new jo,Ro="highlight";var Io=new en({key:new rn(Ro),state:{init:function(){return $r.empty},apply:function(e,t,n,i){var r=e.getMeta(Ro);return null!=r&&r.active?function(e,t,n){var i=[];return i.push(Fr.inline(t,n,{class:"ssml-text-highlight"})),$r.create(e,i)}(i.doc,r.from,r.to):!1===(null==r?void 0:r.active)?$r.empty:t.map(e.mapping,e.doc)}},props:{decorations:function(e){return this.getState(e)}}});Do.registerPlugin(Ro,Io);var qo={highlight:"highlight",clearHighlight:"clearHighlight"};q({name:qo.highlight,description:"高亮",execute:function(e,t){var n=e.state,i=e.dispatch;return i&&i(n.tr.setMeta(Ro,t)),{success:!0}},validate:function(e){return{available:!0}}}),q({name:qo.clearHighlight,description:"清除高亮",execute:function(e){var t=e.state,n=e.dispatch;return n&&n(t.tr.setMeta(Ro,{from:0,to:0,active:!1})),{success:!0}},validate:function(e){return{available:!0}}});var Po=200,_o=function(){};_o.prototype.append=function(e){return e.length?(e=_o.from(e),!this.length&&e||e.length<Po&&this.leafAppend(e)||this.length<Po&&e.leafPrepend(this)||this.appendInner(e)):this},_o.prototype.prepend=function(e){return e.length?_o.from(e).append(this):this},_o.prototype.appendInner=function(e){return new Bo(this,e)},_o.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?_o.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},_o.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},_o.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)},_o.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},_o.from=function(e){return e instanceof _o?e:e&&e.length?new Lo(e):_o.empty};var Lo=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<=Po)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Po)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}(_o);_o.empty=new Lo([]);var Bo=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}(_o);class Fo{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 Vo(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 Vo(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 Fo(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 Vo(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>$o&&(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 Fo(s.append(r),o)}remapping(e,t){let n=new et;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 Fo(this.items.append(e.map(e=>new Vo(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 Vo(l,o,c))}else n.push(new Vo(l))},i);let l=[];for(let e=t;e<o;e++)l.push(new Vo(r.maps[e]));let c=this.items.slice(0,i).append(l).append(n),h=new Fo(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 Vo(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 Fo(_o.from(i.reverse()),r)}}Fo.empty=new Fo(_o.empty,0);class Vo{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 Vo(t.getMap().invert(),t,this.selection)}}}class Wo{constructor(e,t,n,i,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=r}}const $o=20;function Jo(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 Ho(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 Uo=!1,Ko=null;function Go(e){let t=e.plugins;if(Ko!=t){Uo=!1,Ko=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Uo=!0;break}}return Uo}const Yo=new rn("history"),Xo=new rn("closeHistory");function Zo(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new en({key:Yo,state:{init:()=>new Wo(Fo.empty,Fo.empty,null,0,-1),apply:(t,n,i)=>function(e,t,n,i){let r,o=n.getMeta(Yo);if(o)return o.historyState;n.getMeta(Xo)&&(e=new Wo(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Yo))return s.getMeta(Yo).redo?new Wo(e.done.addTransform(n,void 0,i,Go(t)),e.undone,Jo(n.mapping.maps),e.prevTime,e.prevComposition):new Wo(e.done,e.undone.addTransform(n,void 0,i,Go(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new Wo(e.done.rebased(n,r),e.undone.rebased(n,r),Ho(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Wo(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Ho(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?Ho(e.prevRanges,n.mapping):Jo(n.mapping.maps);return new Wo(e.done.addTransform(n,o?t.selection.getBookmark():void 0,i,Go(t)),Fo.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?es:"historyRedo"==n?ts:null;return!(!i||!e.editable)&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}function Qo(e,t){return(n,i)=>{let r=Yo.getState(n);if(!r||0==(e?r.undone:r.done).eventCount)return!1;if(i){let o=function(e,t,n){let i=Go(t),r=Yo.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 Wo(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Yo,{redo:n,historyState:l})}(r,n,e);o&&i(t?o.scrollIntoView():o)}return!0}}const es=Qo(!1,!0),ts=Qo(!0,!0);var ns={undo:"undo",redo:"redo",clear:"clear"};q({name:ns.undo,description:"撤销",execute:function(e){var t=e.state,n=e.dispatch;return n&&es(t,n),{success:!0}},validate:function(e){return function(e){let t=Yo.getState(e);return t?t.done.eventCount:0}(e.state)<=0?{available:!1,reason:"历史栈为空"}:{available:!0}}}),q({name:ns.clear,description:"清空历史栈",execute:function(e){var t=e.state,n=e.view,i=e.editor,r=Zo(),o=Zt.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}}}),q({name:ns.redo,description:"重做",execute:function(e){var t=e.state,n=e.dispatch;return n&&ts(t,n),{success:!0}},validate:function(e){return function(e){let t=Yo.getState(e);return t?t.undone.eventCount:0}(e.state)<=0?{available:!1,reason:"重做栈为空"}:{available:!0}}});var is={inputText:"inputText",replaceRange:"replaceRange"};q({name:is.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 K(V.from(u),1,1),p=(h=h.replace(a,a,d)).mapping.map(a,1);return h.setSelection(Lt.near(h.doc.resolve(p))),i(h.scrollIntoView()),{success:!0}}return{success:!1,code:_.ParamsMissing,reason:"缺少内容"}},validate:function(e){return{available:!0}}}),q({name:is.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 K(V.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(Lt.near(f.doc.resolve(m))),i(f.scrollIntoView()),{success:!0}}return{success:!1,code:_.ParamsMissing,reason:"参数缺失"}},validate:function(e){return{available:!0}}});var rs={insertPptControl:"insertPptControl"};q({name:rs.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[S.PptControl].create(p(p({},n),{},{type:S.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[S.PptControl])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"文本光标处插入Ppt控制"}}});var ss={insertSoundEvent:"insertSoundEvent"};q({name:ss.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[S.SoundEvent].create(p(p({},i),{},{type:S.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[S.SoundEvent])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"当前位置无法插入音效节点"}}});var as={insertCommand:"insertCommand"};q({name:as.insertCommand,description:"插入指令",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Command].create(p(p({},n),{},{type:S.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[S.Command])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"文本光标处插入指令"}}});var ls={insertData:"insertData"};q({name:ls.insertData,description:"插入数据",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Data].create(p(p({},n),{},{type:S.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[S.Data])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"文本光标处插入数据槽位"}}});var cs={insertWait:"insertWait"};q({name:cs.insertWait,description:"插入等待",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Wait].create(p(p({},n),{},{type:S.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[S.Wait])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"文本光标处插入等待"}}});var hs={insertBreak:"insertBreak"};q({name:hs.insertBreak,description:"插入停顿节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Break].create(p(p({},n),{},{type:S.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[S.Break])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"光标插入文本设置停顿时长"}}});var us={insertBreath:"insertBreath"};q({name:us.insertBreath,description:"插入换气节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Breath].create(p(p({},n),{},{type:S.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[S.Breath])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"光标插入文本设置换气"}}});var ds=function(){return s(function e(t,n){r(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}}])}(),ps={"的":["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ā"]},fs="ssml-editor-popover",ms=function(){return s(function e(){var t=this;r(this,e),a(this,"tooltip",null),a(this,"root",null),a(this,"popoverController",null),a(this,"clickEvent",function(e){var n;null!==(n=e.target)&&void 0!==n&&n.closest(".".concat(fs))||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(fs),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=p({},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=f().m(function e(t,n,i){var r,o=this;return f().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)}),t=function(){var t=this,i=arguments;return new Promise(function(r,o){var s=e.apply(t,i);function a(e){n(s,r,o,a,l,"next",e)}function l(e){n(s,r,o,a,l,"throw",e)}a(void 0)})},function(e,n,i){return t.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,t}(),gs=new ms,ys={"ā":"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"},vs=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),ys[e]||e}))+t};var xs=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 bs(e){return e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}function ws(e){return e?e.replace(/'/g,"'").replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&"):""}function ks(e){return e.replace(/\u200b/g,"")}var Ss=new rn("polyphoneTip");var zs=new en({key:Ss,state:{init:function(){return{active:!1,decorations:$r.empty}},apply:function(e,t,n,i){var r,o=e.getMeta(Ss),s=null!==(r=null==o?void 0:o.active)&&void 0!==r?r:t.active,a=$r.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=xs(4);n.push(Fr.inline(r+o,r+o+1,{class:Mo,"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===S.Phoneme&&(o=e.attrs.text,t[o]&&i({pos:n,index:0,char:o}))}),$r.create(e,n)}(i.doc,ps):t.decorations.map(e.mapping,e.doc)),p(p({},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=zs.getState(e.state),r=n.target,o=r.closest(".".concat(Mo)),s=r.closest('[data-type="'.concat(S.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!==S.Phoneme)return!1;a=m.attrs.text,l=f.pos,c=f.pos+m.nodeSize}var g,y,x,b=(g=ps[a],y=new ds("ssml-editor-phoneme__list","ssml-editor-phoneme__item"),x=[].concat(v(g),[""]).map(function(e){return{label:e||"移除",value:vs(e)}}),y.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(Lt.create(e.state.doc,l,c));s=o?s.replaceSelectionWith(e.state.schema.nodes[S.Phoneme].create({value:o,text:a})):s.replaceSelectionWith(e.state.schema.text(a)),e.dispatch(s.setSelection(Lt.near(s.doc.resolve(l)))),gs.hide()}};return b.addEventListener("click",w),gs.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(Lt.create(e.state.doc,l,c)).setMeta(Oo,!0)),!0}}});Do.registerPlugin("phoneme",zs);var Cs={switchPhonemeMode:"switchPhonemeMode",insertPhoneme:"insertPhoneme"};q({name:Cs.switchPhonemeMode,description:"切换多音字模式",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r&&r(i.tr.setMeta(Ss,{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 Ms=/^[+-]?(?!0\d)\d{1,3}(?:,\d{3})*(?:\.\d+)?$|^[+-]?\d+(?:\.\d+)?$/,Ts={setSayAs:"setSayAs"};q({name:Ts.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)===S.SayAs&&(null===(i=u.nodeBefore)||void 0===i?void 0:i.type.name)===S.SayAs&&(d=h.nodeAfter.attrs.text||""),s?(s(o.tr.replaceSelectionWith(o.schema.nodes[S.SayAs].create({interpretAs:r.interpretAs,type:S.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:_.SelectionInvalid,reason:"请选择文本内容"};var h=r.doc.textBetween(s,a,"");return(null===(t=l.nodeAfter)||void 0===t?void 0:t.type.name)===S.SayAs&&(null===(n=c.nodeBefore)||void 0===n?void 0:n.type.name)===S.SayAs&&(h=l.nodeAfter.attrs.text||""),Ms.test(null===(i=h)||void 0===i?void 0:i.trim())?l.parent!==c.parent?{available:!1,code:_.SelectionInvalid,reason:"选区不能跨节点"}:{available:!0}:{available:!1,code:_.ParamsInvalid,reason:"请选择纯数字文本内容"}}}),q({name:E.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=xs(6),u=i.schema,d=u.marks,p=u.nodes,f=d[S.SpeechLanguage];if(l){if(r){var m=p[S.RangeAnchor].create({anchorType:"start",tagType:S.SpeechLanguage,value:n.value,tagId:h}),g=p[S.RangeAnchor].create({anchorType:"end",tagType:S.SpeechLanguage,value:n.value,tagId:h}),y=i.schema.text("",[f.create({value:n.value,tagId:h})]),v=V.from([m,y,g]);c.replaceWith(s,s,v);var x=s+m.nodeSize+y.nodeSize;c.setSelection(It.near(c.doc.resolve(x),-1)),r(c)}return{success:!0}}if(r){var b=f.create({value:n.value,tagId:h}),w=p[S.RangeAnchor].create({anchorType:"start",tagType:S.SpeechLanguage,value:n.value,tagId:h});c.insert(s,w);var k=p[S.RangeAnchor].create({anchorType:"end",tagType:S.SpeechLanguage,value:n.value,tagId:h});return c.insert(a+w.nodeSize,k),c.addMark(s+w.nodeSize,a+w.nodeSize,b),r(c),{success:!0}}return{success:!0}},validate:function(e){return{available:!0}}}),q({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:_.SelectionInvalid,reason:"请先选择文本"};if(r){var l=i.tr,c=xs(6),h=i.schema,u=h.marks,d=h.nodes,p=u[S.SpeechPitch].create({value:n.value,tagId:c}),f=d[S.RangeAnchor].create({anchorType:"start",tagType:S.SpeechPitch,value:n.value,tagId:c});l.insert(s,f);var m=d[S.RangeAnchor].create({anchorType:"end",tagType:S.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:_.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}}),q({name:T.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:_.SelectionInvalid,reason:"请先选择文本"};var l=[];if(i.doc.nodesBetween(s,a,function(e,t){var n=e.marks.find(function(e){return e.type.name===S.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=xs(6),u=i.schema,d=u.marks,p=u.nodes,f=d[S.SpeechRate].create({value:n.value,tagId:h}),m=p[S.RangeAnchor].create({anchorType:"start",tagType:S.SpeechRate,value:n.value,tagId:h});c.insert(s,m);var g=p[S.RangeAnchor].create({anchorType:"end",tagType:S.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:_.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}}),q({name:O.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:_.SelectionInvalid,reason:"请先选择文本"};if(r){var l=i.tr,c=xs(6),h=i.schema,u=h.marks,d=h.nodes,p=u[S.SpeechVolume].create({value:n.value,tagId:c}),f=d[S.RangeAnchor].create({anchorType:"start",tagType:S.SpeechVolume,value:n.value,tagId:c});l.insert(s,f);var m=d[S.RangeAnchor].create({anchorType:"end",tagType:S.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:_.SelectionInvalid,reason:"请选择文本内容"}:{available:!0}}});var Ns={insertWord:"insertWord"};function Os(){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 Es(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")}q({name:Ns.insertWord,description:"插入连读节点",execute:function(e,t){var n=t,i=e.state,r=e.dispatch;return r?(r(i.tr.replaceSelectionWith(i.schema.nodes[S.Word].create(p(p({},n),{},{type:S.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[S.Word])?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"光标插入文本设置连读"}}});var As={group:"inline",attrs:{type:{default:S.Action,validate:"string"},value:{default:"",validate:"string"},label:{default:Eo[S.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(zo," ").concat(zo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label||"".concat(Eo[S.Action]).concat(e.attrs.value)],Os()]},parseDOM:[{tag:"b[data-type='".concat(S.Action,"']"),getAttrs:function(e){var t=e.dataset,n=t.value;return{label:t.label||"".concat(Eo[S.Action]).concat(n),type:S.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(Eo[S.Action]).concat(o),type:S.Action,value:o}}}],handleClickOn:function(e,t,n,i,r){if(Es(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.Action,As);var js={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":S.PptControl,"data-value":encodeURIComponent(bs(e.attrs.value||"")),class:"".concat(zo," ").concat(zo,"-").concat(S.PptControl),"data-ppt-action":e.attrs.pptAction},["span",{class:"ssml-tag-label"},"".concat(Eo[S.PptControl]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Os()]},parseDOM:[{tag:"b[data-type='".concat(S.PptControl,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i,o=t.pptAction;return{type:S.PptControl,value:decodeURIComponent(ws(n||"")),label:r,pptAction:o}}}],handleClickOn:function(e,t,n,i,r){if(Es(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.PptControl,js);var Ds={group:"inline",attrs:{type:{default:S.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":S.SoundEvent,"data-value":e.attrs.value,"data-label":e.attrs.label,"data-volume":e.attrs.volume,class:"".concat(zo," ").concat(zo,"-soundEvent")},["span",{class:"ssml-tag-label"},"".concat(Eo[S.SoundEvent]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Os()]},parseDOM:[{tag:"b[data-type='".concat(S.SoundEvent,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i,o=t.volume;return{type:S.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:S.SoundEvent,value:n,label:r,volume:Number.isNaN(Number(o))?100:Number(o)}}}],handleClickOn:function(e,t,n,i,r){if(Es(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.SoundEvent,Ds);var Rs={group:"inline",attrs:{value:{default:"",validate:"string"},label:{default:""}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-type":S.Command,"data-value":e.attrs.value,class:"".concat(zo," ").concat(zo,"-").concat(S.Command)},["span",{class:"ssml-tag-label"},"".concat(Eo[S.Command]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Os()]},parseDOM:[{tag:"b[data-type='".concat(S.Command,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=t.label,r=void 0===i?"":i;return{type:S.Command,value:n,label:r}}}],handleClickOn:function(e,t,n,i,r){if(Es(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.Command,Rs);var Is={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":S.Data,"data-value":e.attrs.value,"data-label":e.attrs.name,class:"".concat(zo," ").concat(zo,"-").concat(S.Data)},["span",{class:"ssml-tag-label"},"{{ ".concat(null!==(t=e.attrs.label)&&void 0!==t?t:""," }}")],Os()]},parseDOM:[{tag:"b[data-type='".concat(S.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:S.Data,value:i,label:o}}}],handleClickOn:function(e,t,n,i,r){if(Es(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.Data,Is);var qs={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":S.Wait,"data-value":bs(e.attrs.value||""),class:"".concat(zo," ").concat(zo,"-").concat(S.Wait),"data-wait-type":e.attrs.waitType,"data-context":null!==(t=e.attrs.context)&&void 0!==t?t:""},["span",{class:"ssml-tag-label"},"".concat(Eo[S.Wait]).concat(e.attrs.label?":":"").concat(e.attrs.label||"")],Os()]},parseDOM:[{tag:"b[data-type='".concat(S.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:S.Wait,value:ws(n||""),label:r,waitType:o,context:null!=s?s:""}}}],handleClickOn:function(e,t,n,i,r){if(Es(r)){var o=e.state.tr.delete(i,i+n.nodeSize);return e.dispatch(o),!0}return!1}};Do.registerNode(S.Wait,qs);var Ps={group:"inline",attrs:{anchorType:{default:"start"},tagType:{default:S.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=Eo[r]||r,l=document.createElement("b");l.setAttribute("contenteditable","false"),l.classList.add(zo),l.classList.add("".concat(zo,"-").concat(r)),l.classList.add("".concat(zo,"-anchor-").concat(i)),l.dataset.type=S.RangeAnchor,l.dataset.anchorType=i,l.dataset.tagType=r,l.dataset.value=String(o),l.dataset.tagId=s,r===S.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===S.SpeechLanguage?o.toUpperCase():o;c.innerText="".concat(a).concat(h),l.appendChild(c),l.appendChild(Os())}else l.classList.add("range-anchor-end");return l},parseDOM:[{tag:"b[data-type='".concat(S.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(Es(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===S.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}};Do.registerNode(S.RangeAnchor,Ps);var _s={group:"inline",attrs:{type:{default:S.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":xs(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(zo," ").concat(zo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},t]]},parseDOM:[{tag:"b[data-type='".concat(S.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:S.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:S.Break,value:n}}}]};Do.registerNode(S.Break,_s);var Ls={group:"inline",attrs:{type:{default:S.Breath,validate:"string"},value:{default:Ao[S.Breath]},label:{default:Eo[S.Breath]}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-id":xs(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(zo," ").concat(zo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label]]},parseDOM:[{tag:"b[data-type='".concat(S.Breath,"']"),getAttrs:function(e){return{label:Eo[S.Breath],type:S.Breath,value:Ao[S.Breath]}}},{tag:"i.tts-mark-segmentation",getAttrs:function(e){return{label:Eo[S.Breath],type:S.Breath,value:Ao[S.Breath]}}}]};Do.registerNode(S.Breath,Ls);var Bs={group:"inline",attrs:{type:{default:S.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(zo," ").concat(zo,"-").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(S.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:S.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:S.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}};Do.registerNode(S.Phoneme,Bs);var Fs={group:"inline",attrs:{type:{default:S.SayAs,validate:"string"},interpretAs:{default:z.digits},text:{default:"",validate:"string"}},inline:!0,draggable:!1,selectable:!0,atom:!0,toDOM:function(e){var t;return["b",{"data-type":S.SayAs,"data-interpret-as":e.attrs.interpretAs,"data-text":e.attrs.text,class:"".concat(zo," ").concat(zo,"-say-as")},["span",{class:"tag-text"},e.attrs.text],["span",{class:"ssml-tag-label"},"".concat((null===(t=Eo[S.SayAs])||void 0===t?void 0:t[e.attrs.interpretAs])||"读法")]]},parseDOM:[{tag:"b.".concat(zo,"-say-as"),getAttrs:function(e){var t,n,i=e.dataset.interpretAs||z.digits;return{text:(null===(t=e.dataset.text)||void 0===t||null===(n=t.trim)||void 0===n?void 0:n.call(t))||"",type:S.SayAs,interpretAs:i}}},{tag:"b.".concat(zo,"-number"),getAttrs:function(e){var t,n=e.dataset,i=n.value,r=n.text,o={0:z.auto,1:z.digits,2:z.cardinal};return{text:null==r||null===(t=r.trim)||void 0===t?void 0:t.call(r),type:S.SayAs,interpretAs:o[null!=i?i:"1"]||z.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(!Ms.test((null===(t=a)||void 0===t||null===(n=t.trim)||void 0===n?void 0:n.call(t))||""))return!1;var h={0:z.auto,1:z.digits,2:z.cardinal};return{text:null===(i=a)||void 0===i||null===(r=i.trim)||void 0===r?void 0:r.call(i),type:S.SayAs,interpretAs:h[null!=o?o:"1"]||z.digits}}}],leafText:function(e){return e.attrs.text}};Do.registerNode(S.SayAs,Fs);var Vs={group:"inline",attrs:{type:{default:S.Word,validate:"string"},value:{default:Ao[S.Word]},label:{default:Eo[S.Word]}},inline:!0,draggable:!0,selectable:!1,atom:!0,toDOM:function(e){return["b",{"data-id":xs(4),"data-type":e.attrs.type,"data-value":e.attrs.value,class:"".concat(zo," ").concat(zo,"-").concat(e.attrs.type)},["span",{class:"ssml-tag-label"},e.attrs.label]]},parseDOM:[{tag:"b[data-type='".concat(S.Word,"']"),getAttrs:function(e){return{label:Eo[S.Word],type:S.Word,value:Ao[S.Word]}}},{tag:"i.tts-mark-continuity",getAttrs:function(e){return{label:Eo[S.Word],type:S.Word,value:Ao[S.Word]}}}]};Do.registerNode(S.Word,Vs);var Ws={attrs:{value:{default:"en-US"},tagId:{default:""}},inclusive:!0,group:k.textmedia,excludes:"".concat(S.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(Co," ").concat(Co,"-").concat(S.SpeechLanguage),"data-tag-id":r||xs(6),"data-type":S.SpeechLanguage,"data-value":i,dir:o?"rtl":"ltr"},0]},parseDOM:[{tag:"span[data-type='".concat(S.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?xs(6):r}}},{tag:"lang",getAttrs:function(e){return{value:e.getAttribute("xml:lang")||e.getAttribute("lang")||"en-US",tagId:xs(6)}}},{tag:"span[lang]",getAttrs:function(e){return{value:e.getAttribute("lang")||"en-US",tagId:xs(6)}}}]};Do.registerMark(S.SpeechLanguage,Ws);var $s={attrs:{value:{default:50},tagId:{default:""}},inclusive:!0,group:k.textmedia,excludes:"".concat(S.SpeechPitch),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(Co," ").concat(Co,"-").concat(S.SpeechPitch),"data-tag-id":i||xs(6),"data-type":S.SpeechPitch,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(S.SpeechPitch,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"50":n,r=t.tagId,o=void 0===r?xs(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:xs(6)}}}]};Do.registerMark(S.SpeechPitch,$s);var Js={attrs:{value:{default:70},tagId:{default:""}},inclusive:!0,group:k.textmedia,excludes:"".concat(S.SpeechRate),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(Co," ").concat(Co,"-").concat(S.SpeechRate),"data-tag-id":i||xs(6),"data-type":S.SpeechRate,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(S.SpeechRate,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"70":n,r=t.tagId,o=void 0===r?xs(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:xs(6)}}}]};Do.registerMark(S.SpeechRate,Js);var Hs={attrs:{value:{default:50},tagId:{default:""}},inclusive:!0,group:k.textmedia,excludes:"".concat(S.SpeechVolume),spanning:!0,toDOM:function(e){var t=e.attrs,n=t.value,i=t.tagId;return["span",{class:"".concat(Co," ").concat(Co,"-").concat(S.SpeechVolume),"data-tag-id":i||xs(6),"data-type":S.SpeechVolume,"data-value":n},0]},parseDOM:[{tag:"span[data-type='".concat(S.SpeechVolume,"']"),getAttrs:function(e){var t=e.dataset,n=t.value,i=void 0===n?"50":n,r=t.tagId,o=void 0===r?xs(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:xs(6)}}}]};Do.registerMark(S.SpeechVolume,Hs);var Us={attrs:{src:{default:""},mediaType:{default:"image"},extra:{default:""},name:{default:""},tagId:{default:""}},inclusive:!1,group:k.textmedia,excludes:k.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(Co," ").concat(Co,"-").concat(k.textmedia),"data-tag-id":o,"data-name":bs(r||""),"data-type":k.textmedia,"data-extra":bs("".concat(s||"")),"data-extra-type":a,"data-media-type":n,"data-media-src":bs("".concat(i||""))},0]},parseDOM:[{tag:"span[data-type='".concat(k.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=ws(h||"");if("json"===u)try{d=JSON.parse(d)}catch(e){D.warn("parse dataExtra fail",e)}return{tagId:a,src:o||"",name:ws(i),mediaType:c,extra:d}}}]};Do.registerMark(k.textmedia,Us);const Ks=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Gs(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 Ys(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 Xs(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 Zs(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 Qs=(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof Ft&&e.selection.node.isBlock)return!(!n.parentOffset||!yt(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=Zs(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 Lt||e.selection instanceof Wt)&&c.deleteSelection();let h=c.mapping.map(n.pos),u=yt(c.doc,h,s.length,s);if(u||(s[0]=o?{type:o}:null,u=yt(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 ea(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&&!vt(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=V.empty;for(let e=r.length-1;e>=0;e--)o=V.from(r[e].create(null,o));o=V.from(s.copy(o));let l=e.tr.step(new ht(t.pos-1,i,t.pos,i,new K(o,1,0),r.length,!0)),c=l.doc.resolve(i+2*r.length);c.nodeAfter&&c.nodeAfter.type==s.type&&vt(l.doc,c.pos)&&l.join(c.pos),n(l.scrollIntoView())}return!0}let h=a.type.spec.isolating||i>0&&l?null:It.findFrom(t,1),u=h&&h.$from.blockRange(h.$to),d=u&&ft(u);if(null!=d&&d>=t.depth)return n&&n(e.tr.lift(u,d).scrollIntoView()),!0;if(c&&Gs(a,"start",!0)&&Gs(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=V.empty;for(let e=r.length-1;e>=0;e--)i=V.from(r[e].copy(i));n(e.tr.step(new ht(t.pos-r.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new K(i,r.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ta(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(Lt.create(t.doc,e<0?r.start(o):r.end(o)))),!0)}}const na=ta(-1),ia=ta(1);function ra(...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 oa=ra(Ks,(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=Ys(i);if(!r){let n=i.blockRange(),r=n&&ft(n);return null!=r&&(t&&t(e.tr.lift(n,r).scrollIntoView()),!0)}let o=r.nodeBefore;if(ea(e,r,t,-1))return!0;if(0==i.parent.content.size&&(Gs(o,"end")||Ft.isSelectable(o)))for(let n=i.depth;;n--){let s=xt(e.doc,i.before(n),i.after(n),K.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(Gs(o,"end")?It.findFrom(n.doc.resolve(n.mapping.map(r.pos,-1)),-1):Ft.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=Ys(i)}let s=o&&o.nodeBefore;return!(!s||!Ft.isSelectable(s))&&(t&&t(e.tr.setSelection(Ft.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)}),sa=ra(Ks,(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=Xs(i);if(!r)return!1;let o=r.nodeAfter;if(ea(e,r,t,1))return!0;if(0==i.parent.content.size&&(Gs(o,"start")||Ft.isSelectable(o))){let n=xt(e.doc,i.before(),i.after(),K.empty);if(n&&n.slice.size<n.to-n.from){if(t){let i=e.tr.step(n);i.setSelection(Gs(o,"start")?It.findFrom(i.doc.resolve(i.mapping.map(r.pos)),1):Ft.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=Xs(i)}let s=o&&o.nodeAfter;return!(!s||!Ft.isSelectable(s))&&(t&&t(e.tr.setSelection(Ft.create(e.doc,o.pos)).scrollIntoView()),!0)});const aa={Enter:ra((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 Wt||i.parent.inlineContent||r.parent.inlineContent)return!1;let o=Zs(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(Lt.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(yt(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),r=i&&ft(i);return null!=r&&(t&&t(e.tr.lift(i,r).scrollIntoView()),!0)},Qs),"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=Zs(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(It.near(r.doc.resolve(i),1)),t(r.scrollIntoView())}return!0},Backspace:oa,"Mod-Backspace":oa,"Shift-Backspace":oa,Delete:sa,"Mod-Delete":sa,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Wt(e.doc))),!0)},la={"Ctrl-h":aa.Backspace,"Alt-Backspace":aa["Mod-Backspace"],"Ctrl-d":aa.Delete,"Ctrl-Alt-Backspace":aa["Mod-Delete"],"Alt-Delete":aa["Mod-Delete"],"Alt-d":aa["Mod-Delete"],"Ctrl-a":na,"Ctrl-e":ia};for(let e in aa)la[e]=aa[e];const ca=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?la:aa;for(var ha={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:"'"},ua={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},da="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),pa="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),fa=0;fa<10;fa++)ha[48+fa]=ha[96+fa]=String(fa);for(fa=1;fa<=24;fa++)ha[fa+111]="F"+fa;for(fa=65;fa<=90;fa++)ha[fa]=String.fromCharCode(fa+32),ua[fa]=String.fromCharCode(fa);for(var ma in ha)ua.hasOwnProperty(ma)||(ua[ma]=ha[ma]);const ga="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ya="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function va(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);ga?r=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),r&&(s="Meta-"+s),i&&(s="Shift-"+s),s}function xa(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 ba(e){return new en({props:{handleKeyDown:wa(e)}})}function wa(e){let t=function(e){let t=Object.create(null);for(let n in e)t[va(n)]=e[n];return t}(e);return function(e,n){let i,r=function(e){var t=!(da&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||pa&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?ua:ha)[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[xa(r,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==r.length&&" "!=r){if(n.shiftKey){let i=t[xa(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(ya&&n.ctrlKey&&n.altKey)&&(i=ha[n.keyCode])&&i!=r){let r=t[xa(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var ka=function(){return s(function e(){r(this,e),a(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()}}])}(),Sa=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 za(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 Ca=new rn("contextMenu"),Ma=function(e){function t(e,n){r(this,t);var o=null;return i(this,t,[{key:Ca,props:{handleDOMEvents:{contextmenu:function(t,i){var r,s;i.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=t.posAtCoords({left:i.clientX,top:i.clientY}),l={left:i.clientX,top:i.clientY},c=za({left:i.clientX,right:i.clientX,top:i.clientY,bottom:i.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=t.state.doc.resolve(a.pos),d=u.nodeAfter||u.nodeBefore||u.parent;d&&(h={type:d.type.name,attrs:d.attrs})}var f=t.state.selection,m=!!a&&(a.pos>=f.from&&a.pos<=f.to),g={isActive:!0,event:i,pos:null!==(r=null==a?void 0:a.pos)&&void 0!==r?r:0,coords:l,node:h,selection:{from:f.from,to:f.to,text:t.state.doc.textBetween(f.from,f.to," "),content:t.state.doc.slice(f.from,f.to).toJSON(),isClickInside:!f.empty&&m},target:o};e.emit(Sa.ContextMenu,g),null===(s=n.onRender)||void 0===s||s.call(n,o,g);var y=function(e){var t;if(null===(t=o)||void 0===t||!t.contains(e.target)){var i;if(o)null===(i=n.onRender)||void 0===i||i.call(n,o,p(p({},g),{},{isActive:!1}));window.removeEventListener("mousedown",y)}};return window.addEventListener("mousedown",y),!0}}},view:function(){return{destroy:function(){o&&o.remove()}}}}])}return h(t,e),s(t)}(en),Ta=new rn("floatingMenu"),Na=function(e){function t(e,n){r(this,t);var o=!1,s=!1;return i(this,t,[{key:Ta,state:{init:function(){return{prevent:!1}},apply:function(e,t){var n=e.getMeta(Oo);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(t){return new Oa(t,e,n,function(){return{isMouseDown:o,isContextMenuOpen:s,isPopoverVisible:gs.isVisible()}})}}])}return h(t,e),s(t)}(en),Oa=function(){return s(function e(t,n,i,o){r(this,e),this.editor=n,this.options=i,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=Ta.getState(i);if(null!=a&&a.prevent&&(s=!1),r instanceof Ft){var l=r.node.type.name;l!==S.SayAs&&l!==S.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(Sa.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=za(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(Sa.SelectionUpdate,x)}},{key:"destroy",value:function(){this.mountPoint.remove()}}])}(),Ea=new rn("maxLength"),Aa=function(e){function t(e,n){var o;return r(this,t),a(o=i(this,t,[{key:Ea,state:{init:function(t,n){var i=o.calculateCount(n.doc);return e.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(t){o.isComposing=!1;var n=t.state,i=o.calculateCount(n.doc);if(i>o.config.maxLength){var r=n.tr;o.truncateDocument(r,n.doc,n.schema),t.dispatch(r),e.emit("wordCount",{count:o.config.maxLength,exceeded:!0})}else e.emit("wordCount",{count:i,exceeded:!1});return!1}}},filterTransaction:function(t,n){if(t.docChanged){if(o.isComposing)return!0;var i=t.doc,r=o.calculateCount(i);if(r>=o.config.maxLength){var s=o.calculateCount(n.doc);if(s>=o.config.maxLength&&r>s)return e.emit("wordCount",{count:o.config.maxLength,exceeded:!0}),!1}if(r>o.config.maxLength)return o.truncateDocument(t,i,n.schema),e.emit("wordCount",{count:o.config.maxLength,exceeded:!0}),!0;e.emit("wordCount",{count:r,exceeded:!1})}return!0}}]),"config",{countBreak:!0,countSpaces:!0,excludeNodes:["paragraph"],maxLength:2e4}),a(o,"isComposing",!1),o.config=p(p({},o.config),n),o}return h(t,e),s(t,[{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(Lt.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)===S.Phoneme?1:((null==s?void 0:s.type.name)===S.SayAs||(null==s?void 0:s.type.name)===S.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===S.Phoneme||i===S.SayAs||"sayas"===i||"number"===i?{count:!0,text:e.attrs.text||""}:i===S.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}}])}(en),ja=new rn("placeholder");var Da=function(){return s(function e(){r(this,e),a(this,"editable",!0),this.editable=!0},[{key:"setEditable",value:function(e){this.editable=e}},{key:"getEditable",value:function(){return this.editable}}])}();function Ra(e){return e.type.name===S.Phoneme||e.type.name===S.SayAs||e.type.name===S.Sub}function Ia(e){return e.type.name===S.Break||e.type.name===S.Word||e.type.name===S.Breath||e.type.name===S.Action||e.type.name===S.Emotion||e.type.name===S.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:Ia,setPrototypeOf:qa,isFrozen:Pa,getPrototypeOf:_a,getOwnPropertyDescriptor:La}=Object;let{freeze:Ba,seal:Fa,create:Va}=Object,{apply:Wa,construct:$a}="undefined"!=typeof Reflect&&Reflect;Ba||(Ba=function(e){return e}),Fa||(Fa=function(e){return e}),Wa||(Wa=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)}),$a||($a=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 Ja=sl(Array.prototype.forEach),Ha=sl(Array.prototype.lastIndexOf),Ua=sl(Array.prototype.pop),Ka=sl(Array.prototype.push),Ga=sl(Array.prototype.splice),Ya=sl(String.prototype.toLowerCase),Xa=sl(String.prototype.toString),Za=sl(String.prototype.match),Qa=sl(String.prototype.replace),el=sl(String.prototype.indexOf),tl=sl(String.prototype.trim),nl=sl(Object.prototype.hasOwnProperty),il=sl(RegExp.prototype.test),rl=(ol=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return $a(ol,t)});var ol;function sl(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 Wa(e,t,i)}}function al(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ya;qa&&qa(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(Pa(t)||(t[i]=e),r=e)}e[r]=!0}return e}function ll(e){for(let t=0;t<e.length;t++){nl(e,t)||(e[t]=null)}return e}function cl(e){const t=Va(null);for(const[n,i]of Ia(e)){nl(e,n)&&(Array.isArray(i)?t[n]=ll(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=cl(i):t[n]=i)}return t}function hl(e,t){for(;null!==e;){const n=La(e,t);if(n){if(n.get)return sl(n.get);if("function"==typeof n.value)return sl(n.value)}e=_a(e)}return function(){return null}}const ul=Ba(["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"]),dl=Ba(["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"]),pl=Ba(["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"]),fl=Ba(["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"]),ml=Ba(["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"]),gl=Ba(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yl=Ba(["#text"]),vl=Ba(["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"]),xl=Ba(["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"]),bl=Ba(["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"]),wl=Ba(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),kl=Fa(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Sl=Fa(/<%[\w\W]*|[\w\W]*%>/gm),zl=Fa(/\$\{[\w\W]*/gm),Cl=Fa(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ml=Fa(/^aria-[\-\w]+$/),Tl=Fa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Nl=Fa(/^(?:\w+script|data):/i),Ol=Fa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),El=Fa(/^html$/i),Al=Fa(/^[a-z][.\w]*(-[.\w]+)+$/i);var jl=Object.freeze({__proto__:null,ARIA_ATTR:Ml,ATTR_WHITESPACE:Ol,CUSTOM_ELEMENT:Al,DATA_ATTR:Cl,DOCTYPE_NAME:El,ERB_EXPR:Sl,IS_ALLOWED_URI:Tl,IS_SCRIPT_OR_DATA:Nl,MUSTACHE_EXPR:kl,TMPLIT_EXPR:zl});const Dl=1,Rl=3,Il=7,ql=8,Pl=9,_l=function(){return"undefined"==typeof window?null:window};var Ll=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_l();const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||t.document.nodeType!==Pl||!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=hl(m,"cloneNode"),y=hl(m,"remove"),v=hl(m,"nextSibling"),x=hl(m,"childNodes"),b=hl(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:T}=r;let N={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Ia&&"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}=jl;let{IS_ALLOWED_URI:P}=jl,_=null;const L=al({},[...ul,...dl,...pl,...ml,...yl]);let B=null;const F=al({},[...vl,...xl,...bl,...wl]);let V=Object.seal(Va(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(Va(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let H=!0,U=!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=al({},["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=al({},["audio","video","img","source","image","track"]);let pe=null;const fe=al({},["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=al({},[me,ge,ye],Xa);let ke=al({},["mi","mo","mn","ms","mtext"]),Se=al({},["annotation-xml"]);const ze=al({},["title","style","font","a","script"]);let Ce=null;const Me=["application/xhtml+xml","text/html"];let Te=null,Ne=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(!Ne||Ne!==e){if(e&&"object"==typeof e||(e={}),e=cl(e),Ce=-1===Me.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Te="application/xhtml+xml"===Ce?Xa:Ya,_=nl(e,"ALLOWED_TAGS")?al({},e.ALLOWED_TAGS,Te):L,B=nl(e,"ALLOWED_ATTR")?al({},e.ALLOWED_ATTR,Te):F,be=nl(e,"ALLOWED_NAMESPACES")?al({},e.ALLOWED_NAMESPACES,Xa):we,pe=nl(e,"ADD_URI_SAFE_ATTR")?al(cl(fe),e.ADD_URI_SAFE_ATTR,Te):fe,ue=nl(e,"ADD_DATA_URI_TAGS")?al(cl(de),e.ADD_DATA_URI_TAGS,Te):de,ce=nl(e,"FORBID_CONTENTS")?al({},e.FORBID_CONTENTS,Te):he,W=nl(e,"FORBID_TAGS")?al({},e.FORBID_TAGS,Te):cl({}),$=nl(e,"FORBID_ATTR")?al({},e.FORBID_ATTR,Te):cl({}),le=!!nl(e,"USE_PROFILES")&&e.USE_PROFILES,H=!1!==e.ALLOW_ARIA_ATTR,U=!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||Tl,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&&(U=!1),ne&&(te=!0),le&&(_=al({},yl),B=[],!0===le.html&&(al(_,ul),al(B,vl)),!0===le.svg&&(al(_,dl),al(B,xl),al(B,wl)),!0===le.svgFilters&&(al(_,pl),al(B,xl),al(B,wl)),!0===le.mathMl&&(al(_,ml),al(B,bl),al(B,wl))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?J.tagCheck=e.ADD_TAGS:(_===L&&(_=cl(_)),al(_,e.ADD_TAGS,Te))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?J.attributeCheck=e.ADD_ATTR:(B===F&&(B=cl(B)),al(B,e.ADD_ATTR,Te))),e.ADD_URI_SAFE_ATTR&&al(pe,e.ADD_URI_SAFE_ATTR,Te),e.FORBID_CONTENTS&&(ce===he&&(ce=cl(ce)),al(ce,e.FORBID_CONTENTS,Te)),e.ADD_FORBID_CONTENTS&&(ce===he&&(ce=cl(ce)),al(ce,e.ADD_FORBID_CONTENTS,Te)),se&&(_["#text"]=!0),Z&&al(_,["html","head","body"]),_.table&&(al(_,["tbody"]),delete W.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw rl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw rl('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(""));Ba&&Ba(e),Ne=e}},je=al({},[...dl,...pl,...fl]),De=al({},[...ml,...gl]),Re=function(e){Ka(n.removed,{element:e});try{b(e).removeChild(e)}catch(t){y(e)}},Ie=function(e,t){try{Ka(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ka(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=Za(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){Ja(e,e=>{e.call(n,t,i,Ne)})}const Fe=function(e){let t=null;if(Be(N.beforeSanitizeElements,e,null),_e(e))return Re(e),!0;const i=Te(e.nodeName);if(Be(N.uponSanitizeElement,e,{tagName:i,allowedTags:_}),X&&e.hasChildNodes()&&!Le(e.firstElementChild)&&il(/<[/\w!]/g,e.innerHTML)&&il(/<[/\w!]/g,e.textContent))return Re(e),!0;if(e.nodeType===Il)return Re(e),!0;if(X&&e.nodeType===ql&&il(/<[/\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&&il(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=Ya(e.tagName),i=Ya(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||!il(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===Rl&&(t=e.textContent,Ja([O,E,A],e=>{t=Qa(t,e," ")}),e.textContent!==t&&(Ka(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(N.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(U&&!$[t]&&il(j,t));else if(H&&il(D,t));else if(J.attributeCheck instanceof Function&&J.attributeCheck(t,e));else if(!B[t]||$[t]){if(!(We(e)&&(V.tagNameCheck instanceof RegExp&&il(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&il(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t,e))||"is"===t&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&il(V.tagNameCheck,n)||V.tagNameCheck instanceof Function&&V.tagNameCheck(n))))return!1}else if(pe[t]);else if(il(P,Qa(n,I,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==el(n,"data:")||!ue[e]){if(K&&!il(R,Qa(n,I,"")));else if(n)return!1}else;return!0},We=function(e){return"annotation-xml"!==e&&Za(e,q)},$e=function(e){Be(N.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=Te(s),h=l;let u="value"===s?h:tl(h);if(i.attrName=c,i.attrValue=u,i.keepAttr=!0,i.forceKeepAttr=void 0,Be(N.uponSanitizeAttribute,e,i),u=i.attrValue,!oe||"id"!==c&&"name"!==c||(Ie(s,e),u="user-content-"+u),X&&il(/((--!?|])>)|<\/(style|title|textarea)/i,u)){Ie(s,e);continue}if("attributename"===c&&Za(u,"href")){Ie(s,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Ie(s,e);continue}if(!G&&il(/\/>/i,u)){Ie(s,e);continue}Y&&Ja([O,E,A],e=>{u=Qa(u,e," ")});const d=Te(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):Ua(n.removed)}catch(t){Ie(s,e)}}else Ie(s,e)}Be(N.afterSanitizeAttributes,e,null)},Je=function e(t){let n=null;const i=Pe(t);for(Be(N.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Be(N.uponSanitizeShadowNode,n,null),Fe(n),$e(n),n.content instanceof s&&e(n.content);Be(N.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 rl("toString is not a function");if("string"!=typeof(e=e.toString()))throw rl("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=Te(e.nodeName);if(!_[t]||W[t])throw rl("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===Dl&&"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=T.call(r,c,!0)),c}let u=Z?i.outerHTML:i.innerHTML;return Z&&_["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&il(El,i.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+u),Y&&Ja([O,E,A],e=>{u=Qa(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(){Ne=null,Q=!1},n.isValidAttribute=function(e,t,n){Ne||Ae({});const i=Te(e),r=Te(t);return Ve(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&Ka(N[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Ha(N[e],t);return-1===n?void 0:Ga(N[e],n,1)[0]}return Ua(N[e])},n.removeHooks=function(e){N[e]=[]},n.removeAllHooks=function(){N={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Bl=function(){return s(function e(){r(this,e)},null,[{key:"transform",value:function(e){if(!e)return"";var t=Ll.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(zo," ").concat(zo,'-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(Co," ").concat(Co,"-").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>")}}])}(),Fl=function(){return s(function e(){r(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){D.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)}})}}])}(),Vl=/\[((\w+\d*:?-?\d*)|(act-[^\]]+))\]/g,Wl={",":10,";":10,":":10,"、":5},$l=/\[\[data=(.*?)\]\]/;function Jl(e){return e?"[[data=".concat(e,"]]"):""}function Hl(e){var t=e.replace(Vl,"").replace(/\[\[action=(.*?)\]\]/g,"").replace($l,"").replace(/\[\[cmd=.*?\]\]/g,"").replace(/[“”"‘’'()\(\)\[\]\{\}、,。!?;:\s\n\t]/g,"").trim();return/([A-Za-z0-9])|([\u4e00-\u9fa5])/.test(t)}var Ul=function(){function e(){r(this,e),a(this,"currentPosition",0),a(this,"textRegExps",{}),a(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}),a(this,"ATOMIC_NODE_TYPES",["break","breath","word","phoneme","command","data","action","say-as","wait","ppt_control","range_anchor","soundEvent","sub"]),a(this,"SPLITED_NODE_TYPES",["command","data","ppt_control"]),a(this,"curParagraphLastRangeEvents",new Map)}return s(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 Hl(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="",d=[],f=[],m=function(){var e,s,l,c,h=arguments.length>0&&void 0!==arguments[0]&&arguments[0],m=u+r,g=[].concat(v(d),v(n)),y=[].concat(v(f.map(function(e){return p(p({},e),{},{charOffset:e.charOffset})})),v(i.map(function(e){return p(p({},e),{},{charOffset:e.charOffset+u.length})})));if(0!==g.length){var x=Hl(m)||/\[p\d+\]/.test(m);if(!x&&!h)return u=m,d=g,f=y,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,y.forEach(function(e){b.events.push(p(p({},e),{},{trigger:"after",charOffset:S+e.charOffset}))}),u="",d=[],f=[],n=[],i=[],r="",void(o=0)}}if(!x)return u="",d=[],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:y,marks:v(a),taskType:"text"}),u="",d=[],f=[],n=[],i=[],r="",o=0}},g=function(e){m(!0),t.push(p({text:"[p10]"},e))},y=0;y<e.length;y+=1){var x=e[y],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:v(a),taskType:"soundEvent"});else{var C,M,T=b,N=null===(C=x.marks)||void 0===C?void 0:C.find(function(e){return"textmedia"===e.type}),O=this.curParagraphLastRangeEvents.get("textmedia");if(N){if((null==O||null===(M=O.attrs)||void 0===M?void 0:M.src)!==N.attrs.src||"start"!==(null==O?void 0:O.eventLifeType)){var E=0===o;i.push({type:"textmedia",attrs:N.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(p(p({},O),{},{trigger:"inner",charOffset:o,eventLifeType:"stop"})),this.curParagraphLastRangeEvents.set("textmedia",i[i.length-1]));if("text"===w&&T){for(var A="",j=x.start,D=-1,R=0;R<T.length;R+=1){var I=T[R];if("\n"===I){if(A&&(r+=A,o+=A.length,n.push(p(p({},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(p(p({},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 $=Wl[I]||(V?10:1),J=-1!==D?T[D]:"";$>=(J?Wl[J]||(this.textRegExps.EN_MINOR.test(J)?10:1):-1)&&(D=R)}var H=!1;if(L||B){if(!("."===I&&R+1<T.length&&/\d/.test(T[R+1]))){for(var U=0,K=/[”"“)\)(\(「』」『【】> \n\s]/;R+1+U<T.length;){var G=T[R+1+U];if(!K.test(G))break;if(U++,"\n"===G)break}R+=U,H=!0}}else if(_>=this.config.CN_TARGET_MAX)if(F||V){for(var Y=0,X=/[”"“)\)(\(「』」『【】> \n\s]/;R+1+Y<T.length;){var Z=T[R+1+Y];if(!X.test(Z))break;if(Y++,"\n"===Z)break}R+=Y,H=!0}else _>1*this.config.CN_TARGET_MAX&&-1!==D&&(R=D,H=!0);else _>=(W?this.config.MAX_CHAR_CN:this.config.MAX_CHAR_EN)&&(H=!0);if(H&&h(r+A)){var Q=T.slice(j-x.start,R+1);r+=Q,o+=Q.length,n.push(p(p({},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(p(p({},x),{},{text:A,start:j,end:x.end})))}else{var ee;if("data"===w)r+=Jl(T);else r+=T,["phoneme","say-as","sub","word"].includes(w)&&null!==(ee=x.attrs)&&void 0!==ee&&ee.text&&(o+=x.attrs.text.length);n.push(x)}}y===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,v(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=[],d=0;d<n.length;d+=1){var f,m=n[d];(f=u).push.apply(f,v(m.preProcess)),m.sentences.length>0&&(h.push(p(p({},m),{},{preProcess:u,index:h.length})),u=[])}u.length>0&&h.length>0?(c=h[h.length-1].preProcess).push.apply(c,v(u)):u.length>0&&0===h.length&&n.length>0&&h.push(p(p({},n[0]),{},{preProcess:u,sentences:[],index:0}));var g=this.curParagraphLastRangeEvents.get("textmedia");if(g&&"stop"!==g.eventLifeType){for(var y,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)){y=b[w];break}}y&&y.events.push(p(p({},g),{},{trigger:"after",charOffset:y.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=C[(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}}])}(),Kl=function(e){if(!e||"object"!==b(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(Kl),e.marks&&Array.isArray(e.marks)&&e.marks.forEach(function(e){e.type&&t[e.type]&&(e.type=t[e.type])}),e},Gl=function(e){var t={type:"doc",content:[]};if(!e)return t;try{if("".concat(e).trim()){var n=JSON.parse(e);"doc"===(n=Kl(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){D.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},Yl=1e4,Xl=function(e){function t(e){var n,o,s;r(this,t),a(o=i(this,t),"wordcount",0),a(o,"maxWordCount",Yl),a(o,"defaultPlugins",[Zo(),(s={placeholder:"请输入内容..."},new en({key:Aa,state:{init:function(){return{placeholder:s.placeholder||"请输入内容..."}},apply:function(e,t){var n=e.getMeta(Aa);return n?p(p({},t),n):t}},props:{decorations:function(e){var t=e.doc;return this.spec.isEmpty(t)?$r.create(t,[Fr.widget(0,function(){var e=document.createElement("div");return e.classList.add("ssml-editor-placeholder"),e.textContent="请输入内容...",e})]):$r.empty}},isEmpty:function(e){return 1===e.childCount&&2===e.content.size}})),xa({"Mod-z":es,"Mod-y":ts}),xa(la),new Ea(o,{maxLength:Yl})]),a(o,"isEmptyContentSize",function(e){return 2===e}),o.editorStateStore=new ja,o.on(ka.WordCount,function(e){o.wordcount=e.count}),o.config=t.mergeConfig(e),o.registry=Do.clone(),o.commandRegister=I.clone(),o.maxWordCount=null!==(n=e.maxWordCount)&&void 0!==n?n:Yl;var l=[].concat(v(o.defaultPlugins),v(o.registry.getPlugins(o.editorStateStore)));o.config.floatingMenu&&l.push(new Ta(o,o.config.floatingMenu)),o.config.contextMenu&&l.push(new Ca(o,o.config.contextMenu));var c=l.find(function(e){return e.spec.key===Oa});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 Zt.create({schema:e,plugins:n});var i=e.nodeFromJSON(Gl(t));return Zt.create({doc:i,schema:e,plugins:n})}(function(e){return new Ae({nodes:p(p({},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 h(t,e),s(t,[{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=y(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 go(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&&(Da(l)||Ra(l))){var c=e.tr,h=r-l.nodeSize,u=r;if(Ra(l))return c.delete(h,u),t&&t(c),!0;if(Da(l)){var d=l.attrs.text||"";c.replaceWith(h,u,e.schema.text(d));var p=h+d.length;return c.setSelection(Lt.create(c.doc,p)),t&&t(c),!0}}var f=a.nodeAfter;if(f&&f.type.isInline&&(Da(f)||Ra(f))){var m=e.tr,g=r,y=r+f.nodeSize;if(Ra(f))return m.delete(g,y),t&&t(m),!0;if(Da(f)){var v=f.textContent;m.replaceWith(g,y,e.schema.text(v));var x=g+v.length;return m.setSelection(Lt.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(So),requestIdleCallback(function(){return e.dom.classList.remove("ProseMirror-focused")}),t.emit(ka.Focus,{focused:!0}),!1):(e.dom.blur(),!0)},blur:function(e,n){return e.dom.classList.remove(So),t.emit(ka.Focus,{focused:!1}),!1}},transformPastedHTML:function(e,t){return Bl.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(ka.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)||P.all){case P.selection:r=n.textBetween(i.from,i.to," ");break;case P.cursorRight:r=n.textBetween(i.$to.pos,n.content.size," ");break;case P.all:default:r=n.textContent}return bs(r)}},{key:"getPlaybackSegments",value:function(e){var t=this.view.state,n=t.selection,i=(null==e?void 0:e.contentMode)||P.all,r=0,o=t.doc.content.size;if(i===P.selection?(r=n.from,o=n.to):i===P.cursorRight&&(r=n.to,o=t.doc.content.size),r===o&&i!==P.all)return[];var s={type:"doc",content:t.doc.slice(r,o).content.toJSON()};return(new Ul).extractSentences(s,r).filter(function(e){return"text"===e.taskType||"soundEvent"===e.taskType}).map(function(e){return{type:e.taskType,text:bs(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:_.CommandNotFound,reason:"Command ".concat(e," not found")};if(!this.editorStateStore.editable&&![qo.clearHighlight,qo.highlight].includes(e))return{success:!1,code:_.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||_.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:_.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(Gl(e));if(i)i(r.tr.replaceWith(0,r.doc.content.size,o).scrollIntoView()),t&&this.execute(ns.clear)}else{i&&(i(r.tr.delete(0,r.doc.content.size)),t&&this.execute(ns.clear))}}},{key:"count",get:function(){return this.wordcount}},{key:"toJSON",value:function(){var e=this.view.state.toJSON(),t=function(e){if(!e||"object"!==b(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?bs(r):t(r),n[i]=r}),n};return t(e)}},{key:"setContentFromSSML",value:function(e){var t=Fl.ssmlToDOM(e),n=this.view.state.schema,i=De.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=Bl.transform(e),n=this.view.state.schema,i=(new DOMParser).parseFromString(t,"text/html").body,r=De.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 e,n,i,r;(n="removeAllListeners",i=this,"function"==typeof(r=l(c(t.prototype),n,i))?function(e){return r.apply(i,e)}:r)([]),this.view.destroy(),(null===(e=this.view.dom)||void 0===e?void 0:e.parentNode)===this.config.parent&&this.config.parent.removeChild(this.view.dom)}}],[{key:"mergeConfig",value:function(e){var t;return p(p({},e),{},{maxWordCount:null!==(t=e.maxWordCount)&&void 0!==t?t:Yl})}}])}(wa),Zl=new rn("numberTip"),Ql={switchNumberTipMode:"switchNumberTipMode"};q({name:Ql.switchNumberTipMode,description:"切换数字读法标注模式",execute:function(e,t){var n=e.state,i=e.dispatch,r=t;return i?(i(n.tr.setMeta(Zl,{active:!(null==r||!r.active)})),{success:!0}):{success:!0}}});var ec=/[+-]?(?:(?:\d{1,3}(?:,\d{3})+)|(?:\d+))(?:\.\d+)?/g;var tc=new en({key:Zl,state:{init:function(){return{active:!1,decorations:$r.empty}},apply:function(e,t,n,i){var r,o=e.getMeta(Zl),s=null!==(r=null==o?void 0:o.active)&&void 0!==r?r:t.active,a=$r.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(ec.lastIndex=0;null!==(i=ec.exec(e.text));){var r=i.index,o=i.index+i[0].length,s=i[0],a=ys(4);t.push(Fr.inline(n+r,n+o,{class:To,"data-number-tip-text":s,"data-deco-id":a},{decoId:a,text:s}))}else if(e.type.name===S.SayAs){var l=ys(4);t.push(Fr.inline(n,n+e.nodeSize,{class:To,"data-number-tip-text":e.attrs.text,"data-deco-id":l,"data-is-node":"true"},{decoId:l,text:e.attrs.text,isNode:!0}))}}),$r.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=tc.getState(e.state),r=n.target,o=r.closest(".".concat(To)),s=r.closest('[data-type="'.concat(S.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!==S.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:z.digits},{label:"读数值",value:z.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);ms.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(Lt.create(e.state.doc,l,c)).setMeta(Oo,!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(Lt.create(e.state.doc,l,c));i?r=r.replaceSelectionWith(e.state.schema.nodes[S.SayAs].create({interpretAs:i,text:a,type:S.SayAs})):h&&(r=r.replaceSelectionWith(e.state.schema.text(a))),e.dispatch(r.setSelection(Lt.near(r.doc.resolve(l)))),ms.hide()}};return y.addEventListener("click",v),!0}}});Do.registerPlugin("number-tip",tc);var nc=new rn("rangeBoundary");Do.registerPlugin("rangeBoundary",new en({key:nc,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===S.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===S.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(v(f),[p.create({value:u,tagId:d})])),r}if(s&&s.type.name===S.RangeAnchor&&"end"===s.attrs.anchorType){var m=s.attrs,g=m.tagType,y=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(v(w),[b.create({value:y,tagId:x})])),r}if(o&&o.type.name===S.RangeAnchor&&"end"===o.attrs.anchorType){var k=o.attrs.tagType,z=r.storedMarks||n.storedMarks||[];if(z.some(function(e){return e.type.name===k}))return r.setStoredMarks(z.filter(function(e){return e.type.name!==k})),r}if(o&&o.type.name===S.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===S.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===S.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===S.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(Lt.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===S.RangeAnchor&&"end"===r.attrs.anchorType&&i.parentOffset===i.parent.content.size){var o=e.state.tr;return o.insertText("",i.pos),o.setSelection(Lt.create(o.doc,i.pos)),o.setStoredMarks([]),e.dispatch(o),!0}return!1}}}));var ic,rc=new rn("rangeSync");Do.registerPlugin("rangeSync",(ic=[S.SpeechRate,S.SpeechPitch,S.SpeechVolume,S.SpeechLanguage],new en({key:rc,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){ic.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!==S.RangeAnchor)&&(l=!1),l}),l?i.to=t.pos+t.size:(a.push(p({},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:S.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:S.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===S.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 d=c[u],f=d.pos,m=d.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[S.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(ic.includes(e.type.name)){var n=e.attrs.tagId;return t.has(n)||t.set(n,ys(6)),e.type.create(p(p({},e.attrs),{},{tagId:t.get(n)}))}return e});if(e.type.name===S.RangeAnchor){var r=e.attrs.tagId;return t.has(r)||t.set(r,ys(6)),e.type.create(p(p({},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(V.from(o)).mark(i)}return e.mark(i)},i=[];return e.content.forEach(function(e){return i.push(n(e))}),new K(V.from(i),e.openStart,e.openEnd)}}})));var oc=new rn("readOnly");Do.registerPlugin("readOnly",function(e){return new en({key:oc,state:{init:function(){return $r.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 D.debug("filterTransaction",t),!(null==e||!e.editable)||!(null!==(n=t.steps)&&void 0!==n&&n.length||!t.selection)}})});var sc=new rn("speechLanguage");Do.registerPlugin("speechLanguage",new en({key:sc,state:{init:function(){return null},apply:function(e,t){return e.getMeta(sc)||t}}}));var ac=new rn("speechPitch");function lc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===S.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(p({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(Fr.inline(n,i,{class:"range-annotation-content speech-pitch-content","data-pitch":String(r)}))}),$r.create(e.doc,t)}function cc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===S.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(p({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(Fr.inline(n,i,{class:"range-annotation-content speech-rate-content","data-rate":String(r)}))}),$r.create(e.doc,t)}Do.registerPlugin("speechPitch",new en({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 hc=new rn("speechRate");Do.registerPlugin("speechRate",new en({key:hc,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 uc=new rn("speechVolume");function dc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===S.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(p({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(Fr.inline(n,i,{class:"range-annotation-content speech-volume-content","data-volume":String(r)}))}),$r.create(e.doc,t)}Do.registerPlugin("speechVolume",new en({key:uc,state:{init:function(e,t){return{decorations:dc(t)}},apply:function(e,t,n,i){return e.docChanged?{decorations:dc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}}));var pc="thumbnail-icon";function fc(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===k.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(Fr.widget(i,function(e,t,n){var i=document.createElement("b");i.className="".concat(No," ").concat(No,"__").concat(e),i.dataset.id=t,i.dataset.type=e;var r=document.createElement("span");r.classList.add(pc);var o=document.createElement("img");return o.src=n.src,o.style.maxHeight="1em",r.appendChild(o),i.append(r,Ns()),i}("start",n.attrs.tagId,n.attrs),{side:1,key:"start-".concat(n.attrs.tagId)}))}),$r.create(e.doc,t)}var mc=new rn("textMedia");Do.registerPlugin("textMedia",new en({key:mc,state:{init:function(e,t){return{decorations:fc(t)}},apply:function(e,t,n,i){return e.docChanged||e.getMeta("text-media-update")?{decorations:fc(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(No));if(!o)return!1;var s=o.dataset,a=s.id,l=s.type;if(!a)return!1;if("start"===l)if(Os(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===k.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(pc))}(n.target)){var f,m,g=e.state.plugins.find(function(e){return e.spec.key===mc}),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===k.textmedia});n&&y.push(null==n?void 0:n.attrs)}),y.length&&(null===(f=(m=g.spec).emitEvent)||void 0===f||f.call(m,ka.PluginTextMediaClick,y[0]))}return!1}}}));var gc=s(function e(t){r(this,e),this.name=t.name,this.description=t.description,this.execute=t.execute}),yc=new rn("wordmark"),vc=function(e){return e.markWord="markWord",e.clearWordMark="clearWordMark",e}({});function xc(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(Fr.inline(s,a,{class:"ssml-word-mark"})),r=o+t.length,o=e.text.indexOf(t,r)}}),$r.create(e,n)):$r.empty}var bc=new en({key:yc,state:{init:function(){return{word:"",decorations:$r.empty}},apply:function(e,t,n,i){var r=e.getMeta(yc),o=t.word;return r&&"string"==typeof r.word&&(o=r.word),o!==t.word||e.docChanged?{word:o,decorations:xc(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}}});q(new gc({name:vc.markWord,execute:function(e,t){if("string"!=typeof t||!t)return{success:!1,code:t?_.ParamsInvalid:_.ParamsMissing,reason:"Invalid word"};var n=e.state.tr.setMeta(yc,{word:t});return e.dispatch(n),{success:!0}}})),q(new gc({name:vc.clearWordMark,execute:function(e){var t=e.state.tr.setMeta(yc,{word:""});return e.dispatch(t),{success:!0}}})),Do.registerPlugin("wordmark",bc);var wc={setTextMedia:"setTextMedia",resetTextMediaStoredMark:"resetTextMediaStoredMark"};q({name:wc.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[k.textmedia].create(p({tagId:ys(6)},n))).scrollIntoView()),{success:!0}},validate:function(e,t){return e.state.selection.empty?{available:!1,code:_.SelectionInvalid,reason:"选中文本设置媒体"}:{available:!0}}}),q({name:wc.resetTextMediaStoredMark,description:"重置当前光标文案媒体",execute:function(e){var t=e.state,n=e.dispatch,i=t.schema.marks[k.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===k.textmedia})?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"当前光标不在图片范围"}}}),e.ActionCommands=M,e.BreakCommands=hs,e.BreathCommands=us,e.CmdCommands=as,e.CommandErrorCode=_,e.ContentReadMode=P,e.ContextMenuPlugin=Ca,e.DataCommands=ls,e.DataPlaceholderReg=$l,e.EditorEvent=ka,e.FloatingMenuPlugin=Ta,e.HighlightCommands=qo,e.HistoryCommands=ns,e.LogLevel=A,e.MarkEditor=Xl,e.MarkTagType=S,e.NumberTipCommands=Ql,e.PhonemeCommands=zs,e.PptCommands=rs,e.SayAsCommands=Ms,e.SayAsInterpretType=z,e.SoundEventCommands=ss,e.SpeechLanguageCommands=E,e.SpeechPitchCommands=N,e.SpeechRateCommands=T,e.SpeechVolumeCommands=O,e.TextExtractor=Ul,e.TextInputCommands=is,e.TextMediaCommands=wc,e.WaitCommands=cs,e.WordCommands=Ts,e.WordmarkCommands=vc,e.logger=D,e.registerCommand=q,e.registry=Do});
|
|
5
|
+
const{entries:qa,setPrototypeOf:Pa,isFrozen:_a,getPrototypeOf:La,getOwnPropertyDescriptor:Ba}=Object;let{freeze:Fa,seal:Va,create:Wa}=Object,{apply:$a,construct:Ja}="undefined"!=typeof Reflect&&Reflect;Fa||(Fa=function(e){return e}),Va||(Va=function(e){return e}),$a||($a=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)}),Ja||(Ja=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 Ha=al(Array.prototype.forEach),Ua=al(Array.prototype.lastIndexOf),Ka=al(Array.prototype.pop),Ga=al(Array.prototype.push),Ya=al(Array.prototype.splice),Xa=al(String.prototype.toLowerCase),Za=al(String.prototype.toString),Qa=al(String.prototype.match),el=al(String.prototype.replace),tl=al(String.prototype.indexOf),nl=al(String.prototype.trim),il=al(Object.prototype.hasOwnProperty),rl=al(RegExp.prototype.test),ol=(sl=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ja(sl,t)});var sl;function al(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 $a(e,t,i)}}function ll(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Xa;Pa&&Pa(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(_a(t)||(t[i]=e),r=e)}e[r]=!0}return e}function cl(e){for(let t=0;t<e.length;t++){il(e,t)||(e[t]=null)}return e}function hl(e){const t=Wa(null);for(const[n,i]of qa(e)){il(e,n)&&(Array.isArray(i)?t[n]=cl(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=hl(i):t[n]=i)}return t}function ul(e,t){for(;null!==e;){const n=Ba(e,t);if(n){if(n.get)return al(n.get);if("function"==typeof n.value)return al(n.value)}e=La(e)}return function(){return null}}const dl=Fa(["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"]),pl=Fa(["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"]),fl=Fa(["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"]),ml=Fa(["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"]),gl=Fa(["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"]),yl=Fa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),vl=Fa(["#text"]),xl=Fa(["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"]),bl=Fa(["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"]),wl=Fa(["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"]),kl=Fa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Sl=Va(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zl=Va(/<%[\w\W]*|[\w\W]*%>/gm),Cl=Va(/\$\{[\w\W]*/gm),Ml=Va(/^data-[\-\w.\u00B7-\uFFFF]+$/),Tl=Va(/^aria-[\-\w]+$/),Nl=Va(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ol=Va(/^(?:\w+script|data):/i),El=Va(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Al=Va(/^html$/i),jl=Va(/^[a-z][.\w]*(-[.\w]+)+$/i);var Dl=Object.freeze({__proto__:null,ARIA_ATTR:Tl,ATTR_WHITESPACE:El,CUSTOM_ELEMENT:jl,DATA_ATTR:Ml,DOCTYPE_NAME:Al,ERB_EXPR:zl,IS_ALLOWED_URI:Nl,IS_SCRIPT_OR_DATA:Ol,MUSTACHE_EXPR:Sl,TMPLIT_EXPR:Cl});const Rl=1,Il=3,ql=7,Pl=8,_l=9,Ll=function(){return"undefined"==typeof window?null:window};var Bl=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ll();const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||t.document.nodeType!==_l||!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=ul(m,"cloneNode"),y=ul(m,"remove"),v=ul(m,"nextSibling"),x=ul(m,"childNodes"),b=ul(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:T}=r;let N={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof qa&&"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}=Dl;let{IS_ALLOWED_URI:P}=Dl,_=null;const L=ll({},[...dl,...pl,...fl,...gl,...vl]);let B=null;const F=ll({},[...xl,...bl,...wl,...kl]);let V=Object.seal(Wa(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(Wa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let H=!0,U=!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=ll({},["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=ll({},["audio","video","img","source","image","track"]);let pe=null;const fe=ll({},["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=ll({},[me,ge,ye],Za);let ke=ll({},["mi","mo","mn","ms","mtext"]),Se=ll({},["annotation-xml"]);const ze=ll({},["title","style","font","a","script"]);let Ce=null;const Me=["application/xhtml+xml","text/html"];let Te=null,Ne=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(!Ne||Ne!==e){if(e&&"object"==typeof e||(e={}),e=hl(e),Ce=-1===Me.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Te="application/xhtml+xml"===Ce?Za:Xa,_=il(e,"ALLOWED_TAGS")?ll({},e.ALLOWED_TAGS,Te):L,B=il(e,"ALLOWED_ATTR")?ll({},e.ALLOWED_ATTR,Te):F,be=il(e,"ALLOWED_NAMESPACES")?ll({},e.ALLOWED_NAMESPACES,Za):we,pe=il(e,"ADD_URI_SAFE_ATTR")?ll(hl(fe),e.ADD_URI_SAFE_ATTR,Te):fe,ue=il(e,"ADD_DATA_URI_TAGS")?ll(hl(de),e.ADD_DATA_URI_TAGS,Te):de,ce=il(e,"FORBID_CONTENTS")?ll({},e.FORBID_CONTENTS,Te):he,W=il(e,"FORBID_TAGS")?ll({},e.FORBID_TAGS,Te):hl({}),$=il(e,"FORBID_ATTR")?ll({},e.FORBID_ATTR,Te):hl({}),le=!!il(e,"USE_PROFILES")&&e.USE_PROFILES,H=!1!==e.ALLOW_ARIA_ATTR,U=!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||Nl,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&&(U=!1),ne&&(te=!0),le&&(_=ll({},vl),B=[],!0===le.html&&(ll(_,dl),ll(B,xl)),!0===le.svg&&(ll(_,pl),ll(B,bl),ll(B,kl)),!0===le.svgFilters&&(ll(_,fl),ll(B,bl),ll(B,kl)),!0===le.mathMl&&(ll(_,gl),ll(B,wl),ll(B,kl))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?J.tagCheck=e.ADD_TAGS:(_===L&&(_=hl(_)),ll(_,e.ADD_TAGS,Te))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?J.attributeCheck=e.ADD_ATTR:(B===F&&(B=hl(B)),ll(B,e.ADD_ATTR,Te))),e.ADD_URI_SAFE_ATTR&&ll(pe,e.ADD_URI_SAFE_ATTR,Te),e.FORBID_CONTENTS&&(ce===he&&(ce=hl(ce)),ll(ce,e.FORBID_CONTENTS,Te)),e.ADD_FORBID_CONTENTS&&(ce===he&&(ce=hl(ce)),ll(ce,e.ADD_FORBID_CONTENTS,Te)),se&&(_["#text"]=!0),Z&&ll(_,["html","head","body"]),_.table&&(ll(_,["tbody"]),delete W.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw ol('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw ol('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(""));Fa&&Fa(e),Ne=e}},je=ll({},[...pl,...fl,...ml]),De=ll({},[...gl,...yl]),Re=function(e){Ga(n.removed,{element:e});try{b(e).removeChild(e)}catch(t){y(e)}},Ie=function(e,t){try{Ga(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ga(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=Qa(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){Ha(e,e=>{e.call(n,t,i,Ne)})}const Fe=function(e){let t=null;if(Be(N.beforeSanitizeElements,e,null),_e(e))return Re(e),!0;const i=Te(e.nodeName);if(Be(N.uponSanitizeElement,e,{tagName:i,allowedTags:_}),X&&e.hasChildNodes()&&!Le(e.firstElementChild)&&rl(/<[/\w!]/g,e.innerHTML)&&rl(/<[/\w!]/g,e.textContent))return Re(e),!0;if(e.nodeType===ql)return Re(e),!0;if(X&&e.nodeType===Pl&&rl(/<[/\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&&rl(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=Xa(e.tagName),i=Xa(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||!rl(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===Il&&(t=e.textContent,Ha([O,E,A],e=>{t=el(t,e," ")}),e.textContent!==t&&(Ga(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(N.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(U&&!$[t]&&rl(j,t));else if(H&&rl(D,t));else if(J.attributeCheck instanceof Function&&J.attributeCheck(t,e));else if(!B[t]||$[t]){if(!(We(e)&&(V.tagNameCheck instanceof RegExp&&rl(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&rl(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t,e))||"is"===t&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&rl(V.tagNameCheck,n)||V.tagNameCheck instanceof Function&&V.tagNameCheck(n))))return!1}else if(pe[t]);else if(rl(P,el(n,I,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==tl(n,"data:")||!ue[e]){if(K&&!rl(R,el(n,I,"")));else if(n)return!1}else;return!0},We=function(e){return"annotation-xml"!==e&&Qa(e,q)},$e=function(e){Be(N.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=Te(s),h=l;let u="value"===s?h:nl(h);if(i.attrName=c,i.attrValue=u,i.keepAttr=!0,i.forceKeepAttr=void 0,Be(N.uponSanitizeAttribute,e,i),u=i.attrValue,!oe||"id"!==c&&"name"!==c||(Ie(s,e),u="user-content-"+u),X&&rl(/((--!?|])>)|<\/(style|title|textarea)/i,u)){Ie(s,e);continue}if("attributename"===c&&Qa(u,"href")){Ie(s,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Ie(s,e);continue}if(!G&&rl(/\/>/i,u)){Ie(s,e);continue}Y&&Ha([O,E,A],e=>{u=el(u,e," ")});const d=Te(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):Ka(n.removed)}catch(t){Ie(s,e)}}else Ie(s,e)}Be(N.afterSanitizeAttributes,e,null)},Je=function e(t){let n=null;const i=Pe(t);for(Be(N.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Be(N.uponSanitizeShadowNode,n,null),Fe(n),$e(n),n.content instanceof s&&e(n.content);Be(N.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 ol("toString is not a function");if("string"!=typeof(e=e.toString()))throw ol("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=Te(e.nodeName);if(!_[t]||W[t])throw ol("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===Rl&&"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=T.call(r,c,!0)),c}let u=Z?i.outerHTML:i.innerHTML;return Z&&_["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&rl(Al,i.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+u),Y&&Ha([O,E,A],e=>{u=el(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(){Ne=null,Q=!1},n.isValidAttribute=function(e,t,n){Ne||Ae({});const i=Te(e),r=Te(t);return Ve(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&Ga(N[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Ua(N[e],t);return-1===n?void 0:Ya(N[e],n,1)[0]}return Ka(N[e])},n.removeHooks=function(e){N[e]=[]},n.removeAllHooks=function(){N={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Fl=function(){return s(function e(){r(this,e)},null,[{key:"transform",value:function(e){if(!e)return"";var t=Bl.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(zo," ").concat(zo,'-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(Co," ").concat(Co,"-").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>")}}])}(),Vl=function(){return s(function e(){r(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){D.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)}})}}])}(),Wl=/\[((\w+\d*:?-?\d*)|(act-[^\]]+))\]/g,$l={",":10,";":10,":":10,"、":5},Jl=/\[\[data=(.*?)\]\]/;function Hl(e){return e?"[[data=".concat(e,"]]"):""}function Ul(e){var t=e.replace(Wl,"").replace(/\[\[action=(.*?)\]\]/g,"").replace(Jl,"").replace(/\[\[cmd=.*?\]\]/g,"").replace(/[“”"‘’'()\(\)\[\]\{\}、,。!?;:\s\n\t]/g,"").trim();return/([A-Za-z0-9])|([\u4e00-\u9fa5])/.test(t)}var Kl=function(){function e(){r(this,e),a(this,"currentPosition",0),a(this,"textRegExps",{}),a(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}),a(this,"ATOMIC_NODE_TYPES",["break","breath","word","phoneme","command","data","action","say-as","wait","ppt_control","range_anchor","soundEvent","sub"]),a(this,"SPLITED_NODE_TYPES",["command","data","ppt_control"]),a(this,"curParagraphLastRangeEvents",new Map)}return s(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 Ul(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="",d=[],f=[],m=function(){var e,s,l,c,h=arguments.length>0&&void 0!==arguments[0]&&arguments[0],m=u+r,g=[].concat(v(d),v(n)),y=[].concat(v(f.map(function(e){return p(p({},e),{},{charOffset:e.charOffset})})),v(i.map(function(e){return p(p({},e),{},{charOffset:e.charOffset+u.length})})));if(0!==g.length){var x=Ul(m)||/\[p\d+\]/.test(m);if(!x&&!h)return u=m,d=g,f=y,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,y.forEach(function(e){b.events.push(p(p({},e),{},{trigger:"after",charOffset:S+e.charOffset}))}),u="",d=[],f=[],n=[],i=[],r="",void(o=0)}}if(!x)return u="",d=[],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:y,marks:v(a),taskType:"text"}),u="",d=[],f=[],n=[],i=[],r="",o=0}},g=function(e){m(!0),t.push(p({text:"[p10]"},e))},y=0;y<e.length;y+=1){var x=e[y],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:v(a),taskType:"soundEvent"});else{var C,M,T=b,N=null===(C=x.marks)||void 0===C?void 0:C.find(function(e){return"textmedia"===e.type}),O=this.curParagraphLastRangeEvents.get("textmedia");if(N){if((null==O||null===(M=O.attrs)||void 0===M?void 0:M.src)!==N.attrs.src||"start"!==(null==O?void 0:O.eventLifeType)){var E=0===o;i.push({type:"textmedia",attrs:N.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(p(p({},O),{},{trigger:"inner",charOffset:o,eventLifeType:"stop"})),this.curParagraphLastRangeEvents.set("textmedia",i[i.length-1]));if("text"===w&&T){for(var A="",j=x.start,D=-1,R=0;R<T.length;R+=1){var I=T[R];if("\n"===I){if(A&&(r+=A,o+=A.length,n.push(p(p({},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(p(p({},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 $=$l[I]||(V?10:1),J=-1!==D?T[D]:"";$>=(J?$l[J]||(this.textRegExps.EN_MINOR.test(J)?10:1):-1)&&(D=R)}var H=!1;if(L||B){if(!("."===I&&R+1<T.length&&/\d/.test(T[R+1]))){for(var U=0,K=/[”"“)\)(\(「』」『【】> \n\s]/;R+1+U<T.length;){var G=T[R+1+U];if(!K.test(G))break;if(U++,"\n"===G)break}R+=U,H=!0}}else if(_>=this.config.CN_TARGET_MAX)if(F||V){for(var Y=0,X=/[”"“)\)(\(「』」『【】> \n\s]/;R+1+Y<T.length;){var Z=T[R+1+Y];if(!X.test(Z))break;if(Y++,"\n"===Z)break}R+=Y,H=!0}else _>1*this.config.CN_TARGET_MAX&&-1!==D&&(R=D,H=!0);else _>=(W?this.config.MAX_CHAR_CN:this.config.MAX_CHAR_EN)&&(H=!0);if(H&&h(r+A)){var Q=T.slice(j-x.start,R+1);r+=Q,o+=Q.length,n.push(p(p({},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(p(p({},x),{},{text:A,start:j,end:x.end})))}else{var ee;if("data"===w)r+=Hl(T);else r+=T,["phoneme","say-as","sub","word"].includes(w)&&null!==(ee=x.attrs)&&void 0!==ee&&ee.text&&(o+=x.attrs.text.length);n.push(x)}}y===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,v(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=[],d=0;d<n.length;d+=1){var f,m=n[d];(f=u).push.apply(f,v(m.preProcess)),m.sentences.length>0&&(h.push(p(p({},m),{},{preProcess:u,index:h.length})),u=[])}u.length>0&&h.length>0?(c=h[h.length-1].preProcess).push.apply(c,v(u)):u.length>0&&0===h.length&&n.length>0&&h.push(p(p({},n[0]),{},{preProcess:u,sentences:[],index:0}));var g=this.curParagraphLastRangeEvents.get("textmedia");if(g&&"stop"!==g.eventLifeType){for(var y,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)){y=b[w];break}}y&&y.events.push(p(p({},g),{},{trigger:"after",charOffset:y.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=C[(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}}])}(),Gl=function(e){if(!e||"object"!==b(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(Gl),e.marks&&Array.isArray(e.marks)&&e.marks.forEach(function(e){e.type&&t[e.type]&&(e.type=t[e.type])}),e},Yl=function(e){var t={type:"doc",content:[]};if(!e)return t;try{if("".concat(e).trim()){var n=JSON.parse(e);"doc"===(n=Gl(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){D.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},Xl=1e4,Zl=function(e){function t(e){var n,o,s;r(this,t),a(o=i(this,t),"wordcount",0),a(o,"maxWordCount",Xl),a(o,"defaultPlugins",[Zo(),(s={placeholder:"请输入内容..."},new en({key:ja,state:{init:function(){return{placeholder:s.placeholder||"请输入内容..."}},apply:function(e,t){var n=e.getMeta(ja);return n?p(p({},t),n):t}},props:{decorations:function(e){var t=e.doc;return this.spec.isEmpty(t)?$r.create(t,[Fr.widget(0,function(){var e=document.createElement("div");return e.classList.add("ssml-editor-placeholder"),e.textContent="请输入内容...",e})]):$r.empty}},isEmpty:function(e){return 1===e.childCount&&2===e.content.size}})),ba({"Mod-z":es,"Mod-y":ts}),ba(ca),new Aa(o,{maxLength:Xl})]),a(o,"isEmptyContentSize",function(e){return 2===e}),o.editorStateStore=new Da,o.on(Sa.WordCount,function(e){o.wordcount=e.count}),o.config=t.mergeConfig(e),o.registry=Do.clone(),o.commandRegister=I.clone(),o.maxWordCount=null!==(n=e.maxWordCount)&&void 0!==n?n:Xl;var l=[].concat(v(o.defaultPlugins),v(o.registry.getPlugins(o.editorStateStore)));o.config.floatingMenu&&l.push(new Na(o,o.config.floatingMenu)),o.config.contextMenu&&l.push(new Ma(o,o.config.contextMenu));var c=l.find(function(e){return e.spec.key===Ea});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 Zt.create({schema:e,plugins:n});var i=e.nodeFromJSON(Yl(t));return Zt.create({doc:i,schema:e,plugins:n})}(function(e){return new Ae({nodes:p(p({},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 h(t,e),s(t,[{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=y(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 go(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&&(Ra(l)||Ia(l))){var c=e.tr,h=r-l.nodeSize,u=r;if(Ia(l))return c.delete(h,u),t&&t(c),!0;if(Ra(l)){var d=l.attrs.text||"";c.replaceWith(h,u,e.schema.text(d));var p=h+d.length;return c.setSelection(Lt.create(c.doc,p)),t&&t(c),!0}}var f=a.nodeAfter;if(f&&f.type.isInline&&(Ra(f)||Ia(f))){var m=e.tr,g=r,y=r+f.nodeSize;if(Ia(f))return m.delete(g,y),t&&t(m),!0;if(Ra(f)){var v=f.textContent;m.replaceWith(g,y,e.schema.text(v));var x=g+v.length;return m.setSelection(Lt.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(So),requestIdleCallback(function(){return e.dom.classList.remove("ProseMirror-focused")}),t.emit(Sa.Focus,{focused:!0}),!1):(e.dom.blur(),!0)},blur:function(e,n){return e.dom.classList.remove(So),t.emit(Sa.Focus,{focused:!1}),!1}},transformPastedHTML:function(e,t){return Fl.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(Sa.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)||P.all){case P.selection:r=n.textBetween(i.from,i.to," ");break;case P.cursorRight:r=n.textBetween(i.$to.pos,n.content.size," ");break;case P.all:default:r=n.textContent}return ks(r)}},{key:"getPlaybackSegments",value:function(e){var t=this.view.state,n=t.selection,i=(null==e?void 0:e.contentMode)||P.all,r=0,o=t.doc.content.size;if(i===P.selection?(r=n.from,o=n.to):i===P.cursorRight&&(r=n.to,o=t.doc.content.size),r===o&&i!==P.all)return[];var s={type:"doc",content:t.doc.slice(r,o).content.toJSON()};return(new Kl).extractSentences(s,r).filter(function(e){return"text"===e.taskType||"soundEvent"===e.taskType}).map(function(e){return{type:e.taskType,text:ks(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:_.CommandNotFound,reason:"Command ".concat(e," not found")};if(!this.editorStateStore.editable&&![qo.clearHighlight,qo.highlight].includes(e))return{success:!1,code:_.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||_.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:_.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(Yl(e));if(i)i(r.tr.replaceWith(0,r.doc.content.size,o).scrollIntoView()),t&&this.execute(ns.clear)}else{i&&(i(r.tr.delete(0,r.doc.content.size)),t&&this.execute(ns.clear))}}},{key:"count",get:function(){return this.wordcount}},{key:"toJSON",value:function(){var e=this.view.state.toJSON(),t=function(e){if(!e||"object"!==b(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?ks(r):t(r),n[i]=r}),n};return t(e)}},{key:"setContentFromSSML",value:function(e){var t=Vl.ssmlToDOM(e),n=this.view.state.schema,i=De.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=Fl.transform(e),n=this.view.state.schema,i=(new DOMParser).parseFromString(t,"text/html").body,r=De.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 e,n,i,r;(n="removeAllListeners",i=this,"function"==typeof(r=l(c(t.prototype),n,i))?function(e){return r.apply(i,e)}:r)([]),this.view.destroy(),(null===(e=this.view.dom)||void 0===e?void 0:e.parentNode)===this.config.parent&&this.config.parent.removeChild(this.view.dom)}}],[{key:"mergeConfig",value:function(e){var t;return p(p({},e),{},{maxWordCount:null!==(t=e.maxWordCount)&&void 0!==t?t:Xl})}}])}(ka),Ql=new rn("numberTip"),ec={switchNumberTipMode:"switchNumberTipMode"};q({name:ec.switchNumberTipMode,description:"切换数字读法标注模式",execute:function(e,t){var n=e.state,i=e.dispatch,r=t;return i?(i(n.tr.setMeta(Ql,{active:!(null==r||!r.active)})),{success:!0}):{success:!0}}});var tc=/[+-]?(?:(?:\d{1,3}(?:,\d{3})+)|(?:\d+))(?:\.\d+)?/g;var nc=new en({key:Ql,state:{init:function(){return{active:!1,decorations:$r.empty}},apply:function(e,t,n,i){var r,o=e.getMeta(Ql),s=null!==(r=null==o?void 0:o.active)&&void 0!==r?r:t.active,a=$r.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(tc.lastIndex=0;null!==(i=tc.exec(e.text));){var r=i.index,o=i.index+i[0].length,s=i[0],a=xs(4);t.push(Fr.inline(n+r,n+o,{class:To,"data-number-tip-text":s,"data-deco-id":a},{decoId:a,text:s}))}else if(e.type.name===S.SayAs){var l=xs(4);t.push(Fr.inline(n,n+e.nodeSize,{class:To,"data-number-tip-text":e.attrs.text,"data-deco-id":l,"data-is-node":"true"},{decoId:l,text:e.attrs.text,isNode:!0}))}}),$r.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=nc.getState(e.state),r=n.target,o=r.closest(".".concat(To)),s=r.closest('[data-type="'.concat(S.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!==S.SayAs)return!1;a=m.attrs.text,l=f.pos,c=f.pos+m.nodeSize,h=!0}var g,y,v=(g=new ds("ssml-editor-number-tip__list","ssml-editor-number-tip__item"),y=[{label:"读数字",value:z.digits},{label:"读数值",value:z.cardinal},{label:"移除/还原",value:""}],g.render(y));gs.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(Lt.create(e.state.doc,l,c)).setMeta(Oo,!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(Lt.create(e.state.doc,l,c));i?r=r.replaceSelectionWith(e.state.schema.nodes[S.SayAs].create({interpretAs:i,text:a,type:S.SayAs})):h&&(r=r.replaceSelectionWith(e.state.schema.text(a))),e.dispatch(r.setSelection(Lt.near(r.doc.resolve(l)))),gs.hide()}};return v.addEventListener("click",x),!0}}});Do.registerPlugin("number-tip",nc);var ic=new rn("rangeBoundary");Do.registerPlugin("rangeBoundary",new en({key:ic,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===S.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===S.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(v(f),[p.create({value:u,tagId:d})])),r}if(s&&s.type.name===S.RangeAnchor&&"end"===s.attrs.anchorType){var m=s.attrs,g=m.tagType,y=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(v(w),[b.create({value:y,tagId:x})])),r}if(o&&o.type.name===S.RangeAnchor&&"end"===o.attrs.anchorType){var k=o.attrs.tagType,z=r.storedMarks||n.storedMarks||[];if(z.some(function(e){return e.type.name===k}))return r.setStoredMarks(z.filter(function(e){return e.type.name!==k})),r}if(o&&o.type.name===S.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===S.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===S.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===S.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(Lt.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===S.RangeAnchor&&"end"===r.attrs.anchorType&&i.parentOffset===i.parent.content.size){var o=e.state.tr;return o.insertText("",i.pos),o.setSelection(Lt.create(o.doc,i.pos)),o.setStoredMarks([]),e.dispatch(o),!0}return!1}}}));var rc,oc=new rn("rangeSync");Do.registerPlugin("rangeSync",(rc=[S.SpeechRate,S.SpeechPitch,S.SpeechVolume,S.SpeechLanguage],new en({key:oc,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){rc.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!==S.RangeAnchor)&&(l=!1),l}),l?i.to=t.pos+t.size:(a.push(p({},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:S.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:S.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===S.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 d=c[u],f=d.pos,m=d.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[S.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(rc.includes(e.type.name)){var n=e.attrs.tagId;return t.has(n)||t.set(n,xs(6)),e.type.create(p(p({},e.attrs),{},{tagId:t.get(n)}))}return e});if(e.type.name===S.RangeAnchor){var r=e.attrs.tagId;return t.has(r)||t.set(r,xs(6)),e.type.create(p(p({},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(V.from(o)).mark(i)}return e.mark(i)},i=[];return e.content.forEach(function(e){return i.push(n(e))}),new K(V.from(i),e.openStart,e.openEnd)}}})));var sc=new rn("readOnly");Do.registerPlugin("readOnly",function(e){return new en({key:sc,state:{init:function(){return $r.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 D.debug("filterTransaction",t),!(null==e||!e.editable)||!(null!==(n=t.steps)&&void 0!==n&&n.length||!t.selection)}})});var ac=new rn("speechLanguage");Do.registerPlugin("speechLanguage",new en({key:ac,state:{init:function(){return null},apply:function(e,t){return e.getMeta(ac)||t}}}));var lc=new rn("speechPitch");function cc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===S.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(p({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(Fr.inline(n,i,{class:"range-annotation-content speech-pitch-content","data-pitch":String(r)}))}),$r.create(e.doc,t)}function hc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===S.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(p({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(Fr.inline(n,i,{class:"range-annotation-content speech-rate-content","data-rate":String(r)}))}),$r.create(e.doc,t)}Do.registerPlugin("speechPitch",new en({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 uc=new rn("speechRate");Do.registerPlugin("speechRate",new en({key:uc,state:{init:function(e,t){return{decorations:hc(t)}},apply:function(e,t,n,i){return e.docChanged?{decorations:hc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}}));var dc=new rn("speechVolume");function pc(e){var t=[],n=[];e.doc.descendants(function(e,t){var i=e.marks.find(function(e){return e.type.name===S.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(p({},e))}),i.forEach(function(e){var n=e.from,i=e.to,r=e.value;t.push(Fr.inline(n,i,{class:"range-annotation-content speech-volume-content","data-volume":String(r)}))}),$r.create(e.doc,t)}Do.registerPlugin("speechVolume",new en({key:dc,state:{init:function(e,t){return{decorations:pc(t)}},apply:function(e,t,n,i){return e.docChanged?{decorations:pc(i)}:t}},props:{decorations:function(e){var t;return null===(t=this.getState(e))||void 0===t?void 0:t.decorations}}}));var fc="thumbnail-icon";function mc(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===k.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(Fr.widget(i,function(e,t,n){var i=document.createElement("b");i.className="".concat(No," ").concat(No,"__").concat(e),i.dataset.id=t,i.dataset.type=e;var r=document.createElement("span");r.classList.add(fc);var o=document.createElement("img");return o.src=n.src,o.style.maxHeight="1em",r.appendChild(o),i.append(r,Os()),i}("start",n.attrs.tagId,n.attrs),{side:1,key:"start-".concat(n.attrs.tagId)}))}),$r.create(e.doc,t)}var gc=new rn("textMedia");Do.registerPlugin("textMedia",new en({key:gc,state:{init:function(e,t){return{decorations:mc(t)}},apply:function(e,t,n,i){return e.docChanged||e.getMeta("text-media-update")?{decorations:mc(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(No));if(!o)return!1;var s=o.dataset,a=s.id,l=s.type;if(!a)return!1;if("start"===l)if(Es(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===k.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(fc))}(n.target)){var f,m,g=e.state.plugins.find(function(e){return e.spec.key===gc}),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===k.textmedia});n&&y.push(null==n?void 0:n.attrs)}),y.length&&(null===(f=(m=g.spec).emitEvent)||void 0===f||f.call(m,Sa.PluginTextMediaClick,y[0]))}return!1}}}));var yc=s(function e(t){r(this,e),this.name=t.name,this.description=t.description,this.execute=t.execute}),vc=new rn("wordmark"),xc=function(e){return e.markWord="markWord",e.clearWordMark="clearWordMark",e}({});function bc(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(Fr.inline(s,a,{class:"ssml-word-mark"})),r=o+t.length,o=e.text.indexOf(t,r)}}),$r.create(e,n)):$r.empty}var wc=new en({key:vc,state:{init:function(){return{word:"",decorations:$r.empty}},apply:function(e,t,n,i){var r=e.getMeta(vc),o=t.word;return r&&"string"==typeof r.word&&(o=r.word),o!==t.word||e.docChanged?{word:o,decorations:bc(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}}});q(new yc({name:xc.markWord,execute:function(e,t){if("string"!=typeof t||!t)return{success:!1,code:t?_.ParamsInvalid:_.ParamsMissing,reason:"Invalid word"};var n=e.state.tr.setMeta(vc,{word:t});return e.dispatch(n),{success:!0}}})),q(new yc({name:xc.clearWordMark,execute:function(e){var t=e.state.tr.setMeta(vc,{word:""});return e.dispatch(t),{success:!0}}})),Do.registerPlugin("wordmark",wc);var kc={setTextMedia:"setTextMedia",resetTextMediaStoredMark:"resetTextMediaStoredMark"};q({name:kc.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[k.textmedia].create(p({tagId:xs(6)},n))).scrollIntoView()),{success:!0}},validate:function(e,t){return e.state.selection.empty?{available:!1,code:_.SelectionInvalid,reason:"选中文本设置媒体"}:{available:!0}}}),q({name:kc.resetTextMediaStoredMark,description:"重置当前光标文案媒体",execute:function(e){var t=e.state,n=e.dispatch,i=t.schema.marks[k.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===k.textmedia})?{available:!0}:{available:!1,code:_.CursorInvalid,reason:"当前光标不在图片范围"}}}),e.ActionCommands=M,e.BreakCommands=hs,e.BreathCommands=us,e.CmdCommands=as,e.CommandErrorCode=_,e.ContentReadMode=P,e.ContextMenuPlugin=Ma,e.DataCommands=ls,e.DataPlaceholderReg=Jl,e.EditorEvent=Sa,e.FloatingMenuPlugin=Na,e.HighlightCommands=qo,e.HistoryCommands=ns,e.LogLevel=A,e.MarkEditor=Zl,e.MarkTagType=S,e.NumberTipCommands=ec,e.PhonemeCommands=Cs,e.PptCommands=rs,e.SayAsCommands=Ts,e.SayAsInterpretType=z,e.SoundEventCommands=ss,e.SpeechLanguageCommands=E,e.SpeechPitchCommands=N,e.SpeechRateCommands=T,e.SpeechVolumeCommands=O,e.TextExtractor=Kl,e.TextInputCommands=is,e.TextMediaCommands=kc,e.WaitCommands=cs,e.WordCommands=Ns,e.WordmarkCommands=xc,e.logger=D,e.registerCommand=q,e.registry=Do});
|