v?_(a,O-v,Math.min(g,v+d-O)):_(a,0,Math.min(d,O+g-v)),v+=d}},y.prototype.map=function(O){return this.reduce(function(g,_){return g.push(O(_)),g},[])},y.prototype.reduce=function(O,g){for(var _,p=this.iterator();_=p();)g=O(g,_);return g},y}();r.default=c},function(t,r,i){var c=this&&this.__extends||function(){var l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var v in a)a.hasOwnProperty(v)&&(o[v]=a[v])};return function(o,a){l(o,a);function v(){this.constructor=o}o.prototype=a===null?Object.create(a):(v.prototype=a.prototype,new v)}}();Object.defineProperty(r,"__esModule",{value:!0});var y=i(17),O=i(1),g={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},_=100,p=function(l){c(o,l);function o(a){var v=l.call(this,a)||this;return v.scroll=v,v.observer=new MutationObserver(function(h){v.update(h)}),v.observer.observe(v.domNode,g),v.attach(),v}return o.prototype.detach=function(){l.prototype.detach.call(this),this.observer.disconnect()},o.prototype.deleteAt=function(a,v){this.update(),a===0&&v===this.length()?this.children.forEach(function(h){h.remove()}):l.prototype.deleteAt.call(this,a,v)},o.prototype.formatAt=function(a,v,h,d){this.update(),l.prototype.formatAt.call(this,a,v,h,d)},o.prototype.insertAt=function(a,v,h){this.update(),l.prototype.insertAt.call(this,a,v,h)},o.prototype.optimize=function(a,v){var h=this;a===void 0&&(a=[]),v===void 0&&(v={}),l.prototype.optimize.call(this,v);for(var d=[].slice.call(this.observer.takeRecords());d.length>0;)a.push(d.pop());for(var f=function(b,S){S===void 0&&(S=!0),!(b==null||b===h)&&b.domNode.parentNode!=null&&(b.domNode[O.DATA_KEY].mutations==null&&(b.domNode[O.DATA_KEY].mutations=[]),S&&f(b.parent))},u=function(b){b.domNode[O.DATA_KEY]==null||b.domNode[O.DATA_KEY].mutations==null||(b instanceof y.default&&b.children.forEach(u),b.optimize(v))},m=a,s=0;m.length>0;s+=1){if(s>=_)throw new Error("[Parchment] Maximum optimize iterations reached");for(m.forEach(function(b){var S=O.find(b.target,!0);S!=null&&(S.domNode===b.target&&(b.type==="childList"?(f(O.find(b.previousSibling,!1)),[].forEach.call(b.addedNodes,function(A){var k=O.find(A,!1);f(k,!1),k instanceof y.default&&k.children.forEach(function(N){f(N,!1)})})):b.type==="attributes"&&f(S.prev)),f(S))}),this.children.forEach(u),m=[].slice.call(this.observer.takeRecords()),d=m.slice();d.length>0;)a.push(d.pop())}},o.prototype.update=function(a,v){var h=this;v===void 0&&(v={}),a=a||this.observer.takeRecords(),a.map(function(d){var f=O.find(d.target,!0);return f==null?null:f.domNode[O.DATA_KEY].mutations==null?(f.domNode[O.DATA_KEY].mutations=[d],f):(f.domNode[O.DATA_KEY].mutations.push(d),null)}).forEach(function(d){d==null||d===h||d.domNode[O.DATA_KEY]==null||d.update(d.domNode[O.DATA_KEY].mutations||[],v)}),this.domNode[O.DATA_KEY].mutations!=null&&l.prototype.update.call(this,this.domNode[O.DATA_KEY].mutations,v),this.optimize(a,v)},o.blotName="scroll",o.defaultChild="block",o.scope=O.Scope.BLOCK_BLOT,o.tagName="DIV",o}(y.default);r.default=p},function(t,r,i){var c=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,o){l.__proto__=o}||function(l,o){for(var a in o)o.hasOwnProperty(a)&&(l[a]=o[a])};return function(l,o){p(l,o);function a(){this.constructor=l}l.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}}();Object.defineProperty(r,"__esModule",{value:!0});var y=i(18),O=i(1);function g(p,l){if(Object.keys(p).length!==Object.keys(l).length)return!1;for(var o in p)if(p[o]!==l[o])return!1;return!0}var _=function(p){c(l,p);function l(){return p!==null&&p.apply(this,arguments)||this}return l.formats=function(o){if(o.tagName!==l.tagName)return p.formats.call(this,o)},l.prototype.format=function(o,a){var v=this;o===this.statics.blotName&&!a?(this.children.forEach(function(h){h instanceof y.default||(h=h.wrap(l.blotName,!0)),v.attributes.copy(h)}),this.unwrap()):p.prototype.format.call(this,o,a)},l.prototype.formatAt=function(o,a,v,h){if(this.formats()[v]!=null||O.query(v,O.Scope.ATTRIBUTE)){var d=this.isolate(o,a);d.format(v,h)}else p.prototype.formatAt.call(this,o,a,v,h)},l.prototype.optimize=function(o){p.prototype.optimize.call(this,o);var a=this.formats();if(Object.keys(a).length===0)return this.unwrap();var v=this.next;v instanceof l&&v.prev===this&&g(a,v.formats())&&(v.moveChildren(this),v.remove())},l.blotName="inline",l.scope=O.Scope.INLINE_BLOT,l.tagName="SPAN",l}(y.default);r.default=_},function(t,r,i){var c=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,l){p.__proto__=l}||function(p,l){for(var o in l)l.hasOwnProperty(o)&&(p[o]=l[o])};return function(p,l){_(p,l);function o(){this.constructor=p}p.prototype=l===null?Object.create(l):(o.prototype=l.prototype,new o)}}();Object.defineProperty(r,"__esModule",{value:!0});var y=i(18),O=i(1),g=function(_){c(p,_);function p(){return _!==null&&_.apply(this,arguments)||this}return p.formats=function(l){var o=O.query(p.blotName).tagName;if(l.tagName!==o)return _.formats.call(this,l)},p.prototype.format=function(l,o){O.query(l,O.Scope.BLOCK)!=null&&(l===this.statics.blotName&&!o?this.replaceWith(p.blotName):_.prototype.format.call(this,l,o))},p.prototype.formatAt=function(l,o,a,v){O.query(a,O.Scope.BLOCK)!=null?this.format(a,v):_.prototype.formatAt.call(this,l,o,a,v)},p.prototype.insertAt=function(l,o,a){if(a==null||O.query(o,O.Scope.INLINE)!=null)_.prototype.insertAt.call(this,l,o,a);else{var v=this.split(l),h=O.create(o,a);v.parent.insertBefore(h,v)}},p.prototype.update=function(l,o){navigator.userAgent.match(/Trident/)?this.build():_.prototype.update.call(this,l,o)},p.blotName="block",p.scope=O.Scope.BLOCK_BLOT,p.tagName="P",p}(y.default);r.default=g},function(t,r,i){var c=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,p){_.__proto__=p}||function(_,p){for(var l in p)p.hasOwnProperty(l)&&(_[l]=p[l])};return function(_,p){g(_,p);function l(){this.constructor=_}_.prototype=p===null?Object.create(p):(l.prototype=p.prototype,new l)}}();Object.defineProperty(r,"__esModule",{value:!0});var y=i(19),O=function(g){c(_,g);function _(){return g!==null&&g.apply(this,arguments)||this}return _.formats=function(p){},_.prototype.format=function(p,l){g.prototype.formatAt.call(this,0,this.length(),p,l)},_.prototype.formatAt=function(p,l,o,a){p===0&&l===this.length()?this.format(o,a):g.prototype.formatAt.call(this,p,l,o,a)},_.prototype.formats=function(){return this.statics.formats(this.domNode)},_}(y.default);r.default=O},function(t,r,i){var c=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,l){p.__proto__=l}||function(p,l){for(var o in l)l.hasOwnProperty(o)&&(p[o]=l[o])};return function(p,l){_(p,l);function o(){this.constructor=p}p.prototype=l===null?Object.create(l):(o.prototype=l.prototype,new o)}}();Object.defineProperty(r,"__esModule",{value:!0});var y=i(19),O=i(1),g=function(_){c(p,_);function p(l){var o=_.call(this,l)||this;return o.text=o.statics.value(o.domNode),o}return p.create=function(l){return document.createTextNode(l)},p.value=function(l){var o=l.data;return o.normalize&&(o=o.normalize()),o},p.prototype.deleteAt=function(l,o){this.domNode.data=this.text=this.text.slice(0,l)+this.text.slice(l+o)},p.prototype.index=function(l,o){return this.domNode===l?o:-1},p.prototype.insertAt=function(l,o,a){a==null?(this.text=this.text.slice(0,l)+o+this.text.slice(l),this.domNode.data=this.text):_.prototype.insertAt.call(this,l,o,a)},p.prototype.length=function(){return this.text.length},p.prototype.optimize=function(l){_.prototype.optimize.call(this,l),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof p&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},p.prototype.position=function(l,o){return[this.domNode,l]},p.prototype.split=function(l,o){if(o===void 0&&(o=!1),!o){if(l===0)return this;if(l===this.length())return this.next}var a=O.create(this.domNode.splitText(l));return this.parent.insertBefore(a,this.next),this.text=this.statics.value(this.domNode),a},p.prototype.update=function(l,o){var a=this;l.some(function(v){return v.type==="characterData"&&v.target===a.domNode})&&(this.text=this.statics.value(this.domNode))},p.prototype.value=function(){return this.text},p.blotName="text",p.scope=O.Scope.INLINE_BLOT,p}(y.default);r.default=g},function(t,r,i){var c=document.createElement("div");if(c.classList.toggle("test-class",!1),c.classList.contains("test-class")){var y=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(O,g){return arguments.length>1&&!this.contains(O)==!g?g:y.call(this,O)}}String.prototype.startsWith||(String.prototype.startsWith=function(O,g){return g=g||0,this.substr(g,O.length)===O}),String.prototype.endsWith||(String.prototype.endsWith=function(O,g){var _=this.toString();(typeof g!="number"||!isFinite(g)||Math.floor(g)!==g||g>_.length)&&(g=_.length),g-=O.length;var p=_.indexOf(O,g);return p!==-1&&p===g}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(g){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof g!="function")throw new TypeError("predicate must be a function");for(var _=Object(this),p=_.length>>>0,l=arguments[1],o,a=0;ab.length?s:b,k=s.length>b.length?b:s,N=A.indexOf(k);if(N!=-1)return S=[[c,A.substring(0,N)],[y,k],[c,A.substring(N+k.length)]],s.length>b.length&&(S[0][0]=S[2][0]=i),S;if(k.length==1)return[[i,s],[c,b]];var x=a(s,b);if(x){var E=x[0],w=x[1],T=x[2],P=x[3],R=x[4],U=O(E,T),V=O(w,P);return U.concat([[y,R]],V)}return _(s,b)}function _(s,b){for(var S=s.length,A=b.length,k=Math.ceil((S+A)/2),N=k,x=2*k,E=new Array(x),w=new Array(x),T=0;TS)V+=2;else if(z>A)U+=2;else if(R){var H=N+P-q;if(H>=0&&H=F)return p(s,b,$,z)}}}for(var I=-D+ee;I<=D-j;I+=2){var H=N+I,F;I==-D||I!=D&&w[H-1]S)j+=2;else if(G>A)ee+=2;else if(!R){var L=N+P-I;if(L>=0&&L=F)return p(s,b,$,z)}}}}return[[i,s],[c,b]]}function p(s,b,S,A){var k=s.substring(0,S),N=b.substring(0,A),x=s.substring(S),E=b.substring(A),w=O(k,N),T=O(x,E);return w.concat(T)}function l(s,b){if(!s||!b||s.charAt(0)!=b.charAt(0))return 0;for(var S=0,A=Math.min(s.length,b.length),k=A,N=0;Sb.length?s:b,A=s.length>b.length?b:s;if(S.length<4||A.length*2=V.length?[$,z,H,F,L]:null}var N=k(S,A,Math.ceil(S.length/4)),x=k(S,A,Math.ceil(S.length/2)),E;if(!N&&!x)return null;x?N?E=N[4].length>x[4].length?N:x:E=x:E=N;var w,T,P,R;s.length>b.length?(w=E[0],T=E[1],P=E[2],R=E[3]):(P=E[0],R=E[1],w=E[2],T=E[3]);var U=E[4];return[w,T,P,R,U]}function v(s){s.push([y,""]);for(var b=0,S=0,A=0,k="",N="",x;b1?(S!==0&&A!==0&&(x=l(N,k),x!==0&&(b-S-A>0&&s[b-S-A-1][0]==y?s[b-S-A-1][1]+=N.substring(0,x):(s.splice(0,0,[y,N.substring(0,x)]),b++),N=N.substring(x),k=k.substring(x)),x=o(N,k),x!==0&&(s[b][1]=N.substring(N.length-x)+s[b][1],N=N.substring(0,N.length-x),k=k.substring(0,k.length-x))),S===0?s.splice(b-A,S+A,[c,N]):A===0?s.splice(b-S,S+A,[i,k]):s.splice(b-S-A,S+A,[i,k],[c,N]),b=b-S-A+(S?1:0)+(A?1:0)+1):b!==0&&s[b-1][0]==y?(s[b-1][1]+=s[b][1],s.splice(b,1)):b++,A=0,S=0,k="",N="";break}s[s.length-1][1]===""&&s.pop();var E=!1;for(b=1;b0&&A.splice(k+2,0,[x[0],E]),m(A,k,3)}else return s}function u(s){for(var b=!1,S=function(x){return x.charCodeAt(0)>=56320&&x.charCodeAt(0)<=57343},A=function(x){return x.charCodeAt(x.length-1)>=55296&&x.charCodeAt(x.length-1)<=56319},k=2;k0&&N.push(s[k]);return N}function m(s,b,S){for(var A=b+S-1;A>=0&&A>=b-1;A--)if(A+1\r?\n +\<"),this.convert();var Q=this.quill.getFormat(this.quill.selection.savedRange.index);if(Q[A.default.blotName]){var ne=this.container.innerText;return this.container.innerHTML="",new l.default().insert(ne,T({},A.default.blotName,Q[A.default.blotName]))}var oe=this.prepareMatching(),le=y(oe,2),me=le[0],Oe=le[1],fe=I(this.container,me,Oe);return H(fe,`
-`)&&fe.ops[fe.ops.length-1].attributes==null&&(fe=fe.compose(new l.default().retain(fe.length()-1).delete(1))),V.log("convert",this.container.innerHTML,fe),this.container.innerHTML="",fe}},{key:"dangerouslyPasteHTML",value:function(X,Q){var ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h.default.sources.API;if(typeof X=="string")this.quill.setContents(this.convert(X),Q),this.quill.setSelection(0,h.default.sources.SILENT);else{var oe=this.convert(Q);this.quill.updateContents(new l.default().retain(X).concat(oe),ne),this.quill.setSelection(X+oe.length(),h.default.sources.SILENT)}}},{key:"onPaste",value:function(X){var Q=this;if(!(X.defaultPrevented||!this.quill.isEnabled())){var ne=this.quill.getSelection(),oe=new l.default().retain(ne.index),le=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(h.default.sources.SILENT),setTimeout(function(){oe=oe.concat(Q.convert()).delete(ne.length),Q.quill.updateContents(oe,h.default.sources.USER),Q.quill.setSelection(oe.length()-ne.length,h.default.sources.SILENT),Q.quill.scrollingContainer.scrollTop=le,Q.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var X=this,Q=[],ne=[];return this.matchers.forEach(function(oe){var le=y(oe,2),me=le[0],Oe=le[1];switch(me){case Node.TEXT_NODE:ne.push(Oe);break;case Node.ELEMENT_NODE:Q.push(Oe);break;default:[].forEach.call(X.container.querySelectorAll(me),function(fe){fe[ee]=fe[ee]||[],fe[ee].push(Oe)});break}}),[Q,ne]}}]),M}(m.default);L.DEFAULTS={matchers:[],matchVisual:!0};function $(B,M,K){return(typeof M>"u"?"undefined":c(M))==="object"?Object.keys(M).reduce(function(X,Q){return $(X,Q,M[Q])},B):B.reduce(function(X,Q){return Q.attributes&&Q.attributes[M]?X.push(Q):X.insert(Q.insert,(0,_.default)({},T({},M,K),Q.attributes))},new l.default)}function z(B){if(B.nodeType!==Node.ELEMENT_NODE)return{};var M="__ql-computed-style";return B[M]||(B[M]=window.getComputedStyle(B))}function H(B,M){for(var K="",X=B.ops.length-1;X>=0&&K.length-1}function I(B,M,K){return B.nodeType===B.TEXT_NODE?K.reduce(function(X,Q){return Q(B,X)},new l.default):B.nodeType===B.ELEMENT_NODE?[].reduce.call(B.childNodes||[],function(X,Q){var ne=I(Q,M,K);return Q.nodeType===B.ELEMENT_NODE&&(ne=M.reduce(function(oe,le){return le(Q,oe)},ne),ne=(Q[ee]||[]).reduce(function(oe,le){return le(Q,oe)},ne)),X.concat(ne)},new l.default):new l.default}function G(B,M,K){return $(K,B,!0)}function W(B,M){var K=a.default.Attributor.Attribute.keys(B),X=a.default.Attributor.Class.keys(B),Q=a.default.Attributor.Style.keys(B),ne={};return K.concat(X).concat(Q).forEach(function(oe){var le=a.default.query(oe,a.default.Scope.ATTRIBUTE);le!=null&&(ne[le.attrName]=le.value(B),ne[le.attrName])||(le=D[oe],le!=null&&(le.attrName===oe||le.keyName===oe)&&(ne[le.attrName]=le.value(B)||void 0),le=q[oe],le!=null&&(le.attrName===oe||le.keyName===oe)&&(le=q[oe],ne[le.attrName]=le.value(B)||void 0))}),Object.keys(ne).length>0&&(M=$(M,ne)),M}function J(B,M){var K=a.default.query(B);if(K==null)return M;if(K.prototype instanceof a.default.Embed){var X={},Q=K.value(B);Q!=null&&(X[K.blotName]=Q,M=new l.default().insert(X,K.formats(B)))}else typeof K.formats=="function"&&(M=$(M,K.blotName,K.formats(B)));return M}function re(B,M){return H(M,`
-`)||M.insert(`
-`),M}function ie(){return new l.default}function ae(B,M){var K=a.default.query(B);if(K==null||K.blotName!=="list-item"||!H(M,`
-`))return M;for(var X=-1,Q=B.parentNode;!Q.classList.contains("ql-clipboard");)(a.default.query(Q)||{}).blotName==="list"&&(X+=1),Q=Q.parentNode;return X<=0?M:M.compose(new l.default().retain(M.length()-1).retain(1,{indent:X}))}function se(B,M){return H(M,`
-`)||(F(B)||M.length()>0&&B.nextSibling&&F(B.nextSibling))&&M.insert(`
-`),M}function C(B,M){if(F(B)&&B.nextElementSibling!=null&&!H(M,`
-
-`)){var K=B.offsetHeight+parseFloat(z(B).marginTop)+parseFloat(z(B).marginBottom);B.nextElementSibling.offsetTop>B.offsetTop+K*1.5&&M.insert(`
-`)}return M}function Z(B,M){var K={},X=B.style||{};return X.fontStyle&&z(B).fontStyle==="italic"&&(K.italic=!0),X.fontWeight&&(z(B).fontWeight.startsWith("bold")||parseInt(z(B).fontWeight)>=700)&&(K.bold=!0),Object.keys(K).length>0&&(M=$(M,K)),parseFloat(X.textIndent||0)>0&&(M=new l.default().insert(" ").concat(M)),M}function Y(B,M){var K=B.data;if(B.parentNode.tagName==="O:P")return M.insert(K.trim());if(K.trim().length===0&&B.parentNode.classList.contains("ql-clipboard"))return M;if(!z(B.parentNode).whiteSpace.startsWith("pre")){var X=function(ne,oe){return oe=oe.replace(/[^\u00a0]/g,""),oe.length<1&&ne?" ":oe};K=K.replace(/\r\n/g," ").replace(/\n/g," "),K=K.replace(/\s\s+/g,X.bind(X,!0)),(B.previousSibling==null&&F(B.parentNode)||B.previousSibling!=null&&F(B.previousSibling))&&(K=K.replace(/^\s+/,X.bind(X,!1))),(B.nextSibling==null&&F(B.parentNode)||B.nextSibling!=null&&F(B.nextSibling))&&(K=K.replace(/\s+$/,X.bind(X,!1)))}return M.insert(K)}r.default=L,r.matchAttributor=W,r.matchBlot=J,r.matchNewline=se,r.matchSpacing=C,r.matchText=Y},function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var c=function(){function v(h,d){for(var f=0;f '},function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var c=function(){function v(h,d){for(var f=0;fa.right&&(h=a.right-v.right,this.root.style.left=l+h+"px"),v.lefta.bottom){var d=v.bottom-v.top,f=p.bottom-p.top+d;this.root.style.top=o-f+"px",this.root.classList.add("ql-flip")}return h}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),g}();r.default=O},function(t,r,i){Object.defineProperty(r,"__esModule",{value:!0});var c=function(){function x(E,w){var T=[],P=!0,R=!1,U=void 0;try{for(var V=E[Symbol.iterator](),ee;!(P=(ee=V.next()).done)&&(T.push(ee.value),!(w&&T.length===w));P=!0);}catch(j){R=!0,U=j}finally{try{!P&&V.return&&V.return()}finally{if(R)throw U}}return T}return function(E,w){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return x(E,w);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),y=function x(E,w,T){E===null&&(E=Function.prototype);var P=Object.getOwnPropertyDescriptor(E,w);if(P===void 0){var R=Object.getPrototypeOf(E);return R===null?void 0:x(R,w,T)}else{if("value"in P)return P.value;var U=P.get;return U===void 0?void 0:U.call(T)}},O=function(){function x(E,w){for(var T=0;T