UNPKG

@pdftron/webviewer

Version:

[WebViewer](https://www.apryse.com/webviewer) is a powerful JavaScript Document SDK and UI Component Library that is a part of the [Apryse PDF SDK](https://www.apryse.com). It provides a slick, out-of-the-box responsive UI that interacts with the core lib

1 lines • 407 kB
(window.webpackJsonpWebViewerUI=window.webpackJsonpWebViewerUI||[]).push([[31],{1569:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const r=n(1670),o=n(1612),i=n(1613),u=n(1671);e.AttributeMap=u.default;const a=n(1614);e.Op=a.default;const l=n(1672);e.OpIterator=l.default;const s=String.fromCharCode(0),c=(t,e)=>{if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);const n=Object.keys(t)[0];if(!n||n!==Object.keys(e)[0])throw new Error(`embed types not matched: ${n} != ${Object.keys(e)[0]}`);return[n,t[n],e[n]]};class f{constructor(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}static registerEmbed(t,e){this.handlers[t]=e}static unregisterEmbed(t){delete this.handlers[t]}static getHandler(t){const e=this.handlers[t];if(!e)throw new Error(`no handlers for embed type "${t}"`);return e}insert(t,e){const n={};return"string"==typeof t&&0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))}delete(t){return t<=0?this:this.push({delete:t})}retain(t,e){if("number"==typeof t&&t<=0)return this;const n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)}push(t){let e=this.ops.length,n=this.ops[e-1];if(t=o(t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,n=this.ops[e-1],"object"!=typeof n))return this.ops.unshift(t),this;if(i(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this}chop(){const t=this.ops[this.ops.length-1];return t&&"number"==typeof t.retain&&!t.attributes&&this.ops.pop(),this}filter(t){return this.ops.filter(t)}forEach(t){this.ops.forEach(t)}map(t){return this.ops.map(t)}partition(t){const e=[],n=[];return this.forEach(r=>{(t(r)?e:n).push(r)}),[e,n]}reduce(t,e){return this.ops.reduce(t,e)}changeLength(){return this.reduce((t,e)=>e.insert?t+a.default.length(e):e.delete?t-e.delete:t,0)}length(){return this.reduce((t,e)=>t+a.default.length(e),0)}slice(t=0,e=1/0){const n=[],r=new l.default(this.ops);let o=0;for(;o<e&&r.hasNext();){let i;o<t?i=r.next(t-o):(i=r.next(e-o),n.push(i)),o+=a.default.length(i)}return new f(n)}compose(t){const e=new l.default(this.ops),n=new l.default(t.ops),r=[],o=n.peek();if(null!=o&&"number"==typeof o.retain&&null==o.attributes){let t=o.retain;for(;"insert"===e.peekType()&&e.peekLength()<=t;)t-=e.peekLength(),r.push(e.next());o.retain-t>0&&n.next(o.retain-t)}const a=new f(r);for(;e.hasNext()||n.hasNext();)if("insert"===n.peekType())a.push(n.next());else if("delete"===e.peekType())a.push(e.next());else{const t=Math.min(e.peekLength(),n.peekLength()),r=e.next(t),o=n.next(t);if(o.retain){const l={};if("number"==typeof r.retain)l.retain="number"==typeof o.retain?t:o.retain;else if("number"==typeof o.retain)null==r.retain?l.insert=r.insert:l.retain=r.retain;else{const t=null==r.retain?"insert":"retain",[e,n,i]=c(r[t],o.retain),u=f.getHandler(e);l[t]={[e]:u.compose(n,i,"retain"===t)}}const s=u.default.compose(r.attributes,o.attributes,"number"==typeof r.retain);if(s&&(l.attributes=s),a.push(l),!n.hasNext()&&i(a.ops[a.ops.length-1],l)){const t=new f(e.rest());return a.concat(t).chop()}}else"number"==typeof o.delete&&("number"==typeof r.retain||"object"==typeof r.retain&&null!==r.retain)&&a.push(o)}return a.chop()}concat(t){const e=new f(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e}diff(t,e){if(this.ops===t.ops)return new f;const n=[this,t].map(e=>e.map(n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:s;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")}).join("")),o=new f,a=r(n[0],n[1],e,!0),c=new l.default(this.ops),h=new l.default(t.ops);return a.forEach(t=>{let e=t[1].length;for(;e>0;){let n=0;switch(t[0]){case r.INSERT:n=Math.min(h.peekLength(),e),o.push(h.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),o.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),h.peekLength(),e);const t=c.next(n),a=h.next(n);i(t.insert,a.insert)?o.retain(n,u.default.diff(t.attributes,a.attributes)):o.push(a).delete(n)}e-=n}}),o.chop()}eachLine(t,e="\n"){const n=new l.default(this.ops);let r=new f,o=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const i=n.peek(),u=a.default.length(i)-n.peekLength(),l="string"==typeof i.insert?i.insert.indexOf(e,u)-u:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(!1===t(r,n.next(1).attributes||{},o))return;o+=1,r=new f}}r.length()>0&&t(r,{},o)}invert(t){const e=new f;return this.reduce((n,r)=>{if(r.insert)e.delete(a.default.length(r));else{if("number"==typeof r.retain&&null==r.attributes)return e.retain(r.retain),n+r.retain;if(r.delete||"number"==typeof r.retain){const o=r.delete||r.retain;return t.slice(n,n+o).forEach(t=>{r.delete?e.push(t):r.retain&&r.attributes&&e.retain(a.default.length(t),u.default.invert(r.attributes,t.attributes))}),n+o}if("object"==typeof r.retain&&null!==r.retain){const o=t.slice(n,n+1),i=new l.default(o.ops).next(),[a,s,h]=c(r.retain,i.insert),p=f.getHandler(a);return e.retain({[a]:p.invert(s,h)},u.default.invert(r.attributes,i.attributes)),n+1}}return n},0),e.chop()}transform(t,e=!1){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);const n=t,r=new l.default(this.ops),o=new l.default(n.ops),i=new f;for(;r.hasNext()||o.hasNext();)if("insert"!==r.peekType()||!e&&"insert"===o.peekType())if("insert"===o.peekType())i.push(o.next());else{const t=Math.min(r.peekLength(),o.peekLength()),n=r.next(t),a=o.next(t);if(n.delete)continue;if(a.delete)i.push(a);else{const r=n.retain,o=a.retain;let l="object"==typeof o&&null!==o?o:t;if("object"==typeof r&&null!==r&&"object"==typeof o&&null!==o){const t=Object.keys(r)[0];if(t===Object.keys(o)[0]){const n=f.getHandler(t);n&&(l={[t]:n.transform(r[t],o[t],e)})}}i.retain(l,u.default.transform(n.attributes,a.attributes,e))}}else i.retain(a.default.length(r.next()));return i.chop()}transformPosition(t,e=!1){e=!!e;const n=new l.default(this.ops);let r=0;for(;n.hasNext()&&r<=t;){const o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r<t||!e)&&(t+=o),r+=o):t-=Math.min(o,t-r)}return t}}f.Op=a.default,f.OpIterator=l.default,f.AttributeMap=u.default,f.handlers={},e.default=f,t.exports=f,t.exports.default=f},1583:function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"Attributor",(function(){return u})),n.d(r,"AttributorStore",(function(){return d})),n.d(r,"BlockBlot",(function(){return j})),n.d(r,"ClassAttributor",(function(){return f})),n.d(r,"ContainerBlot",(function(){return C})),n.d(r,"EmbedBlot",(function(){return N})),n.d(r,"InlineBlot",(function(){return k})),n.d(r,"LeafBlot",(function(){return m})),n.d(r,"ParentBlot",(function(){return x})),n.d(r,"Registry",(function(){return s})),n.d(r,"Scope",(function(){return i})),n.d(r,"ScrollBlot",(function(){return _})),n.d(r,"StyleAttributor",(function(){return p})),n.d(r,"TextBlot",(function(){return B}));n(9),n(10),n(14),n(21),n(77),n(20),n(22),n(18),n(16),n(49),n(24),n(48),n(50),n(17),n(19),n(11),n(13),n(32),n(38),n(34),n(83),n(27),n(12),n(44),n(119),n(33),n(29),n(163),n(483),n(35),n(8),n(173),n(136),n(31);var o=n(1591),i=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(i||{});class u{constructor(t,e,n={}){this.attrName=t,this.keyName=e;const r=i.TYPE&i.ATTRIBUTE;this.scope=null!=n.scope?n.scope&i.LEVEL|r:i.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(t){return Array.from(t.attributes).map(t=>t.name)}add(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)}canAdd(t,e){return null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1)}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}class a extends Error{constructor(t){super(t="[Parchment] "+t),this.message=t,this.name=this.constructor.name}}const l=class t{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){if(null==t)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let n=null;try{n=t.parentNode}catch{return null}return this.find(n,e)}return null}create(e,n,r){const o=this.query(n);if(null==o)throw new a(`Unable to create ${n} blot`);const i=o,u=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:i.create(r),l=new i(e,u,r);return t.blots.set(l.domNode,l),l}find(e,n=!1){return t.find(e,n)}query(t,e=i.ANY){let n;return"string"==typeof t?n=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof t?t&i.LEVEL&i.BLOCK?n=this.types.block:t&i.LEVEL&i.INLINE&&(n=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(t=>(n=this.classes[t],!!n)),n=n||this.tags[t.tagName]),null==n?null:"scope"in n&&e&i.LEVEL&n.scope&&e&i.TYPE&n.scope?n:null}register(...t){return t.map(t=>{const e="blotName"in t,n="attrName"in t;if(!e&&!n)throw new a("Invalid definition");if(e&&"abstract"===t.blotName)throw new a("Cannot register abstract class");const r=e?t.blotName:n?t.attrName:void 0;return this.types[r]=t,n?"string"==typeof t.keyName&&(this.attributes[t.keyName]=t):e&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(t=>t.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(e=>{(null==this.tags[e]||null==t.className)&&(this.tags[e]=t)}))),t})}};l.blots=new WeakMap;let s=l;function c(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(t=>0===t.indexOf(e+"-"))}const f=class extends u{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0)}remove(t){c(t,this.keyName).forEach(e=>{t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")}value(t){const e=(c(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}};function h(t){const e=t.split("-"),n=e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("");return e[0]+n}const p=class extends u{static keys(t){return(t.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(t,e){return!!this.canAdd(t,e)&&(t.style[h(this.keyName)]=e,!0)}remove(t){t.style[h(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[h(this.keyName)];return this.canAdd(t,e)?e:""}};const d=class{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=s.find(this.domNode);if(null==t)return;const e=u.keys(this.domNode),n=f.keys(this.domNode),r=p.keys(this.domNode);e.concat(n).concat(r).forEach(e=>{const n=t.scroll.query(e,i.ATTRIBUTE);n instanceof u&&(this.attributes[n.attrName]=n)})}copy(t){Object.keys(this.attributes).forEach(e=>{const n=this.attributes[e].value(this.domNode);t.format(e,n)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}},y=class{constructor(t,e){this.scroll=t,this.domNode=e,s.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(null==this.tagName)throw new a("Blot definition missing tagName");let e,n;return Array.isArray(this.tagName)?("string"==typeof t?(n=t.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof t&&(n=t),e="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){null!=this.parent&&this.parent.removeChild(this),s.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,n,r){const o=this.isolate(t,e);if(null!=this.scroll.query(n,i.BLOT)&&r)o.wrap(n,r);else if(null!=this.scroll.query(n,i.ATTRIBUTE)){const t=this.scroll.create(this.statics.scope);o.wrap(t),t.format(n,r)}}insertAt(t,e,n){const r=null==n?this.scroll.create("text",e):this.scroll.create(e,n),o=this.split(t);this.parent.insertBefore(r,o||void 0)}isolate(t,e){const n=this.split(t);if(null==n)throw new Error("Attempt to isolate at end");return n.split(e),n}length(){return 1}offset(t=this.parent){return null==this.parent||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(t,e){return 0===t?this:this.next}update(t,e){}wrap(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new a("Cannot wrap "+t);return n.appendChild(this),n}};y.blotName="abstract";let b=y;const v=class extends b{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};v.scope=i.INLINE_BLOT;const m=v;class g{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){if(this.insertBefore(t[0],null),t.length>1){const e=t.slice(1);this.append(...e)}}at(t){const e=this.iterator();let n=e();for(;n&&t>0;)t-=1,n=e();return n}contains(t){const e=this.iterator();let n=e();for(;n;){if(n===t)return!0;n=e()}return!1}indexOf(t){const e=this.iterator();let n=e(),r=0;for(;n;){if(n===t)return r;r+=1,n=e()}return-1}insertBefore(t,e){null!=t&&(this.remove(t),t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,n=this.head;for(;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1}remove(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return null!=t&&(t=t.next),e}}find(t,e=!1){const n=this.iterator();let r=n();for(;r;){const o=r.length();if(t<o||e&&t===o&&(null==r.next||0!==r.next.length()))return[r,t];t-=o,r=n()}return[null,0]}forEach(t){const e=this.iterator();let n=e();for(;n;)t(n),n=e()}forEachAt(t,e,n){if(e<=0)return;const[r,o]=this.find(t);let i=t-o;const u=this.iterator(r);let a=u();for(;a&&i<t+e;){const r=a.length();t>i?n(a,t-i,Math.min(e,i+r-t)):n(a,0,Math.min(r,t+e-i)),i+=r,a=u()}}map(t){return this.reduce((e,n)=>(e.push(t(n)),e),[])}reduce(t,e){const n=this.iterator();let r=n();for(;r;)e=t(e,r),r=n();return e}}function w(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const n=e.create(i.INLINE);return Array.from(t.childNodes).forEach(t=>{n.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(n.domNode,t),n.attach(),n}}const O=class t extends b{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(e){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=e,t.uiClass&&this.uiNode.classList.add(t.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new g,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=w(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof a)return;throw t}})}deleteAt(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,(t,e,n)=>{t.deleteAt(e,n)})}descendant(e,n=0){const[r,o]=this.children.find(n);return null==e.blotName&&e(r)||null!=e.blotName&&r instanceof e?[r,o]:r instanceof t?r.descendant(e,o):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let o=[],i=r;return this.children.forEachAt(n,r,(n,r,u)=>{(null==e.blotName&&e(n)||null!=e.blotName&&n instanceof e)&&o.push(n),n instanceof t&&(o=o.concat(n.descendants(e,r,i))),i-=u}),o}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(t=>n instanceof t)||(n.statics.scope===i.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof t?n.unwrap():n.remove())})}formatAt(t,e,n,r){this.children.forEachAt(t,e,(t,e,o)=>{t.formatAt(e,o,n,r)})}insertAt(t,e,n){const[r,o]=this.children.find(t);if(r)r.insertAt(o,e,n);else{const t=null==n?this.scroll.create("text",e):this.scroll.create(e,n);this.appendChild(t)}}insertBefore(t,e){null!=t.parent&&t.parent.children.remove(t);let n=null;this.children.insertBefore(t,e||null),t.parent=this,null!=e&&(n=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(t.domNode,n),t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(n=>{t.insertBefore(n,e)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,n=!1){const[r,o]=this.children.find(e,n),i=[[this,e]];return r instanceof t?i.concat(r.path(o,n)):(null!=r&&i.push([r,o]),i)}removeChild(t){this.children.remove(t)}replaceWith(e,n){const r="string"==typeof e?this.scroll.create(e,n):e;return r instanceof t&&this.moveChildren(r),super.replaceWith(r)}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(t,this.length(),(t,r,o)=>{const i=t.split(r,e);null!=i&&n.appendChild(i)}),n}splitAfter(t){const e=this.clone();for(;null!=t.next;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const n=[],r=[];t.forEach(t=>{t.target===this.domNode&&"childList"===t.type&&(n.push(...t.addedNodes),r.push(...t.removedNodes))}),r.forEach(t=>{if(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);null!=e&&(null==e.domNode.parentNode||e.domNode.parentNode===this.domNode)&&e.detach()}),n.filter(t=>t.parentNode===this.domNode&&t!==this.uiNode).sort((t,e)=>t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(t=>{let e=null;null!=t.nextSibling&&(e=this.scroll.find(t.nextSibling));const n=w(t,this.scroll);(n.next!==e||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,e||void 0))}),this.enforceAllowedChildren()}};O.uiClass="";const x=O;const E=class t extends x{static create(t){return super.create(t)}static formats(e,n){const r=n.query(t.blotName);if(null==r||e.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new d(this.domNode)}format(e,n){if(e!==this.statics.blotName||n){const t=this.scroll.query(e,i.INLINE);if(null==t)return;t instanceof u?this.attributes.attribute(t,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}else this.children.forEach(e=>{e instanceof t||(e=e.wrap(t.blotName,!0)),this.attributes.copy(e)}),this.unwrap()}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,r){null!=this.formats()[n]||this.scroll.query(n,i.ATTRIBUTE)?this.isolate(t,e).format(n,r):super.formatAt(t,e,n,r)}optimize(e){super.optimize(e);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const r=this.next;r instanceof t&&r.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof t&&this.attributes.move(r),r}};E.allowedChildren=[E,m],E.blotName="inline",E.scope=i.INLINE_BLOT,E.tagName="SPAN";const k=E,A=class t extends x{static create(t){return super.create(t)}static formats(e,n){const r=n.query(t.blotName);if(null==r||e.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new d(this.domNode)}format(e,n){const r=this.scroll.query(e,i.BLOCK);null!=r&&(r instanceof u?this.attributes.attribute(r,n):e!==this.statics.blotName||n?n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n):this.replaceWith(t.blotName))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,r){null!=this.scroll.query(n,i.BLOCK)?this.format(n,r):super.formatAt(t,e,n,r)}insertAt(t,e,n){if(null==n||null!=this.scroll.query(e,i.INLINE))super.insertAt(t,e,n);else{const r=this.split(t);if(null==r)throw new Error("Attempt to insertAt after block boundaries");{const t=this.scroll.create(e,n);r.parent.insertBefore(t,r)}}}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}};A.blotName="block",A.scope=i.BLOCK_BLOT,A.tagName="P",A.allowedChildren=[k,A,m];const j=A,S=class extends x{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,n,r){super.formatAt(t,e,n,r),this.enforceAllowedChildren()}insertAt(t,e,n){super.insertAt(t,e,n),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};S.blotName="container",S.scope=i.BLOCK_BLOT;const C=S;const N=class extends m{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,n,r){0===t&&e===this.length()?this.format(n,r):super.formatAt(t,e,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},P={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},T=class extends x{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(t=>{this.update(t)}),this.observer.observe(this.domNode,P),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const n=this.registry.find(t,e);return n?n.scroll===this?n:e?this.find(n.scroll.domNode.parentNode,!0):null:null}query(t,e=i.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),0===t&&e===this.length()?this.children.forEach(t=>{t.remove()}):super.deleteAt(t,e)}formatAt(t,e,n,r){this.update(),super.formatAt(t,e,n,r)}insertAt(t,e,n){this.update(),super.insertAt(t,e,n)}optimize(t=[],e={}){super.optimize(e);const n=e.mutationsMap||new WeakMap;let r=Array.from(this.observer.takeRecords());for(;r.length>0;)t.push(r.pop());const o=(t,e=!0)=>{null==t||t===this||null!=t.domNode.parentNode&&(n.has(t.domNode)||n.set(t.domNode,[]),e&&o(t.parent))},i=t=>{n.has(t.domNode)&&(t instanceof x&&t.children.forEach(i),n.delete(t.domNode),t.optimize(e))};let u=t;for(let e=0;u.length>0;e+=1){if(e>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(t=>{const e=this.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(o(this.find(t.previousSibling,!1)),Array.from(t.addedNodes).forEach(t=>{const e=this.find(t,!1);o(e,!1),e instanceof x&&e.children.forEach(t=>{o(t,!1)})})):"attributes"===t.type&&o(e.prev)),o(e))}),this.children.forEach(i),u=Array.from(this.observer.takeRecords()),r=u.slice();r.length>0;)t.push(r.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const n=new WeakMap;t.map(t=>{const e=this.find(t.target,!0);return null==e?null:n.has(e.domNode)?(n.get(e.domNode).push(t),null):(n.set(e.domNode,[t]),e)}).forEach(t=>{null!=t&&t!==this&&n.has(t.domNode)&&t.update(n.get(t.domNode)||[],e)}),e.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),e),this.optimize(t,e)}};T.blotName="scroll",T.defaultChild=j,T.allowedChildren=[j,C],T.scope=i.BLOCK_BLOT,T.tagName="DIV";const _=T,q=class t extends m{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,n){null==n?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,n)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(t,e){t.some(t=>"characterData"===t.type&&t.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};q.blotName="text",q.scope=i.INLINE_BLOT;const B=q;var R=n(1569),D=n.n(R),L=(n(82),n(308),n(182),n(115),n(384),n(1603));var I=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},F=n(1638),M=n(1580),U=n(1602),z=Object(U.a)(Object.keys,Object);var H=function(t,e){return t&&Object(M.a)(e,z(e),t)},V=n(1590);var W=function(t,e){return t&&Object(M.a)(e,Object(V.a)(e),t)},K=n(1636),$=n(1635);var Z=function(){return[]};var G=function(t,e){return Object(M.a)(t,Z(t),e)};var Q=function(){return[]};var X=function(t,e){return Object(M.a)(t,Q(t),e)},Y=n(1617);var J=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},tt=n(1615),et=Object.prototype.hasOwnProperty;var nt=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&et.call(t,"index")&&(n.index=t.index,n.input=t.input),n};var rt=function(t){return t},ot=n(1648),it=n(1588),ut=n(1601);var at=function(){return!1},lt=n(1581);var st=function(){return!1},ct={};ct["[object Arguments]"]=ct["[object Array]"]=ct["[object ArrayBuffer]"]=ct["[object DataView]"]=ct["[object Boolean]"]=ct["[object Date]"]=ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Map]"]=ct["[object Number]"]=ct["[object Object]"]=ct["[object RegExp]"]=ct["[object Set]"]=ct["[object String]"]=ct["[object Symbol]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct["[object Error]"]=ct["[object Function]"]=ct["[object WeakMap]"]=!1;var ft=function t(e,n,r,o,i,u){var a,l=1&n,s=2&n,c=4&n;if(r&&(a=i?r(e,o,i,u):r(e)),void 0!==a)return a;if(!Object(lt.a)(e))return e;var f=Object(it.a)(e);if(f){if(a=nt(e),!l)return Object($.a)(e,a)}else{var h=Object(tt.a)(e),p="[object Function]"==h||"[object GeneratorFunction]"==h;if(Object(ut.a)(e))return Object(K.a)(e,l);if("[object Object]"==h||"[object Arguments]"==h||p&&!i){if(a=s||p?{}:Object(ot.a)(e),!l)return s?X(e,W(a,e)):G(e,H(a,e))}else{if(!ct[h])return i?e:{};a=rt(e,h,l)}}u||(u=new L.a);var d=u.get(e);if(d)return d;u.set(e,a),st(e)?e.forEach((function(o){a.add(t(o,n,r,o,e,u))})):at(e)&&e.forEach((function(o,i){a.set(i,t(o,n,r,i,e,u))}));var y=c?s?J:Y.a:s?V.a:z,b=f?void 0:y(e);return I(b||e,(function(o,i){b&&(o=e[i=o]),Object(F.a)(a,i,t(o,n,r,i,e,u))})),a};var ht=function(t){return ft(t,5)},pt=n(1853);n(26),n(40),n(41),n(42),n(86),n(624),n(473);function dt(t){return(dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vt(r.key),r)}}function vt(t){var e=function(t,e){if("object"!=dt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=dt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dt(e)?e:e+""}function mt(t,e,n){return e=gt(e),function(t,e){if(e&&("object"==dt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,n||[],gt(t).constructor):e.apply(t,n))}function gt(t){return(gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function wt(t,e){return(wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Ot=function(t){function e(){return yt(this,e),mt(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wt(t,e)}(e,t),n=e,o=[{key:"value",value:function(){}}],(r=[{key:"optimize",value:function(){(this.prev||this.next)&&this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}])&&bt(n.prototype,r),o&&bt(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(N);Ot.blotName="break",Ot.tagName="BR";var xt=Ot;function Et(t){return(Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,At(r.key),r)}}function At(t){var e=function(t,e){if("object"!=Et(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Et(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Et(e)?e:e+""}function jt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function St(t,e,n){return e=Ct(e),function(t,e){if(e&&("object"==Et(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,n||[],Ct(t).constructor):e.apply(t,n))}function Ct(t){return(Ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Nt(t,e){return(Nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Pt=function(t){function e(){return jt(this,e),St(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nt(t,e)}(e,t),n=e,r&&kt(n.prototype,r),o&&kt(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(B),Tt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function _t(t){return t.replace(/[&<>"']/g,(function(t){return Tt[t]}))}function qt(t){return(qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ht(r.key),r)}}function Dt(t,e,n){return e=Mt(e),function(t,e){if(e&&("object"==qt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,n||[],Mt(t).constructor):e.apply(t,n))}function Lt(t,e,n,r){var o=It(Mt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function It(){return(It="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=Ft(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(null,arguments)}function Ft(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Mt(t)););return t}function Mt(t){return(Mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ut(t,e){return(Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function zt(t,e,n){return(e=Ht(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ht(t){var e=function(t,e){if("object"!=qt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=qt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==qt(e)?e:e+""}var Vt=function(t){function e(){return Bt(this,e),Dt(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ut(t,e)}(e,t),n=e,o=[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),o=e.order.indexOf(n);return r>=0||o>=0?r-o:t===n?0:t<n?-1:1}}],(r=[{key:"formatAt",value:function(t,n,r,o){if(e.compare(this.statics.blotName,r)<0&&this.scroll.query(r,i.BLOT)){var u=this.isolate(t,n);o&&u.wrap(r,o)}else Lt(e,"formatAt",this,3)([t,n,r,o])}},{key:"optimize",value:function(t){if(Lt(e,"optimize",this,3)([t]),this.parent instanceof e&&e.compare(this.statics.blotName,this.parent.statics.blotName)>0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}])&&Rt(n.prototype,r),o&&Rt(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(k);zt(Vt,"allowedChildren",[Vt,xt,N,Pt]),zt(Vt,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);var Wt=Vt;function Kt(t){return(Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Zt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$t(Object(n),!0).forEach((function(e){ie(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$t(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Gt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ue(r.key),r)}}function Xt(t,e,n){return e&&Qt(t.prototype,e),n&&Qt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yt(t,e,n){return e=ne(e),function(t,e){if(e&&("object"==Kt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,n||[],ne(t).constructor):e.apply(t,n))}function Jt(t,e,n,r){var o=te(ne(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function te(){return(te="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=ee(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(null,arguments)}function ee(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ne(t)););return t}function ne(t){return(ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function re(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oe(t,e)}function oe(t,e){return(oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ie(t,e,n){return(e=ue(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ue(t){var e=function(t,e){if("object"!=Kt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Kt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Kt(e)?e:e+""}var ae=function(t){function e(){var t;Gt(this,e);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return ie(t=Yt(this,e,[].concat(r)),"cache",{}),t}return re(e,t),Xt(e,[{key:"delta",value:function(){return null==this.cache.delta&&(this.cache.delta=se(this)),this.cache.delta}},{key:"deleteAt",value:function(t,n){Jt(e,"deleteAt",this,3)([t,n]),this.cache={}}},{key:"formatAt",value:function(t,n,r,o){n<=0||(this.scroll.query(r,i.BLOCK)?t+n===this.length()&&this.format(r,o):Jt(e,"formatAt",this,3)([t,Math.min(n,this.length()-t-1),r,o]),this.cache={})}},{key:"insertAt",value:function(t,n,r){if(null!=r)return Jt(e,"insertAt",this,3)([t,n,r]),void(this.cache={});if(0!==n.length){var o=n.split("\n"),i=o.shift();i.length>0&&(t<this.length()-1||null==this.children.tail?Jt(e,"insertAt",this,3)([Math.min(t,this.length()-1),i]):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});var u=this;o.reduce((function(t,e){return(u=u.split(t,!0)).insertAt(0,e),e.length}),t+i.length)}}},{key:"insertBefore",value:function(t,n){var r=this.children.head;Jt(e,"insertBefore",this,3)([t,n]),r instanceof xt&&r.remove(),this.cache={}}},{key:"length",value:function(){return null==this.cache.length&&(this.cache.length=Jt(e,"length",this,3)([])+1),this.cache.length}},{key:"moveChildren",value:function(t,n){Jt(e,"moveChildren",this,3)([t,n]),this.cache={}}},{key:"optimize",value:function(t){Jt(e,"optimize",this,3)([t]),this.cache={}}},{key:"path",value:function(t){return Jt(e,"path",this,3)([t,!0])}},{key:"removeChild",value:function(t){Jt(e,"removeChild",this,3)([t]),this.cache={}}},{key:"split",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=Jt(e,"split",this,3)([t,n]);return this.cache={},o}}])}(j);ae.blotName="block",ae.tagName="P",ae.defaultChild=xt,ae.allowedChildren=[xt,Wt,N,Pt];var le=function(t){function e(){return Gt(this,e),Yt(this,e,arguments)}return re(e,t),Xt(e,[{key:"attach",value:function(){Jt(e,"attach",this,3)([]),this.attributes=new d(this.domNode)}},{key:"delta",value:function(){return(new D.a).insert(this.value(),Zt(Zt({},this.formats()),this.attributes.values()))}},{key:"format",value:function(t,e){var n=this.scroll.query(t,i.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,e)}},{key:"formatAt",value:function(t,e,n,r){this.format(n,r)}},{key:"insertAt",value:function(t,n,r){var o=this;if(null==r){var i=n.split("\n"),u=i.pop(),a=i.map((function(t){var e=o.scroll.create(ae.blotName);return e.insertAt(0,t),e})),l=this.split(t);a.forEach((function(t){o.parent.insertBefore(t,l)})),u&&this.parent.insertBefore(this.scroll.create("text",u),l)}else Jt(e,"insertAt",this,3)([t,n,r])}}])}(N);function se(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.descendants(m).reduce((function(t,n){return 0===n.length()?t:t.insert(n.value(),ce(n,{},e))}),new D.a).insert("\n",ce(t))}function ce(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==t?e:("formats"in t&&"function"==typeof t.formats&&(e=Zt(Zt({},e),t.formats()),n&&delete e["code-token"]),null==t.parent||"scroll"===t.parent.statics.blotName||t.parent.statics.scope!==t.statics.scope?e:ce(t.parent,e,n))}le.scope=i.BLOCK_BLOT;n(94);function fe(t){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function he(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,we(r.key),r)}}function pe(t,e,n){return e=ve(e),function(t,e){if(e&&("object"==fe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,n||[],ve(t).constructor):e.apply(t,n))}function de(t,e,n,r){var o=ye(ve(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function ye(){return(ye="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=be(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(null,arguments)}function be(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ve(t)););return t}function ve(t){return(ve=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function me(t,e){return(me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ge(t,e,n){return(e=we(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function we(t){var e=function(t,e){if("object"!=fe(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=fe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==fe(e)?e:e+""}var Oe=function(t){function e(t,n,r){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=pe(this,e,[t,n])).selection=r,o.textNode=document.createTextNode(e.CONTENTS),o.domNode.appendChild(o.textNode),o.savedLength=0,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&me(t,e)}(e,t),n=e,o=[{key:"value",value:function(){}}],(r=[{key:"detach",value:function(){null!=this.parent&&this.parent.removeChild(this)}},{key:"format",value:function(t,n){if(0===this.savedLength){for(var r=this,o=0;null!=r&&r.statics.scope!==i.BLOCK_BLOT;)o+=r.offset(r.parent),r=r.parent;null!=r&&(this.savedLength=e.CONTENTS.length,r.optimize(),r.formatAt(o,e.CONTENTS.length,t,n),this.savedLength=0)}else de(e,"format",this,3)([t,n])}},{key:"index",value:function(t,n){return t===this.textNode?0:de(e,"index",this,3)([t,n])}},{key:"length",value:function(){return this.savedLength}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){de(e,"remove",this,3)([]),this.parent=null}},{key:"restore",value:function(){if(this.selection.composing||null==this.parent)return null;for(var t=this.selection.getNativeRange();null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);var n,r=this.prev instanceof Pt?this.prev:null,o=r?r.length():0,i=this.next instanceof Pt?this.next:null,u=i?i.text:"",a=this.textNode,l=a.data.split(e.CONTENTS).join("");if(a.data=e.CONTENTS,r)n=r,(l||i)&&(r.insertAt(r.length(),l+u),i&&i.remove());else if(i)n=i,i.insertAt(0,l);else{var s=document.createTextNode(l);n=this.scroll.create(s),this.parent.insertBefore(n,this)}if(this.remove(),t){var c=function(t,e){return r&&t===r.domNode?e:t===a?o+e-1:i&&t===i.domNode?o+l.length+e:null},f=c(t.start.node,t.start.offset),h=c(t.end.node,t.end.offset);if(null!==f&&null!==h)return{startNode:n.domNode,startOffset:f,endNode:n.domNode,endOffset:h}}return null}},{key:"update",value:function(t,e){var n=this;if(t.some((function(t){return"characterData"===t.type&&t.target===n.textNode}))){var r=this.restore();r&&(e.range=r)}}},{key:"optimize",value:function(t){de(e,"optimize",this,3)([t]);for(var n=this.parent;n;){if("A"===n.domNode.tagName){this.savedLength=e.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}},{key:"value",value:function(){return""}}])&&he(n.prototype,r),o&&he(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(N);ge(Oe,"blotName","cursor"),ge(Oe,"className","ql-cursor"),ge(Oe,"tagName","span"),ge(Oe,"CONTENTS","\ufeff");var xe=Oe,Ee=(n(93),n(1673)),ke=(n(1593),new WeakMap),Ae=["error","warn","log","info"],je="warn";function Se(t){if(je&&Ae.indexOf(t)<=Ae.indexOf(je)){for(