55 lines
258 KiB
JavaScript
55 lines
258 KiB
JavaScript
|
import{ab as kt,ac as tr,d as er,o as nr,ad as dr,a as Zt,s as Ze,E as Un,ae as vr,r as Gn,n as pr,h as Qt,b as Dn,c as yr,w as Lt,e as Ot,f as ke,A as gr,j as Zn,z as Wn,x as mr,af as br,ag as _r,ah as Or,a2 as Er,Z as Ar,$ as wr,a0 as Tr,a1 as kr,U as Nr,ai as Sr,aj as xr,_ as Pr}from"./index-7b3f5fdc.js";import{c as qr}from"./index-a832a56d.js";import{V as Lr}from"./index-a513db85.js";import{a as Rr}from"./index-e96dc078.js";import{w as jr}from"./index-354ab616.js";import{w as Ir}from"./index-81f068f9.js";import{j as Mr}from"./index-d0b57c12.js";var rr={exports:{}};/*!
|
||
|
* Quill Editor v1.3.7
|
||
|
* https://quilljs.com/
|
||
|
* Copyright (c) 2014, Jason Chen
|
||
|
* Copyright (c) 2013, salesforce.com
|
||
|
*/(function(R,U){(function(p,d){R.exports=d()})(typeof self<"u"?self:kt,function(){return function(m){var p={};function d(E){if(p[E])return p[E].exports;var b=p[E]={i:E,l:!1,exports:{}};return m[E].call(b.exports,b,b.exports,d),b.l=!0,b.exports}return d.m=m,d.c=p,d.d=function(E,b,O){d.o(E,b)||Object.defineProperty(E,b,{configurable:!1,enumerable:!0,get:O})},d.n=function(E){var b=E&&E.__esModule?function(){return E.default}:function(){return E};return d.d(b,"a",b),b},d.o=function(E,b){return Object.prototype.hasOwnProperty.call(E,b)},d.p="",d(d.s=109)}([function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0});var E=d(17),b=d(18),O=d(19),y=d(45),g=d(46),h=d(47),o=d(48),n=d(49),e=d(12),f=d(32),a=d(33),u=d(31),r=d(1),i={Scope:r.Scope,create:r.create,find:r.find,query:r.query,register:r.register,Container:E.default,Format:b.default,Leaf:O.default,Embed:o.default,Scroll:y.default,Block:h.default,Inline:g.default,Text:n.default,Attributor:{Attribute:e.default,Class:f.default,Style:a.default,Store:u.default}};p.default=i},function(m,p,d){var E=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var c in i)i.hasOwnProperty(c)&&(r[c]=i[c])};return function(r,i){u(r,i);function c(){this.constructor=r}r.prototype=i===null?Object.create(i):(c.prototype=i.prototype,new c)}}();Object.defineProperty(p,"__esModule",{value:!0});var b=function(u){E(r,u);function r(i){var c=this;return i="[Parchment] "+i,c=u.call(this,i)||this,c.message=i,c.name=c.constructor.name,c}return r}(Error);p.ParchmentError=b;var O={},y={},g={},h={};p.DATA_KEY="__blot";var o;(function(u){u[u.TYPE=3]="TYPE",u[u.LEVEL=12]="LEVEL",u[u.ATTRIBUTE=13]="ATTRIBUTE",u[u.BLOT=14]="BLOT",u[u.INLINE=7]="INLINE",u[u.BLOCK=11]="BLOCK",u[u.BLOCK_BLOT=10]="BLOCK_BLOT",u[u.INLINE_BLOT=6]="INLINE_BLOT",u[u.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",u[u.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",u[u.ANY=15]="ANY"})(o=p.Scope||(p.Scope={}));function n(u,r){var i=f(u);if(i==null)throw new b("Unable to create "+u+" blot");var c=i,t=u instanceof Node||u.nodeType===Node.TEXT_NODE?u:c.create(r);return new c(t,r)}p.create=n;function e(u,r){return r===void 0&&(r=!1),u==null?null:u[p.DATA_KEY]!=null?u[p.DATA_KEY].blot:r?e(u.parentNode,r):null}p.find=e;function f(u,r){r===void 0&&(r=o.ANY);var i;if(typeof u=="string")i=h[u]||O[u];else if(u instanceof Text||u.nodeType===Node.TEXT_NODE)i=h.text;else if(typeof u=="number")u&o.LEVEL&o.BLOCK?i=h.block:u&o.LEVEL&o.INLINE&&(i=h.inline);else if(u instanceof HTMLElement){var c=(u.getAttribute("class")||"").split(/\s+/);for(var t in c)if(i=y[c[t]],i)break;i=i||g[u.tagName]}return i==null?null:r&o.LEVEL&i.scope&&r&o.TYPE&i.scope?i:null}p.query=f;function a(){for(var u=[],r=0;r<arguments.length;r++)u[r]=arguments[r];if(u.length>1)return u.map(function(t){return a(t)});var i=u[0];if(typeof i.blotName!="string"&&typeof i.attrName!="string")throw new b("Invalid definition");if(i.blotName==="abstract")throw new b("Cannot register abstract class");if(h[i.blotName||i.attrName]=i,typeof i.keyName=="string")O[i.keyName]=i;else if(i.className!=null&&(y[i.className]=i),i.tagName!=null){Array.isArray(i.tagName)?i.tagName=i.tagName.map(function(t){return t.toUpperCase()}):i.tagName=i.tagName.toUpperCase();var c=Array.isArray(i.tagName)?i.tagName:[i.tagName];c.forEach(function(t){(g[t]==null||i.className==null)&&(g[t]=i)})}return i}p.register=a},function(m,p,d){var E=d(51),b=d(11),O=d(3),y=d(20),g=String.fromCharCode(0),h=function(o){Array.isArray(o)?this.ops=o:o!=null&&Array.isArray(o.ops)?this.ops=o.ops:this.ops=[]};h.prototype.insert=function(o,n){var e={};return o.length===0?this:(e.insert=o,n!=null&&typeof n=="object"&&Object.keys(n).length>0&&(e.attributes=n),this.push(e))},h.prototype.delete=function(o){return o<=0?this:this.push({delete:o})},h.prototype.retain=function(o,n){if(o<=0)return this;var e={retain:o};return n!=null&&typeof n=="object"&&Object.keys(n).length>0&&(e.attributes=n),this.push(e)},h.prototype.push=function(o){var n=this.ops.length,e=this.ops[n-1];if(o=
|
||
|
`;for(var e=y.iterator(this.ops),f=new h,a=0;e.hasNext();){if(e.peekType()!=="insert")return;var u=e.peek(),r=y.length(u)-e.peekLength(),i=typeof u.insert=="string"?u.insert.indexOf(n,r)-r:-1;if(i<0)f.push(e.next());else if(i>0)f.push(e.next(i));else{if(o(f,e.next(1).attributes||{},a)===!1)return;a+=1,f=new h}}f.length()>0&&o(f,{},a)},h.prototype.transform=function(o,n){if(n=!!n,typeof o=="number")return this.transformPosition(o,n);for(var e=y.iterator(this.ops),f=y.iterator(o.ops),a=new h;e.hasNext()||f.hasNext();)if(e.peekType()==="insert"&&(n||f.peekType()!=="insert"))a.retain(y.length(e.next()));else if(f.peekType()==="insert")a.push(f.next());else{var u=Math.min(e.peekLength(),f.peekLength()),r=e.next(u),i=f.next(u);if(r.delete)continue;i.delete?a.push(i):a.retain(u,y.attributes.transform(r.attributes,i.attributes,n))}return a.chop()},h.prototype.transformPosition=function(o,n){n=!!n;for(var e=y.iterator(this.ops),f=0;e.hasNext()&&f<=o;){var a=e.peekLength(),u=e.peekType();if(e.next(),u==="delete"){o-=Math.min(a,o-f);continue}else u==="insert"&&(f<o||!n)&&(o+=a);f+=a}return o},m.exports=h},function(m,p){var d=Object.prototype.hasOwnProperty,E=Object.prototype.toString,b=Object.defineProperty,O=Object.getOwnPropertyDescriptor,y=function(e){return typeof Array.isArray=="function"?Array.isArray(e):E.call(e)==="[object Array]"},g=function(e){if(!e||E.call(e)!=="[object Object]")return!1;var f=d.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&d.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!f&&!a)return!1;var u;for(u in e);return typeof u>"u"||d.call(e,u)},h=function(e,f){b&&f.name==="__proto__"?b(e,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):e[f.name]=f.newValue},o=function(e,f){if(f==="__proto__")if(d.call(e,f)){if(O)return O(e,f).value}else return;return e[f]};m.exports=function n(){var e,f,a,u,r,i,c=arguments[0],t=1,s=arguments.length,k=!1;for(typeof c=="boolean"&&(k=c,c=arguments[1]||{},t=2),(c==null||typeof c!="object"&&typeof c!="function")&&(c={});t<s;++t)if(e=arguments[t],e!=null)for(f in e)a=o(c,f),u=o(e,f),c!==u&&(k&&u&&(g(u)||(r=y(u)))?(r?(r=!1,i=a&&y(a)?a:[]):i=a&&g(a)?a:{},h(c,{name:f,newValue:n(k,i,u)})):typeof u<"u"&&h(c,{name:f,newValue:u}));return c}},function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.BlockEmbed=p.bubbleFormats=void 0;var E=function(){function v(_,N){for(var q=0;q<N.length;q++){var D=N[q];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(_,D.key,D)}}return function(_,N,q){return N&&v(_.prototype,N),q&&v(_,q),_}}(),b=function v(_,N,q){_===null&&(_=Function.prototype);var D=Object.getOwnPropertyDescriptor(_,N);if(D===void 0){var z=Object.getPrototypeOf(_);return z===null?void 0:v(z,N,q)}else{if("value"in D)return D.value;var K=D.get;return K===void 0?void 0:K.call(q)}},O=d(3),y=c(O),g=d(2),h=c(g),o=d(0),n=c(o),e=d(16),f=c(e),a=d(6),u=c(a),r=d(7),i=c(r);function c(v){return v&&v.__esModule?v:{default:v}}function t(v,_){if(!(v instanceof _))throw new TypeError("Cannot call a class as a function")}function s(v,_){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:v}function k(v,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);v.prototype=Object.create(_&&_.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(v,_):v.__proto__=_)}var w=1,T=function(v){k(_,v);function _(){return t(this,_),s(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return E(_,[{key:"attach",value:function(){b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"attach",this).call(this),this.attributes=new n.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,y.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(q,D){var z=n.defaul
|
||
|
`)){var K=n.default.create(P.blotName);this.parent.insertBefore(K,q===0?this:this.next),K.insertAt(0,D.slice(0,-1))}else b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertAt",this).call(this,q,D,z)}}]),_}(n.default.Embed);T.scope=n.default.Scope.BLOCK_BLOT;var P=function(v){k(_,v);function _(N){t(this,_);var q=s(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,N));return q.cache={},q}return E(_,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(n.default.Leaf).reduce(function(q,D){return D.length()===0?q:q.insert(D.value(),A(D))},new h.default).insert(`
|
||
|
`,A(this))),this.cache.delta}},{key:"deleteAt",value:function(q,D){b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"deleteAt",this).call(this,q,D),this.cache={}}},{key:"formatAt",value:function(q,D,z,K){D<=0||(n.default.query(z,n.default.Scope.BLOCK)?q+D===this.length()&&this.format(z,K):b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"formatAt",this).call(this,q,Math.min(D,this.length()-q-1),z,K),this.cache={})}},{key:"insertAt",value:function(q,D,z){if(z!=null)return b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertAt",this).call(this,q,D,z);if(D.length!==0){var K=D.split(`
|
||
|
`),Y=K.shift();Y.length>0&&(q<this.length()-1||this.children.tail==null?b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertAt",this).call(this,Math.min(q,this.length()-1),Y):this.children.tail.insertAt(this.children.tail.length(),Y),this.cache={});var H=this;K.reduce(function(j,S){return H=H.split(j,!0),H.insertAt(0,S),S.length},q+Y.length)}}},{key:"insertBefore",value:function(q,D){var z=this.children.head;b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,q,D),z instanceof f.default&&z.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"length",this).call(this)+w),this.cache.length}},{key:"moveChildren",value:function(q,D){b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"moveChildren",this).call(this,q,D),this.cache={}}},{key:"optimize",value:function(q){b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,q),this.cache={}}},{key:"path",value:function(q){return b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"path",this).call(this,q,!0)}},{key:"removeChild",value:function(q){b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"removeChild",this).call(this,q),this.cache={}}},{key:"split",value:function(q){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(D&&(q===0||q>=this.length()-w)){var z=this.clone();return q===0?(this.parent.insertBefore(z,this),this):(this.parent.insertBefore(z,this.next),z)}else{var K=b(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"split",this).call(this,q,D);return this.cache={},K}}}]),_}(n.default.Block);P.blotName="block",P.tagName="P",P.defaultChild="break",P.allowedChildren=[u.default,n.default.Embed,i.default];function A(v){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v==null||(typeof v.formats=="function"&&(_=(0,y.default)(_,v.formats())),v.parent==null||v.parent.blotName=="scroll"||v.parent.statics.scope!==v.statics.scope)?_:A(v.parent,_)}p.bubbleFormats=A,p.BlockEmbed=T,p.default=P},function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.overload=p.expandConfig=void 0;var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},b=function(){function H(j,S){var I=[],M=!0,$=!1,C=void 0;try{for(var L=j[Symbol.iterator](),F;!(M=(F=L.next()).done)&&(I.push(F.value),!(S&&I.length===S));M=!0);}catch(V){$=!0,C=V}finally{try{!M&&L.return&&L.return()}finally{if($)throw C}}return I}return function(j,S){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return H(j,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),O=function(){function H(j,S){for(var I=0;I<S.length;I++){var M=S[I];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(j,M.key,M)}}return function(j,S,I){return S&&H(j.prototype,S),I&&H(j,I),j}}();d(50);var y=d(2),g=A(y),h=d(14),o=A(h),n=d(8),e=A(n),f=d(9),a=A(f),u=d(0),r=A(u),i=d(15),c=A(i),t=d(3),s=A(t),k=d(10),w=A(k),T=d(34),P=A(T);function A(H){return H&&H.__esModule?H:{default:H}}function v(H,j,S){return j in H?Object.defineProperty(H,j,{value:S,enumerable:!0,configurable:!0,writable:!0}):H[j]=S,H}function _(H,j){if(!(H instanceof j))throw new TypeError("Cannot call a class as a function")}var N=(0,w.default)("quill"),q=function(){O(H,null,[{key:"debug",value:function(S){S===!0&&(S="log"),w.default.level(S)}},{key:"find",value:function(S){return S.__quill||r.default.find(S)}},{key:"import",value:function(S){return this.imports[S]==null&&N.error("Cannot import "+S+". Are you sure it was registered?"),this.imports[S]}},{key:"register",value:function(S,I){var M=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof S!="string"){var C=S.attrName||S.blotName;typeof C=="string"?this.register("formats/"+C,S,I):Object.keys(S).forE
|
||
|
`&&(I.editor.deleteText(I.getLength()-1,1),L.delete(1));var V=C.compose(L);return V},M)}},{key:"setSelection",value:function(S,I,M){if(S==null)this.selection.setRange(null,I||H.sources.API);else{var $=K(S,I,M),C=b($,4);S=C[0],I=C[1],M=C[3],this.selection.setRange(new i.Range(S,I),M),M!==e.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API,M=new g.default().insert(S);return this.setContents(M,I)}},{key:"update",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.default.sources.USER,I=this.scroll.update(S);return this.selection.update(S),I}},{key:"updateContents",value:function(S){var I=this,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API;return z.call(this,function(){return S=new g.default(S),I.editor.applyDelta(S,M)},M,!0)}}]),H}();q.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},q.events=e.default.events,q.sources=e.default.sources,q.version="1.3.7",q.imports={delta:g.default,parchment:r.default,"core/module":a.default,"core/theme":P.default};function D(H,j){if(j=(0,s.default)(!0,{container:H,modules:{clipboard:!0,keyboard:!0,history:!0}},j),!j.theme||j.theme===q.DEFAULTS.theme)j.theme=P.default;else if(j.theme=q.import("themes/"+j.theme),j.theme==null)throw new Error("Invalid theme "+j.theme+". Did you register it?");var S=(0,s.default)(!0,{},j.theme.DEFAULTS);[S,j].forEach(function($){$.modules=$.modules||{},Object.keys($.modules).forEach(function(C){$.modules[C]===!0&&($.modules[C]={})})});var I=Object.keys(S.modules).concat(Object.keys(j.modules)),M=I.reduce(function($,C){var L=q.import("modules/"+C);return L==null?N.error("Cannot load "+C+" module. Are you sure you registered it?"):$[C]=L.DEFAULTS||{},$},{});return j.modules!=null&&j.modules.toolbar&&j.modules.toolbar.constructor!==Object&&(j.modules.toolbar={container:j.modules.toolbar}),j=(0,s.default)(!0,{},q.DEFAULTS,{modules:M},S,j),["bounds","container","scrollingContainer"].forEach(function($){typeof j[$]=="string"&&(j[$]=document.querySelector(j[$]))}),j.modules=Object.keys(j.modules).reduce(function($,C){return j.modules[C]&&($[C]=j.modules[C]),$},{}),j}function z(H,j,S,I){if(this.options.strict&&!this.isEnabled()&&j===e.default.sources.USER)return new g.default;var M=S==null?null:this.getSelection(),$=this.editor.delta,C=H();if(M!=null&&(S===!0&&(S=M.index),I==null?M=Y(M,C,j):I!==0&&(M=Y(M,S,I,j)),this.setSelection(M,e.default.sources.SILENT)),C.length()>0){var L,F=[e.default.events.TEXT_CHANGE,C,$,j];if((L=this.emitter).emit.apply(L,[e.default.events.EDITOR_CHANGE].concat(F)),j!==e.default.sources.SILENT){var V;(V=this.emitter).emit.apply(V,F)}}return C}function K(H,j,S,I,M){var $={};return typeof H.index=="number"&&typeof H.length=="number"?typeof j!="number"?(M=I,I=S,S=j,j=H.length,H=H.index):(j=H.length,H=H.index):typeof j!="number"&&(M=I,I=S,S=j,j=0),(typeof S>"u"?"undefined":E(S))==="object"?($=S,M=I):typeof S=="string"&&(I!=null?$[S]=I:M=S),M=M||e.default.sources.API,[H,j,$,M]}function Y(H,j,S,I){if(H==null)return null;var M=void 0,$=void 0;if(j instanceof g.default){var C=[H.index,H.index+H.length].map(function(G){return j.transformPosition(G,I!==e.default.sources.USER)}),L=b(C,2);M=L[0],$=L[1]}else{var F=[H.index,H.index+H.length].map(function(G){return G<j||G===j&&I===e.default.sources.USER?G:S>=0?G+S:Math.max(j,G+S)}),V=b(F,2);M=V[0],$=V[1]}return new i.Range(M,$-M)}p.expandConfig=D,p.overload=K,p.default=q},function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0});var E=function(){function u(r,i){for(var c=0;c<i.length;c++){var t=i[c];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,t.key,t)}}return function(r,i,c){return i&&u(r.prototype,i),c&&u(r,c),r}}(),b=function u(r,i,c){r===null&&(r=Function.prototype);var t=Object.getOwnPropertyDescriptor(r,i);if(t===void 0){var s=Object.getPrototypeOf(r);return s=
|
||
|
`)&&(_=_.slice(0,-1)),_.split(`
|
||
|
`).reduce(function(N,q){return N.insert(q).insert(`
|
||
|
`,v.formats())},new g.default)}},{key:"format",value:function(v,_){if(!(v===this.statics.blotName&&_)){var N=this.descendant(r.default,this.length()-1),q=E(N,1),D=q[0];D!=null&&D.deleteAt(D.length()-1,1),O(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,v,_)}}},{key:"formatAt",value:function(v,_,N,q){if(_!==0&&!(o.default.query(N,o.default.Scope.BLOCK)==null||N===this.statics.blotName&&q===this.statics.formats(this.domNode))){var D=this.newlineIndex(v);if(!(D<0||D>=v+_)){var z=this.newlineIndex(v,!0)+1,K=D-z+1,Y=this.isolate(z,K),H=Y.next;Y.format(N,q),H instanceof P&&H.formatAt(0,v-z+_-K,N,q)}}}},{key:"insertAt",value:function(v,_,N){if(N==null){var q=this.descendant(r.default,v),D=E(q,2),z=D[0],K=D[1];z.insertAt(K,_)}}},{key:"length",value:function(){var v=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
||
|
`)?v:v+1}},{key:"newlineIndex",value:function(v){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(_)return this.domNode.textContent.slice(0,v).lastIndexOf(`
|
||
|
`);var N=this.domNode.textContent.slice(v).indexOf(`
|
||
|
`);return N>-1?v+N:-1}},{key:"optimize",value:function(v){this.domNode.textContent.endsWith(`
|
||
|
`)||this.appendChild(o.default.create("text",`
|
||
|
`)),O(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,v);var _=this.next;_!=null&&_.prev===this&&_.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===_.statics.formats(_.domNode)&&(_.optimize(v),_.moveChildren(this),_.remove())}},{key:"replace",value:function(v){O(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,v),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(_){var N=o.default.find(_);N==null?_.parentNode.removeChild(_):N instanceof o.default.Embed?N.remove():N.unwrap()})}}],[{key:"create",value:function(v){var _=O(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,v);return _.setAttribute("spellcheck",!1),_}},{key:"formats",value:function(){return!0}}]),P}(e.default);w.blotName="code-block",w.tagName="PRE",w.TAB=" ",p.Code=k,p.default=w},function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0});var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},b=function(){function H(j,S){var I=[],M=!0,$=!1,C=void 0;try{for(var L=j[Symbol.iterator](),F;!(M=(F=L.next()).done)&&(I.push(F.value),!(S&&I.length===S));M=!0);}catch(V){$=!0,C=V}finally{try{!M&&L.return&&L.return()}finally{if($)throw C}}return I}return function(j,S){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return H(j,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),O=function(){function H(j,S){for(var I=0;I<S.length;I++){var M=S[I];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(j,M.key,M)}}return function(j,S,I){return S&&H(j.prototype,S),I&&H(j,I),j}}(),y=d(2),g=_(y),h=d(20),o=_(h),n=d(0),e=_(n),f=d(13),a=_(f),u=d(24),r=_(u),i=d(4),c=_(i),t=d(16),s=_(t),k=d(21),w=_(k),T=d(11),P=_(T),A=d(3),v=_(A);function _(H){return H&&H.__esModule?H:{default:H}}function N(H,j,S){return j in H?Object.defineProperty(H,j,{value:S,enumerable:!0,configurable:!0,writable:!0}):H[j]=S,H}function q(H,j){if(!(H instanceof j))throw new TypeError("Cannot call a class as a function")}var D=/^[ -~]*$/,z=function(){function H(j){q(this,H),this.scroll=j,this.delta=this.getDelta()}return O(H,[{key:"applyDelta",value:function(S){var I=this,M=!1;this.scroll.update();var $=this.scroll.length();return this.scroll.batchStart(),S=Y(S),S.reduce(function(C,L){var F=L.retain||L.delete||L.insert.length||1,V=L.attributes||{};if(L.insert!=null){if(typeof L.insert=="string"){var G=L.insert;G.endsWith(`
|
||
|
`)&&M&&(M=!1,G=G.slice(0,-1)),C>=$&&!G.endsWith(`
|
||
|
`)&&(M=!0),I.scroll.insertAt(C,G);var X=I.scroll.line(C),nt=b(X,2),it=nt[0],at=nt[1],ft=(0,v.default)({},(0,i.bubbleFormats)(it));if(it instanceof c.default){var ht=it.descendant(e.default.Leaf,at),mt=b(ht,1),gt=mt[0];ft=(0,v.default)(ft,(0,i.bubbleFormats)(gt))}V=o.default.attributes.diff(ft,V)||{}}else if(E(L.insert)==="object"){var W=Object.keys(L.insert)[0];if(W==null)return C;I.scroll.insertAt(C,W,L.insert[W])}$+=F}return Object.keys(V).forEach(function(Q){I.scroll.formatAt(C,F,Q,V[Q])}),C+F},0),S.reduce(function(C,L){return typeof L.delete=="number"?(I.scroll.deleteAt(C,L.delete),C):C+(L.retain||L.insert.length||1)},0),this.scroll.batchEnd(),this.update(S)}},{key:"deleteText",value:function(S,I){return this.scroll.deleteAt(S,I),this.update(new g.default().retain(S).delete(I))}},{key:"formatLine",value:function(S,I){var M=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys($).forEach(function(C){if(!(M.scroll.whitelist!=null&&!M.scroll.whitelist[C])){var L=M.scroll.lines(S,Math.max(I,1)),F=I;L.forEach(function(V){var G=V.length();if(!(V instanceof a.default))V.format(C,$[C]);else{var X=S-V.offset(M.scroll),nt=V.newlineIndex(X+F)-X+1;V.formatAt(X,nt,C,$[C])}F-=G})}}),this.scroll.optimize(),this.update(new g.default().retain(S).retain(I,(0,w.default)($)))}},{key:"formatText",value:function(S,I){var M=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys($).forEach(function(C){M.scroll.formatAt(S,I,C,$[C])}),this.update(new g.default().retain(S).retain(I,(0,w.default)($)))}},{key:"getContents",value:function(S,I){return this.delta.slice(S,S+I)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(S,I){return S.concat(I.delta())},new g.default)}},{key:"getFormat",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=[],$=[];I===0?this.scroll.path(S).forEach(function(L){var F=b(L,1),V=F[0];V instanceof c.default?M.push(V):V instanceof e.default.Leaf&&$.push(V)}):(M=this.scroll.lines(S,I),$=this.scroll.descendants(e.default.Leaf,S,I));var C=[M,$].map(function(L){if(L.length===0)return{};for(var F=(0,i.bubbleFormats)(L.shift());Object.keys(F).length>0;){var V=L.shift();if(V==null)return F;F=K((0,i.bubbleFormats)(V),F)}return F});return v.default.apply(v.default,C)}},{key:"getText",value:function(S,I){return this.getContents(S,I).filter(function(M){return typeof M.insert=="string"}).map(function(M){return M.insert}).join("")}},{key:"insertEmbed",value:function(S,I,M){return this.scroll.insertAt(S,I,M),this.update(new g.default().retain(S).insert(N({},I,M)))}},{key:"insertText",value:function(S,I){var M=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return I=I.replace(/\r\n/g,`
|
||
|
`).replace(/\r/g,`
|
||
|
`),this.scroll.insertAt(S,I),Object.keys($).forEach(function(C){M.scroll.formatAt(S,I.length,C,$[C])}),this.update(new g.default().retain(S).insert(I,(0,w.default)($)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var S=this.scroll.children.head;return S.statics.blotName!==c.default.blotName||S.children.length>1?!1:S.children.head instanceof s.default}},{key:"removeFormat",value:function(S,I){var M=this.getText(S,I),$=this.scroll.line(S+I),C=b($,2),L=C[0],F=C[1],V=0,G=new g.default;L!=null&&(L instanceof a.default?V=L.newlineIndex(F)-F+1:V=L.length()-F,G=L.delta().slice(F,F+V-1).insert(`
|
||
|
`));var X=this.getContents(S,I+V),nt=X.diff(new g.default().insert(M).concat(G)),it=new g.default().retain(S).concat(nt);return this.applyDelta(it)}},{key:"update",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,$=this.delta;if(I.length===1&&I[0].type==="characterData"&&I[0].target.data.match(D)&&e.default.find(I[0].target)){var C=e.default.find(I[0].target),L=(0,i.bubbleFormats)(C),F=C.offset(this.scroll),V=I[0].oldValue.replace(r.default.CONTENTS,""),G=new g.default().insert(V),X=new g.default().insert(C.value()),nt=new g.default().retain(F).concat(G.diff(X,M));S=nt.reduce(function(it,at){return at.insert?it.insert(at.insert,L):it.push(at)},new g.default),this.delta=$.compose(S)}else this.delta=this.getDelta(),(!S||!(0,P.default)($.compose(S),this.delta))&&(S=$.diff(this.delta,M));return S}}]),H}();function K(H,j){return Object.keys(j).reduce(function(S,I){return H[I]==null||(j[I]===H[I]?S[I]=j[I]:Array.isArray(j[I])?j[I].indexOf(H[I])<0&&(S[I]=j[I].concat([H[I]])):S[I]=[j[I],H[I]]),S},{})}function Y(H){return H.reduce(function(j,S){if(S.insert===1){var I=(0,w.default)(S.attributes);return delete I.image,j.insert({image:S.attributes.image},I)}if(S.attributes!=null&&(S.attributes.list===!0||S.attributes.bullet===!0)&&(S=(0,w.default)(S),S.attributes.list?S.attributes.list="ordered":(S.attributes.list="bullet",delete S.attributes.bullet)),typeof S.insert=="string"){var M=S.insert.replace(/\r\n/g,`
|
||
|
`).replace(/\r/g,`
|
||
|
`);return j.insert(M,S.attributes)}return j.push(S)},new g.default)}p.default=z},function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.Range=void 0;var E=function(){function T(P,A){var v=[],_=!0,N=!1,q=void 0;try{for(var D=P[Symbol.iterator](),z;!(_=(z=D.next()).done)&&(v.push(z.value),!(A&&v.length===A));_=!0);}catch(K){N=!0,q=K}finally{try{!_&&D.return&&D.return()}finally{if(N)throw q}}return v}return function(P,A){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return T(P,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(){function T(P,A){for(var v=0;v<A.length;v++){var _=A[v];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(P,_.key,_)}}return function(P,A,v){return A&&T(P.prototype,A),v&&T(P,v),P}}(),O=d(0),y=r(O),g=d(21),h=r(g),o=d(11),n=r(o),e=d(8),f=r(e),a=d(10),u=r(a);function r(T){return T&&T.__esModule?T:{default:T}}function i(T){if(Array.isArray(T)){for(var P=0,A=Array(T.length);P<T.length;P++)A[P]=T[P];return A}else return Array.from(T)}function c(T,P){if(!(T instanceof P))throw new TypeError("Cannot call a class as a function")}var t=(0,u.default)("quill:selection"),s=function T(P){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;c(this,T),this.index=P,this.length=A},k=function(){function T(P,A){var v=this;c(this,T),this.emitter=A,this.scroll=P,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=y.default.create("cursor",this),this.lastRange=this.savedRange=new s(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){v.mouseDown||setTimeout(v.update.bind(v,f.default.sources.USER),1)}),this.emitter.on(f.default.events.EDITOR_CHANGE,function(_,N){_===f.default.events.TEXT_CHANGE&&N.length()>0&&v.update(f.default.sources.SILENT)}),this.emitter.on(f.default.events.SCROLL_BEFORE_UPDATE,function(){if(v.hasFocus()){var _=v.getNativeRange();_!=null&&_.start.node!==v.cursor.textNode&&v.emitter.once(f.default.events.SCROLL_UPDATE,function(){try{v.setNativeRange(_.start.node,_.start.offset,_.end.node,_.end.offset)}catch{}})}}),this.emitter.on(f.default.events.SCROLL_OPTIMIZE,function(_,N){if(N.range){var q=N.range,D=q.startNode,z=q.startOffset,K=q.endNode,Y=q.endOffset;v.setNativeRange(D,z,K,Y)}}),this.update(f.default.sources.SILENT)}return b(T,[{key:"handleComposition",value:function(){var A=this;this.root.addEventListener("compositionstart",function(){A.composing=!0}),this.root.addEventListener("compositionend",function(){if(A.composing=!1,A.cursor.parent){var v=A.cursor.restore();if(!v)return;setTimeout(function(){A.setNativeRange(v.startNode,v.startOffset,v.endNode,v.endOffset)},1)}})}},{key:"handleDragging",value:function(){var A=this;this.emitter.listenDOM("mousedown",document.body,function(){A.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){A.mouseDown=!1,A.update(f.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(A,v){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[A])){this.scroll.update();var _=this.getNativeRange();if(!(_==null||!_.native.collapsed||y.default.query(A,y.default.Scope.BLOCK))){if(_.start.node!==this.cursor.textNode){var N=y.default.find(_.start.node,!1);if(N==null)return;if(N instanceof y.default.Leaf){var q=N.split(_.start.offset);N.parent.insertBefore(this.cursor,q)}else N.insertBefore(this.cursor,_.start.node);this.cursor.attach()}this.cursor.format(A,v),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(A){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=this.scroll.length();A=Math.min(A,_-1),v=Math.min(A+v,_-1)-A;var N=void 0,q=this.scroll.leaf(A),D=E(q,2),z=D[0],K=D[1];if(z==null)return null;var Y=z.position(K,!0),H=E(Y,2);N=H[0],K=H[1];var j=document.createRange();if(v>0){j.setStart(N,K);var S=this.scroll.leaf(A+
|
||
|
`)&&(q=q.slice(0,-1)),z.insertAt(0,q,D)}else{var K=g.default.create(q,D);this.appendChild(K)}else O(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertAt",this).call(this,N,q,D);this.optimize()}}},{key:"insertBefore",value:function(N,q){if(N.statics.scope===g.default.Scope.INLINE_BLOT){var D=g.default.create(this.statics.defaultChild);D.appendChild(N),N=D}O(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertBefore",this).call(this,N,q)}},{key:"leaf",value:function(N){return this.path(N).pop()||[null,-1]}},{key:"line",value:function(N){return N===this.length()?this.line(N-1):this.descendant(T,N)}},{key:"lines",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,D=function z(K,Y,H){var j=[],S=H;return K.children.forEachAt(Y,H,function(I,M,$){T(I)?j.push(I):I instanceof g.default.Container&&(j=j.concat(z(I,M,S))),S-=$}),j};return D(this,N,q)}},{key:"optimize",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(O(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,N,q),N.length>0&&this.emitter.emit(o.default.events.SCROLL_OPTIMIZE,N,q))}},{key:"path",value:function(N){return O(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"path",this).call(this,N).slice(1)}},{key:"update",value:function(N){if(this.batch!==!0){var q=o.default.sources.USER;typeof N=="string"&&(q=N),Array.isArray(N)||(N=this.observer.takeRecords()),N.length>0&&this.emitter.emit(o.default.events.SCROLL_BEFORE_UPDATE,q,N),O(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"update",this).call(this,N.concat([])),N.length>0&&this.emitter.emit(o.default.events.SCROLL_UPDATE,q,N)}}}]),v}(g.default.Scroll);P.blotName="scroll",P.className="ql-editor",P.tagName="DIV",P.defaultChild="block",P.allowedChildren=[e.default,n.BlockEmbed,c.default],p.default=P},function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0}),p.SHORTKEY=p.default=void 0;var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},b=function(){function L(F,V){var G=[],X=!0,nt=!1,it=void 0;try{for(var at=F[Symbol.iterator](),ft;!(X=(ft=at.next()).done)&&(G.push(ft.value),!(V&&G.length===V));X=!0);}catch(ht){nt=!0,it=ht}finally{try{!X&&at.return&&at.return()}finally{if(nt)throw it}}return G}return function(F,V){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return L(F,V);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),O=function(){function L(F,V){for(var G=0;G<V.length;G++){var X=V[G];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(F,X.key,X)}}return function(F,V,G){return V&&L(F.prototype,V),G&&L(F,G),F}}(),y=d(21),g=A(y),h=d(11),o=A(h),n=d(3),e=A(n),f=d(2),a=A(f),u=d(20),r=A(u),i=d(0),c=A(i),t=d(5),s=A(t),k=d(10),w=A(k),T=d(9),P=A(T);function A(L){return L&&L.__esModule?L:{default:L}}function v(L,F,V){return F in L?Object.defineProperty(L,F,{value:V,enumerable:!0,configurable:!0,writable:!0}):L[F]=V,L}function _(L,F){if(!(L instanceof F))throw new TypeError("Cannot call a class as a function")}function N(L,F){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:L}function q(L,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);L.prototype=Object.create(F&&F.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(L,F):L.__proto__=F)}var D=(0,w.default)("quill:keyboard"),z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",K=function(L){q(F,L),O(F,null,[{key:"match",value:function(G,X){return X=C(X),["altKey","ctrlKey","metaKey","shiftKey"
|
||
|
`,it).retain(X.length()-nt-1).retain(1,{list:"unchecked"});this.quill.updateContents(at,s.default.sources.USER),this.quill.setSelection(F.index+1,s.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:K.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(F,V){var G=this.quill.getLine(F.index),X=b(G,2),nt=X[0],it=X[1],at=new a.default().retain(F.index).insert(`
|
||
|
`,V.format).retain(nt.length()-it-1).retain(1,{header:null});this.quill.updateContents(at,s.default.sources.USER),this.quill.setSelection(F.index+1,s.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(F,V){var G=V.prefix.length,X=this.quill.getLine(F.index),nt=b(X,2),it=nt[0],at=nt[1];if(at>G)return!0;var ft=void 0;switch(V.prefix.trim()){case"[]":case"[ ]":ft="unchecked";break;case"[x]":ft="checked";break;case"-":case"*":ft="bullet";break;default:ft="ordered"}this.quill.insertText(F.index," ",s.default.sources.USER),this.quill.history.cutoff();var ht=new a.default().retain(F.index-at).delete(G+1).retain(it.length()-2-at).retain(1,{list:ft});this.quill.updateContents(ht,s.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(F.index-G,s.default.sources.SILENT)}},"code exit":{key:K.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(F){var V=this.quill.getLine(F.index),G=b(V,2),X=G[0],nt=G[1],it=new a.default().retain(F.index+X.length()-nt-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(it,s.default.sources.USER)}},"embed left":Y(K.keys.LEFT,!1),"embed left shift":Y(K.keys.LEFT,!0),"embed right":Y(K.keys.RIGHT,!1),"embed right shift":Y(K.keys.RIGHT,!0)}};function Y(L,F){var V,G=L===K.keys.LEFT?"prefix":"suffix";return V={key:L,shiftKey:F,altKey:null},v(V,G,/^$/),v(V,"handler",function(nt){var it=nt.index;L===K.keys.RIGHT&&(it+=nt.length+1);var at=this.quill.getLeaf(it),ft=b(at,1),ht=ft[0];return ht instanceof c.default.Embed?(L===K.keys.LEFT?F?this.quill.setSelection(nt.index-1,nt.length+1,s.default.sources.USER):this.quill.setSelection(nt.index-1,s.default.sources.USER):F?this.quill.setSelection(nt.index,nt.length+1,s.default.sources.USER):this.quill.setSelection(nt.index+nt.length+1,s.default.sources.USER),!1):!0}),V}function H(L,F){if(!(L.index===0||this.quill.getLength()<=1)){var V=this.quill.getLine(L.index),G=b(V,1),X=G[0],nt={};if(F.offset===0){var it=this.quill.getLine(L.index-1),at=b(it,1),ft=at[0];if(ft!=null&&ft.length()>1){var ht=X.formats(),mt=this.quill.getFormat(L.index-1,1);nt=r.default.attributes.diff(ht,mt)||{}}}var gt=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(F.prefix)?2:1;this.quill.deleteText(L.index-gt,gt,s.default.sources.USER),Object.keys(nt).length>0&&this.quill.formatLine(L.index-gt,gt,nt,s.default.sources.USER),this.quill.focus()}}function j(L,F){var V=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(F.suffix)?2:1;if(!(L.index>=this.quill.getLength()-V)){var G={},X=0,nt=this.quill.getLine(L.index),it=b(nt,1),at=it[0];if(F.offset>=at.length()-1){var ft=this.quill.getLine(L.index+1),ht=b(ft,1),mt=ht[0];if(mt){var gt=at.formats(),W=this.quill.getFormat(L.index,1);G=r.default.attributes.diff(gt,W)||{},X=mt.length()}}this.quill.deleteText(L.index,V,s.default.sources.USER),Object.keys(G).length>0&&this.quill.formatLine(L.index+X-1,V,G,s.default.sources.USER)}}function S(L){var F=this.quill.getLines(L),V={};if(F.length>1){var G=F[0].formats(),X=F[F.length-1].formats();V=r.default.attributes.diff(X,G)||{}}this.quill.deleteText(L,s.default.sources.USER),Object.keys(V).length>0&&this.quill.formatLine(L.index,1,V,s.default.sources.USER),this.quill.setSelection(L.index,s.default.sources.SILENT),this.quill.focus()}function I(L,F){var V=this;L.length>0&&this.quill.scroll.deleteAt(L.index,L.length);var G=Object.keys(F.format).reduce(function(X,nt){return c.default.query(nt,c.default.Scope.BLOCK)&&!Array.isArray(F.format[nt])&&(X[nt]=F.format[nt]),X},{});this.quill.insertText(L.index,`
|
||
|
`,G,s.default.sources.USER),this.quill.setSelection(L.index+1,s.default.sources.SILENT),this.quill.focus(),Object.keys(F.format).forEach(function(X){G[X]==null&&(Array.isArray(F.format[X])||X!=="link"&&V.quill.format(X,F.format[X],s.default.sources.USER))})}function M(L){return{key:K.keys.TAB,shiftKey:!L,format:{"code-block":!0},handler:function(V){var G=c.default.query("code-block"),X=V.index,nt=V.length,it=this.quill.scroll.descendant(G,X),at=b(it,2),ft=at[0],ht=at[1];if(ft!=null){var mt=this.quill.getIndex(ft),gt=ft.newlineIndex(ht,!0)+1,W=ft.newlineIndex(mt+ht+nt),Q=ft.domNode.textContent.slice(gt,W).split(`
|
||
|
`);ht=0,Q.forEach(function(tt,et){L?(ft.insertAt(gt+ht,G.TAB),ht+=G.TAB.length,et===0?X+=G.TAB.length:nt+=G.TAB.length):tt.startsWith(G.TAB)&&(ft.deleteAt(gt+ht,G.TAB.length),ht-=G.TAB.length,et===0?X-=G.TAB.length:nt-=G.TAB.length),ht+=tt.length+1}),this.quill.update(s.default.sources.USER),this.quill.setSelection(X,nt,s.default.sources.SILENT)}}}}function $(L){return{key:L[0].toUpperCase(),shortKey:!0,handler:function(V,G){this.quill.format(L,!G.format[L],s.default.sources.USER)}}}function C(L){if(typeof L=="string"||typeof L=="number")return C({key:L});if((typeof L>"u"?"undefined":E(L))==="object"&&(L=(0,g.default)(L,!1)),typeof L.key=="string")if(K.keys[L.key.toUpperCase()]!=null)L.key=K.keys[L.key.toUpperCase()];else if(L.key.length===1)L.key=L.key.toUpperCase().charCodeAt(0);else return null;return L.shortKey&&(L[z]=L.shortKey,delete L.shortKey),L}p.default=K,p.SHORTKEY=z},function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0});var E=function(){function r(i,c){var t=[],s=!0,k=!1,w=void 0;try{for(var T=i[Symbol.iterator](),P;!(s=(P=T.next()).done)&&(t.push(P.value),!(c&&t.length===c));s=!0);}catch(A){k=!0,w=A}finally{try{!s&&T.return&&T.return()}finally{if(k)throw w}}return t}return function(i,c){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return r(i,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function r(i,c,t){i===null&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,c);if(s===void 0){var k=Object.getPrototypeOf(i);return k===null?void 0:r(k,c,t)}else{if("value"in s)return s.value;var w=s.get;return w===void 0?void 0:w.call(t)}},O=function(){function r(i,c){for(var t=0;t<c.length;t++){var s=c[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}}return function(i,c,t){return c&&r(i.prototype,c),t&&r(i,t),i}}(),y=d(0),g=n(y),h=d(7),o=n(h);function n(r){return r&&r.__esModule?r:{default:r}}function e(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")}function f(r,i){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i&&(typeof i=="object"||typeof i=="function")?i:r}function a(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);r.prototype=Object.create(i&&i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(r,i):r.__proto__=i)}var u=function(r){a(i,r),O(i,null,[{key:"value",value:function(){}}]);function i(c,t){e(this,i);var s=f(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,c));return s.selection=t,s.textNode=document.createTextNode(i.CONTENTS),s.domNode.appendChild(s.textNode),s._length=0,s}return O(i,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(t,s){if(this._length!==0)return b(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"format",this).call(this,t,s);for(var k=this,w=0;k!=null&&k.statics.scope!==g.default.Scope.BLOCK_BLOT;)w+=k.offset(k.parent),k=k.parent;k!=null&&(this._length=i.CONTENTS.length,k.optimize(),k.formatAt(w,i.CONTENTS.length,t,s),this._length=0)}},{key:"index",value:function(t,s){return t===this.textNode?0:b(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"index",this).call(this,t,s)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){b(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var t=this.textNode,s=this.selection.getNativeRange(),k=void 0,w=void 0,T=void 0;if(s!=null&&s.start.node===t&&s.end.node===t){var P=[t,s.start.offset,s.end.offset];k=P[0],w=P[1],T=P[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNod
|
||
|
`):t.attributes!=null?Object.keys(t.attributes).some(function(s){return O.default.query(s,O.default.Scope.BLOCK)!=null}):!1}function i(c){var t=c.reduce(function(k,w){return k+=w.delete||0,k},0),s=c.length()-t;return r(c)&&(s-=1),s}p.default=u,p.getLastChangeIndex=i},function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0}),p.default=p.BaseTooltip=void 0;var E=function(){function I(M,$){for(var C=0;C<$.length;C++){var L=$[C];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(M,L.key,L)}}return function(M,$,C){return $&&I(M.prototype,$),C&&I(M,C),M}}(),b=function I(M,$,C){M===null&&(M=Function.prototype);var L=Object.getOwnPropertyDescriptor(M,$);if(L===void 0){var F=Object.getPrototypeOf(M);return F===null?void 0:I(F,$,C)}else{if("value"in L)return L.value;var V=L.get;return V===void 0?void 0:V.call(C)}},O=d(3),y=P(O),g=d(2),h=P(g),o=d(8),n=P(o),e=d(23),f=P(e),a=d(34),u=P(a),r=d(59),i=P(r),c=d(60),t=P(c),s=d(28),k=P(s),w=d(61),T=P(w);function P(I){return I&&I.__esModule?I:{default:I}}function A(I,M){if(!(I instanceof M))throw new TypeError("Cannot call a class as a function")}function v(I,M){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:I}function _(I,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);I.prototype=Object.create(M&&M.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(I,M):I.__proto__=M)}var N=[!1,"center","right","justify"],q=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],D=[!1,"serif","monospace"],z=["1","2","3",!1],K=["small",!1,"large","huge"],Y=function(I){_(M,I);function M($,C){A(this,M);var L=v(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,$,C)),F=function V(G){if(!document.body.contains($.root))return document.body.removeEventListener("click",V);L.tooltip!=null&&!L.tooltip.root.contains(G.target)&&document.activeElement!==L.tooltip.textbox&&!L.quill.hasFocus()&&L.tooltip.hide(),L.pickers!=null&&L.pickers.forEach(function(X){X.container.contains(G.target)||X.close()})};return $.emitter.listenDOM("click",document.body,F),L}return E(M,[{key:"addModule",value:function(C){var L=b(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"addModule",this).call(this,C);return C==="toolbar"&&this.extendToolbar(L),L}},{key:"buildButtons",value:function(C,L){C.forEach(function(F){var V=F.getAttribute("class")||"";V.split(/\s+/).forEach(function(G){if(G.startsWith("ql-")&&(G=G.slice(3),L[G]!=null))if(G==="direction")F.innerHTML=L[G][""]+L[G].rtl;else if(typeof L[G]=="string")F.innerHTML=L[G];else{var X=F.value||"";X!=null&&L[G][X]&&(F.innerHTML=L[G][X])}})})}},{key:"buildPickers",value:function(C,L){var F=this;this.pickers=C.map(function(G){if(G.classList.contains("ql-align"))return G.querySelector("option")==null&&S(G,N),new t.default(G,L.align);if(G.classList.contains("ql-background")||G.classList.contains("ql-color")){var X=G.classList.contains("ql-background")?"background":"color";return G.querySelector("option")==null&&S(G,q,X==="background"?"#ffffff":"#000000"),new i.default(G,L[X])}else return G.querySelector("option")==null&&(G.classList.contains("ql-font")?S(G,D):G.classList.contains("ql-header")?S(G,z):G.classList.contains("ql-size")&&S(G,K)),new k.default(G)});var V=function(){F.pickers.forEach(function(X){X.update()})};this.quill.on(n.default.events.EDITOR_CHANGE,V)}}]),M}(u.default);Y.DEFAULTS=(0,y.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var M=this,$=this.container.querySelector("input.ql-i
|
||
|
`)&&pt.ops[pt.ops.length-1].attributes==null&&(pt=pt.compose(new o.default().retain(pt.length()-1).delete(1))),K.log("convert",this.container.innerHTML,pt),this.container.innerHTML="",pt}},{key:"dangerouslyPasteHTML",value:function(et,J){var st=arguments.length>2&&arguments[2]!==void 0?arguments[2]:a.default.sources.API;if(typeof et=="string")this.quill.setContents(this.convert(et),J),this.quill.setSelection(0,a.default.sources.SILENT);else{var ot=this.convert(J);this.quill.updateContents(new o.default().retain(et).concat(ot),st),this.quill.setSelection(et+ot.length(),a.default.sources.SILENT)}}},{key:"onPaste",value:function(et){var J=this;if(!(et.defaultPrevented||!this.quill.isEnabled())){var st=this.quill.getSelection(),ot=new o.default().retain(st.index),lt=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(a.default.sources.SILENT),setTimeout(function(){ot=ot.concat(J.convert()).delete(st.length),J.quill.updateContents(ot,a.default.sources.USER),J.quill.setSelection(ot.length()-st.length,a.default.sources.SILENT),J.quill.scrollingContainer.scrollTop=lt,J.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var et=this,J=[],st=[];return this.matchers.forEach(function(ot){var lt=b(ot,2),Nt=lt[0],Et=lt[1];switch(Nt){case Node.TEXT_NODE:st.push(Et);break;case Node.ELEMENT_NODE:J.push(Et);break;default:[].forEach.call(et.container.querySelectorAll(Nt),function(pt){pt[Y]=pt[Y]||[],pt[Y].push(Et)});break}}),[J,st]}}]),Q}(c.default);I.DEFAULTS={matchers:[],matchVisual:!0};function M(W,Q,tt){return(typeof Q>"u"?"undefined":E(Q))==="object"?Object.keys(Q).reduce(function(et,J){return M(et,J,Q[J])},W):W.reduce(function(et,J){return J.attributes&&J.attributes[Q]?et.push(J):et.insert(J.insert,(0,g.default)({},N({},Q,tt),J.attributes))},new o.default)}function $(W){if(W.nodeType!==Node.ELEMENT_NODE)return{};var Q="__ql-computed-style";return W[Q]||(W[Q]=window.getComputedStyle(W))}function C(W,Q){for(var tt="",et=W.ops.length-1;et>=0&&tt.length<Q.length;--et){var J=W.ops[et];if(typeof J.insert!="string")break;tt=J.insert+tt}return tt.slice(-1*Q.length)===Q}function L(W){if(W.childNodes.length===0)return!1;var Q=$(W);return["block","list-item"].indexOf(Q.display)>-1}function F(W,Q,tt){return W.nodeType===W.TEXT_NODE?tt.reduce(function(et,J){return J(W,et)},new o.default):W.nodeType===W.ELEMENT_NODE?[].reduce.call(W.childNodes||[],function(et,J){var st=F(J,Q,tt);return J.nodeType===W.ELEMENT_NODE&&(st=Q.reduce(function(ot,lt){return lt(J,ot)},st),st=(J[Y]||[]).reduce(function(ot,lt){return lt(J,ot)},st)),et.concat(st)},new o.default):new o.default}function V(W,Q,tt){return M(tt,W,!0)}function G(W,Q){var tt=e.default.Attributor.Attribute.keys(W),et=e.default.Attributor.Class.keys(W),J=e.default.Attributor.Style.keys(W),st={};return tt.concat(et).concat(J).forEach(function(ot){var lt=e.default.query(ot,e.default.Scope.ATTRIBUTE);lt!=null&&(st[lt.attrName]=lt.value(W),st[lt.attrName])||(lt=j[ot],lt!=null&&(lt.attrName===ot||lt.keyName===ot)&&(st[lt.attrName]=lt.value(W)||void 0),lt=S[ot],lt!=null&&(lt.attrName===ot||lt.keyName===ot)&&(lt=S[ot],st[lt.attrName]=lt.value(W)||void 0))}),Object.keys(st).length>0&&(Q=M(Q,st)),Q}function X(W,Q){var tt=e.default.query(W);if(tt==null)return Q;if(tt.prototype instanceof e.default.Embed){var et={},J=tt.value(W);J!=null&&(et[tt.blotName]=J,Q=new o.default().insert(et,tt.formats(W)))}else typeof tt.formats=="function"&&(Q=M(Q,tt.blotName,tt.formats(W)));return Q}function nt(W,Q){return C(Q,`
|
||
|
`)||Q.insert(`
|
||
|
`),Q}function it(){return new o.default}function at(W,Q){var tt=e.default.query(W);if(tt==null||tt.blotName!=="list-item"||!C(Q,`
|
||
|
`))return Q;for(var et=-1,J=W.parentNode;!J.classList.contains("ql-clipboard");)(e.default.query(J)||{}).blotName==="list"&&(et+=1),J=J.parentNode;return et<=0?Q:Q.compose(new o.default().retain(Q.length()-1).retain(1,{indent:et}))}function ft(W,Q){return C(Q,`
|
||
|
`)||(L(W)||Q.length()>0&&W.nextSibling&&L(W.nextSibling))&&Q.insert(`
|
||
|
`),Q}function ht(W,Q){if(L(W)&&W.nextElementSibling!=null&&!C(Q,`
|
||
|
|
||
|
`)){var tt=W.offsetHeight+parseFloat($(W).marginTop)+parseFloat($(W).marginBottom);W.nextElementSibling.offsetTop>W.offsetTop+tt*1.5&&Q.insert(`
|
||
|
`)}return Q}function mt(W,Q){var tt={},et=W.style||{};return et.fontStyle&&$(W).fontStyle==="italic"&&(tt.italic=!0),et.fontWeight&&($(W).fontWeight.startsWith("bold")||parseInt($(W).fontWeight)>=700)&&(tt.bold=!0),Object.keys(tt).length>0&&(Q=M(Q,tt)),parseFloat(et.textIndent||0)>0&&(Q=new o.default().insert(" ").concat(Q)),Q}function gt(W,Q){var tt=W.data;if(W.parentNode.tagName==="O:P")return Q.insert(tt.trim());if(tt.trim().length===0&&W.parentNode.classList.contains("ql-clipboard"))return Q;if(!$(W.parentNode).whiteSpace.startsWith("pre")){var et=function(st,ot){return ot=ot.replace(/[^\u00a0]/g,""),ot.length<1&&st?" ":ot};tt=tt.replace(/\r\n/g," ").replace(/\n/g," "),tt=tt.replace(/\s\s+/g,et.bind(et,!0)),(W.previousSibling==null&&L(W.parentNode)||W.previousSibling!=null&&L(W.previousSibling))&&(tt=tt.replace(/^\s+/,et.bind(et,!1))),(W.nextSibling==null&&L(W.parentNode)||W.nextSibling!=null&&L(W.nextSibling))&&(tt=tt.replace(/\s+$/,et.bind(et,!1)))}return Q.insert(tt)}p.default=I,p.matchAttributor=G,p.matchBlot=X,p.matchNewline=ft,p.matchSpacing=ht,p.matchText=gt},function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0});var E=function(){function f(a,u){for(var r=0;r<u.length;r++){var i=u[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}return function(a,u,r){return u&&f(a.prototype,u),r&&f(a,r),a}}(),b=function f(a,u,r){a===null&&(a=Function.prototype);var i=Object.getOwnPropertyDescriptor(a,u);if(i===void 0){var c=Object.getPrototypeOf(a);return c===null?void 0:f(c,u,r)}else{if("value"in i)return i.value;var t=i.get;return t===void 0?void 0:t.call(r)}},O=d(6),y=g(O);function g(f){return f&&f.__esModule?f:{default:f}}function h(f,a){if(!(f instanceof a))throw new TypeError("Cannot call a class as a function")}function o(f,a){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a&&(typeof a=="object"||typeof a=="function")?a:f}function n(f,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof a);f.prototype=Object.create(a&&a.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(f,a):f.__proto__=a)}var e=function(f){n(a,f);function a(){return h(this,a),o(this,(a.__proto__||Object.getPrototypeOf(a)).apply(this,arguments))}return E(a,[{key:"optimize",value:function(r){b(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"optimize",this).call(this,r),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return b(a.__proto__||Object.getPrototypeOf(a),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),a}(y.default);e.blotName="bold",e.tagName=["STRONG","B"],p.default=e},function(m,p,d){Object.defineProperty(p,"__esModule",{value:!0}),p.addControls=p.default=void 0;var E=function(){function v(_,N){var q=[],D=!0,z=!1,K=void 0;try{for(var Y=_[Symbol.iterator](),H;!(D=(H=Y.next()).done)&&(q.push(H.value),!(N&&q.length===N));D=!0);}catch(j){z=!0,K=j}finally{try{!D&&Y.return&&Y.return()}finally{if(z)throw K}}return q}return function(_,N){if(Array.isArray(_))return _;if(Symbol.iterator in Object(_))return v(_,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(){function v(_,N){for(var q=0;q<N.length;q++){var D=N[q];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(_,D.key,D)}}return function(_,N,q){return N&&v(_.prototype,N),q&&v(_,q),_}}(),O=d(2),y=r(O),g=d(0),h=r(g),o=d(5),n=r(o),e=d(10),f=r(e),a=d(9),u=r(a);function r(v){return v&&v.__esModule?v:{default:v}}function i(v,_,N){return _ in v?Object.defineProperty(v,_,{value:N,enumerable:!0,configurable:!0,writable:!0}):v[_]=N,v}function c(v,_){if(!(v instanceof _))throw new TypeError("Cannot call a class as a function")}function t(v,_){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&
|
||
|
`);for(var p=Tt.default.iterator(this.ops),d=new R,E=0;p.hasNext();){if(p.peekType()!=="insert")return;var b=p.peek(),O=Tt.default.length(b)-p.peekLength(),y=typeof b.insert=="string"?b.insert.indexOf(m,O)-O:-1;if(y<0)d.push(p.next());else if(y>0)d.push(p.next(y));else{if(U(d,p.next(1).attributes||{},E)===!1)return;E+=1,d=new R}}d.length()>0&&U(d,{},E)},R.prototype.invert=function(U){var m=new R;return this.reduce(function(p,d){if(d.insert)m.delete(Tt.default.length(d));else{if(d.retain&&d.attributes==null)return m.retain(d.retain),p+d.retain;if(d.delete||d.retain&&d.attributes){var E=d.delete||d.retain,b=U.slice(p,p+E);return b.forEach(function(O){d.delete?m.push(O):d.retain&&d.attributes&&m.retain(Tt.default.length(O),Ne.default.invert(d.attributes,O.attributes))}),p+E}}return p},0),m.chop()},R.prototype.transform=function(U,m){if(m===void 0&&(m=!1),m=!!m,typeof U=="number")return this.transformPosition(U,m);for(var p=U,d=Tt.default.iterator(this.ops),E=Tt.default.iterator(p.ops),b=new R;d.hasNext()||E.hasNext();)if(d.peekType()==="insert"&&(m||E.peekType()!=="insert"))b.retain(Tt.default.length(d.next()));else if(E.peekType()==="insert")b.push(E.next());else{var O=Math.min(d.peekLength(),E.peekLength()),y=d.next(O),g=E.next(O);if(y.delete)continue;g.delete?b.push(g):b.retain(O,Ne.default.transform(y.attributes,g.attributes,m))}return b.chop()},R.prototype.transformPosition=function(U,m){m===void 0&&(m=!1),m=!!m;for(var p=Tt.default.iterator(this.ops),d=0;p.hasNext()&&d<=U;){var E=p.peekLength(),b=p.peekType();if(p.next(),b==="delete"){U-=Math.min(E,U-d);continue}else b==="insert"&&(d<U||!m)&&(U+=E);d+=E}return U},R.Op=Tt.default,R.AttributeMap=Ne.default,R}(),Yr=Wr;const Qr=tr(Yr);/*!
|
||
|
* VueQuill @vueup/vue-quill v1.2.0
|
||
|
* https://vueup.github.io/vue-quill/
|
||
|
*
|
||
|
* Includes quill v1.3.7
|
||
|
* https://quilljs.com/
|
||
|
*
|
||
|
* Copyright (c) 2023 Ahmad Luthfi Masruri
|
||
|
* Released under the MIT license
|
||
|
* Date: 2023-05-12T08:44:03.742Z
|
||
|
*/const Jn={essential:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"},{align:[]}],["blockquote","code-block","link"],[{color:[]},"clean"]],minimal:[[{header:1},{header:2}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"},{align:[]}]],full:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["link","video","image"],["clean"]]},Xr=er({name:"QuillEditor",inheritAttrs:!1,props:{content:{type:[String,Object]},contentType:{type:String,default:"delta",validator:R=>["delta","html","text"].includes(R)},enable:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},placeholder:{type:String,required:!1},theme:{type:String,default:"snow",validator:R=>["snow","bubble",""].includes(R)},toolbar:{type:[String,Array,Object],required:!1,validator:R=>typeof R=="string"&&R!==""?R.charAt(0)==="#"?!0:Object.keys(Jn).indexOf(R)!==-1:!0},modules:{type:Object,required:!1},options:{type:Object,required:!1},globalOptions:{type:Object,required:!1}},emits:["textChange","selectionChange","editorChange","update:content","focus","blur","ready"],setup:(R,U)=>{nr(()=>{E()}),dr(()=>{m=null});let m,p;const d=Zt(),E=()=>{var v;if(d.value){if(p=b(),R.modules)if(Array.isArray(R.modules))for(const _ of R.modules)Bn.register(`modules/${_.name}`,_.module);else Bn.register(`modules/${R.modules.name}`,R.modules.module);m=new Bn(d.value,p),c(R.content),m.on("text-change",o),m.on("selection-change",e),m.on("editor-change",f),R.theme!=="bubble"&&d.value.classList.remove("ql-bubble"),R.theme!=="snow"&&d.value.classList.remove("ql-snow"),(v=m.getModule("toolbar"))===null||v===void 0||v.container.addEventListener("mousedown",_=>{_.preventDefault()}),U.emit("ready",m)}},b=()=>{const v={};if(R.theme!==""&&(v.theme=R.theme),R.readOnly&&(v.readOnly=R.readOnly),R.placeholder&&(v.placeholder=R.placeholder),R.toolbar&&R.toolbar!==""&&(v.modules={toolbar:(()=>{if(typeof R.toolbar=="object")return R.toolbar;if(typeof R.toolbar=="string")return R.toolbar.charAt(0)==="#"?R.toolbar:Jn[R.toolbar]})()}),R.modules){const _=(()=>{var N,q;const D={};if(Array.isArray(R.modules))for(const z of R.modules)D[z.name]=(N=z.options)!==null&&N!==void 0?N:{};else D[R.modules.name]=(q=R.modules.options)!==null&&q!==void 0?q:{};return D})();v.modules=Object.assign({},v.modules,_)}return Object.assign({},R.globalOptions,R.options,v)},O=v=>typeof v=="object"&&v?v.slice():v,y=v=>Object.values(v.ops).some(_=>!_.retain||Object.keys(_).length!==1);let g;const h=v=>{if(typeof g==typeof v){if(v===g)return!0;if(typeof v=="object"&&v&&typeof g=="object"&&g)return!y(g.diff(v))}return!1},o=(v,_,N)=>{g=O(i()),h(R.content)||U.emit("update:content",g),U.emit("textChange",{delta:v,oldContents:_,source:N})},n=Zt(),e=(v,_,N)=>{n.value=!!(m!=null&&m.hasFocus()),U.emit("selectionChange",{range:v,oldRange:_,source:N})};Ze(n,v=>{v?U.emit("focus",d):U.emit("blur",d)});const f=(...v)=>{v[0]==="text-change"&&U.emit("editorChange",{name:v[0],delta:v[1],oldContents:v[2],source:v[3]}),v[0]==="selection-change"&&U.emit("editorChange",{name:v[0],range:v[1],oldRange:v[2],source:v[3]})},a=()=>d.value,u=()=>{var v;return(v=m==null?void 0:m.getModule("toolbar"))===null||v===void 0?void 0:v.container},r=()=>{if(m)return m;throw`The quill editor hasn't been instantiated yet,
|
||
|
make sure to call this method when the editor ready
|
||
|
or use v-on:ready="onReady(quill)" event instead.`},i=(v,_)=>R.contentType==="html"?k():R.contentType==="text"?t(v,_):m==null?void 0:m.getContents(v,_),c=(v,_="api")=>{const N=v||(R.contentType==="delta"?new Qr:"");R.contentType==="html"?w(N):R.contentType==="text"?s(N,_):m==null||m.setContents(N,_),g=O(N)},t=(v,_)=>{var N;return(N=m==null?void 0:m.getText(v,_))!==null&&N!==void 0?N:""},s=(v,_="api")=>{m==null||m.setText(v,_)},k=()=>{var v;return(v=m==null?void 0:m.root.innerHTML)!==null&&v!==void 0?v:""},w=v=>{m&&(m.root.innerHTML=v)},T=(v,_="api")=>{const N=m==null?void 0:m.clipboard.convert(v);N&&(m==null||m.setContents(N,_))},P=()=>{m==null||m.focus()},A=()=>{Un(()=>{var v;!U.slots.toolbar&&m&&((v=m.getModule("toolbar"))===null||v===void 0||v.container.remove()),E()})};return Ze(()=>R.content,v=>{if(!m||!v||h(v))return;const _=m.getSelection();_&&Un(()=>m==null?void 0:m.setSelection(_)),c(v)},{deep:!0}),Ze(()=>R.enable,v=>{m&&m.enable(v)}),{editor:d,getEditor:a,getToolbar:u,getQuill:r,getContents:i,setContents:c,getHTML:k,setHTML:w,pasteHTML:T,focus:P,getText:t,setText:s,reinit:A}},render(){var R,U;return[(U=(R=this.$slots).toolbar)===null||U===void 0?void 0:U.call(R),vr("div",{ref:"editor",...this.$attrs})]}});const Jr={style:{padding:"10px"}},ti={key:0},ei={key:1},ni=["onClick"],ri={class:"editor"},ii=er({__name:"notice",setup(R){const U=Zt(""),m=Zt(null),d=Zt({theme:"bubble",modules:{toolbar:{container:[["bold","italic","underline","strike"],[{color:[]},{background:[]}],[{align:[]}],[{size:["small",!1,"large","huge"]}],[{font:[]}],[{header:[1,2,3,4,5,6,!1]}],[{direction:"ltl"}],[{direction:"rtl"}],[{indent:"-1"},{indent:"+1"}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],["blockquote","code-block"],["clean"],["link","image","video"]],handlers:{image:()=>{const t=document.createElement("input");t.setAttribute("type","file"),t.setAttribute("accept","image/*"),t.click(),t.onchange=async()=>{const s=t.files?t.files[0]:null;if(s){const k=new FormData;k.append("file",s);try{const w=await Sr(k),T=xr(m.value).getQuill();if(T){const P=T.getSelection(!0);T.insertEmbed(P.index,"image",w.data.fullurl)}}catch{alert("图片上传失败")}}}}}}}}),E=[{Choice:".ql-insertMetric",title:"跳转配置"},{Choice:".ql-bold",title:"加粗"},{Choice:".ql-italic",title:"斜体"},{Choice:".ql-underline",title:"下划线"},{Choice:".ql-header",title:"段落格式"},{Choice:".ql-strike",title:"删除线"},{Choice:".ql-blockquote",title:"块引用"},{Choice:".ql-code",title:"插入代码"},{Choice:".ql-code-block",title:"插入代码段"},{Choice:".ql-font",title:"字体"},{Choice:".ql-size",title:"字体大小"},{Choice:'.ql-list[value="ordered"]',title:"编号列表"},{Choice:'.ql-list[value="bullet"]',title:"项目列表"},{Choice:".ql-direction",title:"文本方向"},{Choice:'.ql-header[value="1"]',title:"h1"},{Choice:'.ql-header[value="2"]',title:"h2"},{Choice:".ql-align",title:"对齐方式"},{Choice:".ql-color",title:"字体颜色"},{Choice:".ql-background",title:"背景颜色"},{Choice:".ql-image",title:"图像"},{Choice:".ql-video",title:"视频"},{Choice:".ql-link",title:"添加链接"},{Choice:".ql-formula",title:"插入公式"},{Choice:".ql-clean",title:"清除字体格式"},{Choice:'.ql-script[value="sub"]',title:"下标"},{Choice:'.ql-script[value="super"]',title:"上标"},{Choice:'.ql-indent[value="-1"]',title:"向左缩进"},{Choice:'.ql-indent[value="+1"]',title:"向右缩进"},{Choice:".ql-header .ql-picker-label",title:"标题大小"},{Choice:'.ql-header .ql-picker-item[data-value="1"]',title:"标题一"},{Choice:'.ql-header .ql-picker-item[data-value="2"]',title:"标题二"},{Choice:'.ql-header .ql-picker-item[data-value="3"]',title:"标题三"},{Choice:'.ql-header .ql-picker-item[data-value="4"]',title:"标题四"},{Choice:'.ql-header .ql-picker-item[data-value="5"]',title:"标题五"},{Choice:'.ql-header .ql-picker-item[data-value="6"]',title:"标题六"},{Choice:".ql-header .ql-picker-item:last-child",title:"标准"},{Choice:'.ql-size .ql-picker-item[data-value="small"]',title:
|