@mgdis/mg-components 6.12.0 → 6.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mg-action-more_37.cjs.entry.js +211 -45
  3. package/dist/cjs/mg-action-more_37.cjs.entry.js.map +1 -1
  4. package/dist/cjs/mg-components.cjs.js +1 -1
  5. package/dist/cjs/mg-input-combobox.cjs.entry.js +38 -16
  6. package/dist/cjs/mg-input-combobox.cjs.entry.js.map +1 -1
  7. package/dist/cjs/mg-input-combobox.entry.cjs.js.map +1 -1
  8. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +33 -15
  9. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js.map +1 -1
  10. package/dist/cjs/mg-input-rich-text-editor.entry.cjs.js.map +1 -1
  11. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +2 -1
  12. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  13. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +42 -5
  14. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  15. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +38 -16
  16. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js.map +1 -1
  17. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +39 -5
  18. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  19. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +41 -6
  20. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +39 -4
  22. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  23. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +40 -4
  24. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +51 -16
  26. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js.map +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +39 -4
  28. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +19 -7
  30. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +39 -4
  32. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  33. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +40 -6
  34. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  35. package/dist/collection/components/molecules/mg-form/mg-form.js +23 -1
  36. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  37. package/dist/components/mg-form.js +9 -1
  38. package/dist/components/mg-form.js.map +1 -1
  39. package/dist/components/mg-input-checkbox-paginated2.js +2 -1
  40. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  41. package/dist/components/mg-input-checkbox.js +26 -5
  42. package/dist/components/mg-input-checkbox.js.map +1 -1
  43. package/dist/components/mg-input-combobox.js +38 -16
  44. package/dist/components/mg-input-combobox.js.map +1 -1
  45. package/dist/components/mg-input-date.js +23 -5
  46. package/dist/components/mg-input-date.js.map +1 -1
  47. package/dist/components/mg-input-numeric.js +23 -4
  48. package/dist/components/mg-input-numeric.js.map +1 -1
  49. package/dist/components/mg-input-password.js +23 -4
  50. package/dist/components/mg-input-password.js.map +1 -1
  51. package/dist/components/mg-input-radio.js +24 -4
  52. package/dist/components/mg-input-radio.js.map +1 -1
  53. package/dist/components/mg-input-rich-text-editor.js +34 -15
  54. package/dist/components/mg-input-rich-text-editor.js.map +1 -1
  55. package/dist/components/mg-input-select2.js +23 -4
  56. package/dist/components/mg-input-select2.js.map +1 -1
  57. package/dist/components/mg-input-text2.js +18 -6
  58. package/dist/components/mg-input-text2.js.map +1 -1
  59. package/dist/components/mg-input-textarea.js +23 -4
  60. package/dist/components/mg-input-textarea.js.map +1 -1
  61. package/dist/components/mg-input-toggle.js +24 -6
  62. package/dist/components/mg-input-toggle.js.map +1 -1
  63. package/dist/components/mg-table.js +1 -1
  64. package/dist/components/mg-table.js.map +1 -1
  65. package/dist/esm/loader.js +1 -1
  66. package/dist/esm/mg-action-more_37.entry.js +211 -45
  67. package/dist/esm/mg-action-more_37.entry.js.map +1 -1
  68. package/dist/esm/mg-components.js +1 -1
  69. package/dist/esm/mg-input-combobox.entry.js +38 -16
  70. package/dist/esm/mg-input-combobox.entry.js.map +1 -1
  71. package/dist/esm/mg-input-rich-text-editor.entry.js +33 -15
  72. package/dist/esm/mg-input-rich-text-editor.entry.js.map +1 -1
  73. package/dist/mg-components/mg-components.esm.js +1 -1
  74. package/dist/mg-components/mg-input-combobox.entry.esm.js.map +1 -1
  75. package/dist/mg-components/mg-input-rich-text-editor.entry.esm.js.map +1 -1
  76. package/dist/mg-components/p-3e92299a.entry.js +2 -0
  77. package/dist/mg-components/p-3e92299a.entry.js.map +1 -0
  78. package/dist/mg-components/p-c907ddac.entry.js +2 -0
  79. package/dist/mg-components/p-c907ddac.entry.js.map +1 -0
  80. package/dist/mg-components/{p-3853afb5.entry.js → p-e7a7c651.entry.js} +2 -2
  81. package/dist/mg-components/p-e7a7c651.entry.js.map +1 -0
  82. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +4 -0
  83. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +1 -1
  84. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +4 -0
  85. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +6 -2
  86. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +4 -0
  87. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +4 -0
  88. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +4 -0
  89. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +4 -0
  90. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +1 -1
  91. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +4 -0
  92. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +9 -4
  93. package/dist/types/components/molecules/mg-form/mg-form.d.ts +4 -0
  94. package/dist/types/components.d.ts +47 -6
  95. package/ide/intellij/web-types.json +21 -17
  96. package/ide/vscode/html-custom-data.json +14 -14
  97. package/package.json +20 -20
  98. package/dist/mg-components/p-3853afb5.entry.js.map +0 -1
  99. package/dist/mg-components/p-5a05b1da.entry.js +0 -2
  100. package/dist/mg-components/p-5a05b1da.entry.js.map +0 -1
  101. package/dist/mg-components/p-74b5112a.entry.js +0 -2
  102. package/dist/mg-components/p-74b5112a.entry.js.map +0 -1
@@ -7,5 +7,5 @@ import{r as t,c as e,h as n,g as r}from"./p-CAuxALt5.js";import{c as i,C as s,t
7
7
  * Released under MIT license <https://lodash.com/license>
8
8
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
9
9
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
10
- */var Vg="4.17.21";var Ug=2;var Fg=1,Pg=3;var Wg=4294967295;var Zg=Array.prototype,Kg=Object.prototype;var Gg=Kg.hasOwnProperty;var Qg=d?d.iterator:undefined;var Yg=Math.max,Jg=Math.min;var Xg=function(t){return function(e,n,r){if(r==null){var i=V(n),s=i&&Br(n),l=s&&s.length&&fd(n,s);if(!(l?l.length:i)){r=n;n=e;e=this}}return t(e,n,r)}}(Op);Yt.after=Ag.after;Yt.ary=Ag.ary;Yt.assign=_g.assign;Yt.assignIn=_g.assignIn;Yt.assignInWith=_g.assignInWith;Yt.assignWith=_g.assignWith;Yt.at=_g.at;Yt.before=Ag.before;Yt.bind=Ag.bind;Yt.bindAll=Lg.bindAll;Yt.bindKey=Ag.bindKey;Yt.castArray=Og.castArray;Yt.chain=Tg.chain;Yt.chunk=kg.chunk;Yt.compact=kg.compact;Yt.concat=kg.concat;Yt.cond=Lg.cond;Yt.conforms=Lg.conforms;Yt.constant=Lg.constant;Yt.countBy=xg.countBy;Yt.create=_g.create;Yt.curry=Ag.curry;Yt.curryRight=Ag.curryRight;Yt.debounce=Ag.debounce;Yt.defaults=_g.defaults;Yt.defaultsDeep=_g.defaultsDeep;Yt.defer=Ag.defer;Yt.delay=Ag.delay;Yt.difference=kg.difference;Yt.differenceBy=kg.differenceBy;Yt.differenceWith=kg.differenceWith;Yt.drop=kg.drop;Yt.dropRight=kg.dropRight;Yt.dropRightWhile=kg.dropRightWhile;Yt.dropWhile=kg.dropWhile;Yt.fill=kg.fill;Yt.filter=xg.filter;Yt.flatMap=xg.flatMap;Yt.flatMapDeep=xg.flatMapDeep;Yt.flatMapDepth=xg.flatMapDepth;Yt.flatten=kg.flatten;Yt.flattenDeep=kg.flattenDeep;Yt.flattenDepth=kg.flattenDepth;Yt.flip=Ag.flip;Yt.flow=Lg.flow;Yt.flowRight=Lg.flowRight;Yt.fromPairs=kg.fromPairs;Yt.functions=_g.functions;Yt.functionsIn=_g.functionsIn;Yt.groupBy=xg.groupBy;Yt.initial=kg.initial;Yt.intersection=kg.intersection;Yt.intersectionBy=kg.intersectionBy;Yt.intersectionWith=kg.intersectionWith;Yt.invert=_g.invert;Yt.invertBy=_g.invertBy;Yt.invokeMap=xg.invokeMap;Yt.iteratee=Lg.iteratee;Yt.keyBy=xg.keyBy;Yt.keys=Br;Yt.keysIn=_g.keysIn;Yt.map=xg.map;Yt.mapKeys=_g.mapKeys;Yt.mapValues=_g.mapValues;Yt.matches=Lg.matches;Yt.matchesProperty=Lg.matchesProperty;Yt.memoize=Ag.memoize;Yt.merge=_g.merge;Yt.mergeWith=_g.mergeWith;Yt.method=Lg.method;Yt.methodOf=Lg.methodOf;Yt.mixin=Xg;Yt.negate=_p;Yt.nthArg=Lg.nthArg;Yt.omit=_g.omit;Yt.omitBy=_g.omitBy;Yt.once=Ag.once;Yt.orderBy=xg.orderBy;Yt.over=Lg.over;Yt.overArgs=Ag.overArgs;Yt.overEvery=Lg.overEvery;Yt.overSome=Lg.overSome;Yt.partial=Ag.partial;Yt.partialRight=Ag.partialRight;Yt.partition=xg.partition;Yt.pick=_g.pick;Yt.pickBy=_g.pickBy;Yt.property=Lg.property;Yt.propertyOf=Lg.propertyOf;Yt.pull=kg.pull;Yt.pullAll=kg.pullAll;Yt.pullAllBy=kg.pullAllBy;Yt.pullAllWith=kg.pullAllWith;Yt.pullAt=kg.pullAt;Yt.range=Lg.range;Yt.rangeRight=Lg.rangeRight;Yt.rearg=Ag.rearg;Yt.reject=xg.reject;Yt.remove=kg.remove;Yt.rest=Ag.rest;Yt.reverse=kg.reverse;Yt.sampleSize=xg.sampleSize;Yt.set=_g.set;Yt.setWith=_g.setWith;Yt.shuffle=xg.shuffle;Yt.slice=kg.slice;Yt.sortBy=xg.sortBy;Yt.sortedUniq=kg.sortedUniq;Yt.sortedUniqBy=kg.sortedUniqBy;Yt.split=Ng.split;Yt.spread=Ag.spread;Yt.tail=kg.tail;Yt.take=kg.take;Yt.takeRight=kg.takeRight;Yt.takeRightWhile=kg.takeRightWhile;Yt.takeWhile=kg.takeWhile;Yt.tap=Tg.tap;Yt.throttle=Ag.throttle;Yt.thru=fm;Yt.toArray=Og.toArray;Yt.toPairs=_g.toPairs;Yt.toPairsIn=_g.toPairsIn;Yt.toPath=Lg.toPath;Yt.toPlainObject=Og.toPlainObject;Yt.transform=_g.transform;Yt.unary=Ag.unary;Yt.union=kg.union;Yt.unionBy=kg.unionBy;Yt.unionWith=kg.unionWith;Yt.uniq=kg.uniq;Yt.uniqBy=kg.uniqBy;Yt.uniqWith=kg.uniqWith;Yt.unset=_g.unset;Yt.unzip=kg.unzip;Yt.unzipWith=kg.unzipWith;Yt.update=_g.update;Yt.updateWith=_g.updateWith;Yt.values=_g.values;Yt.valuesIn=_g.valuesIn;Yt.without=kg.without;Yt.words=Ng.words;Yt.wrap=Ag.wrap;Yt.xor=kg.xor;Yt.xorBy=kg.xorBy;Yt.xorWith=kg.xorWith;Yt.zip=kg.zip;Yt.zipObject=kg.zipObject;Yt.zipObjectDeep=kg.zipObjectDeep;Yt.zipWith=kg.zipWith;Yt.entries=_g.toPairs;Yt.entriesIn=_g.toPairsIn;Yt.extend=_g.assignIn;Yt.extendWith=_g.assignInWith;Xg(Yt,Yt);Yt.add=Mg.add;Yt.attempt=Lg.attempt;Yt.camelCase=Ng.camelCase;Yt.capitalize=Ng.capitalize;Yt.ceil=Mg.ceil;Yt.clamp=Eg.clamp;Yt.clone=Og.clone;Yt.cloneDeep=Og.cloneDeep;Yt.cloneDeepWith=Og.cloneDeepWith;Yt.cloneWith=Og.cloneWith;Yt.conformsTo=Og.conformsTo;Yt.deburr=Ng.deburr;Yt.defaultTo=Lg.defaultTo;Yt.divide=Mg.divide;Yt.endsWith=Ng.endsWith;Yt.eq=Og.eq;Yt.escape=Ng.escape;Yt.escapeRegExp=Ng.escapeRegExp;Yt.every=xg.every;Yt.find=xg.find;Yt.findIndex=kg.findIndex;Yt.findKey=_g.findKey;Yt.findLast=xg.findLast;Yt.findLastIndex=kg.findLastIndex;Yt.findLastKey=_g.findLastKey;Yt.floor=Mg.floor;Yt.forEach=xg.forEach;Yt.forEachRight=xg.forEachRight;Yt.forIn=_g.forIn;Yt.forInRight=_g.forInRight;Yt.forOwn=_g.forOwn;Yt.forOwnRight=_g.forOwnRight;Yt.get=_g.get;Yt.gt=Og.gt;Yt.gte=Og.gte;Yt.has=_g.has;Yt.hasIn=_g.hasIn;Yt.head=kg.head;Yt.identity=et;Yt.includes=xg.includes;Yt.indexOf=kg.indexOf;Yt.inRange=Eg.inRange;Yt.invoke=_g.invoke;Yt.isArguments=Og.isArguments;Yt.isArray=L;Yt.isArrayBuffer=Og.isArrayBuffer;Yt.isArrayLike=Og.isArrayLike;Yt.isArrayLikeObject=Og.isArrayLikeObject;Yt.isBoolean=Og.isBoolean;Yt.isBuffer=Og.isBuffer;Yt.isDate=Og.isDate;Yt.isElement=Og.isElement;Yt.isEmpty=Og.isEmpty;Yt.isEqual=Og.isEqual;Yt.isEqualWith=Og.isEqualWith;Yt.isError=Og.isError;Yt.isFinite=Og.isFinite;Yt.isFunction=Og.isFunction;Yt.isInteger=Og.isInteger;Yt.isLength=Og.isLength;Yt.isMap=Og.isMap;Yt.isMatch=Og.isMatch;Yt.isMatchWith=Og.isMatchWith;Yt.isNaN=Og.isNaN;Yt.isNative=Og.isNative;Yt.isNil=Og.isNil;Yt.isNull=Og.isNull;Yt.isNumber=Og.isNumber;Yt.isObject=V;Yt.isObjectLike=Og.isObjectLike;Yt.isPlainObject=Og.isPlainObject;Yt.isRegExp=Og.isRegExp;Yt.isSafeInteger=Og.isSafeInteger;Yt.isSet=Og.isSet;Yt.isString=Og.isString;Yt.isSymbol=Og.isSymbol;Yt.isTypedArray=Og.isTypedArray;Yt.isUndefined=Og.isUndefined;Yt.isWeakMap=Og.isWeakMap;Yt.isWeakSet=Og.isWeakSet;Yt.join=kg.join;Yt.kebabCase=Ng.kebabCase;Yt.last=Hf;Yt.lastIndexOf=kg.lastIndexOf;Yt.lowerCase=Ng.lowerCase;Yt.lowerFirst=Ng.lowerFirst;Yt.lt=Og.lt;Yt.lte=Og.lte;Yt.max=Mg.max;Yt.maxBy=Mg.maxBy;Yt.mean=Mg.mean;Yt.meanBy=Mg.meanBy;Yt.min=Mg.min;Yt.minBy=Mg.minBy;Yt.stubArray=Lg.stubArray;Yt.stubFalse=Lg.stubFalse;Yt.stubObject=Lg.stubObject;Yt.stubString=Lg.stubString;Yt.stubTrue=Lg.stubTrue;Yt.multiply=Mg.multiply;Yt.nth=kg.nth;Yt.noop=Lg.noop;Yt.now=jg.now;Yt.pad=Ng.pad;Yt.padEnd=Ng.padEnd;Yt.padStart=Ng.padStart;Yt.parseInt=Ng.parseInt;Yt.random=Eg.random;Yt.reduce=xg.reduce;Yt.reduceRight=xg.reduceRight;Yt.repeat=Ng.repeat;Yt.replace=Ng.replace;Yt.result=_g.result;Yt.round=Mg.round;Yt.sample=xg.sample;Yt.size=xg.size;Yt.snakeCase=Ng.snakeCase;Yt.some=xg.some;Yt.sortedIndex=kg.sortedIndex;Yt.sortedIndexBy=kg.sortedIndexBy;Yt.sortedIndexOf=kg.sortedIndexOf;Yt.sortedLastIndex=kg.sortedLastIndex;Yt.sortedLastIndexBy=kg.sortedLastIndexBy;Yt.sortedLastIndexOf=kg.sortedLastIndexOf;Yt.startCase=Ng.startCase;Yt.startsWith=Ng.startsWith;Yt.subtract=Mg.subtract;Yt.sum=Mg.sum;Yt.sumBy=Mg.sumBy;Yt.template=Ng.template;Yt.times=Lg.times;Yt.toFinite=Og.toFinite;Yt.toInteger=J;Yt.toLength=Og.toLength;Yt.toLower=Ng.toLower;Yt.toNumber=Og.toNumber;Yt.toSafeInteger=Og.toSafeInteger;Yt.toString=Og.toString;Yt.toUpper=Ng.toUpper;Yt.trim=Ng.trim;Yt.trimEnd=Ng.trimEnd;Yt.trimStart=Ng.trimStart;Yt.truncate=Ng.truncate;Yt.unescape=Ng.unescape;Yt.uniqueId=Lg.uniqueId;Yt.upperCase=Ng.upperCase;Yt.upperFirst=Ng.upperFirst;Yt.each=xg.forEach;Yt.eachRight=xg.forEachRight;Yt.first=kg.head;Xg(Yt,function(){var t={};ef(Yt,(function(e,n){if(!Gg.call(Yt.prototype,n)){t[n]=e}}));return t}(),{chain:false});Yt.VERSION=Vg;(Yt.templateSettings=Ng.templateSettings).imports._=Yt;de(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Yt[t].placeholder=Yt}));de(["drop","take"],(function(t,e){Bt.prototype[t]=function(n){n=n===undefined?1:Yg(J(n),0);var r=this.__filtered__&&!e?new Bt(this):this.clone();if(r.__filtered__){r.__takeCount__=Jg(n,r.__takeCount__)}else{r.__views__.push({size:Jg(n,Wg),type:t+(r.__dir__<0?"Right":"")})}return r};Bt.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}));de(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=n==Fg||n==Pg;Bt.prototype[t]=function(t){var e=this.clone();e.__iteratees__.push({iteratee:Fc(t),type:n});e.__filtered__=e.__filtered__||r;return e}}));de(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Bt.prototype[t]=function(){return this[n](1).value()[0]}}));de(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Bt.prototype[t]=function(){return this.__filtered__?new Bt(this):this[n](1)}}));Bt.prototype.compact=function(){return this.filter(et)};Bt.prototype.find=function(t){return this.filter(t).head()};Bt.prototype.findLast=function(t){return this.reverse().find(t)};Bt.prototype.invokeMap=_n((function(t,e){if(typeof t=="function"){return new Bt(this)}return this.map((function(n){return tv(n,t,e)}))}));Bt.prototype.reject=function(t){return this.filter(_p(Fc(t)))};Bt.prototype.slice=function(t,e){t=J(t);var n=this;if(n.__filtered__&&(t>0||e<0)){return new Bt(n)}if(t<0){n=n.takeRight(-t)}else if(t){n=n.drop(t)}if(e!==undefined){e=J(e);n=e<0?n.dropRight(-e):n.take(e-t)}return n};Bt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()};Bt.prototype.toArray=function(){return this.take(Wg)};ef(Bt.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Yt[r?"take"+(e=="last"?"Right":""):e],s=r||/^find/.test(e);if(!i){return}Yt.prototype[e]=function(){var e=this.__wrapped__,l=r?[1]:arguments,o=e instanceof Bt,u=l[0],a=o||L(e);var c=function(t){var e=i.apply(Yt,Fi([t],l));return r&&f?e[0]:e};if(a&&n&&typeof u=="function"&&u.length!=1){o=a=false}var f=this.__chain__,h=!!this.__actions__.length,d=s&&!f,v=o&&!h;if(!s&&a){e=v?e:new Bt(this);var p=t.apply(e,l);p.__actions__.push({func:fm,args:[c],thisArg:undefined});return new Wt(p,f)}if(d&&v){return t.apply(this,l)}p=this.thru(c);return d?r?p.value()[0]:p.value():p}}));de(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Zg[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Yt.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(L(i)?i:[],t)}return this[n]((function(n){return e.apply(L(n)?n:[],t)}))}}));ef(Bt.prototype,(function(t,e){var n=Yt[e];if(n){var r=n.name+"";if(!Gg.call(Vt,r)){Vt[r]=[]}Vt[r].push({name:e,func:n})}}));Vt[Qe(undefined,Ug).name]=[{name:"wrapper",func:undefined}];Bt.prototype.clone=$g;Bt.prototype.reverse=Sg;Bt.prototype.value=Hg;Yt.prototype.at=Tg.at;Yt.prototype.chain=Tg.wrapperChain;Yt.prototype.commit=Tg.commit;Yt.prototype.next=Tg.next;Yt.prototype.plant=Tg.plant;Yt.prototype.reverse=Tg.reverse;Yt.prototype.toJSON=Yt.prototype.valueOf=Yt.prototype.value=Tg.value;Yt.prototype.first=Yt.prototype.head;if(Qg){Yt.prototype[Qg]=Tg.toIterator}var ty=(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))(ty||{});class ey{constructor(t,e,n={}){this.attrName=t,this.keyName=e;const r=ty.TYPE&ty.ATTRIBUTE;this.scope=n.scope!=null?n.scope&ty.LEVEL|r:ty.ATTRIBUTE,n.whitelist!=null&&(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),true):false}canAdd(t,e){return this.whitelist==null?true:typeof e=="string"?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 ny extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const ry=class t{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=false){if(t==null)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 i=this.query(n);if(i==null)throw new ny(`Unable to create ${n} blot`);const s=i,l=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:s.create(r),o=new s(e,l,r);return t.blots.set(o.domNode,o),o}find(e,n=false){return t.find(e,n)}query(t,e=ty.ANY){let n;return typeof t=="string"?n=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?n=this.types.text:typeof t=="number"?t&ty.LEVEL&ty.BLOCK?n=this.types.block:t&ty.LEVEL&ty.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]),n==null?null:"scope"in n&&e&ty.LEVEL&n.scope&&e&ty.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 ny("Invalid definition");if(e&&t.blotName==="abstract")throw new ny("Cannot register abstract class");const r=e?t.blotName:n?t.attrName:void 0;return this.types[r]=t,n?typeof t.keyName=="string"&&(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=>{(this.tags[e]==null||t.className==null)&&(this.tags[e]=t)})))),t}))}};ry.blots=new WeakMap;let iy=ry;function sy(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter((t=>t.indexOf(`${e}-`)===0))}class ly extends ey{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}`),true):false}remove(t){sy(t,this.keyName).forEach((e=>{t.classList.remove(e)})),t.classList.length===0&&t.removeAttribute("class")}value(t){const e=(sy(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}}const oy=ly;function uy(t){const e=t.split("-"),n=e.slice(1).map((t=>t[0].toUpperCase()+t.slice(1))).join("");return e[0]+n}class ay extends ey{static keys(t){return(t.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(t,e){return this.canAdd(t,e)?(t.style[uy(this.keyName)]=e,true):false}remove(t){t.style[uy(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[uy(this.keyName)];return this.canAdd(t,e)?e:""}}const cy=ay;class fy{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(t.value(this.domNode)!=null?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=iy.find(this.domNode);if(t==null)return;const e=ey.keys(this.domNode),n=oy.keys(this.domNode),r=cy.keys(this.domNode);e.concat(n).concat(r).forEach((e=>{const n=t.scroll.query(e,ty.ATTRIBUTE);n instanceof ey&&(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)),{})}}const hy=fy,dy=class t{constructor(t,e){this.scroll=t,this.domNode=e,iy.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new ny("Blot definition missing tagName");let e,n;return Array.isArray(this.tagName)?(typeof t=="string"?(n=t.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof t=="number"&&(n=t),typeof n=="number"?e=document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?e=document.createElement(n):e=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(false);return this.scroll.create(t)}detach(){this.parent!=null&&this.parent.removeChild(this),iy.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,n,r){const i=this.isolate(t,e);if(this.scroll.query(n,ty.BLOT)!=null&&r)i.wrap(n,r);else if(this.scroll.query(n,ty.ATTRIBUTE)!=null){const t=this.scroll.create(this.statics.scope);i.wrap(t),t.format(n,r)}}insertAt(t,e,n){const r=n==null?this.scroll.create("text",e):this.scroll.create(e,n),i=this.split(t);this.parent.insertBefore(r,i||void 0)}isolate(t,e){const n=this.split(t);if(n==null)throw new Error("Attempt to isolate at end");return n.split(e),n}length(){return 1}offset(t=this.parent){return this.parent==null||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(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(t,e){return t===0?this:this.next}update(t,e){}wrap(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!="function")throw new ny(`Cannot wrap ${t}`);return n.appendChild(this),n}};dy.blotName="abstract";let vy=dy;const py=class t extends vy{static value(t){return true}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)||true}}};py.scope=ty.INLINE_BLOT;let by=py;const qy=by;class wy{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 true;n=e()}return false}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){t!=null&&(this.remove(t),t.next=e,e!=null?(t.prev=e.prev,e.prev!=null&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):this.tail!=null?(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(;n!=null;){if(n===t)return e;e+=n.length(),n=n.next}return-1}remove(t){this.contains(t)&&(t.prev!=null&&(t.prev.next=t.next),t.next!=null&&(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 t!=null&&(t=t.next),e}}find(t,e=false){const n=this.iterator();let r=n();for(;r;){const i=r.length();if(t<i||e&&t===i&&(r.next==null||r.next.length()!==0))return[r,t];t-=i,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,i]=this.find(t);let s=t-i;const l=this.iterator(r);let o=l();for(;o&&s<t+e;){const r=o.length();t>s?n(o,t-s,Math.min(e,s+r-t)):n(o,0,Math.min(r,t+e-s)),s+=r,o=l()}}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 my(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const n=e.create(ty.INLINE);return Array.from(t.childNodes).forEach((t=>{n.domNode.appendChild(t)})),t.parentNode&&t.parentNode.replaceChild(n.domNode,t),n.attach(),n}}const gy=class t extends vy{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){this.uiNode!=null&&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 wy,Array.from(this.domNode.childNodes).filter((t=>t!==this.uiNode)).reverse().forEach((t=>{try{const e=my(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof ny)return;throw t}}))}deleteAt(t,e){if(t===0&&e===this.length())return this.remove();this.children.forEachAt(t,e,((t,e,n)=>{t.deleteAt(e,n)}))}descendant(e,n=0){const[r,i]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof t?r.descendant(e,i):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let i=[],s=r;return this.children.forEachAt(n,r,((n,r,l)=>{(e.blotName==null&&e(n)||e.blotName!=null&&n instanceof e)&&i.push(n),n instanceof t&&(i=i.concat(n.descendants(e,r,s))),s-=l})),i}detach(){this.children.forEach((t=>{t.detach()})),super.detach()}enforceAllowedChildren(){let e=false;this.children.forEach((n=>{e||this.statics.allowedChildren.some((t=>n instanceof t))||(n.statics.scope===ty.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=true):n instanceof t?n.unwrap():n.remove())}))}formatAt(t,e,n,r){this.children.forEachAt(t,e,((t,e,i)=>{t.formatAt(e,i,n,r)}))}insertAt(t,e,n){const[r,i]=this.children.find(t);if(r)r.insertAt(i,e,n);else{const t=n==null?this.scroll.create("text",e):this.scroll.create(e,n);this.appendChild(t)}}insertBefore(t,e){t.parent!=null&&t.parent.children.remove(t);let n=null;this.children.insertBefore(t,e||null),t.parent=this,e!=null&&(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(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,n=false){const[r,i]=this.children.find(e,n),s=[[this,e]];return r instanceof t?s.concat(r.path(i,n)):(r!=null&&s.push([r,i]),s)}removeChild(t){this.children.remove(t)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof t&&this.moveChildren(r),super.replaceWith(r)}split(t,e=false){if(!e){if(t===0)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,i)=>{const s=t.split(r,e);s!=null&&n.appendChild(s)})),n}splitAfter(t){const e=this.clone();for(;t.next!=null;)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&&t.type==="childList"&&(n.push(...t.addedNodes),r.push(...t.removedNodes))})),r.forEach((t=>{if(t.parentNode!=null&&t.tagName!=="IFRAME"&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);e!=null&&(e.domNode.parentNode==null||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;t.nextSibling!=null&&(e=this.scroll.find(t.nextSibling));const n=my(t,this.scroll);(n.next!==e||n.next==null)&&(n.parent!=null&&n.parent.removeChild(this),this.insertBefore(n,e||void 0))})),this.enforceAllowedChildren()}};gy.uiClass="";let yy=gy;const ky=yy;function xy(t,e){if(Object.keys(t).length!==Object.keys(e).length)return false;for(const n in t)if(t[n]!==e[n])return false;return true}const jy=class t extends ky{static create(t){return super.create(t)}static formats(e,n){const r=n.query(t.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return true;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new hy(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach((e=>{e instanceof t||(e=e.wrap(t.blotName,true)),this.attributes.copy(e)})),this.unwrap();else{const t=this.scroll.query(e,ty.INLINE);if(t==null)return;t instanceof ey?this.attributes.attribute(t,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,r){this.formats()[n]!=null||this.scroll.query(n,ty.ATTRIBUTE)?this.isolate(t,e).format(n,r):super.formatAt(t,e,n,r)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof t&&r.prev===this&&xy(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&&t.type==="attributes"))&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof t&&this.attributes.move(r),r}};jy.allowedChildren=[jy,qy],jy.blotName="inline",jy.scope=ty.INLINE_BLOT,jy.tagName="SPAN";let Ay=jy;const Oy=Ay,My=class t extends ky{static create(t){return super.create(t)}static formats(e,n){const r=n.query(t.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return true;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new hy(this.domNode)}format(e,n){const r=this.scroll.query(e,ty.BLOCK);r!=null&&(r instanceof ey?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(t.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,r){this.scroll.query(n,ty.BLOCK)!=null?this.format(n,r):super.formatAt(t,e,n,r)}insertAt(t,e,n){if(n==null||this.scroll.query(e,ty.INLINE)!=null)super.insertAt(t,e,n);else{const r=this.split(t);if(r!=null){const t=this.scroll.create(e,n);r.parent.insertBefore(t,r)}else throw new Error("Attempt to insertAt after block boundaries")}}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&&t.type==="attributes"))&&this.attributes.build()}};My.blotName="block",My.scope=ty.BLOCK_BLOT,My.tagName="P",My.allowedChildren=[Oy,My,qy];let Ey=My;const _y=Ey,Ty=class t extends ky{checkMerge(){return this.next!==null&&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&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Ty.blotName="container",Ty.scope=ty.BLOCK_BLOT;let Ny=Ty;const Ly=Ny;class $y extends qy{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,n,r){t===0&&e===this.length()?this.format(n,r):super.formatAt(t,e,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Sy=$y,zy={attributes:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true},Ry=100,Iy=class t extends ky{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,zy),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=false){const n=this.registry.find(t,e);return n?n.scroll===this?n:e?this.find(n.scroll.domNode.parentNode,true):null:null}query(t,e=ty.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),t===0&&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 i=(t,e=true)=>{t==null||t===this||t.domNode.parentNode!=null&&(n.has(t.domNode)||n.set(t.domNode,[]),e&&i(t.parent))},s=t=>{n.has(t.domNode)&&(t instanceof ky&&t.children.forEach(s),n.delete(t.domNode),t.optimize(e))};let l=t;for(let e=0;l.length>0;e+=1){if(e>=Ry)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach((t=>{const e=this.find(t.target,true);e!=null&&(e.domNode===t.target&&(t.type==="childList"?(i(this.find(t.previousSibling,false)),Array.from(t.addedNodes).forEach((t=>{const e=this.find(t,false);i(e,false),e instanceof ky&&e.children.forEach((t=>{i(t,false)}))}))):t.type==="attributes"&&i(e.prev)),i(e))})),this.children.forEach(s),l=Array.from(this.observer.takeRecords()),r=l.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,true);return e==null?null:n.has(e.domNode)?(n.get(e.domNode).push(t),null):(n.set(e.domNode,[t]),e)})).forEach((t=>{t!=null&&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)}};Iy.blotName="scroll",Iy.defaultChild=_y,Iy.allowedChildren=[_y,Ly],Iy.scope=ty.BLOCK_BLOT,Iy.tagName="DIV";let Cy=Iy;const By=Cy,Dy=class t extends qy{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){n==null?(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),this.text.length===0?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=false){return[this.domNode,t]}split(t,e=false){if(!e){if(t===0)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=>t.type==="characterData"&&t.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Dy.blotName="text",Dy.scope=ty.INLINE_BLOT;let Hy=Dy;const Vy=Hy;var Uy=Object.freeze({__proto__:null,Attributor:ey,AttributorStore:hy,BlockBlot:_y,ClassAttributor:oy,ContainerBlot:Ly,EmbedBlot:Sy,InlineBlot:Oy,LeafBlot:qy,ParentBlot:ky,Registry:iy,Scope:ty,ScrollBlot:By,StyleAttributor:cy,TextBlot:Vy});var Fy=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function Py(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}var Wy={exports:{}};var Zy;var Ky;function Gy(){if(Ky)return Zy;Ky=1;var t=-1;var e=1;var n=0;function r(t,e,r,s,l){if(t===e){if(t){return[[n,t]]}return[]}if(r!=null){var u=A(t,e,r);if(u){return u}}var c=o(t,e);var h=t.substring(0,c);t=t.substring(c);e=e.substring(c);c=a(t,e);var d=t.substring(t.length-c);t=t.substring(0,t.length-c);e=e.substring(0,e.length-c);var v=i(t,e);if(h){v.unshift([n,h])}if(d){v.push([n,d])}w(v,l);if(s){f(v)}return v}function i(i,l){var o;if(!i){return[[e,l]]}if(!l){return[[t,i]]}var u=i.length>l.length?i:l;var a=i.length>l.length?l:i;var f=u.indexOf(a);if(f!==-1){o=[[e,u.substring(0,f)],[n,a],[e,u.substring(f+a.length)]];if(i.length>l.length){o[0][0]=o[2][0]=t}return o}if(a.length===1){return[[t,i],[e,l]]}var h=c(i,l);if(h){var d=h[0];var v=h[1];var p=h[2];var b=h[3];var q=h[4];var w=r(d,p);var m=r(v,b);return w.concat([[n,q]],m)}return s(i,l)}function s(n,r){var i=n.length;var s=r.length;var o=Math.ceil((i+s)/2);var u=o;var a=2*o;var c=new Array(a);var f=new Array(a);for(var h=0;h<a;h++){c[h]=-1;f[h]=-1}c[u+1]=0;f[u+1]=0;var d=i-s;var v=d%2!==0;var p=0;var b=0;var q=0;var w=0;for(var m=0;m<o;m++){for(var g=-m+p;g<=m-b;g+=2){var y=u+g;var k;if(g===-m||g!==m&&c[y-1]<c[y+1]){k=c[y+1]}else{k=c[y-1]+1}var x=k-g;while(k<i&&x<s&&n.charAt(k)===r.charAt(x)){k++;x++}c[y]=k;if(k>i){b+=2}else if(x>s){p+=2}else if(v){var j=u+d-g;if(j>=0&&j<a&&f[j]!==-1){var A=i-f[j];if(k>=A){return l(n,r,k,x)}}}}for(var O=-m+q;O<=m-w;O+=2){var j=u+O;var A;if(O===-m||O!==m&&f[j-1]<f[j+1]){A=f[j+1]}else{A=f[j-1]+1}var M=A-O;while(A<i&&M<s&&n.charAt(i-A-1)===r.charAt(s-M-1)){A++;M++}f[j]=A;if(A>i){w+=2}else if(M>s){q+=2}else if(!v){var y=u+d-O;if(y>=0&&y<a&&c[y]!==-1){var k=c[y];var x=u+k-y;A=i-A;if(k>=A){return l(n,r,k,x)}}}}}return[[t,n],[e,r]]}function l(t,e,n,i){var s=t.substring(0,n);var l=e.substring(0,i);var o=t.substring(n);var u=e.substring(i);var a=r(s,l);var c=r(o,u);return a.concat(c)}function o(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0)){return 0}var n=0;var r=Math.min(t.length,e.length);var i=r;var s=0;while(n<i){if(t.substring(s,i)==e.substring(s,i)){n=i;s=n}else{r=i}i=Math.floor((r-n)/2+n)}if(m(t.charCodeAt(i-1))){i--}return i}function u(t,e){var n=t.length;var r=e.length;if(n==0||r==0){return 0}if(n>r){t=t.substring(n-r)}else if(n<r){e=e.substring(0,n)}var i=Math.min(n,r);if(t==e){return i}var s=0;var l=1;while(true){var o=t.substring(i-l);var u=e.indexOf(o);if(u==-1){return s}l+=u;if(u==0||t.substring(i-l)==e.substring(0,l)){s=l;l++}}}function a(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1)){return 0}var n=0;var r=Math.min(t.length,e.length);var i=r;var s=0;while(n<i){if(t.substring(t.length-i,t.length-s)==e.substring(e.length-i,e.length-s)){n=i;s=n}else{r=i}i=Math.floor((r-n)/2+n)}if(g(t.charCodeAt(t.length-i))){i--}return i}function c(t,e){var n=t.length>e.length?t:e;var r=t.length>e.length?e:t;if(n.length<4||r.length*2<n.length){return null}function i(t,e,n){var r=t.substring(n,n+Math.floor(t.length/4));var i=-1;var s="";var l,u,c,f;while((i=e.indexOf(r,i+1))!==-1){var h=o(t.substring(n),e.substring(i));var d=a(t.substring(0,n),e.substring(0,i));if(s.length<d+h){s=e.substring(i-d,i)+e.substring(i,i+h);l=t.substring(0,n-d);u=t.substring(n+h);c=e.substring(0,i-d);f=e.substring(i+h)}}if(s.length*2>=t.length){return[l,u,c,f,s]}else{return null}}var s=i(n,r,Math.ceil(n.length/4));var l=i(n,r,Math.ceil(n.length/2));var u;if(!s&&!l){return null}else if(!l){u=s}else if(!s){u=l}else{u=s[4].length>l[4].length?s:l}var c,f,h,d;if(t.length>e.length){c=u[0];f=u[1];h=u[2];d=u[3]}else{h=u[0];d=u[1];c=u[2];f=u[3]}var v=u[4];return[c,f,h,d,v]}function f(r){var i=false;var s=[];var l=0;var o=null;var a=0;var c=0;var f=0;var h=0;var d=0;while(a<r.length){if(r[a][0]==n){s[l++]=a;c=h;f=d;h=0;d=0;o=r[a][1]}else{if(r[a][0]==e){h+=r[a][1].length}else{d+=r[a][1].length}if(o&&o.length<=Math.max(c,f)&&o.length<=Math.max(h,d)){r.splice(s[l-1],0,[t,o]);r[s[l-1]+1][0]=e;l--;l--;a=l>0?s[l-1]:-1;c=0;f=0;h=0;d=0;o=null;i=true}}a++}if(i){w(r)}q(r);a=1;while(a<r.length){if(r[a-1][0]==t&&r[a][0]==e){var v=r[a-1][1];var p=r[a][1];var b=u(v,p);var m=u(p,v);if(b>=m){if(b>=v.length/2||b>=p.length/2){r.splice(a,0,[n,p.substring(0,b)]);r[a-1][1]=v.substring(0,v.length-b);r[a+1][1]=p.substring(b);a++}}else{if(m>=v.length/2||m>=p.length/2){r.splice(a,0,[n,v.substring(0,m)]);r[a-1][0]=e;r[a-1][1]=p.substring(0,p.length-m);r[a+1][0]=t;r[a+1][1]=v.substring(m);a++}}a++}a++}}var h=/[^a-zA-Z0-9]/;var d=/\s/;var v=/[\r\n]/;var p=/\n\r?\n$/;var b=/^\r?\n\r?\n/;function q(t){function e(t,e){if(!t||!e){return 6}var n=t.charAt(t.length-1);var r=e.charAt(0);var i=n.match(h);var s=r.match(h);var l=i&&n.match(d);var o=s&&r.match(d);var u=l&&n.match(v);var a=o&&r.match(v);var c=u&&t.match(p);var f=a&&e.match(b);if(c||f){return 5}else if(u||a){return 4}else if(i&&!l&&o){return 3}else if(l||o){return 2}else if(i||s){return 1}return 0}var r=1;while(r<t.length-1){if(t[r-1][0]==n&&t[r+1][0]==n){var i=t[r-1][1];var s=t[r][1];var l=t[r+1][1];var o=a(i,s);if(o){var u=s.substring(s.length-o);i=i.substring(0,i.length-o);s=u+s.substring(0,s.length-o);l=u+l}var c=i;var f=s;var q=l;var w=e(i,s)+e(s,l);while(s.charAt(0)===l.charAt(0)){i+=s.charAt(0);s=s.substring(1)+l.charAt(0);l=l.substring(1);var m=e(i,s)+e(s,l);if(m>=w){w=m;c=i;f=s;q=l}}if(t[r-1][1]!=c){if(c){t[r-1][1]=c}else{t.splice(r-1,1);r--}t[r][1]=f;if(q){t[r+1][1]=q}else{t.splice(r+1,1);r--}}}r++}}function w(r,i){r.push([n,""]);var s=0;var l=0;var u=0;var c="";var f="";var h;while(s<r.length){if(s<r.length-1&&!r[s][1]){r.splice(s,1);continue}switch(r[s][0]){case e:u++;f+=r[s][1];s++;break;case t:l++;c+=r[s][1];s++;break;case n:var d=s-u-l-1;if(i){if(d>=0&&k(r[d][1])){var v=r[d][1].slice(-1);r[d][1]=r[d][1].slice(0,-1);c=v+c;f=v+f;if(!r[d][1]){r.splice(d,1);s--;var p=d-1;if(r[p]&&r[p][0]===e){u++;f=r[p][1]+f;p--}if(r[p]&&r[p][0]===t){l++;c=r[p][1]+c;p--}d=p}}if(y(r[s][1])){var v=r[s][1].charAt(0);r[s][1]=r[s][1].slice(1);c+=v;f+=v}}if(s<r.length-1&&!r[s][1]){r.splice(s,1);break}if(c.length>0||f.length>0){if(c.length>0&&f.length>0){h=o(f,c);if(h!==0){if(d>=0){r[d][1]+=f.substring(0,h)}else{r.splice(0,0,[n,f.substring(0,h)]);s++}f=f.substring(h);c=c.substring(h)}h=a(f,c);if(h!==0){r[s][1]=f.substring(f.length-h)+r[s][1];f=f.substring(0,f.length-h);c=c.substring(0,c.length-h)}}var b=u+l;if(c.length===0&&f.length===0){r.splice(s-b,b);s=s-b}else if(c.length===0){r.splice(s-b,b,[e,f]);s=s-b+1}else if(f.length===0){r.splice(s-b,b,[t,c]);s=s-b+1}else{r.splice(s-b,b,[t,c],[e,f]);s=s-b+2}}if(s!==0&&r[s-1][0]===n){r[s-1][1]+=r[s][1];r.splice(s,1)}else{s++}u=0;l=0;c="";f="";break}}if(r[r.length-1][1]===""){r.pop()}var q=false;s=1;while(s<r.length-1){if(r[s-1][0]===n&&r[s+1][0]===n){if(r[s][1].substring(r[s][1].length-r[s-1][1].length)===r[s-1][1]){r[s][1]=r[s-1][1]+r[s][1].substring(0,r[s][1].length-r[s-1][1].length);r[s+1][1]=r[s-1][1]+r[s+1][1];r.splice(s-1,1);q=true}else if(r[s][1].substring(0,r[s+1][1].length)==r[s+1][1]){r[s-1][1]+=r[s+1][1];r[s][1]=r[s][1].substring(r[s+1][1].length)+r[s+1][1];r.splice(s+1,1);q=true}}s++}if(q){w(r,i)}}function m(t){return t>=55296&&t<=56319}function g(t){return t>=56320&&t<=57343}function y(t){return g(t.charCodeAt(0))}function k(t){return m(t.charCodeAt(t.length-1))}function x(t){var e=[];for(var n=0;n<t.length;n++){if(t[n][1].length>0){e.push(t[n])}}return e}function j(r,i,s,l){if(k(r)||y(l)){return null}return x([[n,r],[t,i],[e,s],[n,l]])}function A(t,e,n){var r=typeof n==="number"?{index:n,length:0}:n.oldRange;var i=typeof n==="number"?null:n.newRange;var s=t.length;var l=e.length;if(r.length===0&&(i===null||i.length===0)){var o=r.index;var u=t.slice(0,o);var a=t.slice(o);var c=i?i.index:null;t:{var f=o+l-s;if(c!==null&&c!==f){break t}if(f<0||f>l){break t}var h=e.slice(0,f);var d=e.slice(f);if(d!==a){break t}var v=Math.min(o,f);var p=u.slice(0,v);var b=h.slice(0,v);if(p!==b){break t}var q=u.slice(v);var w=h.slice(v);return j(p,q,w,a)}t:{if(c!==null&&c!==o){break t}var m=o;var h=e.slice(0,m);var d=e.slice(m);if(h!==u){break t}var g=Math.min(s-m,l-m);var y=a.slice(a.length-g);var k=d.slice(d.length-g);if(y!==k){break t}var q=a.slice(0,a.length-g);var w=d.slice(0,d.length-g);return j(u,q,w,y)}}if(r.length>0&&i&&i.length===0){t:{var p=t.slice(0,r.index);var y=t.slice(r.index+r.length);var v=p.length;var g=y.length;if(l<v+g){break t}var b=e.slice(0,v);var k=e.slice(l-g);if(p!==b||y!==k){break t}var q=t.slice(v,s-g);var w=e.slice(v,l-g);return j(p,q,w,y)}}return null}function O(t,e,n,i){return r(t,e,n,i,true)}O.INSERT=e;O.DELETE=t;O.EQUAL=n;Zy=O;return Zy}var Qy={exports:{}};var Yy;function Jy(){if(Yy)return Qy.exports;Yy=1;(function(t,e){var n=200;var r="__lodash_hash_undefined__";var i=9007199254740991;var s="[object Arguments]",l="[object Array]",o="[object Boolean]",u="[object Date]",a="[object Error]",c="[object Function]",f="[object GeneratorFunction]",h="[object Map]",d="[object Number]",v="[object Object]",p="[object Promise]",b="[object RegExp]",q="[object Set]",w="[object String]",m="[object Symbol]",g="[object WeakMap]";var y="[object ArrayBuffer]",k="[object DataView]",x="[object Float32Array]",j="[object Float64Array]",A="[object Int8Array]",O="[object Int16Array]",M="[object Int32Array]",E="[object Uint8Array]",_="[object Uint8ClampedArray]",T="[object Uint16Array]",N="[object Uint32Array]";var L=/[\\^$.*+?()[\]{}|]/g;var $=/\w*$/;var S=/^\[object .+?Constructor\]$/;var z=/^(?:0|[1-9]\d*)$/;var R={};R[s]=R[l]=R[y]=R[k]=R[o]=R[u]=R[x]=R[j]=R[A]=R[O]=R[M]=R[h]=R[d]=R[v]=R[b]=R[q]=R[w]=R[m]=R[E]=R[_]=R[T]=R[N]=true;R[a]=R[c]=R[g]=false;var I=typeof Fy=="object"&&Fy&&Fy.Object===Object&&Fy;var C=typeof self=="object"&&self&&self.Object===Object&&self;var B=I||C||Function("return this")();var D=e&&!e.nodeType&&e;var H=D&&"object"=="object"&&t&&!t.nodeType&&t;var V=H&&H.exports===D;function U(t,e){t.set(e[0],e[1]);return t}function F(t,e){t.add(e);return t}function P(t,e){var n=-1,r=t?t.length:0;while(++n<r){if(e(t[n],n,t)===false){break}}return t}function W(t,e){var n=-1,r=e.length,i=t.length;while(++n<r){t[i+n]=e[n]}return t}function Z(t,e,n,r){var i=-1,s=t?t.length:0;while(++i<s){n=e(n,t[i],i,t)}return n}function K(t,e){var n=-1,r=Array(t);while(++n<t){r[n]=e(n)}return r}function G(t,e){return t==null?undefined:t[e]}function Q(t){var e=false;if(t!=null&&typeof t.toString!="function"){try{e=!!(t+"")}catch(t){}}return e}function Y(t){var e=-1,n=Array(t.size);t.forEach((function(t,r){n[++e]=[r,t]}));return n}function J(t,e){return function(n){return t(e(n))}}function X(t){var e=-1,n=Array(t.size);t.forEach((function(t){n[++e]=t}));return n}var tt=Array.prototype,et=Function.prototype,nt=Object.prototype;var rt=B["__core-js_shared__"];var it=function(){var t=/[^.]+$/.exec(rt&&rt.keys&&rt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var st=et.toString;var lt=nt.hasOwnProperty;var ot=nt.toString;var ut=RegExp("^"+st.call(lt).replace(L,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var at=V?B.Buffer:undefined,ct=B.Symbol,ft=B.Uint8Array,ht=J(Object.getPrototypeOf,Object),dt=Object.create,vt=nt.propertyIsEnumerable,pt=tt.splice;var bt=Object.getOwnPropertySymbols,qt=at?at.isBuffer:undefined,wt=J(Object.keys,Object);var mt=Ae(B,"DataView"),gt=Ae(B,"Map"),yt=Ae(B,"Promise"),kt=Ae(B,"Set"),xt=Ae(B,"WeakMap"),jt=Ae(Object,"create");var At=ze(mt),Ot=ze(gt),Mt=ze(yt),Et=ze(kt),_t=ze(xt);var Tt=ct?ct.prototype:undefined,Nt=Tt?Tt.valueOf:undefined;function Lt(t){var e=-1,n=t?t.length:0;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function $t(){this.__data__=jt?jt(null):{}}function St(t){return this.has(t)&&delete this.__data__[t]}function zt(t){var e=this.__data__;if(jt){var n=e[t];return n===r?undefined:n}return lt.call(e,t)?e[t]:undefined}function Rt(t){var e=this.__data__;return jt?e[t]!==undefined:lt.call(e,t)}function It(t,e){var n=this.__data__;n[t]=jt&&e===undefined?r:e;return this}Lt.prototype.clear=$t;Lt.prototype["delete"]=St;Lt.prototype.get=zt;Lt.prototype.has=Rt;Lt.prototype.set=It;function Ct(t){var e=-1,n=t?t.length:0;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Bt(){this.__data__=[]}function Dt(t){var e=this.__data__,n=ie(e,t);if(n<0){return false}var r=e.length-1;if(n==r){e.pop()}else{pt.call(e,n,1)}return true}function Ht(t){var e=this.__data__,n=ie(e,t);return n<0?undefined:e[n][1]}function Vt(t){return ie(this.__data__,t)>-1}function Ut(t,e){var n=this.__data__,r=ie(n,t);if(r<0){n.push([t,e])}else{n[r][1]=e}return this}Ct.prototype.clear=Bt;Ct.prototype["delete"]=Dt;Ct.prototype.get=Ht;Ct.prototype.has=Vt;Ct.prototype.set=Ut;function Ft(t){var e=-1,n=t?t.length:0;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Pt(){this.__data__={hash:new Lt,map:new(gt||Ct),string:new Lt}}function Wt(t){return je(this,t)["delete"](t)}function Zt(t){return je(this,t).get(t)}function Kt(t){return je(this,t).has(t)}function Gt(t,e){je(this,t).set(t,e);return this}Ft.prototype.clear=Pt;Ft.prototype["delete"]=Wt;Ft.prototype.get=Zt;Ft.prototype.has=Kt;Ft.prototype.set=Gt;function Qt(t){this.__data__=new Ct(t)}function Yt(){this.__data__=new Ct}function Jt(t){return this.__data__["delete"](t)}function Xt(t){return this.__data__.get(t)}function te(t){return this.__data__.has(t)}function ee(t,e){var r=this.__data__;if(r instanceof Ct){var i=r.__data__;if(!gt||i.length<n-1){i.push([t,e]);return this}r=this.__data__=new Ft(i)}r.set(t,e);return this}Qt.prototype.clear=Yt;Qt.prototype["delete"]=Jt;Qt.prototype.get=Xt;Qt.prototype.has=te;Qt.prototype.set=ee;function ne(t,e){var n=Be(t)||Ce(t)?K(t.length,String):[];var r=n.length,i=!!r;for(var s in t){if(lt.call(t,s)&&!(i&&(s=="length"||Ne(s,r)))){n.push(s)}}return n}function re(t,e,n){var r=t[e];if(!(lt.call(t,e)&&Ie(r,n))||n===undefined&&!(e in t)){t[e]=n}}function ie(t,e){var n=t.length;while(n--){if(Ie(t[n][0],e)){return n}}return-1}function se(t,e){return t&&ye(e,Ze(e),t)}function le(t,e,n,r,i,l,o){var u;if(r){u=l?r(t,i,l,o):r(t)}if(u!==undefined){return u}if(!Pe(t)){return t}var a=Be(t);if(a){u=Ee(t);if(!e){return ge(t,u)}}else{var h=Me(t),d=h==c||h==f;if(Ve(t)){return he(t,e)}if(h==v||h==s||d&&!l){if(Q(t)){return l?t:{}}u=_e(d?{}:t);if(!e){return ke(t,se(u,t))}}else{if(!R[h]){return l?t:{}}u=Te(t,h,le,e)}}o||(o=new Qt);var p=o.get(t);if(p){return p}o.set(t,u);if(!a){var b=n?xe(t):Ze(t)}P(b||t,(function(i,s){if(b){s=i;i=t[s]}re(u,s,le(i,e,n,r,s,t,o))}));return u}function oe(t){return Pe(t)?dt(t):{}}function ue(t,e,n){var r=e(t);return Be(t)?r:W(r,n(t))}function ae(t){return ot.call(t)}function ce(t){if(!Pe(t)||$e(t)){return false}var e=Ue(t)||Q(t)?ut:S;return e.test(ze(t))}function fe(t){if(!Se(t)){return wt(t)}var e=[];for(var n in Object(t)){if(lt.call(t,n)&&n!="constructor"){e.push(n)}}return e}function he(t,e){if(e){return t.slice()}var n=new t.constructor(t.length);t.copy(n);return n}function de(t){var e=new t.constructor(t.byteLength);new ft(e).set(new ft(t));return e}function ve(t,e){var n=e?de(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function pe(t,e,n){var r=e?n(Y(t),true):Y(t);return Z(r,U,new t.constructor)}function be(t){var e=new t.constructor(t.source,$.exec(t));e.lastIndex=t.lastIndex;return e}function qe(t,e,n){var r=e?n(X(t),true):X(t);return Z(r,F,new t.constructor)}function we(t){return Nt?Object(Nt.call(t)):{}}function me(t,e){var n=e?de(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ge(t,e){var n=-1,r=t.length;e||(e=Array(r));while(++n<r){e[n]=t[n]}return e}function ye(t,e,n,r){n||(n={});var i=-1,s=e.length;while(++i<s){var l=e[i];var o=undefined;re(n,l,o===undefined?t[l]:o)}return n}function ke(t,e){return ye(t,Oe(t),e)}function xe(t){return ue(t,Ze,Oe)}function je(t,e){var n=t.__data__;return Le(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Ae(t,e){var n=G(t,e);return ce(n)?n:undefined}var Oe=bt?J(bt,Object):Ke;var Me=ae;if(mt&&Me(new mt(new ArrayBuffer(1)))!=k||gt&&Me(new gt)!=h||yt&&Me(yt.resolve())!=p||kt&&Me(new kt)!=q||xt&&Me(new xt)!=g){Me=function(t){var e=ot.call(t),n=e==v?t.constructor:undefined,r=n?ze(n):undefined;if(r){switch(r){case At:return k;case Ot:return h;case Mt:return p;case Et:return q;case _t:return g}}return e}}function Ee(t){var e=t.length,n=t.constructor(e);if(e&&typeof t[0]=="string"&&lt.call(t,"index")){n.index=t.index;n.input=t.input}return n}function _e(t){return typeof t.constructor=="function"&&!Se(t)?oe(ht(t)):{}}function Te(t,e,n,r){var i=t.constructor;switch(e){case y:return de(t);case o:case u:return new i(+t);case k:return ve(t,r);case x:case j:case A:case O:case M:case E:case _:case T:case N:return me(t,r);case h:return pe(t,r,n);case d:case w:return new i(t);case b:return be(t);case q:return qe(t,r,n);case m:return we(t)}}function Ne(t,e){e=e==null?i:e;return!!e&&(typeof t=="number"||z.test(t))&&(t>-1&&t%1==0&&t<e)}function Le(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function $e(t){return!!it&&it in t}function Se(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||nt;return t===n}function ze(t){if(t!=null){try{return st.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Re(t){return le(t,true,true)}function Ie(t,e){return t===e||t!==t&&e!==e}function Ce(t){return He(t)&&lt.call(t,"callee")&&(!vt.call(t,"callee")||ot.call(t)==s)}var Be=Array.isArray;function De(t){return t!=null&&Fe(t.length)&&!Ue(t)}function He(t){return We(t)&&De(t)}var Ve=qt||Ge;function Ue(t){var e=Pe(t)?ot.call(t):"";return e==c||e==f}function Fe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=i}function Pe(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function We(t){return!!t&&typeof t=="object"}function Ze(t){return De(t)?ne(t):fe(t)}function Ke(){return[]}function Ge(){return false}t.exports=Re})(Qy,Qy.exports);return Qy.exports}var Xy={exports:{}};var tk;function ek(){if(tk)return Xy.exports;tk=1;(function(t,e){var n=200;var r="__lodash_hash_undefined__";var i=1,s=2;var l=9007199254740991;var o="[object Arguments]",u="[object Array]",a="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",h="[object Error]",d="[object Function]",v="[object GeneratorFunction]",p="[object Map]",b="[object Number]",q="[object Null]",w="[object Object]",m="[object Promise]",g="[object Proxy]",y="[object RegExp]",k="[object Set]",x="[object String]",j="[object Symbol]",A="[object Undefined]",O="[object WeakMap]";var M="[object ArrayBuffer]",E="[object DataView]",_="[object Float32Array]",T="[object Float64Array]",N="[object Int8Array]",L="[object Int16Array]",$="[object Int32Array]",S="[object Uint8Array]",z="[object Uint8ClampedArray]",R="[object Uint16Array]",I="[object Uint32Array]";var C=/[\\^$.*+?()[\]{}|]/g;var B=/^\[object .+?Constructor\]$/;var D=/^(?:0|[1-9]\d*)$/;var H={};H[_]=H[T]=H[N]=H[L]=H[$]=H[S]=H[z]=H[R]=H[I]=true;H[o]=H[u]=H[M]=H[c]=H[E]=H[f]=H[h]=H[d]=H[p]=H[b]=H[w]=H[y]=H[k]=H[x]=H[O]=false;var V=typeof Fy=="object"&&Fy&&Fy.Object===Object&&Fy;var U=typeof self=="object"&&self&&self.Object===Object&&self;var F=V||U||Function("return this")();var P=e&&!e.nodeType&&e;var W=P&&"object"=="object"&&t&&!t.nodeType&&t;var Z=W&&W.exports===P;var K=Z&&V.process;var G=function(){try{return K&&K.binding&&K.binding("util")}catch(t){}}();var Q=G&&G.isTypedArray;function Y(t,e){var n=-1,r=t==null?0:t.length,i=0,s=[];while(++n<r){var l=t[n];if(e(l,n,t)){s[i++]=l}}return s}function J(t,e){var n=-1,r=e.length,i=t.length;while(++n<r){t[i+n]=e[n]}return t}function X(t,e){var n=-1,r=t==null?0:t.length;while(++n<r){if(e(t[n],n,t)){return true}}return false}function tt(t,e){var n=-1,r=Array(t);while(++n<t){r[n]=e(n)}return r}function et(t){return function(e){return t(e)}}function nt(t,e){return t.has(e)}function rt(t,e){return t==null?undefined:t[e]}function it(t){var e=-1,n=Array(t.size);t.forEach((function(t,r){n[++e]=[r,t]}));return n}function st(t,e){return function(n){return t(e(n))}}function lt(t){var e=-1,n=Array(t.size);t.forEach((function(t){n[++e]=t}));return n}var ot=Array.prototype,ut=Function.prototype,at=Object.prototype;var ct=F["__core-js_shared__"];var ft=ut.toString;var ht=at.hasOwnProperty;var dt=function(){var t=/[^.]+$/.exec(ct&&ct.keys&&ct.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var vt=at.toString;var pt=RegExp("^"+ft.call(ht).replace(C,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var bt=Z?F.Buffer:undefined,qt=F.Symbol,wt=F.Uint8Array,mt=at.propertyIsEnumerable,gt=ot.splice,yt=qt?qt.toStringTag:undefined;var kt=Object.getOwnPropertySymbols,xt=bt?bt.isBuffer:undefined,jt=st(Object.keys,Object);var At=Oe(F,"DataView"),Ot=Oe(F,"Map"),Mt=Oe(F,"Promise"),Et=Oe(F,"Set"),_t=Oe(F,"WeakMap"),Tt=Oe(Object,"create");var Nt=ze(At),Lt=ze(Ot),$t=ze(Mt),St=ze(Et),zt=ze(_t);var Rt=qt?qt.prototype:undefined,It=Rt?Rt.valueOf:undefined;function Ct(t){var e=-1,n=t==null?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Bt(){this.__data__=Tt?Tt(null):{};this.size=0}function Dt(t){var e=this.has(t)&&delete this.__data__[t];this.size-=e?1:0;return e}function Ht(t){var e=this.__data__;if(Tt){var n=e[t];return n===r?undefined:n}return ht.call(e,t)?e[t]:undefined}function Vt(t){var e=this.__data__;return Tt?e[t]!==undefined:ht.call(e,t)}function Ut(t,e){var n=this.__data__;this.size+=this.has(t)?0:1;n[t]=Tt&&e===undefined?r:e;return this}Ct.prototype.clear=Bt;Ct.prototype["delete"]=Dt;Ct.prototype.get=Ht;Ct.prototype.has=Vt;Ct.prototype.set=Ut;function Ft(t){var e=-1,n=t==null?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Pt(){this.__data__=[];this.size=0}function Wt(t){var e=this.__data__,n=he(e,t);if(n<0){return false}var r=e.length-1;if(n==r){e.pop()}else{gt.call(e,n,1)}--this.size;return true}function Zt(t){var e=this.__data__,n=he(e,t);return n<0?undefined:e[n][1]}function Kt(t){return he(this.__data__,t)>-1}function Gt(t,e){var n=this.__data__,r=he(n,t);if(r<0){++this.size;n.push([t,e])}else{n[r][1]=e}return this}Ft.prototype.clear=Pt;Ft.prototype["delete"]=Wt;Ft.prototype.get=Zt;Ft.prototype.has=Kt;Ft.prototype.set=Gt;function Qt(t){var e=-1,n=t==null?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Yt(){this.size=0;this.__data__={hash:new Ct,map:new(Ot||Ft),string:new Ct}}function Jt(t){var e=Ae(this,t)["delete"](t);this.size-=e?1:0;return e}function Xt(t){return Ae(this,t).get(t)}function te(t){return Ae(this,t).has(t)}function ee(t,e){var n=Ae(this,t),r=n.size;n.set(t,e);this.size+=n.size==r?0:1;return this}Qt.prototype.clear=Yt;Qt.prototype["delete"]=Jt;Qt.prototype.get=Xt;Qt.prototype.has=te;Qt.prototype.set=ee;function ne(t){var e=-1,n=t==null?0:t.length;this.__data__=new Qt;while(++e<n){this.add(t[e])}}function re(t){this.__data__.set(t,r);return this}function ie(t){return this.__data__.has(t)}ne.prototype.add=ne.prototype.push=re;ne.prototype.has=ie;function se(t){var e=this.__data__=new Ft(t);this.size=e.size}function le(){this.__data__=new Ft;this.size=0}function oe(t){var e=this.__data__,n=e["delete"](t);this.size=e.size;return n}function ue(t){return this.__data__.get(t)}function ae(t){return this.__data__.has(t)}function ce(t,e){var r=this.__data__;if(r instanceof Ft){var i=r.__data__;if(!Ot||i.length<n-1){i.push([t,e]);this.size=++r.size;return this}r=this.__data__=new Qt(i)}r.set(t,e);this.size=r.size;return this}se.prototype.clear=le;se.prototype["delete"]=oe;se.prototype.get=ue;se.prototype.has=ae;se.prototype.set=ce;function fe(t,e){var n=Ce(t),r=!n&&Ie(t),i=!n&&!r&&De(t),s=!n&&!r&&!i&&We(t),l=n||r||i||s,o=l?tt(t.length,String):[],u=o.length;for(var a in t){if(ht.call(t,a)&&!(l&&(a=="length"||i&&(a=="offset"||a=="parent")||s&&(a=="buffer"||a=="byteLength"||a=="byteOffset")||Te(a,u)))){o.push(a)}}return o}function he(t,e){var n=t.length;while(n--){if(Re(t[n][0],e)){return n}}return-1}function de(t,e,n){var r=e(t);return Ce(t)?r:J(r,n(t))}function ve(t){if(t==null){return t===undefined?A:q}return yt&&yt in Object(t)?Me(t):Se(t)}function pe(t){return Pe(t)&&ve(t)==o}function be(t,e,n,r,i){if(t===e){return true}if(t==null||e==null||!Pe(t)&&!Pe(e)){return t!==t&&e!==e}return qe(t,e,n,r,be,i)}function qe(t,e,n,r,s,l){var a=Ce(t),c=Ce(e),f=a?u:_e(t),h=c?u:_e(e);f=f==o?w:f;h=h==o?w:h;var d=f==w,v=h==w,p=f==h;if(p&&De(t)){if(!De(e)){return false}a=true;d=false}if(p&&!d){l||(l=new se);return a||We(t)?ye(t,e,n,r,s,l):ke(t,e,f,n,r,s,l)}if(!(n&i)){var b=d&&ht.call(t,"__wrapped__"),q=v&&ht.call(e,"__wrapped__");if(b||q){var m=b?t.value():t,g=q?e.value():e;l||(l=new se);return s(m,g,n,r,l)}}if(!p){return false}l||(l=new se);return xe(t,e,n,r,s,l)}function we(t){if(!Fe(t)||Le(t)){return false}var e=Ve(t)?pt:B;return e.test(ze(t))}function me(t){return Pe(t)&&Ue(t.length)&&!!H[ve(t)]}function ge(t){if(!$e(t)){return jt(t)}var e=[];for(var n in Object(t)){if(ht.call(t,n)&&n!="constructor"){e.push(n)}}return e}function ye(t,e,n,r,l,o){var u=n&i,a=t.length,c=e.length;if(a!=c&&!(u&&c>a)){return false}var f=o.get(t);if(f&&o.get(e)){return f==e}var h=-1,d=true,v=n&s?new ne:undefined;o.set(t,e);o.set(e,t);while(++h<a){var p=t[h],b=e[h];if(r){var q=u?r(b,p,h,e,t,o):r(p,b,h,t,e,o)}if(q!==undefined){if(q){continue}d=false;break}if(v){if(!X(e,(function(t,e){if(!nt(v,e)&&(p===t||l(p,t,n,r,o))){return v.push(e)}}))){d=false;break}}else if(!(p===b||l(p,b,n,r,o))){d=false;break}}o["delete"](t);o["delete"](e);return d}function ke(t,e,n,r,l,o,u){switch(n){case E:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset){return false}t=t.buffer;e=e.buffer;case M:if(t.byteLength!=e.byteLength||!o(new wt(t),new wt(e))){return false}return true;case c:case f:case b:return Re(+t,+e);case h:return t.name==e.name&&t.message==e.message;case y:case x:return t==e+"";case p:var a=it;case k:var d=r&i;a||(a=lt);if(t.size!=e.size&&!d){return false}var v=u.get(t);if(v){return v==e}r|=s;u.set(t,e);var q=ye(a(t),a(e),r,l,o,u);u["delete"](t);return q;case j:if(It){return It.call(t)==It.call(e)}}return false}function xe(t,e,n,r,s,l){var o=n&i,u=je(t),a=u.length,c=je(e),f=c.length;if(a!=f&&!o){return false}var h=a;while(h--){var d=u[h];if(!(o?d in e:ht.call(e,d))){return false}}var v=l.get(t);if(v&&l.get(e)){return v==e}var p=true;l.set(t,e);l.set(e,t);var b=o;while(++h<a){d=u[h];var q=t[d],w=e[d];if(r){var m=o?r(w,q,d,e,t,l):r(q,w,d,t,e,l)}if(!(m===undefined?q===w||s(q,w,n,r,l):m)){p=false;break}b||(b=d=="constructor")}if(p&&!b){var g=t.constructor,y=e.constructor;if(g!=y&&("constructor"in t&&"constructor"in e)&&!(typeof g=="function"&&g instanceof g&&typeof y=="function"&&y instanceof y)){p=false}}l["delete"](t);l["delete"](e);return p}function je(t){return de(t,Ze,Ee)}function Ae(t,e){var n=t.__data__;return Ne(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Oe(t,e){var n=rt(t,e);return we(n)?n:undefined}function Me(t){var e=ht.call(t,yt),n=t[yt];try{t[yt]=undefined;var r=true}catch(t){}var i=vt.call(t);if(r){if(e){t[yt]=n}else{delete t[yt]}}return i}var Ee=!kt?Ke:function(t){if(t==null){return[]}t=Object(t);return Y(kt(t),(function(e){return mt.call(t,e)}))};var _e=ve;if(At&&_e(new At(new ArrayBuffer(1)))!=E||Ot&&_e(new Ot)!=p||Mt&&_e(Mt.resolve())!=m||Et&&_e(new Et)!=k||_t&&_e(new _t)!=O){_e=function(t){var e=ve(t),n=e==w?t.constructor:undefined,r=n?ze(n):"";if(r){switch(r){case Nt:return E;case Lt:return p;case $t:return m;case St:return k;case zt:return O}}return e}}function Te(t,e){e=e==null?l:e;return!!e&&(typeof t=="number"||D.test(t))&&(t>-1&&t%1==0&&t<e)}function Ne(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Le(t){return!!dt&&dt in t}function $e(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||at;return t===n}function Se(t){return vt.call(t)}function ze(t){if(t!=null){try{return ft.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Re(t,e){return t===e||t!==t&&e!==e}var Ie=pe(function(){return arguments}())?pe:function(t){return Pe(t)&&ht.call(t,"callee")&&!mt.call(t,"callee")};var Ce=Array.isArray;function Be(t){return t!=null&&Ue(t.length)&&!Ve(t)}var De=xt||Ge;function He(t,e){return be(t,e)}function Ve(t){if(!Fe(t)){return false}var e=ve(t);return e==d||e==v||e==a||e==g}function Ue(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}function Fe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Pe(t){return t!=null&&typeof t=="object"}var We=Q?et(Q):me;function Ze(t){return Be(t)?fe(t):ge(t)}function Ke(){return[]}function Ge(){return false}t.exports=He})(Xy,Xy.exports);return Xy.exports}var nk={};var rk;function ik(){if(rk)return nk;rk=1;Object.defineProperty(nk,"__esModule",{value:true});const t=Jy();const e=ek();var n;(function(n){function r(e={},n={},r=false){if(typeof e!=="object"){e={}}if(typeof n!=="object"){n={}}let i=t(n);if(!r){i=Object.keys(i).reduce(((t,e)=>{if(i[e]!=null){t[e]=i[e]}return t}),{})}for(const t in e){if(e[t]!==undefined&&n[t]===undefined){i[t]=e[t]}}return Object.keys(i).length>0?i:undefined}n.compose=r;function i(t={},n={}){if(typeof t!=="object"){t={}}if(typeof n!=="object"){n={}}const r=Object.keys(t).concat(Object.keys(n)).reduce(((r,i)=>{if(!e(t[i],n[i])){r[i]=n[i]===undefined?null:n[i]}return r}),{});return Object.keys(r).length>0?r:undefined}n.diff=i;function s(t={},e={}){t=t||{};const n=Object.keys(e).reduce(((n,r)=>{if(e[r]!==t[r]&&t[r]!==undefined){n[r]=e[r]}return n}),{});return Object.keys(t).reduce(((n,r)=>{if(t[r]!==e[r]&&e[r]===undefined){n[r]=null}return n}),n)}n.invert=s;function l(t,e,n=false){if(typeof t!=="object"){return e}if(typeof e!=="object"){return undefined}if(!n){return e}const r=Object.keys(e).reduce(((n,r)=>{if(t[r]===undefined){n[r]=e[r]}return n}),{});return Object.keys(r).length>0?r:undefined}n.transform=l})(n||(n={}));nk.default=n;return nk}var sk={};var lk;function ok(){if(lk)return sk;lk=1;Object.defineProperty(sk,"__esModule",{value:true});var t;(function(t){function e(t){if(typeof t.delete==="number"){return t.delete}else if(typeof t.retain==="number"){return t.retain}else if(typeof t.retain==="object"&&t.retain!==null){return 1}else{return typeof t.insert==="string"?t.insert.length:1}}t.length=e})(t||(t={}));sk.default=t;return sk}var uk={};var ak;function ck(){if(ak)return uk;ak=1;Object.defineProperty(uk,"__esModule",{value:true});const t=ok();class e{constructor(t){this.ops=t;this.index=0;this.offset=0}hasNext(){return this.peekLength()<Infinity}next(e){if(!e){e=Infinity}const n=this.ops[this.index];if(n){const r=this.offset;const i=t.default.length(n);if(e>=i-r){e=i-r;this.index+=1;this.offset=0}else{this.offset+=e}if(typeof n.delete==="number"){return{delete:e}}else{const t={};if(n.attributes){t.attributes=n.attributes}if(typeof n.retain==="number"){t.retain=e}else if(typeof n.retain==="object"&&n.retain!==null){t.retain=n.retain}else if(typeof n.insert==="string"){t.insert=n.insert.substr(r,e)}else{t.insert=n.insert}return t}}else{return{retain:Infinity}}}peek(){return this.ops[this.index]}peekLength(){if(this.ops[this.index]){return t.default.length(this.ops[this.index])-this.offset}else{return Infinity}}peekType(){const t=this.ops[this.index];if(t){if(typeof t.delete==="number"){return"delete"}else if(typeof t.retain==="number"||typeof t.retain==="object"&&t.retain!==null){return"retain"}else{return"insert"}}return"retain"}rest(){if(!this.hasNext()){return[]}else if(this.offset===0){return this.ops.slice(this.index)}else{const t=this.offset;const e=this.index;const n=this.next();const r=this.ops.slice(this.index);this.offset=t;this.index=e;return[n].concat(r)}}}uk.default=e;return uk}var fk;function hk(){if(fk)return Wy.exports;fk=1;(function(t,e){Object.defineProperty(e,"__esModule",{value:true});e.AttributeMap=e.OpIterator=e.Op=void 0;const n=Gy();const r=Jy();const i=ek();const s=ik();e.AttributeMap=s.default;const l=ok();e.Op=l.default;const o=ck();e.OpIterator=o.default;const u=String.fromCharCode(0);const a=(t,e)=>{if(typeof t!=="object"||t===null){throw new Error(`cannot retain a ${typeof t}`)}if(typeof e!=="object"||e===null){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 c{constructor(t){if(Array.isArray(t)){this.ops=t}else if(t!=null&&Array.isArray(t.ops)){this.ops=t.ops}else{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={};if(typeof t==="string"&&t.length===0){return this}n.insert=t;if(e!=null&&typeof e==="object"&&Object.keys(e).length>0){n.attributes=e}return this.push(n)}delete(t){if(t<=0){return this}return this.push({delete:t})}retain(t,e){if(typeof t==="number"&&t<=0){return this}const n={retain:t};if(e!=null&&typeof e==="object"&&Object.keys(e).length>0){n.attributes=e}return this.push(n)}push(t){let e=this.ops.length;let n=this.ops[e-1];t=r(t);if(typeof n==="object"){if(typeof t.delete==="number"&&typeof n.delete==="number"){this.ops[e-1]={delete:n.delete+t.delete};return this}if(typeof n.delete==="number"&&t.insert!=null){e-=1;n=this.ops[e-1];if(typeof n!=="object"){this.ops.unshift(t);return this}}if(i(t.attributes,n.attributes)){if(typeof t.insert==="string"&&typeof n.insert==="string"){this.ops[e-1]={insert:n.insert+t.insert};if(typeof t.attributes==="object"){this.ops[e-1].attributes=t.attributes}return this}else if(typeof t.retain==="number"&&typeof n.retain==="number"){this.ops[e-1]={retain:n.retain+t.retain};if(typeof t.attributes==="object"){this.ops[e-1].attributes=t.attributes}return this}}}if(e===this.ops.length){this.ops.push(t)}else{this.ops.splice(e,0,t)}return this}chop(){const t=this.ops[this.ops.length-1];if(t&&typeof t.retain==="number"&&!t.attributes){this.ops.pop()}return 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=[];const n=[];this.forEach((r=>{const i=t(r)?e:n;i.push(r)}));return[e,n]}reduce(t,e){return this.ops.reduce(t,e)}changeLength(){return this.reduce(((t,e)=>{if(e.insert){return t+l.default.length(e)}else if(e.delete){return t-e.delete}return t}),0)}length(){return this.reduce(((t,e)=>t+l.default.length(e)),0)}slice(t=0,e=Infinity){const n=[];const r=new o.default(this.ops);let i=0;while(i<e&&r.hasNext()){let s;if(i<t){s=r.next(t-i)}else{s=r.next(e-i);n.push(s)}i+=l.default.length(s)}return new c(n)}compose(t){const e=new o.default(this.ops);const n=new o.default(t.ops);const r=[];const l=n.peek();if(l!=null&&typeof l.retain==="number"&&l.attributes==null){let t=l.retain;while(e.peekType()==="insert"&&e.peekLength()<=t){t-=e.peekLength();r.push(e.next())}if(l.retain-t>0){n.next(l.retain-t)}}const u=new c(r);while(e.hasNext()||n.hasNext()){if(n.peekType()==="insert"){u.push(n.next())}else if(e.peekType()==="delete"){u.push(e.next())}else{const t=Math.min(e.peekLength(),n.peekLength());const r=e.next(t);const l=n.next(t);if(l.retain){const o={};if(typeof r.retain==="number"){o.retain=typeof l.retain==="number"?t:l.retain}else{if(typeof l.retain==="number"){if(r.retain==null){o.insert=r.insert}else{o.retain=r.retain}}else{const t=r.retain==null?"insert":"retain";const[e,n,i]=a(r[t],l.retain);const s=c.getHandler(e);o[t]={[e]:s.compose(n,i,t==="retain")}}}const f=s.default.compose(r.attributes,l.attributes,typeof r.retain==="number");if(f){o.attributes=f}u.push(o);if(!n.hasNext()&&i(u.ops[u.ops.length-1],o)){const t=new c(e.rest());return u.concat(t).chop()}}else if(typeof l.delete==="number"&&(typeof r.retain==="number"||typeof r.retain==="object"&&r.retain!==null)){u.push(l)}}}return u.chop()}concat(t){const e=new c(this.ops.slice());if(t.ops.length>0){e.push(t.ops[0]);e.ops=e.ops.concat(t.ops.slice(1))}return e}diff(t,e){if(this.ops===t.ops){return new c}const r=[this,t].map((e=>e.map((n=>{if(n.insert!=null){return typeof n.insert==="string"?n.insert:u}const r=e===t?"on":"with";throw new Error("diff() called "+r+" non-document")})).join("")));const l=new c;const a=n(r[0],r[1],e,true);const f=new o.default(this.ops);const h=new o.default(t.ops);a.forEach((t=>{let e=t[1].length;while(e>0){let r=0;switch(t[0]){case n.INSERT:r=Math.min(h.peekLength(),e);l.push(h.next(r));break;case n.DELETE:r=Math.min(e,f.peekLength());f.next(r);l.delete(r);break;case n.EQUAL:r=Math.min(f.peekLength(),h.peekLength(),e);const t=f.next(r);const o=h.next(r);if(i(t.insert,o.insert)){l.retain(r,s.default.diff(t.attributes,o.attributes))}else{l.push(o).delete(r)}break}e-=r}}));return l.chop()}eachLine(t,e="\n"){const n=new o.default(this.ops);let r=new c;let i=0;while(n.hasNext()){if(n.peekType()!=="insert"){return}const s=n.peek();const o=l.default.length(s)-n.peekLength();const u=typeof s.insert==="string"?s.insert.indexOf(e,o)-o:-1;if(u<0){r.push(n.next())}else if(u>0){r.push(n.next(u))}else{if(t(r,n.next(1).attributes||{},i)===false){return}i+=1;r=new c}}if(r.length()>0){t(r,{},i)}}invert(t){const e=new c;this.reduce(((n,r)=>{if(r.insert){e.delete(l.default.length(r))}else if(typeof r.retain==="number"&&r.attributes==null){e.retain(r.retain);return n+r.retain}else if(r.delete||typeof r.retain==="number"){const i=r.delete||r.retain;const o=t.slice(n,n+i);o.forEach((t=>{if(r.delete){e.push(t)}else if(r.retain&&r.attributes){e.retain(l.default.length(t),s.default.invert(r.attributes,t.attributes))}}));return n+i}else if(typeof r.retain==="object"&&r.retain!==null){const i=t.slice(n,n+1);const l=new o.default(i.ops).next();const[u,f,h]=a(r.retain,l.insert);const d=c.getHandler(u);e.retain({[u]:d.invert(f,h)},s.default.invert(r.attributes,l.attributes));return n+1}return n}),0);return e.chop()}transform(t,e=false){e=!!e;if(typeof t==="number"){return this.transformPosition(t,e)}const n=t;const r=new o.default(this.ops);const i=new o.default(n.ops);const u=new c;while(r.hasNext()||i.hasNext()){if(r.peekType()==="insert"&&(e||i.peekType()!=="insert")){u.retain(l.default.length(r.next()))}else if(i.peekType()==="insert"){u.push(i.next())}else{const t=Math.min(r.peekLength(),i.peekLength());const n=r.next(t);const l=i.next(t);if(n.delete){continue}else if(l.delete){u.push(l)}else{const r=n.retain;const i=l.retain;let o=typeof i==="object"&&i!==null?i:t;if(typeof r==="object"&&r!==null&&typeof i==="object"&&i!==null){const t=Object.keys(r)[0];if(t===Object.keys(i)[0]){const n=c.getHandler(t);if(n){o={[t]:n.transform(r[t],i[t],e)}}}}u.retain(o,s.default.transform(n.attributes,l.attributes,e))}}}return u.chop()}transformPosition(t,e=false){e=!!e;const n=new o.default(this.ops);let r=0;while(n.hasNext()&&r<=t){const i=n.peekLength();const s=n.peekType();n.next();if(s==="delete"){t-=Math.min(i,t-r);continue}else if(s==="insert"&&(r<t||!e)){t+=i}r+=i}return t}}c.Op=l.default;c.OpIterator=o.default;c.AttributeMap=s.default;c.handlers={};e.default=c;{t.exports=c;t.exports.default=c}})(Wy,Wy.exports);return Wy.exports}var dk=hk();var vk=Py(dk);class pk extends Sy{static value(){return undefined}optimize(){if(this.prev||this.next){this.remove()}}length(){return 0}value(){return""}}pk.blotName="break";pk.tagName="BR";let bk=class t extends Vy{};const qk={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function wk(t){return t.replace(/[&<>"']/g,(t=>qk[t]))}class mk extends Oy{static allowedChildren=[mk,pk,Sy,bk];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(t,e){const n=mk.order.indexOf(t);const r=mk.order.indexOf(e);if(n>=0||r>=0){return n-r}if(t===e){return 0}if(t<e){return-1}return 1}formatAt(t,e,n,r){if(mk.compare(this.statics.blotName,n)<0&&this.scroll.query(n,ty.BLOT)){const i=this.isolate(t,e);if(r){i.wrap(n,r)}}else{super.formatAt(t,e,n,r)}}optimize(t){super.optimize(t);if(this.parent instanceof mk&&mk.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t);t.wrap(this)}}}const gk=1;class yk extends _y{cache={};delta(){if(this.cache.delta==null){this.cache.delta=xk(this)}return this.cache.delta}deleteAt(t,e){super.deleteAt(t,e);this.cache={}}formatAt(t,e,n,r){if(e<=0)return;if(this.scroll.query(n,ty.BLOCK)){if(t+e===this.length()){this.format(n,r)}}else{super.formatAt(t,Math.min(e,this.length()-t-1),n,r)}this.cache={}}insertAt(t,e,n){if(n!=null){super.insertAt(t,e,n);this.cache={};return}if(e.length===0)return;const r=e.split("\n");const i=r.shift();if(i.length>0){if(t<this.length()-1||this.children.tail==null){super.insertAt(Math.min(t,this.length()-1),i)}else{this.children.tail.insertAt(this.children.tail.length(),i)}this.cache={}}let s=this;r.reduce(((t,e)=>{s=s.split(t,true);s.insertAt(0,e);return e.length}),t+i.length)}insertBefore(t,e){const{head:n}=this.children;super.insertBefore(t,e);if(n instanceof pk){n.remove()}this.cache={}}length(){if(this.cache.length==null){this.cache.length=super.length()+gk}return this.cache.length}moveChildren(t,e){super.moveChildren(t,e);this.cache={}}optimize(t){super.optimize(t);this.cache={}}path(t){return super.path(t,true)}removeChild(t){super.removeChild(t);this.cache={}}split(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(e&&(t===0||t>=this.length()-gk)){const e=this.clone();if(t===0){this.parent.insertBefore(e,this);return this}this.parent.insertBefore(e,this.next);return e}const n=super.split(t,e);this.cache={};return n}}yk.blotName="block";yk.tagName="P";yk.defaultChild=pk;yk.allowedChildren=[pk,mk,Sy,bk];class kk extends Sy{attach(){super.attach();this.attributes=new hy(this.domNode)}delta(){return(new vk).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const n=this.scroll.query(t,ty.BLOCK_ATTRIBUTE);if(n!=null){this.attributes.attribute(n,e)}}formatAt(t,e,n,r){this.format(n,r)}insertAt(t,e,n){if(n!=null){super.insertAt(t,e,n);return}const r=e.split("\n");const i=r.pop();const s=r.map((t=>{const e=this.scroll.create(yk.blotName);e.insertAt(0,t);return e}));const l=this.split(t);s.forEach((t=>{this.parent.insertBefore(t,l)}));if(i){this.parent.insertBefore(this.scroll.create("text",i),l)}}}kk.scope=ty.BLOCK_BLOT;function xk(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return t.descendants(qy).reduce(((t,n)=>{if(n.length()===0){return t}return t.insert(n.value(),jk(n,{},e))}),new vk).insert("\n",jk(t))}function jk(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(t==null)return e;if("formats"in t&&typeof t.formats==="function"){e={...e,...t.formats()};if(n){delete e["code-token"]}}if(t.parent==null||t.parent.statics.blotName==="scroll"||t.parent.statics.scope!==t.statics.scope){return e}return jk(t.parent,e,n)}class Ak extends Sy{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){return undefined}constructor(t,e,n){super(t,e);this.selection=n;this.textNode=document.createTextNode(Ak.CONTENTS);this.domNode.appendChild(this.textNode);this.savedLength=0}detach(){if(this.parent!=null)this.parent.removeChild(this)}format(t,e){if(this.savedLength!==0){super.format(t,e);return}let n=this;let r=0;while(n!=null&&n.statics.scope!==ty.BLOCK_BLOT){r+=n.offset(n.parent);n=n.parent}if(n!=null){this.savedLength=Ak.CONTENTS.length;n.optimize();n.formatAt(r,Ak.CONTENTS.length,t,e);this.savedLength=0}}index(t,e){if(t===this.textNode)return 0;return super.index(t,e)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove();this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const t=this.selection.getNativeRange();while(this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode){this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode)}const e=this.prev instanceof bk?this.prev:null;const n=e?e.length():0;const r=this.next instanceof bk?this.next:null;const i=r?r.text:"";const{textNode:s}=this;const l=s.data.split(Ak.CONTENTS).join("");s.data=Ak.CONTENTS;let o;if(e){o=e;if(l||r){e.insertAt(e.length(),l+i);if(r){r.remove()}}}else if(r){o=r;r.insertAt(0,l)}else{const t=document.createTextNode(l);o=this.scroll.create(t);this.parent.insertBefore(o,this)}this.remove();if(t){const i=(t,i)=>{if(e&&t===e.domNode){return i}if(t===s){return n+i-1}if(r&&t===r.domNode){return n+l.length+i}return null};const u=i(t.start.node,t.start.offset);const a=i(t.end.node,t.end.offset);if(u!==null&&a!==null){return{startNode:o.domNode,startOffset:u,endNode:o.domNode,endOffset:a}}}return null}update(t,e){if(t.some((t=>t.type==="characterData"&&t.target===this.textNode))){const t=this.restore();if(t)e.range=t}}optimize(t){super.optimize(t);let{parent:e}=this;while(e){if(e.domNode.tagName==="A"){this.savedLength=Ak.CONTENTS.length;e.isolate(this.offset(e),this.length()).unwrap();this.savedLength=0;break}e=e.parent}}value(){return""}}var Ok={exports:{}};var Mk;function Ek(){if(Mk)return Ok.exports;Mk=1;(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}if(Object.create){r.prototype=Object.create(null);if(!(new r).__proto__)n=false}function i(t,e,n){this.fn=t;this.context=e;this.once=n||false}function s(t,e,r,s,l){if(typeof r!=="function"){throw new TypeError("The listener must be a function")}var o=new i(r,s||t,l),u=n?n+e:e;if(!t._events[u])t._events[u]=o,t._eventsCount++;else if(!t._events[u].fn)t._events[u].push(o);else t._events[u]=[t._events[u],o];return t}function l(t,e){if(--t._eventsCount===0)t._events=new r;else delete t._events[e]}function o(){this._events=new r;this._eventsCount=0}o.prototype.eventNames=function t(){var r=[],i,s;if(this._eventsCount===0)return r;for(s in i=this._events){if(e.call(i,s))r.push(n?s.slice(1):s)}if(Object.getOwnPropertySymbols){return r.concat(Object.getOwnPropertySymbols(i))}return r};o.prototype.listeners=function t(e){var r=n?n+e:e,i=this._events[r];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,l=i.length,o=new Array(l);s<l;s++){o[s]=i[s].fn}return o};o.prototype.listenerCount=function t(e){var r=n?n+e:e,i=this._events[r];if(!i)return 0;if(i.fn)return 1;return i.length};o.prototype.emit=function t(e,r,i,s,l,o){var u=n?n+e:e;if(!this._events[u])return false;var a=this._events[u],c=arguments.length,f,h;if(a.fn){if(a.once)this.removeListener(e,a.fn,undefined,true);switch(c){case 1:return a.fn.call(a.context),true;case 2:return a.fn.call(a.context,r),true;case 3:return a.fn.call(a.context,r,i),true;case 4:return a.fn.call(a.context,r,i,s),true;case 5:return a.fn.call(a.context,r,i,s,l),true;case 6:return a.fn.call(a.context,r,i,s,l,o),true}for(h=1,f=new Array(c-1);h<c;h++){f[h-1]=arguments[h]}a.fn.apply(a.context,f)}else{var d=a.length,v;for(h=0;h<d;h++){if(a[h].once)this.removeListener(e,a[h].fn,undefined,true);switch(c){case 1:a[h].fn.call(a[h].context);break;case 2:a[h].fn.call(a[h].context,r);break;case 3:a[h].fn.call(a[h].context,r,i);break;case 4:a[h].fn.call(a[h].context,r,i,s);break;default:if(!f)for(v=1,f=new Array(c-1);v<c;v++){f[v-1]=arguments[v]}a[h].fn.apply(a[h].context,f)}}}return true};o.prototype.on=function t(e,n,r){return s(this,e,n,r,false)};o.prototype.once=function t(e,n,r){return s(this,e,n,r,true)};o.prototype.removeListener=function t(e,r,i,s){var o=n?n+e:e;if(!this._events[o])return this;if(!r){l(this,o);return this}var u=this._events[o];if(u.fn){if(u.fn===r&&(!s||u.once)&&(!i||u.context===i)){l(this,o)}}else{for(var a=0,c=[],f=u.length;a<f;a++){if(u[a].fn!==r||s&&!u[a].once||i&&u[a].context!==i){c.push(u[a])}}if(c.length)this._events[o]=c.length===1?c[0]:c;else l(this,o)}return this};o.prototype.removeAllListeners=function t(e){var i;if(e){i=n?n+e:e;if(this._events[i])l(this,i)}else{this._events=new r;this._eventsCount=0}return this};o.prototype.off=o.prototype.removeListener;o.prototype.addListener=o.prototype.on;o.prefixed=n;o.EventEmitter=o;{t.exports=o}})(Ok);return Ok.exports}var _k=Ek();var Tk=Py(_k);var Nk=new WeakMap;const Lk=["error","warn","log","info"];let $k="warn";function Sk(t){if($k){if(Lk.indexOf(t)<=Lk.indexOf($k)){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}console[t](...n)}}}function zk(t){return Lk.reduce(((e,n)=>{e[n]=Sk.bind(console,n,t);return e}),{})}zk.level=t=>{$k=t};Sk.level=zk.level;const Rk=zk("quill:events");const Ik=["selectionchange","mousedown","mouseup","click"];Ik.forEach((t=>{document.addEventListener(t,(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}Array.from(document.querySelectorAll(".ql-container")).forEach((t=>{const n=Nk.get(t);if(n&&n.emitter){n.emitter.handleDOM(...e)}}))}))}));class Ck extends Tk{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super();this.domListeners={};this.on("error",Rk.error)}emit(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}Rk.log.call(Rk,...e);return super.emit(...e)}handleDOM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}(this.domListeners[t.type]||[]).forEach((e=>{let{node:r,handler:i}=e;if(t.target===r||r.contains(t.target)){i(t,...n)}}))}listenDOM(t,e,n){if(!this.domListeners[t]){this.domListeners[t]=[]}this.domListeners[t].push({node:e,handler:n})}}const Bk=zk("quill:selection");class Dk{constructor(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;this.index=t;this.length=e}}class Hk{constructor(t,e){this.emitter=e;this.scroll=t;this.composing=false;this.mouseDown=false;this.root=this.scroll.domNode;this.cursor=this.scroll.create("cursor",this);this.savedRange=new Dk(0,0);this.lastRange=this.savedRange;this.lastNative=null;this.handleComposition();this.handleDragging();this.emitter.listenDOM("selectionchange",document,(()=>{if(!this.mouseDown&&!this.composing){setTimeout(this.update.bind(this,Ck.sources.USER),1)}}));this.emitter.on(Ck.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const t=this.getNativeRange();if(t==null)return;if(t.start.node===this.cursor.textNode)return;this.emitter.once(Ck.events.SCROLL_UPDATE,((e,n)=>{try{if(this.root.contains(t.start.node)&&this.root.contains(t.end.node)){this.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}const r=n.some((t=>t.type==="characterData"||t.type==="childList"||t.type==="attributes"&&t.target===this.root));this.update(r?Ck.sources.SILENT:e)}catch(t){}}))}));this.emitter.on(Ck.events.SCROLL_OPTIMIZE,((t,e)=>{if(e.range){const{startNode:t,startOffset:n,endNode:r,endOffset:i}=e.range;this.setNativeRange(t,n,r,i);this.update(Ck.sources.SILENT)}}));this.update(Ck.sources.SILENT)}handleComposition(){this.emitter.on(Ck.events.COMPOSITION_BEFORE_START,(()=>{this.composing=true}));this.emitter.on(Ck.events.COMPOSITION_END,(()=>{this.composing=false;if(this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout((()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=true}));this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=false;this.update(Ck.sources.USER)}))}focus(){if(this.hasFocus())return;this.root.focus({preventScroll:true});this.setRange(this.savedRange)}format(t,e){this.scroll.update();const n=this.getNativeRange();if(n==null||!n.native.collapsed||this.scroll.query(t,ty.BLOCK))return;if(n.start.node!==this.cursor.textNode){const t=this.scroll.find(n.start.node,false);if(t==null)return;if(t instanceof qy){const e=t.split(n.start.offset);t.parent.insertBefore(this.cursor,e)}else{t.insertBefore(this.cursor,n.start.node)}this.cursor.attach()}this.cursor.format(t,e);this.scroll.optimize();this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length);this.update()}getBounds(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;const n=this.scroll.length();t=Math.min(t,n-1);e=Math.min(t+e,n-1)-t;let r;let[i,s]=this.scroll.leaf(t);if(i==null)return null;if(e>0&&s===i.length()){const[e]=this.scroll.leaf(t+1);if(e){const[n]=this.scroll.line(t);const[r]=this.scroll.line(t+1);if(n===r){i=e;s=0}}}[r,s]=i.position(s,true);const l=document.createRange();if(e>0){l.setStart(r,s);[i,s]=this.scroll.leaf(t+e);if(i==null)return null;[r,s]=i.position(s,true);l.setEnd(r,s);return l.getBoundingClientRect()}let o="left";let u;if(r instanceof Text){if(!r.data.length){return null}if(s<r.data.length){l.setStart(r,s);l.setEnd(r,s+1)}else{l.setStart(r,s-1);l.setEnd(r,s);o="right"}u=l.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;u=i.domNode.getBoundingClientRect();if(s>0)o="right"}return{bottom:u.top+u.height,height:u.height,left:u[o],right:u[o],top:u.top,width:0}}getNativeRange(){const t=document.getSelection();if(t==null||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(e==null)return null;const n=this.normalizeNative(e);Bk.info("getNativeRange",n);return n}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected){return[null,null]}const e=this.getNativeRange();if(e==null)return[null,null];const n=this.normalizedToRange(e);return[n,e]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Vk(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];if(!t.native.collapsed){e.push([t.end.node,t.end.offset])}const n=e.map((t=>{const[e,n]=t;const r=this.scroll.find(e,true);const i=r.offset(this.scroll);if(n===0){return i}if(r instanceof qy){return i+r.index(e,n)}return i+r.length()}));const r=Math.min(Math.max(...n),this.scroll.length()-1);const i=Math.min(r,...n);return new Dk(i,r-i)}normalizeNative(t){if(!Vk(this.root,t.startContainer)||!t.collapsed&&!Vk(this.root,t.endContainer)){return null}const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};[e.start,e.end].forEach((t=>{let{node:e,offset:n}=t;while(!(e instanceof Text)&&e.childNodes.length>0){if(e.childNodes.length>n){e=e.childNodes[n];n=0}else if(e.childNodes.length===n){e=e.lastChild;if(e instanceof Text){n=e.data.length}else if(e.childNodes.length>0){n=e.childNodes.length}else{n=e.childNodes.length+1}}else{break}}t.node=e;t.offset=n}));return e}rangeToNative(t){const e=this.scroll.length();const n=(t,n)=>{t=Math.min(e-1,t);const[r,i]=this.scroll.leaf(t);return r?r.position(i,n):[null,-1]};return[...n(t.index,false),...n(t.index+t.length,true)]}setNativeRange(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t;let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:e;let i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;Bk.info("setNativeRange",t,e,n,r);if(t!=null&&(this.root.parentNode==null||t.parentNode==null||n.parentNode==null)){return}const s=document.getSelection();if(s==null)return;if(t!=null){if(!this.hasFocus())this.root.focus({preventScroll:true});const{native:l}=this.getNativeRange()||{};if(l==null||i||t!==l.startContainer||e!==l.startOffset||n!==l.endContainer||r!==l.endOffset){if(t instanceof Element&&t.tagName==="BR"){e=Array.from(t.parentNode.childNodes).indexOf(t);t=t.parentNode}if(n instanceof Element&&n.tagName==="BR"){r=Array.from(n.parentNode.childNodes).indexOf(n);n=n.parentNode}const i=document.createRange();i.setStart(t,e);i.setEnd(n,r);s.removeAllRanges();s.addRange(i)}}else{s.removeAllRanges();this.root.blur()}}setRange(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:Ck.sources.API;if(typeof e==="string"){n=e;e=false}Bk.info("setRange",t);if(t!=null){const n=this.rangeToNative(t);this.setNativeRange(...n,e)}else{this.setNativeRange(null)}this.update(n)}update(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Ck.sources.USER;const e=this.lastRange;const[n,r]=this.getRange();this.lastRange=n;this.lastNative=r;if(this.lastRange!=null){this.savedRange=this.lastRange}if(!mv(e,this.lastRange)){if(!this.composing&&r!=null&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const t=this.cursor.restore();if(t){this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}}const n=[Ck.events.SELECTION_CHANGE,Sa(this.lastRange),Sa(e),t];this.emitter.emit(Ck.events.EDITOR_CHANGE,...n);if(t!==Ck.sources.SILENT){this.emitter.emit(...n)}}}}function Vk(t,e){return t.contains(e)}const Uk=/^[ -~]*$/;class Fk{constructor(t){this.scroll=t;this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const n=Gk(t);const r=new vk;const i=Yk(n.ops.slice());i.reduce(((t,n)=>{const i=dk.Op.length(n);let s=n.attributes||{};let l=false;let o=false;if(n.insert!=null){r.retain(i);if(typeof n.insert==="string"){const r=n.insert;o=!r.endsWith("\n")&&(e<=t||!!this.scroll.descendant(kk,t)[0]);this.scroll.insertAt(t,r);const[i,l]=this.scroll.line(t);let u=yp({},jk(i));if(i instanceof yk){const[t]=i.descendant(qy,l);if(t){u=yp(u,jk(t))}}s=dk.AttributeMap.diff(u,s)||{}}else if(typeof n.insert==="object"){const r=Object.keys(n.insert)[0];if(r==null)return t;const i=this.scroll.query(r,ty.INLINE)!=null;if(i){if(e<=t||!!this.scroll.descendant(kk,t)[0]){o=true}}else if(t>0){const[e,n]=this.scroll.descendant(qy,t-1);if(e instanceof bk){const t=e.value();if(t[n]!=="\n"){l=true}}else if(e instanceof Sy&&e.statics.scope===ty.INLINE_BLOT){l=true}}this.scroll.insertAt(t,r,n.insert[r]);if(i){const[e]=this.scroll.descendant(qy,t);if(e){const t=yp({},jk(e));s=dk.AttributeMap.diff(t,s)||{}}}}e+=i}else{r.push(n);if(n.retain!==null&&typeof n.retain==="object"){const e=Object.keys(n.retain)[0];if(e==null)return t;this.scroll.updateEmbedAt(t,e,n.retain[e])}}Object.keys(s).forEach((e=>{this.scroll.formatAt(t,i,e,s[e])}));const u=l?1:0;const a=o?1:0;e+=u+a;r.retain(u);r.delete(a);return t+i+u+a}),0);r.reduce(((t,e)=>{if(typeof e.delete==="number"){this.scroll.deleteAt(t,e.delete);return t}return t+dk.Op.length(e)}),0);this.scroll.batchEnd();this.scroll.optimize();return this.update(n)}deleteText(t,e){this.scroll.deleteAt(t,e);return this.update((new vk).retain(t).delete(e))}formatLine(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};this.scroll.update();Object.keys(n).forEach((r=>{this.scroll.lines(t,Math.max(e,1)).forEach((t=>{t.format(r,n[r])}))}));this.scroll.optimize();const r=(new vk).retain(t).retain(e,Sa(n));return this.update(r)}formatText(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};Object.keys(n).forEach((r=>{this.scroll.formatAt(t,e,r,n[r])}));const r=(new vk).retain(t).retain(e,Sa(n));return this.update(r)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce(((t,e)=>t.concat(e.delta())),new vk)}getFormat(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;let n=[];let r=[];if(e===0){this.scroll.path(t).forEach((t=>{const[e]=t;if(e instanceof yk){n.push(e)}else if(e instanceof qy){r.push(e)}}))}else{n=this.scroll.lines(t,e);r=this.scroll.descendants(qy,t,e)}const[i,s]=[n,r].map((t=>{const e=t.shift();if(e==null)return{};let n=jk(e);while(Object.keys(n).length>0){const e=t.shift();if(e==null)return n;n=Zk(jk(e),n)}return n}));return{...i,...s}}getHTML(t,e){const[n,r]=this.scroll.line(t);if(n){const i=n.length();const s=n.length()>=r+e;if(s&&!(r===0&&e===i)){return Wk(n,r,e,true)}return Wk(this.scroll,t,e,true)}return""}getText(t,e){return this.getContents(t,e).filter((t=>typeof t.insert==="string")).map((t=>t.insert)).join("")}insertContents(t,e){const n=Gk(e);const r=(new vk).retain(t).concat(n);this.scroll.insertContents(t,n);return this.update(r)}insertEmbed(t,e,n){this.scroll.insertAt(t,e,n);return this.update((new vk).retain(t).insert({[e]:n}))}insertText(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n");this.scroll.insertAt(t,e);Object.keys(n).forEach((r=>{this.scroll.formatAt(t,e.length,r,n[r])}));return this.update((new vk).retain(t).insert(e,Sa(n)))}isBlank(){if(this.scroll.children.length===0)return true;if(this.scroll.children.length>1)return false;const t=this.scroll.children.head;if(t?.statics.blotName!==yk.blotName)return false;const e=t;if(e.children.length>1)return false;return e.children.head instanceof pk}removeFormat(t,e){const n=this.getText(t,e);const[r,i]=this.scroll.line(t+e);let s=0;let l=new vk;if(r!=null){s=r.length()-i;l=r.delta().slice(i,i+s-1).insert("\n")}const o=this.getContents(t,e+s);const u=o.diff((new vk).insert(n).concat(l));const a=(new vk).retain(t).concat(u);return this.applyDelta(a)}update(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:undefined;const r=this.delta;if(e.length===1&&e[0].type==="characterData"&&e[0].target.data.match(Uk)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target);const s=jk(i);const l=i.offset(this.scroll);const o=e[0].oldValue.replace(Ak.CONTENTS,"");const u=(new vk).insert(o);const a=(new vk).insert(i.value());const c=n&&{oldRange:Qk(n.oldRange,-l),newRange:Qk(n.newRange,-l)};const f=(new vk).retain(l).concat(u.diff(a,c));t=f.reduce(((t,e)=>{if(e.insert){return t.insert(e.insert,s)}return t.push(e)}),new vk);this.delta=r.compose(t)}else{this.delta=this.getDelta();if(!t||!mv(r.compose(t),this.delta)){t=r.diff(this.delta,n)}}return t}}function Pk(t,e,n){if(t.length===0){const[t]=Kk(n.pop());if(e<=0){return`</li></${t}>`}return`</li></${t}>${Pk([],e-1,n)}`}const[{child:r,offset:i,length:s,indent:l,type:o},...u]=t;const[a,c]=Kk(o);if(l>e){n.push(o);if(l===e+1){return`<${a}><li${c}>${Wk(r,i,s)}${Pk(u,l,n)}`}return`<${a}><li>${Pk(t,e+1,n)}`}const f=n[n.length-1];if(l===e&&o===f){return`</li><li${c}>${Wk(r,i,s)}${Pk(u,l,n)}`}const[h]=Kk(n.pop());return`</li></${h}>${Pk(t,e-1,n)}`}function Wk(t,e,n){let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if("html"in t&&typeof t.html==="function"){return t.html(e,n)}if(t instanceof bk){const r=wk(t.value().slice(e,e+n));return r.replaceAll(" ","&nbsp;")}if(t instanceof ky){if(t.statics.blotName==="list-container"){const r=[];t.children.forEachAt(e,n,((t,e,n)=>{const i="formats"in t&&typeof t.formats==="function"?t.formats():{};r.push({child:t,offset:e,length:n,indent:i.indent||0,type:i.list})}));return Pk(r,-1,[])}const i=[];t.children.forEachAt(e,n,((t,e,n)=>{i.push(Wk(t,e,n))}));if(r||t.statics.blotName==="list"){return i.join("")}const{outerHTML:s,innerHTML:l}=t.domNode;const[o,u]=s.split(`>${l}<`);if(o==="<table"){return`<table style="border: 1px solid #000;">${i.join("")}<${u}`}return`${o}>${i.join("")}<${u}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function Zk(t,e){return Object.keys(e).reduce(((n,r)=>{if(t[r]==null)return n;const i=e[r];if(i===t[r]){n[r]=i}else if(Array.isArray(i)){if(i.indexOf(t[r])<0){n[r]=i.concat([t[r]])}else{n[r]=i}}else{n[r]=[i,t[r]]}return n}),{})}function Kk(t){const e=t==="ordered"?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Gk(t){return t.reduce(((t,e)=>{if(typeof e.insert==="string"){const n=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(n,e.attributes)}return t.push(e)}),new vk)}function Qk(t,e){let{index:n,length:r}=t;return new Dk(n+e,r)}function Yk(t){const e=[];t.forEach((t=>{if(typeof t.insert==="string"){const n=t.insert.split("\n");n.forEach(((n,r)=>{if(r)e.push({insert:"\n",attributes:t.attributes});if(n)e.push({insert:n,attributes:t.attributes})}))}else{e.push(t)}}));return e}class Jk{static DEFAULTS={};constructor(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.quill=t;this.options=e}}const Xk="\ufeff";class tx extends Sy{constructor(t,e){super(t,e);this.contentNode=document.createElement("span");this.contentNode.setAttribute("contenteditable","false");Array.from(this.domNode.childNodes).forEach((t=>{this.contentNode.appendChild(t)}));this.leftGuard=document.createTextNode(Xk);this.rightGuard=document.createTextNode(Xk);this.domNode.appendChild(this.leftGuard);this.domNode.appendChild(this.contentNode);this.domNode.appendChild(this.rightGuard)}index(t,e){if(t===this.leftGuard)return 0;if(t===this.rightGuard)return 1;return super.index(t,e)}restore(t){let e=null;let n;const r=t.data.split(Xk).join("");if(t===this.leftGuard){if(this.prev instanceof bk){const t=this.prev.length();this.prev.insertAt(t,r);e={startNode:this.prev.domNode,startOffset:t+r.length}}else{n=document.createTextNode(r);this.parent.insertBefore(this.scroll.create(n),this);e={startNode:n,startOffset:r.length}}}else if(t===this.rightGuard){if(this.next instanceof bk){this.next.insertAt(0,r);e={startNode:this.next.domNode,startOffset:r.length}}else{n=document.createTextNode(r);this.parent.insertBefore(this.scroll.create(n),this.next);e={startNode:n,startOffset:r.length}}}t.data=Xk;return e}update(t,e){t.forEach((t=>{if(t.type==="characterData"&&(t.target===this.leftGuard||t.target===this.rightGuard)){const n=this.restore(t.target);if(n)e.range=n}}))}}class ex{isComposing=false;constructor(t,e){this.scroll=t;this.emitter=e;this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(t=>{if(!this.isComposing){this.handleCompositionStart(t)}}));this.scroll.domNode.addEventListener("compositionend",(t=>{if(this.isComposing){queueMicrotask((()=>{this.handleCompositionEnd(t)}))}}))}handleCompositionStart(t){const e=t.target instanceof Node?this.scroll.find(t.target,true):null;if(e&&!(e instanceof tx)){this.emitter.emit(Ck.events.COMPOSITION_BEFORE_START,t);this.scroll.batchStart();this.emitter.emit(Ck.events.COMPOSITION_START,t);this.isComposing=true}}handleCompositionEnd(t){this.emitter.emit(Ck.events.COMPOSITION_BEFORE_END,t);this.scroll.batchEnd();this.emitter.emit(Ck.events.COMPOSITION_END,t);this.isComposing=false}}class nx{static DEFAULTS={modules:{}};static themes={default:nx};modules={};constructor(t,e){this.quill=t;this.options=e}init(){Object.keys(this.options.modules).forEach((t=>{if(this.modules[t]==null){this.addModule(t)}}))}addModule(t){const e=this.quill.constructor.import(`modules/${t}`);this.modules[t]=new e(this.quill,this.options.modules[t]||{});return this.modules[t]}}const rx=t=>t.parentElement||t.getRootNode().host||null;const ix=t=>{const e=t.getBoundingClientRect();const n="offsetWidth"in t&&Math.abs(e.width)/t.offsetWidth||1;const r="offsetHeight"in t&&Math.abs(e.height)/t.offsetHeight||1;return{top:e.top,right:e.left+t.clientWidth*n,bottom:e.top+t.clientHeight*r,left:e.left}};const sx=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e};const lx=(t,e,n,r,i,s)=>{if(t<n&&e>r){return 0}if(t<n){return-(n-t+i)}if(e>r){return e-t>r-n?t+i-n:e-r+s}return 0};const ox=(t,e)=>{const n=t.ownerDocument;let r=e;let i=t;while(i){const t=i===n.body;const e=t?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:ix(i);const s=getComputedStyle(i);const l=lx(r.left,r.right,e.left,e.right,sx(s.scrollPaddingLeft),sx(s.scrollPaddingRight));const o=lx(r.top,r.bottom,e.top,e.bottom,sx(s.scrollPaddingTop),sx(s.scrollPaddingBottom));if(l||o){if(t){n.defaultView?.scrollBy(l,o)}else{const{scrollLeft:t,scrollTop:e}=i;if(o){i.scrollTop+=o}if(l){i.scrollLeft+=l}const n=i.scrollLeft-t;const s=i.scrollTop-e;r={left:r.left-n,top:r.top-s,right:r.right-n,bottom:r.bottom-s}}}i=t||s.position==="fixed"?null:rx(i)}};const ux=100;const ax=["block","break","cursor","inline","scroll","text"];const cx=(t,e,n)=>{const r=new iy;ax.forEach((t=>{const n=e.query(t);if(n)r.register(n)}));t.forEach((t=>{let i=e.query(t);if(!i){n.error(`Cannot register "${t}" specified in "formats" config. Are you sure it was registered?`)}let s=0;while(i){r.register(i);i="blotName"in i?i.requiredContainer??null:null;s+=1;if(s>ux){n.error(`Cycle detected in registering blot requiredContainer: "${t}"`);break}}}));return r};const fx=zk("quill");const hx=new iy;ky.uiClass="ql-ui";class dx{static DEFAULTS={bounds:null,modules:{clipboard:true,keyboard:true,history:true,uploader:true},placeholder:"",readOnly:false,registry:hx,theme:"default"};static events=Ck.events;static sources=Ck.sources;static version="2.0.3";static imports={delta:vk,parchment:Uy,"core/module":Jk,"core/theme":nx};static debug(t){if(t===true){t="log"}zk.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return Nk.get(t)||hx.find(t,e)}static import(t){if(this.imports[t]==null){fx.error(`Cannot import ${t}. Are you sure it was registered?`)}return this.imports[t]}static register(){if(typeof(arguments.length<=0?undefined:arguments[0])!=="string"){const t=arguments.length<=0?undefined:arguments[0];const e=!!(arguments.length<=1?undefined:arguments[1]);const n="attrName"in t?t.attrName:t.blotName;if(typeof n==="string"){this.register(`formats/${n}`,t,e)}else{Object.keys(t).forEach((n=>{this.register(n,t[n],e)}))}}else{const t=arguments.length<=0?undefined:arguments[0];const e=arguments.length<=1?undefined:arguments[1];const n=!!(arguments.length<=2?undefined:arguments[2]);if(this.imports[t]!=null&&!n){fx.warn(`Overwriting ${t} with`,e)}this.imports[t]=e;if((t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!=="boolean"&&e.blotName!=="abstract"){hx.register(e)}if(typeof e.register==="function"){e.register(hx)}}}constructor(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.options=qx(t,e);this.container=this.options.container;if(this.container==null){fx.error("Invalid Quill container",t);return}if(this.options.debug){dx.debug(this.options.debug)}const n=this.container.innerHTML.trim();this.container.classList.add("ql-container");this.container.innerHTML="";Nk.set(this.container,this);this.root=this.addContainer("ql-editor");this.root.classList.add("ql-blank");this.emitter=new Ck;const r=By.blotName;const i=this.options.registry.query(r);if(!i||!("blotName"in i)){throw new Error(`Cannot initialize Quill without "${r}" blot`)}this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter});this.editor=new Fk(this.scroll);this.selection=new Hk(this.scroll,this.emitter);this.composition=new ex(this.scroll,this.emitter);this.theme=new this.options.theme(this,this.options);this.keyboard=this.theme.addModule("keyboard");this.clipboard=this.theme.addModule("clipboard");this.history=this.theme.addModule("history");this.uploader=this.theme.addModule("uploader");this.theme.addModule("input");this.theme.addModule("uiNode");this.theme.init();this.emitter.on(Ck.events.EDITOR_CHANGE,(t=>{if(t===Ck.events.TEXT_CHANGE){this.root.classList.toggle("ql-blank",this.editor.isBlank())}}));this.emitter.on(Ck.events.SCROLL_UPDATE,((t,e)=>{const n=this.selection.lastRange;const[r]=this.selection.getRange();const i=n&&r?{oldRange:n,newRange:r}:undefined;wx.call(this,(()=>this.editor.update(null,e,i)),t)}));this.emitter.on(Ck.events.SCROLL_EMBED_UPDATE,((t,e)=>{const n=this.selection.lastRange;const[r]=this.selection.getRange();const i=n&&r?{oldRange:n,newRange:r}:undefined;wx.call(this,(()=>{const n=(new vk).retain(t.offset(this)).retain({[t.statics.blotName]:e});return this.editor.update(n,[],i)}),dx.sources.USER)}));if(n){const t=this.clipboard.convert({html:`${n}<p><br></p>`,text:"\n"});this.setContents(t)}this.history.clear();if(this.options.placeholder){this.root.setAttribute("data-placeholder",this.options.placeholder)}if(this.options.readOnly){this.disable()}this.allowReadOnlyEdits=false}addContainer(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(typeof t==="string"){const e=t;t=document.createElement("div");t.classList.add(e)}this.container.insertBefore(t,e);return t}blur(){this.selection.setRange(null)}deleteText(t,e,n){[t,e,,n]=mx(t,e,n);return wx.call(this,(()=>this.editor.deleteText(t,e)),n,t,-1*e)}disable(){this.enable(false)}editReadOnly(t){this.allowReadOnlyEdits=true;const e=t();this.allowReadOnlyEdits=false;return e}enable(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.scroll.enable(t);this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.selection.focus();if(!t.preventScroll){this.scrollSelectionIntoView()}}format(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:Ck.sources.API;return wx.call(this,(()=>{const n=this.getSelection(true);let r=new vk;if(n==null)return r;if(this.scroll.query(t,ty.BLOCK)){r=this.editor.formatLine(n.index,n.length,{[t]:e})}else if(n.length===0){this.selection.format(t,e);return r}else{r=this.editor.formatText(n.index,n.length,{[t]:e})}this.setSelection(n,Ck.sources.SILENT);return r}),n)}formatLine(t,e,n,r,i){let s;[t,e,s,i]=mx(t,e,n,r,i);return wx.call(this,(()=>this.editor.formatLine(t,e,s)),i,t,0)}formatText(t,e,n,r,i){let s;[t,e,s,i]=mx(t,e,n,r,i);return wx.call(this,(()=>this.editor.formatText(t,e,s)),i,t,0)}getBounds(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;let n=null;if(typeof t==="number"){n=this.selection.getBounds(t,e)}else{n=this.selection.getBounds(t.index,t.length)}if(!n)return null;const r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.getLength()-t;[t,e]=mx(t,e);return this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.getSelection(true);let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(typeof t==="number"){return this.editor.getFormat(t,e)}return this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Number.MAX_VALUE;if(typeof t!=="number"){return this.scroll.lines(t.index,t.length)}return this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(t)this.focus();this.update();return this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;let e=arguments.length>1?arguments[1]:undefined;if(typeof t==="number"){e=e??this.getLength()-t}[t,e]=mx(t,e);return this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;let e=arguments.length>1?arguments[1]:undefined;if(typeof t==="number"){e=e??this.getLength()-t}[t,e]=mx(t,e);return this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,n){let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:dx.sources.API;return wx.call(this,(()=>this.editor.insertEmbed(t,e,n)),r,t)}insertText(t,e,n,r,i){let s;[t,,s,i]=mx(t,0,n,r,i);return wx.call(this,(()=>this.editor.insertText(t,e,s)),i,t,e.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(t,e,n){[t,e,,n]=mx(t,e,n);return wx.call(this,(()=>this.editor.removeFormat(t,e)),n,t)}scrollRectIntoView(t){ox(this.root,t)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.");this.scrollSelectionIntoView()}scrollSelectionIntoView(){const t=this.selection.lastRange;const e=t&&this.selection.getBounds(t.index,t.length);if(e){this.scrollRectIntoView(e)}}setContents(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Ck.sources.API;return wx.call(this,(()=>{t=new vk(t);const e=this.getLength();const n=this.editor.deleteText(0,e);const r=this.editor.insertContents(0,t);const i=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(i)}),e)}setSelection(t,e,n){if(t==null){this.selection.setRange(null,e||dx.sources.API)}else{[t,e,,n]=mx(t,e,n);this.selection.setRange(new Dk(Math.max(0,t),e),n);if(n!==Ck.sources.SILENT){this.scrollSelectionIntoView()}}}setText(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Ck.sources.API;const n=(new vk).insert(t);return this.setContents(n,e)}update(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Ck.sources.USER;const e=this.scroll.update(t);this.selection.update(t);return e}updateContents(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Ck.sources.API;return wx.call(this,(()=>{t=new vk(t);return this.editor.applyDelta(t)}),e,true)}}function vx(t){return typeof t==="string"?document.querySelector(t):t}function px(t){return Object.entries(t??{}).reduce(((t,e)=>{let[n,r]=e;return{...t,[n]:r===true?{}:r}}),{})}function bx(t){return Object.fromEntries(Object.entries(t).filter((t=>t[1]!==undefined)))}function qx(t,e){const n=vx(t);if(!n){throw new Error("Invalid Quill container")}const r=!e.theme||e.theme===dx.DEFAULTS.theme;const i=r?nx:dx.import(`themes/${e.theme}`);if(!i){throw new Error(`Invalid theme ${e.theme}. Did you register it?`)}const{modules:s,...l}=dx.DEFAULTS;const{modules:o,...u}=i.DEFAULTS;let a=px(e.modules);if(a!=null&&a.toolbar&&a.toolbar.constructor!==Object){a={...a,toolbar:{container:a.toolbar}}}const c=yp({},px(s),px(o),a);const f={...l,...bx(u),...bx(e)};let h=e.registry;if(h){if(e.formats){fx.warn('Ignoring "formats" option because "registry" is specified')}}else{h=e.formats?cx(e.formats,f.registry,fx):f.registry}return{...f,registry:h,container:n,theme:i,modules:Object.entries(c).reduce(((t,e)=>{let[n,r]=e;if(!r)return t;const i=dx.import(`modules/${n}`);if(i==null){fx.error(`Cannot load ${n} module. Are you sure you registered it?`);return t}return{...t,[n]:yp({},i.DEFAULTS||{},r)}}),{}),bounds:vx(f.bounds)}}function wx(t,e,n,r){if(!this.isEnabled()&&e===Ck.sources.USER&&!this.allowReadOnlyEdits){return new vk}let i=n==null?null:this.getSelection();const s=this.editor.delta;const l=t();if(i!=null){if(n===true){n=i.index}if(r==null){i=gx(i,l,e)}else if(r!==0){i=gx(i,n,r,e)}this.setSelection(i,Ck.sources.SILENT)}if(l.length()>0){const t=[Ck.events.TEXT_CHANGE,l,s,e];this.emitter.emit(Ck.events.EDITOR_CHANGE,...t);if(e!==Ck.sources.SILENT){this.emitter.emit(...t)}}return l}function mx(t,e,n,r,i){let s={};if(typeof t.index==="number"&&typeof t.length==="number"){if(typeof e!=="number"){i=r;r=n;n=e;e=t.length;t=t.index}else{e=t.length;t=t.index}}else if(typeof e!=="number"){i=r;r=n;n=e;e=0}if(typeof n==="object"){s=n;i=r}else if(typeof n==="string"){if(r!=null){s[n]=r}else{i=n}}i=i||Ck.sources.API;return[t,e,s,i]}function gx(t,e,n,r){const i=typeof n==="number"?n:0;if(t==null)return null;let s;let l;if(e&&typeof e.transformPosition==="function"){[s,l]=[t.index,t.index+t.length].map((t=>e.transformPosition(t,r!==Ck.sources.USER)))}else{[s,l]=[t.index,t.index+t.length].map((t=>{if(t<e||t===e&&r===Ck.sources.USER)return t;if(i>=0){return t+i}return Math.max(e,t+i)}))}return new Dk(s,l-s)}class yx extends Ly{}function kx(t){return t instanceof yk||t instanceof kk}function xx(t){return typeof t.updateContent==="function"}class jx extends By{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=yk;static allowedChildren=[yk,kk,yx];constructor(t,e,n){let{emitter:r}=n;super(t,e);this.emitter=r;this.batch=false;this.optimize();this.enable();this.domNode.addEventListener("dragstart",(t=>this.handleDragStart(t)))}batchStart(){if(!Array.isArray(this.batch)){this.batch=[]}}batchEnd(){if(!this.batch)return;const t=this.batch;this.batch=false;this.update(t)}emitMount(t){this.emitter.emit(Ck.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(Ck.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(Ck.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[n,r]=this.line(t);const[i]=this.line(t+e);super.deleteAt(t,e);if(i!=null&&n!==i&&r>0){if(n instanceof kk||i instanceof kk){this.optimize();return}const t=i.children.head instanceof pk?null:i.children.head;n.moveChildren(i,t);n.remove()}this.optimize()}enable(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,e,n,r){super.formatAt(t,e,n,r);this.optimize()}insertAt(t,e,n){if(t>=this.length()){if(n==null||this.scroll.query(e,ty.BLOCK)==null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t);if(n==null&&e.endsWith("\n")){t.insertAt(0,e.slice(0,-1),n)}else{t.insertAt(0,e,n)}}else{const t=this.scroll.create(e,n);this.appendChild(t)}}else{super.insertAt(t,e,n)}this.optimize()}insertBefore(t,e){if(t.statics.scope===ty.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(t);super.insertBefore(n,e)}else{super.insertBefore(t,e)}}insertContents(t,e){const n=this.deltaToRenderBlocks(e.concat((new vk).insert("\n")));const r=n.pop();if(r==null)return;this.batchStart();const i=n.shift();if(i){const e=i.type==="block"&&(i.delta.length()===0||!this.descendant(kk,t)[0]&&t<this.length());const n=i.type==="block"?i.delta:(new vk).insert({[i.key]:i.value});Ax(this,t,n);const r=i.type==="block"?1:0;const s=t+n.length()+r;if(e){this.insertAt(s-1,"\n")}const l=jk(this.line(t)[0]);const o=dk.AttributeMap.diff(l,i.attributes)||{};Object.keys(o).forEach((t=>{this.formatAt(s-1,1,t,o[t])}));t=s}let[s,l]=this.children.find(t);if(n.length){if(s){s=s.split(l);l=0}n.forEach((t=>{if(t.type==="block"){const e=this.createBlock(t.attributes,s||undefined);Ax(e,0,t.delta)}else{const e=this.create(t.key,t.value);this.insertBefore(e,s||undefined);Object.keys(t.attributes).forEach((n=>{e.format(n,t.attributes[n])}))}}))}if(r.type==="block"&&r.delta.length()){const t=s?s.offset(s.scroll)+l:this.length();Ax(this,t,r.delta)}this.batchEnd();this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(t){const e=this.path(t).pop();if(!e){return[null,-1]}const[n,r]=e;return n instanceof qy?[n,r]:[null,-1]}line(t){if(t===this.length()){return this.line(t-1)}return this.descendant(kx,t)}lines(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Number.MAX_VALUE;const n=(t,e,r)=>{let i=[];let s=r;t.children.forEachAt(e,r,((t,e,r)=>{if(kx(t)){i.push(t)}else if(t instanceof Ly){i=i.concat(n(t,e,s))}s-=r}));return i};return n(this,t,e)}optimize(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.batch)return;super.optimize(t,e);if(t.length>0){this.emitter.emit(Ck.events.SCROLL_OPTIMIZE,t,e)}}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch){if(Array.isArray(t)){this.batch=this.batch.concat(t)}return}let e=Ck.sources.USER;if(typeof t==="string"){e=t}if(!Array.isArray(t)){t=this.observer.takeRecords()}t=t.filter((t=>{let{target:e}=t;const n=this.find(e,true);return n&&!xx(n)}));if(t.length>0){this.emitter.emit(Ck.events.SCROLL_BEFORE_UPDATE,e,t)}super.update(t.concat([]));if(t.length>0){this.emitter.emit(Ck.events.SCROLL_UPDATE,e,t)}}updateEmbedAt(t,e,n){const[r]=this.descendant((t=>t instanceof kk),t);if(r&&r.statics.blotName===e&&xx(r)){r.updateContent(n)}}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let n=new vk;t.forEach((t=>{const r=t?.insert;if(!r)return;if(typeof r==="string"){const i=r.split("\n");i.slice(0,-1).forEach((r=>{n.insert(r,t.attributes);e.push({type:"block",delta:n,attributes:t.attributes??{}});n=new vk}));const s=i[i.length-1];if(s){n.insert(s,t.attributes)}}else{const i=Object.keys(r)[0];if(!i)return;if(this.query(i,ty.INLINE)){n.push(t)}else{if(n.length()){e.push({type:"block",delta:n,attributes:{}})}n=new vk;e.push({type:"blockEmbed",key:i,value:r[i],attributes:t.attributes??{}})}}}));if(n.length()){e.push({type:"block",delta:n,attributes:{}})}return e}createBlock(t,e){let n;const r={};Object.entries(t).forEach((t=>{let[e,i]=t;const s=this.query(e,ty.BLOCK&ty.BLOT)!=null;if(s){n=e}else{r[e]=i}}));const i=this.create(n||this.statics.defaultChild.blotName,n?t[n]:undefined);this.insertBefore(i,e||undefined);const s=i.length();Object.entries(r).forEach((t=>{let[e,n]=t;i.formatAt(0,s,e,n)}));return i}}function Ax(t,e,n){n.reduce(((e,n)=>{const r=dk.Op.length(n);let i=n.attributes||{};if(n.insert!=null){if(typeof n.insert==="string"){const r=n.insert;t.insertAt(e,r);const[s]=t.descendant(qy,e);const l=jk(s);i=dk.AttributeMap.diff(l,i)||{}}else if(typeof n.insert==="object"){const r=Object.keys(n.insert)[0];if(r==null)return e;t.insertAt(e,r,n.insert[r]);const s=t.scroll.query(r,ty.INLINE)!=null;if(s){const[n]=t.descendant(qy,e);const r=jk(n);i=dk.AttributeMap.diff(r,i)||{}}}}Object.keys(i).forEach((n=>{t.formatAt(e,r,n,i[n])}));return e+r}),e)}const Ox={scope:ty.BLOCK,whitelist:["right","center","justify"]};const Mx=new ey("align","align",Ox);const Ex=new oy("align","ql-align",Ox);const _x=new cy("align","text-align",Ox);class Tx extends cy{value(t){let e=super.value(t);if(!e.startsWith("rgb("))return e;e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");const n=e.split(",").map((t=>`00${parseInt(t,10).toString(16)}`.slice(-2))).join("");return`#${n}`}}const Nx=new oy("color","ql-color",{scope:ty.INLINE});const Lx=new Tx("color","color",{scope:ty.INLINE});const $x=new oy("background","ql-bg",{scope:ty.INLINE});const Sx=new Tx("background","background-color",{scope:ty.INLINE});class zx extends yx{static create(t){const e=super.create(t);e.setAttribute("spellcheck","false");return e}code(t,e){return this.children.map((t=>t.length()<=1?"":t.domNode.innerText)).join("\n").slice(t,t+e)}html(t,e){return`<pre>\n${wk(this.code(t,e))}\n</pre>`}}class Rx extends yk{static TAB=" ";static register(){dx.register(zx)}}class Ix extends mk{}Ix.blotName="code";Ix.tagName="CODE";Rx.blotName="code-block";Rx.className="ql-code-block";Rx.tagName="DIV";zx.blotName="code-block-container";zx.className="ql-code-block-container";zx.tagName="DIV";zx.allowedChildren=[Rx];Rx.allowedChildren=[bk,pk,Ak];Rx.requiredContainer=zx;const Cx={scope:ty.BLOCK,whitelist:["rtl"]};const Bx=new ey("direction","dir",Cx);const Dx=new oy("direction","ql-direction",Cx);const Hx=new cy("direction","direction",Cx);const Vx={scope:ty.INLINE,whitelist:["serif","monospace"]};const Ux=new oy("font","ql-font",Vx);class Fx extends cy{value(t){return super.value(t).replace(/["']/g,"")}}const Px=new Fx("font","font-family",Vx);const Wx=new oy("size","ql-size",{scope:ty.INLINE,whitelist:["small","large","huge"]});const Zx=new cy("size","font-size",{scope:ty.INLINE,whitelist:["10px","18px","32px"]});const Kx=zk("quill:keyboard");const Gx=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Qx extends Jk{static match(t,e){if(["altKey","ctrlKey","metaKey","shiftKey"].some((n=>!!e[n]!==t[n]&&e[n]!==null))){return false}return e.key===t.key||e.key===t.which}constructor(t,e){super(t,e);this.bindings={};Object.keys(this.options.bindings).forEach((t=>{if(this.options.bindings[t]){this.addBinding(this.options.bindings[t])}}));this.addBinding({key:"Enter",shiftKey:null},this.handleEnter);this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{}));if(/Firefox/i.test(navigator.userAgent)){this.addBinding({key:"Backspace"},{collapsed:true},this.handleBackspace);this.addBinding({key:"Delete"},{collapsed:true},this.handleDelete)}else{this.addBinding({key:"Backspace"},{collapsed:true,prefix:/^.?$/},this.handleBackspace);this.addBinding({key:"Delete"},{collapsed:true,suffix:/^.?$/},this.handleDelete)}this.addBinding({key:"Backspace"},{collapsed:false},this.handleDeleteRange);this.addBinding({key:"Delete"},{collapsed:false},this.handleDeleteRange);this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:true,offset:0},this.handleBackspace);this.listen()}addBinding(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};const r=nj(t);if(r==null){Kx.warn("Attempted to add invalid keyboard binding",r);return}if(typeof e==="function"){e={handler:e}}if(typeof n==="function"){n={handler:n}}const i=Array.isArray(r.key)?r.key:[r.key];i.forEach((t=>{const i={...r,key:t,...e,...n};this.bindings[i.key]=this.bindings[i.key]||[];this.bindings[i.key].push(i)}))}listen(){this.quill.root.addEventListener("keydown",(t=>{if(t.defaultPrevented||t.isComposing)return;const e=t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace");if(e)return;const n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]);const r=n.filter((e=>Qx.match(t,e)));if(r.length===0)return;const i=dx.find(t.target,true);if(i&&i.scroll!==this.quill.scroll)return;const s=this.quill.getSelection();if(s==null||!this.quill.hasFocus())return;const[l,o]=this.quill.getLine(s.index);const[u,a]=this.quill.getLeaf(s.index);const[c,f]=s.length===0?[u,a]:this.quill.getLeaf(s.index+s.length);const h=u instanceof Vy?u.value().slice(0,a):"";const d=c instanceof Vy?c.value().slice(f):"";const v={collapsed:s.length===0,empty:s.length===0&&l.length()<=1,format:this.quill.getFormat(s),line:l,offset:o,prefix:h,suffix:d,event:t};const p=r.some((t=>{if(t.collapsed!=null&&t.collapsed!==v.collapsed){return false}if(t.empty!=null&&t.empty!==v.empty){return false}if(t.offset!=null&&t.offset!==v.offset){return false}if(Array.isArray(t.format)){if(t.format.every((t=>v.format[t]==null))){return false}}else if(typeof t.format==="object"){if(!Object.keys(t.format).every((e=>{if(t.format[e]===true)return v.format[e]!=null;if(t.format[e]===false)return v.format[e]==null;return mv(t.format[e],v.format[e])}))){return false}}if(t.prefix!=null&&!t.prefix.test(v.prefix)){return false}if(t.suffix!=null&&!t.suffix.test(v.suffix)){return false}return t.handler.call(this,s,v,t)!==true}));if(p){t.preventDefault()}}))}handleBackspace(t,e){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(t.index===0||this.quill.getLength()<=1)return;let r={};const[i]=this.quill.getLine(t.index);let s=(new vk).retain(t.index-n).delete(n);if(e.offset===0){const[e]=this.quill.getLine(t.index-1);if(e){const n=e.statics.blotName==="block"&&e.length()<=1;if(!n){const e=i.formats();const n=this.quill.getFormat(t.index-1,1);r=dk.AttributeMap.diff(e,n)||{};if(Object.keys(r).length>0){const e=(new vk).retain(t.index+i.length()-2).retain(1,r);s=s.compose(e)}}}}this.quill.updateContents(s,dx.sources.USER);this.quill.focus()}handleDelete(t,e){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-n)return;let r={};const[i]=this.quill.getLine(t.index);let s=(new vk).retain(t.index).delete(n);if(e.offset>=i.length()-1){const[e]=this.quill.getLine(t.index+1);if(e){const n=i.formats();const l=this.quill.getFormat(t.index,1);r=dk.AttributeMap.diff(n,l)||{};if(Object.keys(r).length>0){s=s.retain(e.length()-1).retain(1,r)}}}this.quill.updateContents(s,dx.sources.USER);this.quill.focus()}handleDeleteRange(t){rj({range:t,quill:this.quill});this.quill.focus()}handleEnter(t,e){const n=Object.keys(e.format).reduce(((t,n)=>{if(this.quill.scroll.query(n,ty.BLOCK)&&!Array.isArray(e.format[n])){t[n]=e.format[n]}return t}),{});const r=(new vk).retain(t.index).delete(t.length).insert("\n",n);this.quill.updateContents(r,dx.sources.USER);this.quill.setSelection(t.index+1,dx.sources.SILENT);this.quill.focus()}}const Yx={bindings:{bold:tj("bold"),italic:tj("italic"),underline:tj("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){if(e.collapsed&&e.offset!==0)return true;this.quill.format("indent","+1",dx.sources.USER);return false}},outdent:{key:"Tab",shiftKey:true,format:["blockquote","indent","list"],handler(t,e){if(e.collapsed&&e.offset!==0)return true;this.quill.format("indent","-1",dx.sources.USER);return false}},"outdent backspace":{key:"Backspace",collapsed:true,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){if(e.format.indent!=null){this.quill.format("indent","-1",dx.sources.USER)}else if(e.format.list!=null){this.quill.format("list",false,dx.sources.USER)}}},"indent code-block":Jx(true),"outdent code-block":Jx(false),"remove tab":{key:"Tab",shiftKey:true,collapsed:true,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,dx.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return true;this.quill.history.cutoff();const n=(new vk).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(n,dx.sources.USER);this.quill.history.cutoff();this.quill.setSelection(t.index+1,dx.sources.SILENT);return false}},"blockquote empty enter":{key:"Enter",collapsed:true,format:["blockquote"],empty:true,handler(){this.quill.format("blockquote",false,dx.sources.USER)}},"list empty enter":{key:"Enter",collapsed:true,format:["list"],empty:true,handler(t,e){const n={list:false};if(e.format.indent){n.indent=false}this.quill.formatLine(t.index,t.length,n,dx.sources.USER)}},"checklist enter":{key:"Enter",collapsed:true,format:{list:"checked"},handler(t){const[e,n]=this.quill.getLine(t.index);const r={...e.formats(),list:"checked"};const i=(new vk).retain(t.index).insert("\n",r).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,dx.sources.USER);this.quill.setSelection(t.index+1,dx.sources.SILENT);this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:true,format:["header"],suffix:/^$/,handler(t,e){const[n,r]=this.quill.getLine(t.index);const i=(new vk).retain(t.index).insert("\n",e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,dx.sources.USER);this.quill.setSelection(t.index+1,dx.sources.SILENT);this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:true,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:true,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(t){const e=this.quill.getModule("table");if(e){const[n,r,i,s]=e.getTable(t);const l=ij(n,r,i,s);if(l==null)return;let o=n.offset();if(l<0){const e=(new vk).retain(o).insert("\n");this.quill.updateContents(e,dx.sources.USER);this.quill.setSelection(t.index+1,t.length,dx.sources.SILENT)}else if(l>0){o+=n.length();const t=(new vk).retain(o).insert("\n");this.quill.updateContents(t,dx.sources.USER);this.quill.setSelection(o,dx.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:n,line:r}=e;const i=r.offset(this.quill.scroll);if(n.shiftKey){this.quill.setSelection(i-1,dx.sources.USER)}else{this.quill.setSelection(i+r.length(),dx.sources.USER)}}},"list autofill":{key:" ",shiftKey:null,collapsed:true,format:{"code-block":false,blockquote:false,table:false},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(this.quill.scroll.query("list")==null)return true;const{length:n}=e.prefix;const[r,i]=this.quill.getLine(t.index);if(i>n)return true;let s;switch(e.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(t.index," ",dx.sources.USER);this.quill.history.cutoff();const l=(new vk).retain(t.index-i).delete(n+1).retain(r.length()-2-i).retain(1,{list:s});this.quill.updateContents(l,dx.sources.USER);this.quill.history.cutoff();this.quill.setSelection(t.index-n,dx.sources.SILENT);return false}},"code exit":{key:"Enter",collapsed:true,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,n]=this.quill.getLine(t.index);let r=2;let i=e;while(i!=null&&i.length()<=1&&i.formats()["code-block"]){i=i.prev;r-=1;if(r<=0){const r=(new vk).retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(r,dx.sources.USER);this.quill.setSelection(t.index-1,dx.sources.SILENT);return false}}return true}},"embed left":Xx("ArrowLeft",false),"embed left shift":Xx("ArrowLeft",true),"embed right":Xx("ArrowRight",false),"embed right shift":Xx("ArrowRight",true),"table down":ej(false),"table up":ej(true)}};Qx.DEFAULTS=Yx;function Jx(t){return{key:"Tab",shiftKey:!t,format:{"code-block":true},handler(e,n){let{event:r}=n;const i=this.quill.scroll.query("code-block");const{TAB:s}=i;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,s,dx.sources.USER);this.quill.setSelection(e.index+s.length,dx.sources.SILENT);return}const l=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:u}=e;l.forEach(((e,n)=>{if(t){e.insertAt(0,s);if(n===0){o+=s.length}else{u+=s.length}}else if(e.domNode.textContent.startsWith(s)){e.deleteAt(0,s.length);if(n===0){o-=s.length}else{u-=s.length}}}));this.quill.update(dx.sources.USER);this.quill.setSelection(o,u,dx.sources.SILENT)}}}function Xx(t,e){const n=t==="ArrowLeft"?"prefix":"suffix";return{key:t,shiftKey:e,altKey:null,[n]:/^$/,handler(n){let{index:r}=n;if(t==="ArrowRight"){r+=n.length+1}const[i]=this.quill.getLeaf(r);if(!(i instanceof Sy))return true;if(t==="ArrowLeft"){if(e){this.quill.setSelection(n.index-1,n.length+1,dx.sources.USER)}else{this.quill.setSelection(n.index-1,dx.sources.USER)}}else if(e){this.quill.setSelection(n.index,n.length+1,dx.sources.USER)}else{this.quill.setSelection(n.index+n.length+1,dx.sources.USER)}return false}}}function tj(t){return{key:t[0],shortKey:true,handler(e,n){this.quill.format(t,!n.format[t],dx.sources.USER)}}}function ej(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:true,format:["table"],handler(e,n){const r=t?"prev":"next";const i=n.line;const s=i.parent[r];if(s!=null){if(s.statics.blotName==="table-row"){let t=s.children.head;let e=i;while(e.prev!=null){e=e.prev;t=t.next}const r=t.offset(this.quill.scroll)+Math.min(n.offset,t.length()-1);this.quill.setSelection(r,0,dx.sources.USER)}}else{const e=i.table()[r];if(e!=null){if(t){this.quill.setSelection(e.offset(this.quill.scroll)+e.length()-1,0,dx.sources.USER)}else{this.quill.setSelection(e.offset(this.quill.scroll),0,dx.sources.USER)}}}return false}}}function nj(t){if(typeof t==="string"||typeof t==="number"){t={key:t}}else if(typeof t==="object"){t=Sa(t)}else{return null}if(t.shortKey){t[Gx]=t.shortKey;delete t.shortKey}return t}function rj(t){let{quill:e,range:n}=t;const r=e.getLines(n);let i={};if(r.length>1){const t=r[0].formats();const e=r[r.length-1].formats();i=dk.AttributeMap.diff(e,t)||{}}e.deleteText(n,dx.sources.USER);if(Object.keys(i).length>0){e.formatLine(n.index,1,i,dx.sources.USER)}e.setSelection(n.index,dx.sources.SILENT)}function ij(t,e,n,r){if(e.prev==null&&e.next==null){if(n.prev==null&&n.next==null){return r===0?-1:1}return n.prev==null?-1:1}if(e.prev==null){return-1}if(e.next==null){return 1}return null}const sj=/font-weight:\s*normal/;const lj=["P","OL","UL"];const oj=t=>t&&lj.includes(t.tagName);const uj=t=>{Array.from(t.querySelectorAll("br")).filter((t=>oj(t.previousElementSibling)&&oj(t.nextElementSibling))).forEach((t=>{t.parentNode?.removeChild(t)}))};const aj=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter((t=>t.getAttribute("style")?.match(sj))).forEach((e=>{const n=t.createDocumentFragment();n.append(...e.childNodes);e.parentNode?.replaceChild(n,e)}))};function cj(t){if(t.querySelector('[id^="docs-internal-guid-"]')){aj(t);uj(t)}}const fj=/\bmso-list:[^;]*ignore/i;const hj=/\bmso-list:[^;]*\bl(\d+)/i;const dj=/\bmso-list:[^;]*\blevel(\d+)/i;const vj=(t,e)=>{const n=t.getAttribute("style");const r=n?.match(hj);if(!r){return null}const i=Number(r[1]);const s=n?.match(dj);const l=s?Number(s[1]):1;const o=new RegExp(`@list l${i}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i");const u=e.match(o);const a=u&&u[1]==="bullet"?"bullet":"ordered";return{id:i,indent:l,type:a,element:t}};const pj=t=>{const e=Array.from(t.querySelectorAll("[style*=mso-list]"));const n=[];const r=[];e.forEach((t=>{const e=(t.getAttribute("style")||"").match(fj);if(e){n.push(t)}else{r.push(t)}}));n.forEach((t=>t.parentNode?.removeChild(t)));const i=t.documentElement.innerHTML;const s=r.map((t=>vj(t,i))).filter((t=>t));while(s.length){const t=[];let e=s.shift();while(e){t.push(e);e=s.length&&s[0]?.element===e.element.nextElementSibling&&s[0].id===e.id?s.shift():null}const n=document.createElement("ul");t.forEach((t=>{const e=document.createElement("li");e.setAttribute("data-list",t.type);if(t.indent>1){e.setAttribute("class",`ql-indent-${t.indent-1}`)}e.innerHTML=t.element.innerHTML;n.appendChild(e)}));const r=t[0]?.element;const{parentNode:i}=r??{};if(r){i?.replaceChild(n,r)}t.slice(1).forEach((t=>{let{element:e}=t;i?.removeChild(e)}))}};function bj(t){if(t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"){pj(t)}}const qj=[bj,cj];const wj=t=>{if(t.documentElement){qj.forEach((e=>{e(t)}))}};const mj=zk("quill:clipboard");const gj=[[Node.TEXT_NODE,Vj],[Node.TEXT_NODE,Bj],["br",Sj],[Node.ELEMENT_NODE,Bj],[Node.ELEMENT_NODE,$j],[Node.ELEMENT_NODE,Lj],[Node.ELEMENT_NODE,Dj],["li",Ij],["ol, ul",Cj],["pre",zj],["tr",Hj],["b",Nj("bold")],["i",Nj("italic")],["strike",Nj("strike")],["style",Rj]];const yj=[Mx,Bx].reduce(((t,e)=>{t[e.keyName]=e;return t}),{});const kj=[_x,Sx,Lx,Hx,Px,Zx].reduce(((t,e)=>{t[e.keyName]=e;return t}),{});class xj extends Jk{static DEFAULTS={matchers:[]};constructor(t,e){super(t,e);this.quill.root.addEventListener("copy",(t=>this.onCaptureCopy(t,false)));this.quill.root.addEventListener("cut",(t=>this.onCaptureCopy(t,true)));this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this));this.matchers=[];gj.concat(this.options.matchers??[]).forEach((t=>{let[e,n]=t;this.addMatcher(e,n)}))}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:n}=t;let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(r[Rx.blotName]){return(new vk).insert(n||"",{[Rx.blotName]:r[Rx.blotName]})}if(!e){return(new vk).insert(n||"",r)}const i=this.convertHTML(e);if(Aj(i,"\n")&&(i.ops[i.ops.length-1].attributes==null||r.table)){return i.compose((new vk).retain(i.length()-1).delete(1))}return i}normalizeHTML(t){wj(t)}convertHTML(t){const e=(new DOMParser).parseFromString(t,"text/html");this.normalizeHTML(e);const n=e.body;const r=new WeakMap;const[i,s]=this.prepareMatching(n,r);return Tj(this.quill.scroll,n,i,s,r)}dangerouslyPasteHTML(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:dx.sources.API;if(typeof t==="string"){const n=this.convert({html:t,text:""});this.quill.setContents(n,e);this.quill.setSelection(0,dx.sources.SILENT)}else{const r=this.convert({html:e,text:""});this.quill.updateContents((new vk).retain(t).concat(r),n);this.quill.setSelection(t+r.length(),dx.sources.SILENT)}}onCaptureCopy(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(t.defaultPrevented)return;t.preventDefault();const[n]=this.quill.selection.getRange();if(n==null)return;const{html:r,text:i}=this.onCopy(n,e);t.clipboardData?.setData("text/plain",i);t.clipboardData?.setData("text/html",r);if(e){rj({range:n,quill:this.quill})}}normalizeURIList(t){return t.split(/\r?\n/).filter((t=>t[0]!=="#")).join("\n")}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(true);if(e==null)return;const n=t.clipboardData?.getData("text/html");let r=t.clipboardData?.getData("text/plain");if(!n&&!r){const e=t.clipboardData?.getData("text/uri-list");if(e){r=this.normalizeURIList(e)}}const i=Array.from(t.clipboardData?.files||[]);if(!n&&i.length>0){this.quill.uploader.upload(e,i);return}if(n&&i.length>0){const t=(new DOMParser).parseFromString(n,"text/html");if(t.body.childElementCount===1&&t.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(e,i);return}}this.onPaste(e,{html:n,text:r})}onCopy(t){const e=this.quill.getText(t);const n=this.quill.getSemanticHTML(t);return{html:n,text:e}}onPaste(t,e){let{text:n,html:r}=e;const i=this.quill.getFormat(t.index);const s=this.convert({text:n,html:r},i);mj.log("onPaste",s,{text:n,html:r});const l=(new vk).retain(t.index).delete(t.length).concat(s);this.quill.updateContents(l,dx.sources.USER);this.quill.setSelection(l.length()-t.length,dx.sources.SILENT);this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const n=[];const r=[];this.matchers.forEach((i=>{const[s,l]=i;switch(s){case Node.TEXT_NODE:r.push(l);break;case Node.ELEMENT_NODE:n.push(l);break;default:Array.from(t.querySelectorAll(s)).forEach((t=>{if(e.has(t)){const n=e.get(t);n?.push(l)}else{e.set(t,[l])}}));break}}));return[n,r]}}function jj(t,e,n,r){if(!r.query(e)){return t}return t.reduce(((t,r)=>{if(!r.insert)return t;if(r.attributes&&r.attributes[e]){return t.push(r)}const i=n?{[e]:n}:{};return t.insert(r.insert,{...i,...r.attributes})}),new vk)}function Aj(t,e){let n="";for(let r=t.ops.length-1;r>=0&&n.length<e.length;--r){const e=t.ops[r];if(typeof e.insert!=="string")break;n=e.insert+n}return n.slice(-1*e.length)===e}function Oj(t,e){if(!(t instanceof Element))return false;const n=e.query(t);if(n&&n.prototype instanceof Sy)return false;return["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(t.tagName.toLowerCase())}function Mj(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Oj(t.previousElementSibling,e)&&!Oj(t.nextElementSibling,e)}const Ej=new WeakMap;function _j(t){if(t==null)return false;if(!Ej.has(t)){if(t.tagName==="PRE"){Ej.set(t,true)}else{Ej.set(t,_j(t.parentNode))}}return Ej.get(t)}function Tj(t,e,n,r,i){if(e.nodeType===e.TEXT_NODE){return r.reduce(((n,r)=>r(e,n,t)),new vk)}if(e.nodeType===e.ELEMENT_NODE){return Array.from(e.childNodes||[]).reduce(((s,l)=>{let o=Tj(t,l,n,r,i);if(l.nodeType===e.ELEMENT_NODE){o=n.reduce(((e,n)=>n(l,e,t)),o);o=(i.get(l)||[]).reduce(((e,n)=>n(l,e,t)),o)}return s.concat(o)}),new vk)}return new vk}function Nj(t){return(e,n,r)=>jj(n,t,true,r)}function Lj(t,e,n){const r=ey.keys(t);const i=oy.keys(t);const s=cy.keys(t);const l={};r.concat(i).concat(s).forEach((e=>{let r=n.query(e,ty.ATTRIBUTE);if(r!=null){l[r.attrName]=r.value(t);if(l[r.attrName])return}r=yj[e];if(r!=null&&(r.attrName===e||r.keyName===e)){l[r.attrName]=r.value(t)||undefined}r=kj[e];if(r!=null&&(r.attrName===e||r.keyName===e)){r=kj[e];l[r.attrName]=r.value(t)||undefined}}));return Object.entries(l).reduce(((t,e)=>{let[r,i]=e;return jj(t,r,i,n)}),e)}function $j(t,e,n){const r=n.query(t);if(r==null)return e;if(r.prototype instanceof Sy){const e={};const i=r.value(t);if(i!=null){e[r.blotName]=i;return(new vk).insert(e,r.formats(t,n))}}else{if(r.prototype instanceof _y&&!Aj(e,"\n")){e.insert("\n")}if("blotName"in r&&"formats"in r&&typeof r.formats==="function"){return jj(e,r.blotName,r.formats(t,n),n)}}return e}function Sj(t,e){if(!Aj(e,"\n")){e.insert("\n")}return e}function zj(t,e,n){const r=n.query("code-block");const i=r&&"formats"in r&&typeof r.formats==="function"?r.formats(t,n):true;return jj(e,"code-block",i,n)}function Rj(){return new vk}function Ij(t,e,n){const r=n.query(t);if(r==null||r.blotName!=="list"||!Aj(e,"\n")){return e}let i=-1;let s=t.parentNode;while(s!=null){if(["OL","UL"].includes(s.tagName)){i+=1}s=s.parentNode}if(i<=0)return e;return e.reduce(((t,e)=>{if(!e.insert)return t;if(e.attributes&&typeof e.attributes.indent==="number"){return t.push(e)}return t.insert(e.insert,{indent:i,...e.attributes||{}})}),new vk)}function Cj(t,e,n){const r=t;let i=r.tagName==="OL"?"ordered":"bullet";const s=r.getAttribute("data-checked");if(s){i=s==="true"?"checked":"unchecked"}return jj(e,"list",i,n)}function Bj(t,e,n){if(!Aj(e,"\n")){if(Oj(t,n)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement)){return e.insert("\n")}if(e.length()>0&&t.nextSibling){let r=t.nextSibling;while(r!=null){if(Oj(r,n)){return e.insert("\n")}const t=n.query(r);if(t&&t.prototype instanceof kk){return e.insert("\n")}r=r.firstChild}}}return e}function Dj(t,e,n){const r={};const i=t.style||{};if(i.fontStyle==="italic"){r.italic=true}if(i.textDecoration==="underline"){r.underline=true}if(i.textDecoration==="line-through"){r.strike=true}if(i.fontWeight?.startsWith("bold")||parseInt(i.fontWeight,10)>=700){r.bold=true}e=Object.entries(r).reduce(((t,e)=>{let[r,i]=e;return jj(t,r,i,n)}),e);if(parseFloat(i.textIndent||0)>0){return(new vk).insert("\t").concat(e)}return e}function Hj(t,e,n){const r=t.parentElement?.tagName==="TABLE"?t.parentElement:t.parentElement?.parentElement;if(r!=null){const i=Array.from(r.querySelectorAll("tr"));const s=i.indexOf(t)+1;return jj(e,"table",s,n)}return e}function Vj(t,e,n){let r=t.data;if(t.parentElement?.tagName==="O:P"){return e.insert(r.trim())}if(!_j(t)){if(r.trim().length===0&&r.includes("\n")&&!Mj(t,n)){return e}r=r.replace(/[^\S\u00a0]/g," ");r=r.replace(/ {2,}/g," ");if(t.previousSibling==null&&t.parentElement!=null&&Oj(t.parentElement,n)||t.previousSibling instanceof Element&&Oj(t.previousSibling,n)){r=r.replace(/^ /,"")}if(t.nextSibling==null&&t.parentElement!=null&&Oj(t.parentElement,n)||t.nextSibling instanceof Element&&Oj(t.nextSibling,n)){r=r.replace(/ $/,"")}r=r.replaceAll(" "," ")}return e.insert(r)}class Uj extends Jk{static DEFAULTS={delay:1e3,maxStack:100,userOnly:false};lastRecorded=0;ignoreChange=false;stack={undo:[],redo:[]};currentRange=null;constructor(t,e){super(t,e);this.quill.on(dx.events.EDITOR_CHANGE,((t,e,n,r)=>{if(t===dx.events.SELECTION_CHANGE){if(e&&r!==dx.sources.SILENT){this.currentRange=e}}else if(t===dx.events.TEXT_CHANGE){if(!this.ignoreChange){if(!this.options.userOnly||r===dx.sources.USER){this.record(e,n)}else{this.transform(e)}}this.currentRange=Zj(this.currentRange,e)}}));this.quill.keyboard.addBinding({key:"z",shortKey:true},this.undo.bind(this));this.quill.keyboard.addBinding({key:["z","Z"],shortKey:true,shiftKey:true},this.redo.bind(this));if(/Win/i.test(navigator.platform)){this.quill.keyboard.addBinding({key:"y",shortKey:true},this.redo.bind(this))}this.quill.root.addEventListener("beforeinput",(t=>{if(t.inputType==="historyUndo"){this.undo();t.preventDefault()}else if(t.inputType==="historyRedo"){this.redo();t.preventDefault()}}))}change(t,e){if(this.stack[t].length===0)return;const n=this.stack[t].pop();if(!n)return;const r=this.quill.getContents();const i=n.delta.invert(r);this.stack[e].push({delta:i,range:Zj(n.range,i)});this.lastRecorded=0;this.ignoreChange=true;this.quill.updateContents(n.delta,dx.sources.USER);this.ignoreChange=false;this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(t.ops.length===0)return;this.stack.redo=[];let n=t.invert(e);let r=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const t=this.stack.undo.pop();if(t){n=n.compose(t.delta);r=t.range}}else{this.lastRecorded=i}if(n.length()===0)return;this.stack.undo.push({delta:n,range:r});if(this.stack.undo.length>this.options.maxStack){this.stack.undo.shift()}}redo(){this.change("redo","undo")}transform(t){Fj(this.stack.undo,t);Fj(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range){this.quill.setSelection(t.range,dx.sources.USER)}else{const e=Wj(this.quill.scroll,t.delta);this.quill.setSelection(e,dx.sources.USER)}}}function Fj(t,e){let n=e;for(let e=t.length-1;e>=0;e-=1){const r=t[e];t[e]={delta:n.transform(r.delta,true),range:r.range&&Zj(r.range,n)};n=r.delta.transform(n);if(t[e].delta.length()===0){t.splice(e,1)}}}function Pj(t,e){const n=e.ops[e.ops.length-1];if(n==null)return false;if(n.insert!=null){return typeof n.insert==="string"&&n.insert.endsWith("\n")}if(n.attributes!=null){return Object.keys(n.attributes).some((e=>t.query(e,ty.BLOCK)!=null))}return false}function Wj(t,e){const n=e.reduce(((t,e)=>t+(e.delete||0)),0);let r=e.length()-n;if(Pj(t,e)){r-=1}return r}function Zj(t,e){if(!t)return t;const n=e.transformPosition(t.index);const r=e.transformPosition(t.index+t.length);return{index:n,length:r-n}}class Kj extends Jk{constructor(t,e){super(t,e);t.root.addEventListener("drop",(e=>{e.preventDefault();let n=null;if(document.caretRangeFromPoint){n=document.caretRangeFromPoint(e.clientX,e.clientY)}else if(document.caretPositionFromPoint){const t=document.caretPositionFromPoint(e.clientX,e.clientY);n=document.createRange();n.setStart(t.offsetNode,t.offset);n.setEnd(t.offsetNode,t.offset)}const r=n&&t.selection.normalizeNative(n);if(r){const n=t.selection.normalizedToRange(r);if(e.dataTransfer?.files){this.upload(n,e.dataTransfer.files)}}}))}upload(t,e){const n=[];Array.from(e).forEach((t=>{if(t&&this.options.mimetypes?.includes(t.type)){n.push(t)}}));if(n.length>0){this.options.handler.call(this,t,n)}}}Kj.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image")){return}const n=e.map((t=>new Promise((e=>{const n=new FileReader;n.onload=()=>{e(n.result)};n.readAsDataURL(t)}))));Promise.all(n).then((e=>{const n=e.reduce(((t,e)=>t.insert({image:e})),(new vk).retain(t.index).delete(t.length));this.quill.updateContents(n,Ck.sources.USER);this.quill.setSelection(t.index+e.length,Ck.sources.SILENT)}))}};const Gj=["insertText","insertReplacementText"];class Qj extends Jk{constructor(t,e){super(t,e);t.root.addEventListener("beforeinput",(t=>{this.handleBeforeInput(t)}));if(!/Android/i.test(navigator.userAgent)){t.on(dx.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}}deleteRange(t){rj({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";if(t.length===0)return false;if(e){const n=this.quill.getFormat(t.index,1);this.deleteRange(t);this.quill.updateContents((new vk).retain(t.index).insert(e,n),dx.sources.USER)}else{this.deleteRange(t)}this.quill.setSelection(t.index+e.length,0,dx.sources.SILENT);return true}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!Gj.includes(t.inputType)){return}const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===true){return}const n=Yj(t);if(n==null){return}const r=this.quill.selection.normalizeNative(e);const i=r?this.quill.selection.normalizedToRange(r):null;if(i&&this.replaceText(i,n)){t.preventDefault()}}handleCompositionStart(){const t=this.quill.getSelection();if(t){this.replaceText(t)}}}function Yj(t){if(typeof t.data==="string"){return t.data}if(t.dataTransfer?.types.includes("text/plain")){return t.dataTransfer.getData("text/plain")}return null}const Jj=/Mac/i.test(navigator.platform);const Xj=100;const tA=t=>{if(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"){return true}if(Jj&&t.key==="a"&&t.ctrlKey===true){return true}return false};class eA extends Jk{isListening=false;selectionChangeDeadline=0;constructor(t,e){super(t,e);this.handleArrowKeys();this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,e){let{line:n,event:r}=e;if(!(n instanceof ky)||!n.uiNode){return true}const i=getComputedStyle(n.domNode)["direction"]==="rtl";if(i&&r.key!=="ArrowRight"||!i&&r.key!=="ArrowLeft"){return true}this.quill.setSelection(t.index-1,t.length+(r.shiftKey?1:0),dx.sources.USER);return false}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(t=>{if(!t.defaultPrevented&&tA(t)){this.ensureListeningToSelectionChange()}}))}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+Xj;if(this.isListening)return;this.isListening=true;const t=()=>{this.isListening=false;if(Date.now()<=this.selectionChangeDeadline){this.handleSelectionChange()}};document.addEventListener("selectionchange",t,{once:true})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const e=t.getRangeAt(0);if(e.collapsed!==true||e.startOffset!==0)return;const n=this.quill.scroll.find(e.startContainer);if(!(n instanceof ky)||!n.uiNode)return;const r=document.createRange();r.setStartAfter(n.uiNode);r.setEndAfter(n.uiNode);t.removeAllRanges();t.addRange(r)}}dx.register({"blots/block":yk,"blots/block/embed":kk,"blots/break":pk,"blots/container":yx,"blots/cursor":Ak,"blots/embed":tx,"blots/inline":mk,"blots/scroll":jx,"blots/text":bk,"modules/clipboard":xj,"modules/history":Uj,"modules/keyboard":Qx,"modules/uploader":Kj,"modules/input":Qj,"modules/uiNode":eA});class nA extends oy{add(t,e){let n=0;if(e==="+1"||e==="-1"){const r=this.value(t)||0;n=e==="+1"?r+1:r-1}else if(typeof e==="number"){n=e}if(n===0){this.remove(t);return true}return super.add(t,n.toString())}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||undefined}}const rA=new nA("indent","ql-indent",{scope:ty.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class iA extends yk{static blotName="blockquote";static tagName="blockquote"}class sA extends yk{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(t){return this.tagName.indexOf(t.tagName)+1}}class lA extends yx{}lA.blotName="list-container";lA.tagName="OL";class oA extends yk{static create(t){const e=super.create();e.setAttribute("data-list",t);return e}static formats(t){return t.getAttribute("data-list")||undefined}static register(){dx.register(lA)}constructor(t,e){super(t,e);const n=e.ownerDocument.createElement("span");const r=n=>{if(!t.isEnabled())return;const r=this.statics.formats(e,t);if(r==="checked"){this.format("list","unchecked");n.preventDefault()}else if(r==="unchecked"){this.format("list","checked");n.preventDefault()}};n.addEventListener("mousedown",r);n.addEventListener("touchstart",r);this.attachUI(n)}format(t,e){if(t===this.statics.blotName&&e){this.domNode.setAttribute("data-list",e)}else{super.format(t,e)}}}oA.blotName="list";oA.tagName="LI";lA.allowedChildren=[oA];oA.requiredContainer=lA;class uA extends mk{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return true}optimize(t){super.optimize(t);if(this.domNode.tagName!==this.statics.tagName[0]){this.replaceWith(this.statics.blotName)}}}class aA extends uA{static blotName="italic";static tagName=["EM","I"]}class cA extends mk{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(t){const e=super.create(t);e.setAttribute("href",this.sanitize(t));e.setAttribute("rel","noopener noreferrer");e.setAttribute("target","_blank");return e}static formats(t){return t.getAttribute("href")}static sanitize(t){return fA(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){if(t!==this.statics.blotName||!e){super.format(t,e)}else{this.domNode.setAttribute("href",this.constructor.sanitize(e))}}}function fA(t,e){const n=document.createElement("a");n.href=t;const r=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(r)>-1}class hA extends mk{static blotName="script";static tagName=["SUB","SUP"];static create(t){if(t==="super"){return document.createElement("sup")}if(t==="sub"){return document.createElement("sub")}return super.create(t)}static formats(t){if(t.tagName==="SUB")return"sub";if(t.tagName==="SUP")return"super";return undefined}}class dA extends uA{static blotName="strike";static tagName=["S","STRIKE"]}class vA extends mk{static blotName="underline";static tagName="U"}class pA extends tx{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(t){if(window.katex==null){throw new Error("Formula module requires KaTeX.")}const e=super.create(t);if(typeof t==="string"){window.katex.render(t,e,{throwOnError:false,errorColor:"#f00"});e.setAttribute("data-value",t)}return e}static value(t){return t.getAttribute("data-value")}html(){const{formula:t}=this.value();return`<span>${t}</span>`}}const bA=["alt","height","width"];class qA extends Sy{static blotName="image";static tagName="IMG";static create(t){const e=super.create(t);if(typeof t==="string"){e.setAttribute("src",this.sanitize(t))}return e}static formats(t){return bA.reduce(((e,n)=>{if(t.hasAttribute(n)){e[n]=t.getAttribute(n)}return e}),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return fA(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){if(bA.indexOf(t)>-1){if(e){this.domNode.setAttribute(t,e)}else{this.domNode.removeAttribute(t)}}else{super.format(t,e)}}}const wA=["height","width"];class mA extends kk{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(t){const e=super.create(t);e.setAttribute("frameborder","0");e.setAttribute("allowfullscreen","true");e.setAttribute("src",this.sanitize(t));return e}static formats(t){return wA.reduce(((e,n)=>{if(t.hasAttribute(n)){e[n]=t.getAttribute(n)}return e}),{})}static sanitize(t){return cA.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){if(wA.indexOf(t)>-1){if(e){this.domNode.setAttribute(t,e)}else{this.domNode.removeAttribute(t)}}else{super.format(t,e)}}html(){const{video:t}=this.value();return`<a href="${t}">${t}</a>`}}const gA=new oy("code-token","hljs",{scope:ty.INLINE});class yA extends mk{static formats(t,e){while(t!=null&&t!==e.domNode){if(t.classList&&t.classList.contains(Rx.className)){return super.formats(t,e)}t=t.parentNode}return undefined}constructor(t,e,n){super(t,e,n);gA.add(this.domNode,n)}format(t,e){if(t!==yA.blotName){super.format(t,e)}else if(e){gA.add(this.domNode,e)}else{gA.remove(this.domNode);this.domNode.classList.remove(this.statics.className)}}optimize(){super.optimize(...arguments);if(!gA.value(this.domNode)){this.unwrap()}}}yA.blotName="code-token";yA.className="ql-token";class kA extends Rx{static create(t){const e=super.create(t);if(typeof t==="string"){e.setAttribute("data-language",t)}return e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){if(t===this.statics.blotName&&e){this.domNode.setAttribute("data-language",e)}else{super.format(t,e)}}replaceWith(t,e){this.formatAt(0,this.length(),yA.blotName,false);return super.replaceWith(t,e)}}class xA extends zx{attach(){super.attach();this.forceNext=false;this.scroll.emitMount(this)}format(t,e){if(t===kA.blotName){this.forceNext=true;this.children.forEach((n=>{n.format(t,e)}))}}formatAt(t,e,n,r){if(n===kA.blotName){this.forceNext=true}super.formatAt(t,e,n,r)}highlight(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(this.children.head==null)return;const n=Array.from(this.domNode.childNodes).filter((t=>t!==this.uiNode));const r=`${n.map((t=>t.textContent)).join("\n")}\n`;const i=kA.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==r){if(r.trim().length>0||this.cachedText==null){const e=this.children.reduce(((t,e)=>t.concat(xk(e,false))),new vk);const n=t(r,i);e.diff(n).reduce(((t,e)=>{let{retain:n,attributes:r}=e;if(!n)return t;if(r){Object.keys(r).forEach((e=>{if([kA.blotName,yA.blotName].includes(e)){this.formatAt(t,n,e,r[e])}}))}return t+n}),0)}this.cachedText=r;this.forceNext=false}}html(t,e){const[n]=this.children.find(t);const r=n?kA.formats(n.domNode):"plain";return`<pre data-language="${r}">\n${wk(this.code(t,e))}\n</pre>`}optimize(t){super.optimize(t);if(this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=kA.formats(this.children.head.domNode);if(t!==this.uiNode.value){this.uiNode.value=t}}}}xA.allowedChildren=[kA];kA.requiredContainer=xA;kA.allowedChildren=[yA,Ak,bk,pk];const jA=(t,e,n)=>{if(typeof t.versionString==="string"){const r=t.versionString.split(".")[0];if(parseInt(r,10)>=11){return t.highlight(n,{language:e}).value}}return t.highlight(e,n).value};class AA extends Jk{static register(){dx.register(yA,true);dx.register(kA,true);dx.register(xA,true)}constructor(t,e){super(t,e);if(this.options.hljs==null){throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.")}this.languages=this.options.languages.reduce(((t,e)=>{let{key:n}=e;t[n]=true;return t}),{});this.highlightBlot=this.highlightBlot.bind(this);this.initListener();this.initTimer()}initListener(){this.quill.on(dx.events.SCROLL_BLOT_MOUNT,(t=>{if(!(t instanceof xA))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((t=>{let{key:n,label:r}=t;const i=e.ownerDocument.createElement("option");i.textContent=r;i.setAttribute("value",n);e.appendChild(i)}));e.addEventListener("change",(()=>{t.format(kA.blotName,e.value);this.quill.root.focus();this.highlight(t,true)}));if(t.uiNode==null){t.attachUI(e);if(t.children.head){e.value=kA.formats(t.children.head.domNode)}}}))}initTimer(){let t=null;this.quill.on(dx.events.SCROLL_OPTIMIZE,(()=>{if(t){clearTimeout(t)}t=setTimeout((()=>{this.highlight();t=null}),this.options.interval)}))}highlight(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(this.quill.selection.composing)return;this.quill.update(dx.sources.USER);const n=this.quill.getSelection();const r=t==null?this.quill.scroll.descendants(xA):[t];r.forEach((t=>{t.highlight(this.highlightBlot,e)}));this.quill.update(dx.sources.SILENT);if(n!=null){this.quill.setSelection(n,dx.sources.SILENT)}}highlightBlot(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"plain";e=this.languages[e]?e:"plain";if(e==="plain"){return wk(t).split("\n").reduce(((t,n,r)=>{if(r!==0){t.insert("\n",{[Rx.blotName]:e})}return t.insert(n)}),new vk)}const n=this.quill.root.ownerDocument.createElement("div");n.classList.add(Rx.className);n.innerHTML=jA(this.options.hljs,e,t);return Tj(this.quill.scroll,n,[(t,e)=>{const n=gA.value(t);if(n){return e.compose((new vk).retain(e.length(),{[yA.blotName]:n}))}return e}],[(t,n)=>t.data.split("\n").reduce(((t,n,r)=>{if(r!==0)t.insert("\n",{[Rx.blotName]:e});return t.insert(n)}),n)],new WeakMap)}}AA.DEFAULTS={hljs:(()=>window.hljs)(),interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class OA extends yk{static blotName="table";static tagName="TD";static create(t){const e=super.create();if(t){e.setAttribute("data-row",t)}else{e.setAttribute("data-row",TA())}return e}static formats(t){if(t.hasAttribute("data-row")){return t.getAttribute("data-row")}return undefined}cellOffset(){if(this.parent){return this.parent.children.indexOf(this)}return-1}format(t,e){if(t===OA.blotName&&e){this.domNode.setAttribute("data-row",e)}else{super.format(t,e)}}row(){return this.parent}rowOffset(){if(this.row()){return this.row().rowOffset()}return-1}table(){return this.row()&&this.row().table()}}class MA extends yx{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats();const e=this.children.tail.formats();const n=this.next.children.head.formats();const r=this.next.children.tail.formats();return t.table===e.table&&t.table===n.table&&t.table===r.table}return false}optimize(t){super.optimize(t);this.children.forEach((t=>{if(t.next==null)return;const e=t.formats();const n=t.next.formats();if(e.table!==n.table){const e=this.splitAfter(t);if(e){e.optimize()}if(this.prev){this.prev.optimize()}}}))}rowOffset(){if(this.parent){return this.parent.children.indexOf(this)}return-1}table(){return this.parent&&this.parent.parent}}class EA extends yx{static blotName="table-body";static tagName="TBODY"}class _A extends yx{static blotName="table-container";static tagName="TABLE";balanceCells(){const t=this.descendants(MA);const e=t.reduce(((t,e)=>Math.max(e.children.length,t)),0);t.forEach((t=>{new Array(e-t.children.length).fill(0).forEach((()=>{let e;if(t.children.head!=null){e=OA.formats(t.children.head.domNode)}const n=this.scroll.create(OA.blotName,e);t.appendChild(n);n.optimize()}))}))}cells(t){return this.rows().map((e=>e.children.at(t)))}deleteColumn(t){const[e]=this.descendant(EA);if(e==null||e.children.head==null)return;e.children.forEach((e=>{const n=e.children.at(t);if(n!=null){n.remove()}}))}insertColumn(t){const[e]=this.descendant(EA);if(e==null||e.children.head==null)return;e.children.forEach((e=>{const n=e.children.at(t);const r=OA.formats(e.children.head.domNode);const i=this.scroll.create(OA.blotName,r);e.insertBefore(i,n)}))}insertRow(t){const[e]=this.descendant(EA);if(e==null||e.children.head==null)return;const n=TA();const r=this.scroll.create(MA.blotName);e.children.head.children.forEach((()=>{const t=this.scroll.create(OA.blotName,n);r.appendChild(t)}));const i=e.children.at(t);e.insertBefore(r,i)}rows(){const t=this.children.head;if(t==null)return[];return t.children.map((t=>t))}}_A.allowedChildren=[EA];EA.requiredContainer=_A;EA.allowedChildren=[MA];MA.requiredContainer=EA;MA.allowedChildren=[OA];OA.requiredContainer=MA;function TA(){const t=Math.random().toString(36).slice(2,6);return`row-${t}`}class NA extends Jk{static register(){dx.register(OA);dx.register(MA);dx.register(EA);dx.register(_A)}constructor(){super(...arguments);this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(_A).forEach((t=>{t.balanceCells()}))}deleteColumn(){const[t,,e]=this.getTable();if(e==null)return;t.deleteColumn(e.cellOffset());this.quill.update(dx.sources.USER)}deleteRow(){const[,t]=this.getTable();if(t==null)return;t.remove();this.quill.update(dx.sources.USER)}deleteTable(){const[t]=this.getTable();if(t==null)return;const e=t.offset();t.remove();this.quill.update(dx.sources.USER);this.quill.setSelection(e,dx.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[e,n]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==OA.blotName){return[null,null,null,-1]}const r=e.parent;const i=r.parent.parent;return[i,r,e,n]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[n,r,i]=this.getTable(e);if(i==null)return;const s=i.cellOffset();n.insertColumn(s+t);this.quill.update(dx.sources.USER);let l=r.rowOffset();if(t===0){l+=1}this.quill.setSelection(e.index+l,e.length,dx.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[n,r,i]=this.getTable(e);if(i==null)return;const s=r.rowOffset();n.insertRow(s+t);this.quill.update(dx.sources.USER);if(t>0){this.quill.setSelection(e,dx.sources.SILENT)}else{this.quill.setSelection(e.index+r.children.length,e.length,dx.sources.SILENT)}}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const n=this.quill.getSelection();if(n==null)return;const r=new Array(t).fill(0).reduce((t=>{const n=new Array(e).fill("\n").join("");return t.insert(n,{table:TA()})}),(new vk).retain(n.index));this.quill.updateContents(r,dx.sources.USER);this.quill.setSelection(n.index,dx.sources.SILENT);this.balanceTables()}listenBalanceCells(){this.quill.on(dx.events.SCROLL_OPTIMIZE,(t=>{t.some((t=>{if(["TD","TR","TBODY","TABLE"].includes(t.target.tagName)){this.quill.once(dx.events.TEXT_CHANGE,((t,e,n)=>{if(n!==dx.sources.USER)return;this.balanceTables()}));return true}return false}))}))}}const LA=zk("quill:toolbar");class $A extends Jk{constructor(t,e){super(t,e);if(Array.isArray(this.options.container)){const e=document.createElement("div");e.setAttribute("role","toolbar");zA(e,this.options.container);t.container?.parentNode?.insertBefore(e,t.container);this.container=e}else if(typeof this.options.container==="string"){this.container=document.querySelector(this.options.container)}else{this.container=this.options.container}if(!(this.container instanceof HTMLElement)){LA.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar");this.controls=[];this.handlers={};if(this.options.handlers){Object.keys(this.options.handlers).forEach((t=>{const e=this.options.handlers?.[t];if(e){this.addHandler(t,e)}}))}Array.from(this.container.querySelectorAll("button, select")).forEach((t=>{this.attach(t)}));this.quill.on(dx.events.EDITOR_CHANGE,(()=>{const[t]=this.quill.selection.getRange();this.update(t)}))}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find((t=>t.indexOf("ql-")===0));if(!e)return;e=e.slice("ql-".length);if(t.tagName==="BUTTON"){t.setAttribute("type","button")}if(this.handlers[e]==null&&this.quill.scroll.query(e)==null){LA.warn("ignoring attaching to nonexistent format",e,t);return}const n=t.tagName==="SELECT"?"change":"click";t.addEventListener(n,(n=>{let r;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const e=t.options[t.selectedIndex];if(e.hasAttribute("selected")){r=false}else{r=e.value||false}}else{if(t.classList.contains("ql-active")){r=false}else{r=t.value||!t.hasAttribute("value")}n.preventDefault()}this.quill.focus();const[i]=this.quill.selection.getRange();if(this.handlers[e]!=null){this.handlers[e].call(this,r)}else if(this.quill.scroll.query(e).prototype instanceof Sy){r=prompt(`Enter ${e}`);if(!r)return;this.quill.updateContents((new vk).retain(i.index).delete(i.length).insert({[e]:r}),dx.sources.USER)}else{this.quill.format(e,r,dx.sources.USER)}this.update(i)}));this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach((n=>{const[r,i]=n;if(i.tagName==="SELECT"){let n=null;if(t==null){n=null}else if(e[r]==null){n=i.querySelector("option[selected]")}else if(!Array.isArray(e[r])){let t=e[r];if(typeof t==="string"){t=t.replace(/"/g,'\\"')}n=i.querySelector(`option[value="${t}"]`)}if(n==null){i.value="";i.selectedIndex=-1}else{n.selected=true}}else if(t==null){i.classList.remove("ql-active");i.setAttribute("aria-pressed","false")}else if(i.hasAttribute("value")){const t=e[r];const n=t===i.getAttribute("value")||t!=null&&t.toString()===i.getAttribute("value")||t==null&&!i.getAttribute("value");i.classList.toggle("ql-active",n);i.setAttribute("aria-pressed",n.toString())}else{const t=e[r]!=null;i.classList.toggle("ql-active",t);i.setAttribute("aria-pressed",t.toString())}}))}}$A.DEFAULTS={};function SA(t,e,n){const r=document.createElement("button");r.setAttribute("type","button");r.classList.add(`ql-${e}`);r.setAttribute("aria-pressed","false");if(n!=null){r.value=n;r.setAttribute("aria-label",`${e}: ${n}`)}else{r.setAttribute("aria-label",e)}t.appendChild(r)}function zA(t,e){if(!Array.isArray(e[0])){e=[e]}e.forEach((e=>{const n=document.createElement("span");n.classList.add("ql-formats");e.forEach((t=>{if(typeof t==="string"){SA(n,t)}else{const e=Object.keys(t)[0];const r=t[e];if(Array.isArray(r)){RA(n,e,r)}else{SA(n,e,r)}}}));t.appendChild(n)}))}function RA(t,e,n){const r=document.createElement("select");r.classList.add(`ql-${e}`);n.forEach((t=>{const e=document.createElement("option");if(t!==false){e.setAttribute("value",String(t))}else{e.setAttribute("selected","selected")}r.appendChild(e)}));t.appendChild(r)}$A.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(t==null)return;if(t.length===0){const t=this.quill.getFormat();Object.keys(t).forEach((t=>{if(this.quill.scroll.query(t,ty.INLINE)!=null){this.quill.format(t,false,dx.sources.USER)}}))}else{this.quill.removeFormat(t.index,t.length,dx.sources.USER)}},direction(t){const{align:e}=this.quill.getFormat();if(t==="rtl"&&e==null){this.quill.format("align","right",dx.sources.USER)}else if(!t&&e==="right"){this.quill.format("align",false,dx.sources.USER)}this.quill.format("direction",t,dx.sources.USER)},indent(t){const e=this.quill.getSelection();const n=this.quill.getFormat(e);const r=parseInt(n.indent||0,10);if(t==="+1"||t==="-1"){let e=t==="+1"?1:-1;if(n.direction==="rtl")e*=-1;this.quill.format("indent",r+e,dx.sources.USER)}},link(t){if(t===true){t=prompt("Enter link URL:")}this.quill.format("link",t,dx.sources.USER)},list(t){const e=this.quill.getSelection();const n=this.quill.getFormat(e);if(t==="check"){if(n.list==="checked"||n.list==="unchecked"){this.quill.format("list",false,dx.sources.USER)}else{this.quill.format("list","unchecked",dx.sources.USER)}}else{this.quill.format("list",t,dx.sources.USER)}}}};const IA='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>';const CA='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>';const BA='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>';const DA='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>';const HA='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>';const VA='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>';const UA='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>';const FA='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>';const PA='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>';const WA='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>';const ZA='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>';const KA='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>';const GA='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>';const QA='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>';const YA='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>';const JA='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>';const XA='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>';const tO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>';const eO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>';const nO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>';const rO='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>';const iO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>';const sO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>';const lO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>';const oO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>';const uO='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>';const aO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>';const cO='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>';const fO='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>';const hO='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>';const dO='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>';const vO='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>';const pO='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>';var bO={align:{"":IA,center:CA,right:BA,justify:DA},background:HA,blockquote:VA,bold:UA,clean:FA,code:PA,"code-block":PA,color:WA,direction:{"":ZA,rtl:KA},formula:GA,header:{1:QA,2:YA,3:JA,4:XA,5:tO,6:eO},italic:nO,image:rO,indent:{"+1":iO,"-1":sO},link:lO,list:{bullet:oO,check:uO,ordered:aO},script:{sub:cO,super:fO},strike:hO,table:dO,underline:vO,video:pO};const qO='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let wO=0;function mO(t,e){t.setAttribute(e,`${!(t.getAttribute(e)==="true")}`)}class gO{constructor(t){this.select=t;this.container=document.createElement("span");this.buildPicker();this.select.style.display="none";this.select.parentNode.insertBefore(this.container,this.select);this.label.addEventListener("mousedown",(()=>{this.togglePicker()}));this.label.addEventListener("keydown",(t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape();t.preventDefault();break}}));this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded");mO(this.label,"aria-expanded");mO(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");e.tabIndex="0";e.setAttribute("role","button");e.classList.add("ql-picker-item");const n=t.getAttribute("value");if(n){e.setAttribute("data-value",n)}if(t.textContent){e.setAttribute("data-label",t.textContent)}e.addEventListener("click",(()=>{this.selectItem(e,true)}));e.addEventListener("keydown",(t=>{switch(t.key){case"Enter":this.selectItem(e,true);t.preventDefault();break;case"Escape":this.escape();t.preventDefault();break}}));return e}buildLabel(){const t=document.createElement("span");t.classList.add("ql-picker-label");t.innerHTML=qO;t.tabIndex="0";t.setAttribute("role","button");t.setAttribute("aria-expanded","false");this.container.appendChild(t);return t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options");t.setAttribute("aria-hidden","true");t.tabIndex="-1";t.id=`ql-picker-options-${wO}`;wO+=1;this.label.setAttribute("aria-controls",t.id);this.options=t;Array.from(this.select.options).forEach((e=>{const n=this.buildItem(e);t.appendChild(n);if(e.selected===true){this.selectItem(n)}}));this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach((t=>{this.container.setAttribute(t.name,t.value)}));this.container.classList.add("ql-picker");this.label=this.buildLabel();this.buildOptions()}escape(){this.close();setTimeout((()=>this.label.focus()),1)}close(){this.container.classList.remove("ql-expanded");this.label.setAttribute("aria-expanded","false");this.options.setAttribute("aria-hidden","true")}selectItem(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;const n=this.container.querySelector(".ql-selected");if(t===n)return;if(n!=null){n.classList.remove("ql-selected")}if(t==null)return;t.classList.add("ql-selected");this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t);if(t.hasAttribute("data-value")){this.label.setAttribute("data-value",t.getAttribute("data-value"))}else{this.label.removeAttribute("data-value")}if(t.hasAttribute("data-label")){this.label.setAttribute("data-label",t.getAttribute("data-label"))}else{this.label.removeAttribute("data-label")}if(e){this.select.dispatchEvent(new Event("change"));this.close()}}update(){let t;if(this.select.selectedIndex>-1){const e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex];this.selectItem(e)}else{this.selectItem(null)}const e=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class yO extends gO{constructor(t,e){super(t);this.label.innerHTML=e;this.container.classList.add("ql-color-picker");Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((t=>{t.classList.add("ql-primary")}))}buildItem(t){const e=super.buildItem(t);e.style.backgroundColor=t.getAttribute("value")||"";return e}selectItem(t,e){super.selectItem(t,e);const n=this.label.querySelector(".ql-color-label");const r=t?t.getAttribute("data-value")||"":"";if(n){if(n.tagName==="line"){n.style.stroke=r}else{n.style.fill=r}}}}class kO extends gO{constructor(t,e){super(t);this.container.classList.add("ql-icon-picker");Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((t=>{t.innerHTML=e[t.getAttribute("data-value")||""]}));this.defaultItem=this.container.querySelector(".ql-selected");this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const n=t||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}const xO=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class jO{constructor(t,e){this.quill=t;this.boundsContainer=e||document.body;this.root=t.addContainer("ql-tooltip");this.root.innerHTML=this.constructor.TEMPLATE;if(xO(this.quill.root)){this.quill.root.addEventListener("scroll",(()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}))}this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){const e=t.left+t.width/2-this.root.offsetWidth/2;const n=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`;this.root.style.top=`${n}px`;this.root.classList.remove("ql-flip");const r=this.boundsContainer.getBoundingClientRect();const i=this.root.getBoundingClientRect();let s=0;if(i.right>r.right){s=r.right-i.right;this.root.style.left=`${e+s}px`}if(i.left<r.left){s=r.left-i.left;this.root.style.left=`${e+s}px`}if(i.bottom>r.bottom){const e=i.bottom-i.top;const r=t.bottom-t.top+e;this.root.style.top=`${n-r}px`;this.root.classList.add("ql-flip")}return s}show(){this.root.classList.remove("ql-editing");this.root.classList.remove("ql-hidden")}}const AO=[false,"center","right","justify"];const OO=["#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"];const MO=[false,"serif","monospace"];const EO=["1","2","3",false];const _O=["small",false,"large","huge"];class TO extends nx{constructor(t,e){super(t,e);const n=e=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",n);return}if(this.tooltip!=null&&!this.tooltip.root.contains(e.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()){this.tooltip.hide()}if(this.pickers!=null){this.pickers.forEach((t=>{if(!t.container.contains(e.target)){t.close()}}))}};t.emitter.listenDOM("click",document.body,n)}addModule(t){const e=super.addModule(t);if(t==="toolbar"){this.extendToolbar(e)}return e}buildButtons(t,e){Array.from(t).forEach((t=>{const n=t.getAttribute("class")||"";n.split(/\s+/).forEach((n=>{if(!n.startsWith("ql-"))return;n=n.slice("ql-".length);if(e[n]==null)return;if(n==="direction"){t.innerHTML=e[n][""]+e[n].rtl}else if(typeof e[n]==="string"){t.innerHTML=e[n]}else{const r=t.value||"";if(r!=null&&e[n][r]){t.innerHTML=e[n][r]}}}))}))}buildPickers(t,e){this.pickers=Array.from(t).map((t=>{if(t.classList.contains("ql-align")){if(t.querySelector("option")==null){$O(t,AO)}if(typeof e.align==="object"){return new kO(t,e.align)}}if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){const n=t.classList.contains("ql-background")?"background":"color";if(t.querySelector("option")==null){$O(t,OO,n==="background"?"#ffffff":"#000000")}return new yO(t,e[n])}if(t.querySelector("option")==null){if(t.classList.contains("ql-font")){$O(t,MO)}else if(t.classList.contains("ql-header")){$O(t,EO)}else if(t.classList.contains("ql-size")){$O(t,_O)}}return new gO(t)}));const n=()=>{this.pickers.forEach((t=>{t.update()}))};this.quill.on(Ck.events.EDITOR_CHANGE,n)}}TO.DEFAULTS=yp({},nx.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");if(t==null){t=document.createElement("input");t.setAttribute("type","file");t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", "));t.classList.add("ql-image");t.addEventListener("change",(()=>{const e=this.quill.getSelection(true);this.quill.uploader.upload(e,t.files);t.value=""}));this.container.appendChild(t)}t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class NO extends jO{constructor(t,e){super(t,e);this.textbox=this.root.querySelector('input[type="text"]');this.listen()}listen(){this.textbox.addEventListener("keydown",(t=>{if(t.key==="Enter"){this.save();t.preventDefault()}else if(t.key==="Escape"){this.cancel();t.preventDefault()}}))}cancel(){this.hide();this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"link";let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;this.root.classList.remove("ql-hidden");this.root.classList.add("ql-editing");if(this.textbox==null)return;if(e!=null){this.textbox.value=e}else if(t!==this.root.getAttribute("data-mode")){this.textbox.value=""}const n=this.quill.getBounds(this.quill.selection.savedRange);if(n!=null){this.position(n)}this.textbox.select();this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||"");this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:true})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:e}=this.quill.root;if(this.linkRange){this.quill.formatText(this.linkRange,"link",t,Ck.sources.USER);delete this.linkRange}else{this.restoreFocus();this.quill.format("link",t,Ck.sources.USER)}this.quill.root.scrollTop=e;break}case"video":{t=LO(t)}case"formula":{if(!t)break;const e=this.quill.getSelection(true);if(e!=null){const n=e.index+e.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),t,Ck.sources.USER);if(this.root.getAttribute("data-mode")==="formula"){this.quill.insertText(n+1," ",Ck.sources.USER)}this.quill.setSelection(n+2,Ck.sources.USER)}break}}this.textbox.value="";this.hide()}}function LO(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(e){return`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`}if(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)){return`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`}return t}function $O(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;e.forEach((e=>{const r=document.createElement("option");if(e===n){r.setAttribute("selected","selected")}else{r.setAttribute("value",String(e))}t.appendChild(r)}))}const SO=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class zO extends NO{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(t,e){super(t,e);this.quill.on(Ck.events.EDITOR_CHANGE,((t,e,n,r)=>{if(t!==Ck.events.SELECTION_CHANGE)return;if(e!=null&&e.length>0&&r===Ck.sources.USER){this.show();this.root.style.left="0px";this.root.style.width="";this.root.style.width=`${this.root.offsetWidth}px`;const t=this.quill.getLines(e.index,e.length);if(t.length===1){const t=this.quill.getBounds(e);if(t!=null){this.position(t)}}else{const n=t[t.length-1];const r=this.quill.getIndex(n);const i=Math.min(n.length()-1,e.index+e.length-r);const s=this.quill.getBounds(new Dk(r,i));if(s!=null){this.position(s)}}}else if(document.activeElement!==this.textbox&&this.quill.hasFocus()){this.hide()}}))}listen(){super.listen();this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")}));this.quill.on(Ck.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const e=this.quill.getBounds(t);if(e!=null){this.position(e)}}}),1)}))}cancel(){this.show()}position(t){const e=super.position(t);const n=this.root.querySelector(".ql-tooltip-arrow");n.style.marginLeft="";if(e!==0){n.style.marginLeft=`${-1*e-n.offsetWidth/2}px`}return e}}class RO extends TO{constructor(t,e){if(e.modules.toolbar!=null&&e.modules.toolbar.container==null){e.modules.toolbar.container=SO}super(t,e);this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new zO(this.quill,this.options.bounds);if(t.container!=null){this.tooltip.root.appendChild(t.container);this.buildButtons(t.container.querySelectorAll("button"),bO);this.buildPickers(t.container.querySelectorAll("select"),bO)}}}RO.DEFAULTS=yp({},TO.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(!t){this.quill.format("link",false,dx.sources.USER)}else{this.quill.theme.tooltip.edit()}}}}}});const IO=[[{header:["1","2","3",false]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class CO extends NO{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen();this.root.querySelector("a.ql-action").addEventListener("click",(t=>{if(this.root.classList.contains("ql-editing")){this.save()}else{this.edit("link",this.preview.textContent)}t.preventDefault()}));this.root.querySelector("a.ql-remove").addEventListener("click",(t=>{if(this.linkRange!=null){const t=this.linkRange;this.restoreFocus();this.quill.formatText(t,"link",false,Ck.sources.USER);delete this.linkRange}t.preventDefault();this.hide()}));this.quill.on(Ck.events.SELECTION_CHANGE,((t,e,n)=>{if(t==null)return;if(t.length===0&&n===Ck.sources.USER){const[e,n]=this.quill.scroll.descendant(cA,t.index);if(e!=null){this.linkRange=new Dk(t.index-n,e.length());const r=cA.formats(e.domNode);this.preview.textContent=r;this.preview.setAttribute("href",r);this.show();const i=this.quill.getBounds(this.linkRange);if(i!=null){this.position(i)}return}}else{delete this.linkRange}this.hide()}))}show(){super.show();this.root.removeAttribute("data-mode")}}class BO extends TO{constructor(t,e){if(e.modules.toolbar!=null&&e.modules.toolbar.container==null){e.modules.toolbar.container=IO}super(t,e);this.quill.container.classList.add("ql-snow")}extendToolbar(t){if(t.container!=null){t.container.classList.add("ql-snow");this.buildButtons(t.container.querySelectorAll("button"),bO);this.buildPickers(t.container.querySelectorAll("select"),bO);this.tooltip=new CO(this.quill,this.options.bounds);if(t.container.querySelector(".ql-link")){this.quill.keyboard.addBinding({key:"k",shortKey:true},((e,n)=>{t.handlers.link.call(t,!n.format.link)}))}}}}BO.DEFAULTS=yp({},TO.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const t=this.quill.getSelection();if(t==null||t.length===0)return;let e=this.quill.getText(t);if(/^\S+@\S+\.\S+$/.test(e)&&e.indexOf("mailto:")!==0){e=`mailto:${e}`}const{tooltip:n}=this.quill.theme;n.edit("link",e)}else{this.quill.format("link",false,dx.sources.USER)}}}}}});dx.register({"attributors/attribute/direction":Bx,"attributors/class/align":Ex,"attributors/class/background":$x,"attributors/class/color":Nx,"attributors/class/direction":Dx,"attributors/class/font":Ux,"attributors/class/size":Wx,"attributors/style/align":_x,"attributors/style/background":Sx,"attributors/style/color":Lx,"attributors/style/direction":Hx,"attributors/style/font":Px,"attributors/style/size":Zx},true);dx.register({"formats/align":Ex,"formats/direction":Dx,"formats/indent":rA,"formats/background":Sx,"formats/color":Lx,"formats/font":Ux,"formats/size":Wx,"formats/blockquote":iA,"formats/code-block":Rx,"formats/header":sA,"formats/list":oA,"formats/bold":uA,"formats/code":Ix,"formats/italic":aA,"formats/link":cA,"formats/script":hA,"formats/strike":dA,"formats/underline":vA,"formats/formula":pA,"formats/image":qA,"formats/video":mA,"modules/syntax":AA,"modules/table":NA,"modules/toolbar":$A,"themes/bubble":RO,"themes/snow":BO,"ui/icons":bO,"ui/picker":gO,"ui/icon-picker":kO,"ui/color-picker":yO,"ui/tooltip":jO},true);const DO=t=>Boolean(t.tagName);const HO=t=>{try{if(typeof document.createElement("div").attachShadow({mode:"open"}).getSelection==="function"){return t.getSelection().getRangeAt(0)}const e=window.getSelection();if(typeof e.getComposedRanges==="function"){return e.getComposedRanges(t)[0]}return e.getRangeAt(0)}catch(t){return null}};const VO=t=>{const e=()=>t.root.getRootNode();t.selection.hasFocus=()=>e().activeElement===t.root;t.selection.getNativeRange=()=>{const n=HO(e());return Boolean(n)?t.selection.normalizeNative(n):null};t.selection.setNativeRange=(e,n,r=e,i=n,s=false)=>{if([e===null||e===void 0?void 0:e.parentNode,t.root.parentNode,r===null||r===void 0?void 0:r.parentNode].some((t=>t==null))){return}const l=window.getSelection();if(!t.selection.hasFocus())t.root.focus();const o=(t.selection.getNativeRange()||{}).native;if(!Boolean(o)||s||e!==o.startContainer||n!==o.startOffset||r!==o.endContainer||i!==o.endOffset){if(DO(e)&&e.tagName==="BR"){n=[].indexOf.call(e.parentNode.childNodes,e);e=e.parentNode}if(DO(r)&&r.tagName==="BR"){i=[].indexOf.call(r.parentNode.childNodes,r);r=r.parentNode}l.setBaseAndExtent(e,n,r,i)}};document.addEventListener("selectionchange",(()=>{t.selection.update()}))};const UO=(t,{value:e,modules:n,readOnly:r,placeholder:s,handleTextChange:l,handleFocus:o,handleBlur:u})=>{const a={toolbar:[["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]]};const c=new dx(t.querySelector("div"),{theme:"snow",modules:n||a,readOnly:r,placeholder:s});if(i(e)&&/<[a-z][\s\S]*>/i.test(e)){c.clipboard.dangerouslyPasteHTML(e)}else if(i(e)){c.setText(e)}const f=t.querySelector(".ql-editor");f.addEventListener("focus",o);f.addEventListener("blur",u);c.on("text-change",l);VO(c);return c};const FO="/*!\n * Quill Editor v2.0.3\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked]>.ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked]>.ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor>*{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li>.ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked]>.ql-ui,.ql-editor li[data-list=unchecked]>.ql-ui{color:#777}.ql-editor li[data-list=bullet]>.ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked]>.ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked]>.ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered]>.ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1>.ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2>.ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3>.ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4>.ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5>.ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6>.ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7>.ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8>.ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9>.ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl>.ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-snow.ql-toolbar:after,.ql-snow .ql-toolbar:after{clear:both;content:'';display:table}.ql-snow.ql-toolbar button,.ql-snow .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-snow.ql-toolbar button svg,.ql-snow .ql-toolbar button svg{float:left;height:100%}.ql-snow.ql-toolbar button:active:hover,.ql-snow .ql-toolbar button:active:hover{outline:none}.ql-snow.ql-toolbar input.ql-image[type=file],.ql-snow .ql-toolbar input.ql-image[type=file]{display:none}.ql-snow.ql-toolbar button:hover,.ql-snow .ql-toolbar button:hover,.ql-snow.ql-toolbar button:focus,.ql-snow .ql-toolbar button:focus,.ql-snow.ql-toolbar button.ql-active,.ql-snow .ql-toolbar button.ql-active,.ql-snow.ql-toolbar .ql-picker-label:hover,.ql-snow .ql-toolbar .ql-picker-label:hover,.ql-snow.ql-toolbar .ql-picker-label.ql-active,.ql-snow .ql-toolbar .ql-picker-label.ql-active,.ql-snow.ql-toolbar .ql-picker-item:hover,.ql-snow .ql-toolbar .ql-picker-item:hover,.ql-snow.ql-toolbar .ql-picker-item.ql-selected,.ql-snow .ql-toolbar .ql-picker-item.ql-selected{color:#06c}.ql-snow.ql-toolbar button:hover .ql-fill,.ql-snow .ql-toolbar button:hover .ql-fill,.ql-snow.ql-toolbar button:focus .ql-fill,.ql-snow .ql-toolbar button:focus .ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#06c}.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke,.ql-snow.ql-toolbar button:focus .ql-stroke,.ql-snow .ql-toolbar button:focus .ql-stroke,.ql-snow.ql-toolbar button.ql-active .ql-stroke,.ql-snow .ql-toolbar button.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow.ql-toolbar button:hover .ql-stroke-miter,.ql-snow .ql-toolbar button:hover .ql-stroke-miter,.ql-snow.ql-toolbar button:focus .ql-stroke-miter,.ql-snow .ql-toolbar button:focus .ql-stroke-miter,.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow.ql-toolbar button:hover:not(.ql-active),.ql-snow .ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow{box-sizing:border-box}.ql-snow *{box-sizing:border-box}.ql-snow .ql-hidden{display:none}.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:'';display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-thin,.ql-snow .ql-stroke.ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor code,.ql-snow .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-snow .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-snow .ql-picker-label::before{display:inline-block;line-height:22px}.ql-snow .ql-picker-options{background-color:#fff;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-snow .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#ccc;z-index:2}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-snow .ql-color-picker,.ql-snow .ql-icon-picker{width:28px}.ql-snow .ql-color-picker .ql-picker-label,.ql-snow .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-label svg,.ql-snow .ql-icon-picker .ql-picker-label svg{right:4px}.ql-snow .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-snow .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-snow .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-snow .ql-picker.ql-header{width:98px}.ql-snow .ql-picker.ql-header .ql-picker-label::before,.ql-snow .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-snow .ql-picker.ql-font{width:108px}.ql-snow .ql-picker.ql-font .ql-picker-label::before,.ql-snow .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-snow .ql-picker.ql-size{width:98px}.ql-snow .ql-picker.ql-size .ql-picker-label::before,.ql-snow .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-snow .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-snow .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-toolbar.ql-snow{border:1px solid #ccc;box-sizing:border-box;font-family:'Helvetica Neue','Helvetica','Arial',sans-serif;padding:8px}.ql-toolbar.ql-snow .ql-formats{margin-right:15px}.ql-toolbar.ql-snow .ql-picker-label{border:1px solid transparent}.ql-toolbar.ql-snow .ql-picker-options{border:1px solid transparent;box-shadow:rgba(0,0,0,0.2) 0 2px 8px}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:#ccc}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc}.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover{border-color:#000}.ql-toolbar.ql-snow+.ql-container.ql-snow{border-top:0}.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:\"Visit URL:\";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';margin-left:16px;padding-right:8px}.ql-snow .ql-tooltip a.ql-remove::before{content:'Remove';margin-left:8px}.ql-snow .ql-tooltip a{line-height:26px}.ql-snow .ql-tooltip.ql-editing a.ql-preview,.ql-snow .ql-tooltip.ql-editing a.ql-remove{display:none}.ql-snow .ql-tooltip.ql-editing input[type=text]{display:inline-block}.ql-snow .ql-tooltip.ql-editing a.ql-action::after{border-right:0;content:'Save';padding-right:0}.ql-snow .ql-tooltip[data-mode=link]::before{content:\"Enter link:\"}.ql-snow .ql-tooltip[data-mode=formula]::before{content:\"Enter formula:\"}.ql-snow .ql-tooltip[data-mode=video]::before{content:\"Enter video:\"}.ql-snow a{color:#06c}.ql-container.ql-snow{border:1px solid #ccc}";const PO=FO+"";const WO='.mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);word-break:break-word}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__wrapper{display:flex;width:100%;flex-direction:column;border-width:var(--mg-c-input-border-width);border-style:solid;border-color:var(--mg-c-input-color-border);border-radius:var(--mg-c-input-border-radius);background-color:var(--mg-b-color-light)}.mg-c-input__wrapper:focus-within{box-shadow:0 0 var(--mg-b-size-4) var(--mg-c-input-color-box-shadow-focus);outline:Highlight auto .1rem;outline:-webkit-focus-ring-color auto .1rem}.mg-c-input--has-error .mg-c-input__wrapper{border-color:var(--mg-b-color-danger)}.mg-c-input--disabled .mg-c-input__wrapper{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input--rich-text-editor .mg-c-input__readonly-value p{margin:0}.mg-c-input--rich-text-editor .mg-c-input__readonly-value p:not(:first-child){margin-top:1em}.mg-c-input--rich-text-editor .ql-toolbar{display:flex;flex-wrap:wrap;padding:var(--mg-b-size-8);border:0;border-radius:var(--mg-c-input-border-radius) var(--mg-c-input-border-radius) 0 0;background:var(--mg-b-color-neutral-0);border-block-end-width:var(--mg-c-input-border-width);border-block-end-color:var(--mg-c-input-color-border);border-block-end-style:solid}.mg-c-input--rich-text-editor .ql-toolbar .ql-formats{display:inline-flex;margin:inherit;gap:.2rem}.mg-c-input--rich-text-editor .ql-toolbar .ql-formats:not(:last-child)::after{width:.1rem;height:var(--mg-b-size-16);background:var(--mg-c-input-color-border);content:"";margin-block:var(--mg-b-size-8);margin-inline:var(--mg-b-size-8)}.mg-c-input--rich-text-editor .ql-toolbar button{display:flex;min-width:var(--mg-b-size-32);height:var(--mg-b-size-32);align-items:center;justify-content:center;padding:var(--mg-b-size-4);border:.1rem solid rgba(0,0,0,0);border-radius:var(--mg-b-size-radius);color:var(--mg-b-color-dark);float:inherit;transition-duration:.2s;transition-property:background-color,border-color;transition-timing-function:ease-in-out}.mg-c-input--rich-text-editor .ql-toolbar button .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button:hover .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button:focus .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active .ql-fill{fill:currentcolor}.mg-c-input--rich-text-editor .ql-toolbar button:hover .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button:focus .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke{stroke:currentcolor}.mg-c-input--rich-text-editor .ql-toolbar button svg{width:var(--mg-b-size-20);height:var(--mg-b-size-20)}.mg-c-input--rich-text-editor .ql-toolbar button:focus{color:var(--mg-b-color-dark)}.mg-c-input--rich-text-editor .ql-toolbar button:focus-visible,.mg-c-input--rich-text-editor .ql-toolbar button:hover,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active{border-color:var(--mg-b-color-neutral-70);background:var(--mg-b-color-neutral-20);color:var(--mg-b-color-dark)}.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke{stroke-width:.12rem}.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke.ql-thin{stroke-width:.1rem}.mg-c-input--rich-text-editor .ql-toolbar button.ql-bold .ql-stroke{stroke-width:.2rem}.mg-c-input--rich-text-editor .ql-container{border:0;border-radius:0 0 var(--mg-c-input-border-radius) var(--mg-c-input-border-radius);margin:0 .1rem .1rem;background:var(--mg-b-color-neutral-0)}.mg-c-input--rich-text-editor .ql-editor{min-height:calc(calc(var(--mg-b-font-size) * var(--mg-b-line-height) * var(--mg-c-input-rich-text-editor-rows, 3)) + calc((var(--mg-b-size-min-height) - var(--mg-b-font-size) * var(--mg-b-line-height)) / 2));padding:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-8);color:var(--mg-b-color-dark);font-size:var(--mg-b-font-size)}.mg-c-input--rich-text-editor .ql-editor.ql-blank::before{right:var(--mg-b-size-8);left:var(--mg-b-size-8)}.mg-c-input--rich-text-editor .ql-editor p:not(:first-child){margin-top:1em}.mg-c-input--rich-text-editor.mg-c-input--disabled .ql-toolbar{pointer-events:none}.mg-c-input--rich-text-editor.mg-c-input--has-error .ql-toolbar{border-color:var(--mg-b-color-danger)}';const ZO=class{constructor(n){t(this,n);this.inputValid=e(this,"input-valid");this.valueChange=e(this,"value-change");this.hasDisplayedError=false;this.classFocus="mg-u-is-focused";this.value="";this.labelOnTop=false;this.labelHide=false;this.rows=5;this.required=false;this.readonly=false;this.disabled=false;this.tooltipPosition="input";this.classCollection=new s(["mg-c-input--rich-text-editor"]);this.isEmpty=()=>{const t=this.getTextContent();return!(i(t)&&t!=="\n")};this.getTextContent=()=>this.value.replace(/<[^>]*>/g,"").trim();this.getPatternValidity=()=>this.pattern===undefined||new RegExp(`^${this.pattern}$`,"u").test(this.getTextContent());this.checkValidity=()=>{this.setValidity(this.readonly||this.disabled||(this.required?!this.isEmpty():true)&&this.getPatternValidity())};this.setErrorMessage=t=>{this.errorMessage=undefined;if(this.valid)return;else if(i(t)){this.errorMessage=t}else if(this.required&&this.isEmpty()){this.errorMessage=this.messages.errors.required}else if(!this.getPatternValidity()){this.errorMessage=this.patternErrorMessage}};this.handleFocus=()=>{this.classCollection.add(this.classFocus);this.classCollection=new s(this.classCollection.classes)};this.handleBlur=()=>{this.classCollection.delete(this.classFocus);this.classCollection=new s(this.classCollection.classes);if(!this.readonly){this.checkValidity();this.setErrorMessage();if(!this.valid){this.hasDisplayedError=true}}};this.handleTextChange=()=>{const t=this.editor.getSemanticHTML();this.value=t;this.valueChange.emit(t);this.checkValidity();if(this.hasDisplayedError){this.setErrorMessage()}}}watchReadonly(t){if(t)this.classCollection.add(o);else this.classCollection.delete(o)}watchDisabled(t){var e,n;if(t){this.classCollection.add(u);(e=this.editor)===null||e===void 0?void 0:e.disable()}else{this.classCollection.delete(u);(n=this.editor)===null||n===void 0?void 0:n.enable()}}handleValidityChange(){if(this.editor!==undefined&&this.editor!==null){this.checkValidity();if(this.hasDisplayedError){this.setErrorMessage();this.hasDisplayedError=false}}}validatePattern(t){if(t!==undefined&&!(i(this.pattern)&&i(this.patternErrorMessage))){throw new Error(`<mg-input-rich-text-editor> props "pattern" and "patternErrorMessage" must be non-empty string and paired. Passed value: "pattern='${l(this.pattern)}'" and "patternErrorMessage='${l(this.patternErrorMessage)}'".`)}}async getHTML(){return new Promise((t=>{requestAnimationFrame((()=>{t(this.editor.getSemanticHTML())}))}))}async getText(){return new Promise((t=>{requestAnimationFrame((()=>{t(this.editor.getText())}))}))}async displayError(){return new Promise((t=>{requestAnimationFrame((()=>{this.checkValidity();this.setErrorMessage();this.hasDisplayedError=this.invalid;t()}))}))}async setError(t,e){if(typeof t!=="boolean"){throw new Error('<mg-input-rich-text-editor> method "setError()" param "valid" must be a boolean.')}else if(!i(e)){throw new Error('<mg-input-rich-text-editor> method "setError()" param "errorMessage" must be a string.')}else{this.setValidity(t);this.setErrorMessage(t?undefined:e);this.hasDisplayedError=this.invalid}}async reset(){if(!this.readonly){this.value="";this.editor.setText("");this.checkValidity();this.errorMessage=undefined;this.hasDisplayedError=false}}setValidity(t){const e=this.valid;this.valid=t;this.invalid=!this.valid;if(this.valid!==e){this.inputValid.emit(this.valid)}}componentWillLoad(){this.messages=a(this.element).messages;this.element.style.setProperty("--mg-c-input-rich-text-editor-rows",this.rows.toString());this.validatePattern(this.pattern);this.validatePattern(this.patternErrorMessage);this.watchReadonly(this.readonly);this.watchDisabled(this.disabled);return setTimeout((()=>{this.checkValidity()}),0)}componentDidLoad(){if(this.readonly)return;this.editor=UO(this.wrapperElement,{modules:this.modules,readOnly:this.readonly||this.disabled,placeholder:this.placeholder,value:this.value,handleTextChange:this.handleTextChange,handleBlur:this.handleBlur,handleFocus:this.handleFocus})}render(){return n("mg-input",{key:"7636809a87a04ebf36f60c0f13152566e3ed45a4",identifier:this.identifier,class:this.classCollection.join(),label:this.label,labelOnTop:this.labelOnTop,labelHide:this.labelHide,required:this.required,tooltip:this.tooltip,tooltipPosition:this.tooltipPosition,helpText:this.helpText,errorMessage:this.hasDisplayedError?this.errorMessage:undefined},this.readonly?n("div",{class:"mg-c-input__readonly-value",innerHTML:this.value}):n("div",{ref:t=>{this.wrapperElement=t},id:this.identifier,class:"mg-c-input__wrapper"},n("div",null)))}get element(){return r(this)}static get watchers(){return{readonly:["watchReadonly","handleValidityChange"],disabled:["watchDisabled","handleValidityChange"],required:["handleValidityChange"],pattern:["validatePattern"],patternErrorMessage:["validatePattern"]}}};ZO.style=PO+WO;export{ZO as mg_input_rich_text_editor};
11
- //# sourceMappingURL=p-3853afb5.entry.js.map
10
+ */var Vg="4.17.21";var Ug=2;var Fg=1,Pg=3;var Wg=4294967295;var Zg=Array.prototype,Kg=Object.prototype;var Gg=Kg.hasOwnProperty;var Qg=d?d.iterator:undefined;var Yg=Math.max,Jg=Math.min;var Xg=function(t){return function(e,n,r){if(r==null){var i=V(n),s=i&&Br(n),l=s&&s.length&&fd(n,s);if(!(l?l.length:i)){r=n;n=e;e=this}}return t(e,n,r)}}(Op);Yt.after=Ag.after;Yt.ary=Ag.ary;Yt.assign=_g.assign;Yt.assignIn=_g.assignIn;Yt.assignInWith=_g.assignInWith;Yt.assignWith=_g.assignWith;Yt.at=_g.at;Yt.before=Ag.before;Yt.bind=Ag.bind;Yt.bindAll=Lg.bindAll;Yt.bindKey=Ag.bindKey;Yt.castArray=Og.castArray;Yt.chain=Tg.chain;Yt.chunk=kg.chunk;Yt.compact=kg.compact;Yt.concat=kg.concat;Yt.cond=Lg.cond;Yt.conforms=Lg.conforms;Yt.constant=Lg.constant;Yt.countBy=xg.countBy;Yt.create=_g.create;Yt.curry=Ag.curry;Yt.curryRight=Ag.curryRight;Yt.debounce=Ag.debounce;Yt.defaults=_g.defaults;Yt.defaultsDeep=_g.defaultsDeep;Yt.defer=Ag.defer;Yt.delay=Ag.delay;Yt.difference=kg.difference;Yt.differenceBy=kg.differenceBy;Yt.differenceWith=kg.differenceWith;Yt.drop=kg.drop;Yt.dropRight=kg.dropRight;Yt.dropRightWhile=kg.dropRightWhile;Yt.dropWhile=kg.dropWhile;Yt.fill=kg.fill;Yt.filter=xg.filter;Yt.flatMap=xg.flatMap;Yt.flatMapDeep=xg.flatMapDeep;Yt.flatMapDepth=xg.flatMapDepth;Yt.flatten=kg.flatten;Yt.flattenDeep=kg.flattenDeep;Yt.flattenDepth=kg.flattenDepth;Yt.flip=Ag.flip;Yt.flow=Lg.flow;Yt.flowRight=Lg.flowRight;Yt.fromPairs=kg.fromPairs;Yt.functions=_g.functions;Yt.functionsIn=_g.functionsIn;Yt.groupBy=xg.groupBy;Yt.initial=kg.initial;Yt.intersection=kg.intersection;Yt.intersectionBy=kg.intersectionBy;Yt.intersectionWith=kg.intersectionWith;Yt.invert=_g.invert;Yt.invertBy=_g.invertBy;Yt.invokeMap=xg.invokeMap;Yt.iteratee=Lg.iteratee;Yt.keyBy=xg.keyBy;Yt.keys=Br;Yt.keysIn=_g.keysIn;Yt.map=xg.map;Yt.mapKeys=_g.mapKeys;Yt.mapValues=_g.mapValues;Yt.matches=Lg.matches;Yt.matchesProperty=Lg.matchesProperty;Yt.memoize=Ag.memoize;Yt.merge=_g.merge;Yt.mergeWith=_g.mergeWith;Yt.method=Lg.method;Yt.methodOf=Lg.methodOf;Yt.mixin=Xg;Yt.negate=_p;Yt.nthArg=Lg.nthArg;Yt.omit=_g.omit;Yt.omitBy=_g.omitBy;Yt.once=Ag.once;Yt.orderBy=xg.orderBy;Yt.over=Lg.over;Yt.overArgs=Ag.overArgs;Yt.overEvery=Lg.overEvery;Yt.overSome=Lg.overSome;Yt.partial=Ag.partial;Yt.partialRight=Ag.partialRight;Yt.partition=xg.partition;Yt.pick=_g.pick;Yt.pickBy=_g.pickBy;Yt.property=Lg.property;Yt.propertyOf=Lg.propertyOf;Yt.pull=kg.pull;Yt.pullAll=kg.pullAll;Yt.pullAllBy=kg.pullAllBy;Yt.pullAllWith=kg.pullAllWith;Yt.pullAt=kg.pullAt;Yt.range=Lg.range;Yt.rangeRight=Lg.rangeRight;Yt.rearg=Ag.rearg;Yt.reject=xg.reject;Yt.remove=kg.remove;Yt.rest=Ag.rest;Yt.reverse=kg.reverse;Yt.sampleSize=xg.sampleSize;Yt.set=_g.set;Yt.setWith=_g.setWith;Yt.shuffle=xg.shuffle;Yt.slice=kg.slice;Yt.sortBy=xg.sortBy;Yt.sortedUniq=kg.sortedUniq;Yt.sortedUniqBy=kg.sortedUniqBy;Yt.split=Ng.split;Yt.spread=Ag.spread;Yt.tail=kg.tail;Yt.take=kg.take;Yt.takeRight=kg.takeRight;Yt.takeRightWhile=kg.takeRightWhile;Yt.takeWhile=kg.takeWhile;Yt.tap=Tg.tap;Yt.throttle=Ag.throttle;Yt.thru=fm;Yt.toArray=Og.toArray;Yt.toPairs=_g.toPairs;Yt.toPairsIn=_g.toPairsIn;Yt.toPath=Lg.toPath;Yt.toPlainObject=Og.toPlainObject;Yt.transform=_g.transform;Yt.unary=Ag.unary;Yt.union=kg.union;Yt.unionBy=kg.unionBy;Yt.unionWith=kg.unionWith;Yt.uniq=kg.uniq;Yt.uniqBy=kg.uniqBy;Yt.uniqWith=kg.uniqWith;Yt.unset=_g.unset;Yt.unzip=kg.unzip;Yt.unzipWith=kg.unzipWith;Yt.update=_g.update;Yt.updateWith=_g.updateWith;Yt.values=_g.values;Yt.valuesIn=_g.valuesIn;Yt.without=kg.without;Yt.words=Ng.words;Yt.wrap=Ag.wrap;Yt.xor=kg.xor;Yt.xorBy=kg.xorBy;Yt.xorWith=kg.xorWith;Yt.zip=kg.zip;Yt.zipObject=kg.zipObject;Yt.zipObjectDeep=kg.zipObjectDeep;Yt.zipWith=kg.zipWith;Yt.entries=_g.toPairs;Yt.entriesIn=_g.toPairsIn;Yt.extend=_g.assignIn;Yt.extendWith=_g.assignInWith;Xg(Yt,Yt);Yt.add=Mg.add;Yt.attempt=Lg.attempt;Yt.camelCase=Ng.camelCase;Yt.capitalize=Ng.capitalize;Yt.ceil=Mg.ceil;Yt.clamp=Eg.clamp;Yt.clone=Og.clone;Yt.cloneDeep=Og.cloneDeep;Yt.cloneDeepWith=Og.cloneDeepWith;Yt.cloneWith=Og.cloneWith;Yt.conformsTo=Og.conformsTo;Yt.deburr=Ng.deburr;Yt.defaultTo=Lg.defaultTo;Yt.divide=Mg.divide;Yt.endsWith=Ng.endsWith;Yt.eq=Og.eq;Yt.escape=Ng.escape;Yt.escapeRegExp=Ng.escapeRegExp;Yt.every=xg.every;Yt.find=xg.find;Yt.findIndex=kg.findIndex;Yt.findKey=_g.findKey;Yt.findLast=xg.findLast;Yt.findLastIndex=kg.findLastIndex;Yt.findLastKey=_g.findLastKey;Yt.floor=Mg.floor;Yt.forEach=xg.forEach;Yt.forEachRight=xg.forEachRight;Yt.forIn=_g.forIn;Yt.forInRight=_g.forInRight;Yt.forOwn=_g.forOwn;Yt.forOwnRight=_g.forOwnRight;Yt.get=_g.get;Yt.gt=Og.gt;Yt.gte=Og.gte;Yt.has=_g.has;Yt.hasIn=_g.hasIn;Yt.head=kg.head;Yt.identity=et;Yt.includes=xg.includes;Yt.indexOf=kg.indexOf;Yt.inRange=Eg.inRange;Yt.invoke=_g.invoke;Yt.isArguments=Og.isArguments;Yt.isArray=L;Yt.isArrayBuffer=Og.isArrayBuffer;Yt.isArrayLike=Og.isArrayLike;Yt.isArrayLikeObject=Og.isArrayLikeObject;Yt.isBoolean=Og.isBoolean;Yt.isBuffer=Og.isBuffer;Yt.isDate=Og.isDate;Yt.isElement=Og.isElement;Yt.isEmpty=Og.isEmpty;Yt.isEqual=Og.isEqual;Yt.isEqualWith=Og.isEqualWith;Yt.isError=Og.isError;Yt.isFinite=Og.isFinite;Yt.isFunction=Og.isFunction;Yt.isInteger=Og.isInteger;Yt.isLength=Og.isLength;Yt.isMap=Og.isMap;Yt.isMatch=Og.isMatch;Yt.isMatchWith=Og.isMatchWith;Yt.isNaN=Og.isNaN;Yt.isNative=Og.isNative;Yt.isNil=Og.isNil;Yt.isNull=Og.isNull;Yt.isNumber=Og.isNumber;Yt.isObject=V;Yt.isObjectLike=Og.isObjectLike;Yt.isPlainObject=Og.isPlainObject;Yt.isRegExp=Og.isRegExp;Yt.isSafeInteger=Og.isSafeInteger;Yt.isSet=Og.isSet;Yt.isString=Og.isString;Yt.isSymbol=Og.isSymbol;Yt.isTypedArray=Og.isTypedArray;Yt.isUndefined=Og.isUndefined;Yt.isWeakMap=Og.isWeakMap;Yt.isWeakSet=Og.isWeakSet;Yt.join=kg.join;Yt.kebabCase=Ng.kebabCase;Yt.last=Hf;Yt.lastIndexOf=kg.lastIndexOf;Yt.lowerCase=Ng.lowerCase;Yt.lowerFirst=Ng.lowerFirst;Yt.lt=Og.lt;Yt.lte=Og.lte;Yt.max=Mg.max;Yt.maxBy=Mg.maxBy;Yt.mean=Mg.mean;Yt.meanBy=Mg.meanBy;Yt.min=Mg.min;Yt.minBy=Mg.minBy;Yt.stubArray=Lg.stubArray;Yt.stubFalse=Lg.stubFalse;Yt.stubObject=Lg.stubObject;Yt.stubString=Lg.stubString;Yt.stubTrue=Lg.stubTrue;Yt.multiply=Mg.multiply;Yt.nth=kg.nth;Yt.noop=Lg.noop;Yt.now=jg.now;Yt.pad=Ng.pad;Yt.padEnd=Ng.padEnd;Yt.padStart=Ng.padStart;Yt.parseInt=Ng.parseInt;Yt.random=Eg.random;Yt.reduce=xg.reduce;Yt.reduceRight=xg.reduceRight;Yt.repeat=Ng.repeat;Yt.replace=Ng.replace;Yt.result=_g.result;Yt.round=Mg.round;Yt.sample=xg.sample;Yt.size=xg.size;Yt.snakeCase=Ng.snakeCase;Yt.some=xg.some;Yt.sortedIndex=kg.sortedIndex;Yt.sortedIndexBy=kg.sortedIndexBy;Yt.sortedIndexOf=kg.sortedIndexOf;Yt.sortedLastIndex=kg.sortedLastIndex;Yt.sortedLastIndexBy=kg.sortedLastIndexBy;Yt.sortedLastIndexOf=kg.sortedLastIndexOf;Yt.startCase=Ng.startCase;Yt.startsWith=Ng.startsWith;Yt.subtract=Mg.subtract;Yt.sum=Mg.sum;Yt.sumBy=Mg.sumBy;Yt.template=Ng.template;Yt.times=Lg.times;Yt.toFinite=Og.toFinite;Yt.toInteger=J;Yt.toLength=Og.toLength;Yt.toLower=Ng.toLower;Yt.toNumber=Og.toNumber;Yt.toSafeInteger=Og.toSafeInteger;Yt.toString=Og.toString;Yt.toUpper=Ng.toUpper;Yt.trim=Ng.trim;Yt.trimEnd=Ng.trimEnd;Yt.trimStart=Ng.trimStart;Yt.truncate=Ng.truncate;Yt.unescape=Ng.unescape;Yt.uniqueId=Lg.uniqueId;Yt.upperCase=Ng.upperCase;Yt.upperFirst=Ng.upperFirst;Yt.each=xg.forEach;Yt.eachRight=xg.forEachRight;Yt.first=kg.head;Xg(Yt,function(){var t={};ef(Yt,(function(e,n){if(!Gg.call(Yt.prototype,n)){t[n]=e}}));return t}(),{chain:false});Yt.VERSION=Vg;(Yt.templateSettings=Ng.templateSettings).imports._=Yt;de(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Yt[t].placeholder=Yt}));de(["drop","take"],(function(t,e){Bt.prototype[t]=function(n){n=n===undefined?1:Yg(J(n),0);var r=this.__filtered__&&!e?new Bt(this):this.clone();if(r.__filtered__){r.__takeCount__=Jg(n,r.__takeCount__)}else{r.__views__.push({size:Jg(n,Wg),type:t+(r.__dir__<0?"Right":"")})}return r};Bt.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}));de(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=n==Fg||n==Pg;Bt.prototype[t]=function(t){var e=this.clone();e.__iteratees__.push({iteratee:Fc(t),type:n});e.__filtered__=e.__filtered__||r;return e}}));de(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Bt.prototype[t]=function(){return this[n](1).value()[0]}}));de(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Bt.prototype[t]=function(){return this.__filtered__?new Bt(this):this[n](1)}}));Bt.prototype.compact=function(){return this.filter(et)};Bt.prototype.find=function(t){return this.filter(t).head()};Bt.prototype.findLast=function(t){return this.reverse().find(t)};Bt.prototype.invokeMap=_n((function(t,e){if(typeof t=="function"){return new Bt(this)}return this.map((function(n){return tv(n,t,e)}))}));Bt.prototype.reject=function(t){return this.filter(_p(Fc(t)))};Bt.prototype.slice=function(t,e){t=J(t);var n=this;if(n.__filtered__&&(t>0||e<0)){return new Bt(n)}if(t<0){n=n.takeRight(-t)}else if(t){n=n.drop(t)}if(e!==undefined){e=J(e);n=e<0?n.dropRight(-e):n.take(e-t)}return n};Bt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()};Bt.prototype.toArray=function(){return this.take(Wg)};ef(Bt.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Yt[r?"take"+(e=="last"?"Right":""):e],s=r||/^find/.test(e);if(!i){return}Yt.prototype[e]=function(){var e=this.__wrapped__,l=r?[1]:arguments,o=e instanceof Bt,u=l[0],a=o||L(e);var c=function(t){var e=i.apply(Yt,Fi([t],l));return r&&f?e[0]:e};if(a&&n&&typeof u=="function"&&u.length!=1){o=a=false}var f=this.__chain__,h=!!this.__actions__.length,d=s&&!f,v=o&&!h;if(!s&&a){e=v?e:new Bt(this);var p=t.apply(e,l);p.__actions__.push({func:fm,args:[c],thisArg:undefined});return new Wt(p,f)}if(d&&v){return t.apply(this,l)}p=this.thru(c);return d?r?p.value()[0]:p.value():p}}));de(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Zg[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Yt.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(L(i)?i:[],t)}return this[n]((function(n){return e.apply(L(n)?n:[],t)}))}}));ef(Bt.prototype,(function(t,e){var n=Yt[e];if(n){var r=n.name+"";if(!Gg.call(Vt,r)){Vt[r]=[]}Vt[r].push({name:e,func:n})}}));Vt[Qe(undefined,Ug).name]=[{name:"wrapper",func:undefined}];Bt.prototype.clone=$g;Bt.prototype.reverse=Sg;Bt.prototype.value=Hg;Yt.prototype.at=Tg.at;Yt.prototype.chain=Tg.wrapperChain;Yt.prototype.commit=Tg.commit;Yt.prototype.next=Tg.next;Yt.prototype.plant=Tg.plant;Yt.prototype.reverse=Tg.reverse;Yt.prototype.toJSON=Yt.prototype.valueOf=Yt.prototype.value=Tg.value;Yt.prototype.first=Yt.prototype.head;if(Qg){Yt.prototype[Qg]=Tg.toIterator}var ty=(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))(ty||{});class ey{constructor(t,e,n={}){this.attrName=t,this.keyName=e;const r=ty.TYPE&ty.ATTRIBUTE;this.scope=n.scope!=null?n.scope&ty.LEVEL|r:ty.ATTRIBUTE,n.whitelist!=null&&(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),true):false}canAdd(t,e){return this.whitelist==null?true:typeof e=="string"?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 ny extends Error{constructor(t){t="[Parchment] "+t,super(t),this.message=t,this.name=this.constructor.name}}const ry=class t{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=false){if(t==null)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 i=this.query(n);if(i==null)throw new ny(`Unable to create ${n} blot`);const s=i,l=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:s.create(r),o=new s(e,l,r);return t.blots.set(o.domNode,o),o}find(e,n=false){return t.find(e,n)}query(t,e=ty.ANY){let n;return typeof t=="string"?n=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?n=this.types.text:typeof t=="number"?t&ty.LEVEL&ty.BLOCK?n=this.types.block:t&ty.LEVEL&ty.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]),n==null?null:"scope"in n&&e&ty.LEVEL&n.scope&&e&ty.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 ny("Invalid definition");if(e&&t.blotName==="abstract")throw new ny("Cannot register abstract class");const r=e?t.blotName:n?t.attrName:void 0;return this.types[r]=t,n?typeof t.keyName=="string"&&(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=>{(this.tags[e]==null||t.className==null)&&(this.tags[e]=t)})))),t}))}};ry.blots=new WeakMap;let iy=ry;function sy(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter((t=>t.indexOf(`${e}-`)===0))}class ly extends ey{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}`),true):false}remove(t){sy(t,this.keyName).forEach((e=>{t.classList.remove(e)})),t.classList.length===0&&t.removeAttribute("class")}value(t){const e=(sy(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}}const oy=ly;function uy(t){const e=t.split("-"),n=e.slice(1).map((t=>t[0].toUpperCase()+t.slice(1))).join("");return e[0]+n}class ay extends ey{static keys(t){return(t.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(t,e){return this.canAdd(t,e)?(t.style[uy(this.keyName)]=e,true):false}remove(t){t.style[uy(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[uy(this.keyName)];return this.canAdd(t,e)?e:""}}const cy=ay;class fy{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(t.value(this.domNode)!=null?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=iy.find(this.domNode);if(t==null)return;const e=ey.keys(this.domNode),n=oy.keys(this.domNode),r=cy.keys(this.domNode);e.concat(n).concat(r).forEach((e=>{const n=t.scroll.query(e,ty.ATTRIBUTE);n instanceof ey&&(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)),{})}}const hy=fy,dy=class t{constructor(t,e){this.scroll=t,this.domNode=e,iy.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(this.tagName==null)throw new ny("Blot definition missing tagName");let e,n;return Array.isArray(this.tagName)?(typeof t=="string"?(n=t.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof t=="number"&&(n=t),typeof n=="number"?e=document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?e=document.createElement(n):e=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(false);return this.scroll.create(t)}detach(){this.parent!=null&&this.parent.removeChild(this),iy.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,n,r){const i=this.isolate(t,e);if(this.scroll.query(n,ty.BLOT)!=null&&r)i.wrap(n,r);else if(this.scroll.query(n,ty.ATTRIBUTE)!=null){const t=this.scroll.create(this.statics.scope);i.wrap(t),t.format(n,r)}}insertAt(t,e,n){const r=n==null?this.scroll.create("text",e):this.scroll.create(e,n),i=this.split(t);this.parent.insertBefore(r,i||void 0)}isolate(t,e){const n=this.split(t);if(n==null)throw new Error("Attempt to isolate at end");return n.split(e),n}length(){return 1}offset(t=this.parent){return this.parent==null||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(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(t,e){return t===0?this:this.next}update(t,e){}wrap(t,e){const n=typeof t=="string"?this.scroll.create(t,e):t;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!="function")throw new ny(`Cannot wrap ${t}`);return n.appendChild(this),n}};dy.blotName="abstract";let vy=dy;const py=class t extends vy{static value(t){return true}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)||true}}};py.scope=ty.INLINE_BLOT;let by=py;const qy=by;class wy{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 true;n=e()}return false}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){t!=null&&(this.remove(t),t.next=e,e!=null?(t.prev=e.prev,e.prev!=null&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):this.tail!=null?(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(;n!=null;){if(n===t)return e;e+=n.length(),n=n.next}return-1}remove(t){this.contains(t)&&(t.prev!=null&&(t.prev.next=t.next),t.next!=null&&(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 t!=null&&(t=t.next),e}}find(t,e=false){const n=this.iterator();let r=n();for(;r;){const i=r.length();if(t<i||e&&t===i&&(r.next==null||r.next.length()!==0))return[r,t];t-=i,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,i]=this.find(t);let s=t-i;const l=this.iterator(r);let o=l();for(;o&&s<t+e;){const r=o.length();t>s?n(o,t-s,Math.min(e,s+r-t)):n(o,0,Math.min(r,t+e-s)),s+=r,o=l()}}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 my(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const n=e.create(ty.INLINE);return Array.from(t.childNodes).forEach((t=>{n.domNode.appendChild(t)})),t.parentNode&&t.parentNode.replaceChild(n.domNode,t),n.attach(),n}}const gy=class t extends vy{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){this.uiNode!=null&&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 wy,Array.from(this.domNode.childNodes).filter((t=>t!==this.uiNode)).reverse().forEach((t=>{try{const e=my(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof ny)return;throw t}}))}deleteAt(t,e){if(t===0&&e===this.length())return this.remove();this.children.forEachAt(t,e,((t,e,n)=>{t.deleteAt(e,n)}))}descendant(e,n=0){const[r,i]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof t?r.descendant(e,i):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let i=[],s=r;return this.children.forEachAt(n,r,((n,r,l)=>{(e.blotName==null&&e(n)||e.blotName!=null&&n instanceof e)&&i.push(n),n instanceof t&&(i=i.concat(n.descendants(e,r,s))),s-=l})),i}detach(){this.children.forEach((t=>{t.detach()})),super.detach()}enforceAllowedChildren(){let e=false;this.children.forEach((n=>{e||this.statics.allowedChildren.some((t=>n instanceof t))||(n.statics.scope===ty.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=true):n instanceof t?n.unwrap():n.remove())}))}formatAt(t,e,n,r){this.children.forEachAt(t,e,((t,e,i)=>{t.formatAt(e,i,n,r)}))}insertAt(t,e,n){const[r,i]=this.children.find(t);if(r)r.insertAt(i,e,n);else{const t=n==null?this.scroll.create("text",e):this.scroll.create(e,n);this.appendChild(t)}}insertBefore(t,e){t.parent!=null&&t.parent.children.remove(t);let n=null;this.children.insertBefore(t,e||null),t.parent=this,e!=null&&(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(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,n=false){const[r,i]=this.children.find(e,n),s=[[this,e]];return r instanceof t?s.concat(r.path(i,n)):(r!=null&&s.push([r,i]),s)}removeChild(t){this.children.remove(t)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof t&&this.moveChildren(r),super.replaceWith(r)}split(t,e=false){if(!e){if(t===0)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,i)=>{const s=t.split(r,e);s!=null&&n.appendChild(s)})),n}splitAfter(t){const e=this.clone();for(;t.next!=null;)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&&t.type==="childList"&&(n.push(...t.addedNodes),r.push(...t.removedNodes))})),r.forEach((t=>{if(t.parentNode!=null&&t.tagName!=="IFRAME"&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);e!=null&&(e.domNode.parentNode==null||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;t.nextSibling!=null&&(e=this.scroll.find(t.nextSibling));const n=my(t,this.scroll);(n.next!==e||n.next==null)&&(n.parent!=null&&n.parent.removeChild(this),this.insertBefore(n,e||void 0))})),this.enforceAllowedChildren()}};gy.uiClass="";let yy=gy;const ky=yy;function xy(t,e){if(Object.keys(t).length!==Object.keys(e).length)return false;for(const n in t)if(t[n]!==e[n])return false;return true}const jy=class t extends ky{static create(t){return super.create(t)}static formats(e,n){const r=n.query(t.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return true;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new hy(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach((e=>{e instanceof t||(e=e.wrap(t.blotName,true)),this.attributes.copy(e)})),this.unwrap();else{const t=this.scroll.query(e,ty.INLINE);if(t==null)return;t instanceof ey?this.attributes.attribute(t,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,r){this.formats()[n]!=null||this.scroll.query(n,ty.ATTRIBUTE)?this.isolate(t,e).format(n,r):super.formatAt(t,e,n,r)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof t&&r.prev===this&&xy(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&&t.type==="attributes"))&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof t&&this.attributes.move(r),r}};jy.allowedChildren=[jy,qy],jy.blotName="inline",jy.scope=ty.INLINE_BLOT,jy.tagName="SPAN";let Ay=jy;const Oy=Ay,My=class t extends ky{static create(t){return super.create(t)}static formats(e,n){const r=n.query(t.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return true;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new hy(this.domNode)}format(e,n){const r=this.scroll.query(e,ty.BLOCK);r!=null&&(r instanceof ey?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(t.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return e!=null&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,r){this.scroll.query(n,ty.BLOCK)!=null?this.format(n,r):super.formatAt(t,e,n,r)}insertAt(t,e,n){if(n==null||this.scroll.query(e,ty.INLINE)!=null)super.insertAt(t,e,n);else{const r=this.split(t);if(r!=null){const t=this.scroll.create(e,n);r.parent.insertBefore(t,r)}else throw new Error("Attempt to insertAt after block boundaries")}}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&&t.type==="attributes"))&&this.attributes.build()}};My.blotName="block",My.scope=ty.BLOCK_BLOT,My.tagName="P",My.allowedChildren=[Oy,My,qy];let Ey=My;const _y=Ey,Ty=class t extends ky{checkMerge(){return this.next!==null&&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&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Ty.blotName="container",Ty.scope=ty.BLOCK_BLOT;let Ny=Ty;const Ly=Ny;class $y extends qy{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,n,r){t===0&&e===this.length()?this.format(n,r):super.formatAt(t,e,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Sy=$y,zy={attributes:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true},Ry=100,Iy=class t extends ky{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,zy),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=false){const n=this.registry.find(t,e);return n?n.scroll===this?n:e?this.find(n.scroll.domNode.parentNode,true):null:null}query(t,e=ty.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),t===0&&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 i=(t,e=true)=>{t==null||t===this||t.domNode.parentNode!=null&&(n.has(t.domNode)||n.set(t.domNode,[]),e&&i(t.parent))},s=t=>{n.has(t.domNode)&&(t instanceof ky&&t.children.forEach(s),n.delete(t.domNode),t.optimize(e))};let l=t;for(let e=0;l.length>0;e+=1){if(e>=Ry)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach((t=>{const e=this.find(t.target,true);e!=null&&(e.domNode===t.target&&(t.type==="childList"?(i(this.find(t.previousSibling,false)),Array.from(t.addedNodes).forEach((t=>{const e=this.find(t,false);i(e,false),e instanceof ky&&e.children.forEach((t=>{i(t,false)}))}))):t.type==="attributes"&&i(e.prev)),i(e))})),this.children.forEach(s),l=Array.from(this.observer.takeRecords()),r=l.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,true);return e==null?null:n.has(e.domNode)?(n.get(e.domNode).push(t),null):(n.set(e.domNode,[t]),e)})).forEach((t=>{t!=null&&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)}};Iy.blotName="scroll",Iy.defaultChild=_y,Iy.allowedChildren=[_y,Ly],Iy.scope=ty.BLOCK_BLOT,Iy.tagName="DIV";let Cy=Iy;const By=Cy,Dy=class t extends qy{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){n==null?(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),this.text.length===0?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=false){return[this.domNode,t]}split(t,e=false){if(!e){if(t===0)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=>t.type==="characterData"&&t.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Dy.blotName="text",Dy.scope=ty.INLINE_BLOT;let Hy=Dy;const Vy=Hy;var Uy=Object.freeze({__proto__:null,Attributor:ey,AttributorStore:hy,BlockBlot:_y,ClassAttributor:oy,ContainerBlot:Ly,EmbedBlot:Sy,InlineBlot:Oy,LeafBlot:qy,ParentBlot:ky,Registry:iy,Scope:ty,ScrollBlot:By,StyleAttributor:cy,TextBlot:Vy});var Fy=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function Py(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}var Wy={exports:{}};var Zy;var Ky;function Gy(){if(Ky)return Zy;Ky=1;var t=-1;var e=1;var n=0;function r(t,e,r,s,l){if(t===e){if(t){return[[n,t]]}return[]}if(r!=null){var u=A(t,e,r);if(u){return u}}var c=o(t,e);var h=t.substring(0,c);t=t.substring(c);e=e.substring(c);c=a(t,e);var d=t.substring(t.length-c);t=t.substring(0,t.length-c);e=e.substring(0,e.length-c);var v=i(t,e);if(h){v.unshift([n,h])}if(d){v.push([n,d])}w(v,l);if(s){f(v)}return v}function i(i,l){var o;if(!i){return[[e,l]]}if(!l){return[[t,i]]}var u=i.length>l.length?i:l;var a=i.length>l.length?l:i;var f=u.indexOf(a);if(f!==-1){o=[[e,u.substring(0,f)],[n,a],[e,u.substring(f+a.length)]];if(i.length>l.length){o[0][0]=o[2][0]=t}return o}if(a.length===1){return[[t,i],[e,l]]}var h=c(i,l);if(h){var d=h[0];var v=h[1];var p=h[2];var b=h[3];var q=h[4];var w=r(d,p);var m=r(v,b);return w.concat([[n,q]],m)}return s(i,l)}function s(n,r){var i=n.length;var s=r.length;var o=Math.ceil((i+s)/2);var u=o;var a=2*o;var c=new Array(a);var f=new Array(a);for(var h=0;h<a;h++){c[h]=-1;f[h]=-1}c[u+1]=0;f[u+1]=0;var d=i-s;var v=d%2!==0;var p=0;var b=0;var q=0;var w=0;for(var m=0;m<o;m++){for(var g=-m+p;g<=m-b;g+=2){var y=u+g;var k;if(g===-m||g!==m&&c[y-1]<c[y+1]){k=c[y+1]}else{k=c[y-1]+1}var x=k-g;while(k<i&&x<s&&n.charAt(k)===r.charAt(x)){k++;x++}c[y]=k;if(k>i){b+=2}else if(x>s){p+=2}else if(v){var j=u+d-g;if(j>=0&&j<a&&f[j]!==-1){var A=i-f[j];if(k>=A){return l(n,r,k,x)}}}}for(var O=-m+q;O<=m-w;O+=2){var j=u+O;var A;if(O===-m||O!==m&&f[j-1]<f[j+1]){A=f[j+1]}else{A=f[j-1]+1}var M=A-O;while(A<i&&M<s&&n.charAt(i-A-1)===r.charAt(s-M-1)){A++;M++}f[j]=A;if(A>i){w+=2}else if(M>s){q+=2}else if(!v){var y=u+d-O;if(y>=0&&y<a&&c[y]!==-1){var k=c[y];var x=u+k-y;A=i-A;if(k>=A){return l(n,r,k,x)}}}}}return[[t,n],[e,r]]}function l(t,e,n,i){var s=t.substring(0,n);var l=e.substring(0,i);var o=t.substring(n);var u=e.substring(i);var a=r(s,l);var c=r(o,u);return a.concat(c)}function o(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0)){return 0}var n=0;var r=Math.min(t.length,e.length);var i=r;var s=0;while(n<i){if(t.substring(s,i)==e.substring(s,i)){n=i;s=n}else{r=i}i=Math.floor((r-n)/2+n)}if(m(t.charCodeAt(i-1))){i--}return i}function u(t,e){var n=t.length;var r=e.length;if(n==0||r==0){return 0}if(n>r){t=t.substring(n-r)}else if(n<r){e=e.substring(0,n)}var i=Math.min(n,r);if(t==e){return i}var s=0;var l=1;while(true){var o=t.substring(i-l);var u=e.indexOf(o);if(u==-1){return s}l+=u;if(u==0||t.substring(i-l)==e.substring(0,l)){s=l;l++}}}function a(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1)){return 0}var n=0;var r=Math.min(t.length,e.length);var i=r;var s=0;while(n<i){if(t.substring(t.length-i,t.length-s)==e.substring(e.length-i,e.length-s)){n=i;s=n}else{r=i}i=Math.floor((r-n)/2+n)}if(g(t.charCodeAt(t.length-i))){i--}return i}function c(t,e){var n=t.length>e.length?t:e;var r=t.length>e.length?e:t;if(n.length<4||r.length*2<n.length){return null}function i(t,e,n){var r=t.substring(n,n+Math.floor(t.length/4));var i=-1;var s="";var l,u,c,f;while((i=e.indexOf(r,i+1))!==-1){var h=o(t.substring(n),e.substring(i));var d=a(t.substring(0,n),e.substring(0,i));if(s.length<d+h){s=e.substring(i-d,i)+e.substring(i,i+h);l=t.substring(0,n-d);u=t.substring(n+h);c=e.substring(0,i-d);f=e.substring(i+h)}}if(s.length*2>=t.length){return[l,u,c,f,s]}else{return null}}var s=i(n,r,Math.ceil(n.length/4));var l=i(n,r,Math.ceil(n.length/2));var u;if(!s&&!l){return null}else if(!l){u=s}else if(!s){u=l}else{u=s[4].length>l[4].length?s:l}var c,f,h,d;if(t.length>e.length){c=u[0];f=u[1];h=u[2];d=u[3]}else{h=u[0];d=u[1];c=u[2];f=u[3]}var v=u[4];return[c,f,h,d,v]}function f(r){var i=false;var s=[];var l=0;var o=null;var a=0;var c=0;var f=0;var h=0;var d=0;while(a<r.length){if(r[a][0]==n){s[l++]=a;c=h;f=d;h=0;d=0;o=r[a][1]}else{if(r[a][0]==e){h+=r[a][1].length}else{d+=r[a][1].length}if(o&&o.length<=Math.max(c,f)&&o.length<=Math.max(h,d)){r.splice(s[l-1],0,[t,o]);r[s[l-1]+1][0]=e;l--;l--;a=l>0?s[l-1]:-1;c=0;f=0;h=0;d=0;o=null;i=true}}a++}if(i){w(r)}q(r);a=1;while(a<r.length){if(r[a-1][0]==t&&r[a][0]==e){var v=r[a-1][1];var p=r[a][1];var b=u(v,p);var m=u(p,v);if(b>=m){if(b>=v.length/2||b>=p.length/2){r.splice(a,0,[n,p.substring(0,b)]);r[a-1][1]=v.substring(0,v.length-b);r[a+1][1]=p.substring(b);a++}}else{if(m>=v.length/2||m>=p.length/2){r.splice(a,0,[n,v.substring(0,m)]);r[a-1][0]=e;r[a-1][1]=p.substring(0,p.length-m);r[a+1][0]=t;r[a+1][1]=v.substring(m);a++}}a++}a++}}var h=/[^a-zA-Z0-9]/;var d=/\s/;var v=/[\r\n]/;var p=/\n\r?\n$/;var b=/^\r?\n\r?\n/;function q(t){function e(t,e){if(!t||!e){return 6}var n=t.charAt(t.length-1);var r=e.charAt(0);var i=n.match(h);var s=r.match(h);var l=i&&n.match(d);var o=s&&r.match(d);var u=l&&n.match(v);var a=o&&r.match(v);var c=u&&t.match(p);var f=a&&e.match(b);if(c||f){return 5}else if(u||a){return 4}else if(i&&!l&&o){return 3}else if(l||o){return 2}else if(i||s){return 1}return 0}var r=1;while(r<t.length-1){if(t[r-1][0]==n&&t[r+1][0]==n){var i=t[r-1][1];var s=t[r][1];var l=t[r+1][1];var o=a(i,s);if(o){var u=s.substring(s.length-o);i=i.substring(0,i.length-o);s=u+s.substring(0,s.length-o);l=u+l}var c=i;var f=s;var q=l;var w=e(i,s)+e(s,l);while(s.charAt(0)===l.charAt(0)){i+=s.charAt(0);s=s.substring(1)+l.charAt(0);l=l.substring(1);var m=e(i,s)+e(s,l);if(m>=w){w=m;c=i;f=s;q=l}}if(t[r-1][1]!=c){if(c){t[r-1][1]=c}else{t.splice(r-1,1);r--}t[r][1]=f;if(q){t[r+1][1]=q}else{t.splice(r+1,1);r--}}}r++}}function w(r,i){r.push([n,""]);var s=0;var l=0;var u=0;var c="";var f="";var h;while(s<r.length){if(s<r.length-1&&!r[s][1]){r.splice(s,1);continue}switch(r[s][0]){case e:u++;f+=r[s][1];s++;break;case t:l++;c+=r[s][1];s++;break;case n:var d=s-u-l-1;if(i){if(d>=0&&k(r[d][1])){var v=r[d][1].slice(-1);r[d][1]=r[d][1].slice(0,-1);c=v+c;f=v+f;if(!r[d][1]){r.splice(d,1);s--;var p=d-1;if(r[p]&&r[p][0]===e){u++;f=r[p][1]+f;p--}if(r[p]&&r[p][0]===t){l++;c=r[p][1]+c;p--}d=p}}if(y(r[s][1])){var v=r[s][1].charAt(0);r[s][1]=r[s][1].slice(1);c+=v;f+=v}}if(s<r.length-1&&!r[s][1]){r.splice(s,1);break}if(c.length>0||f.length>0){if(c.length>0&&f.length>0){h=o(f,c);if(h!==0){if(d>=0){r[d][1]+=f.substring(0,h)}else{r.splice(0,0,[n,f.substring(0,h)]);s++}f=f.substring(h);c=c.substring(h)}h=a(f,c);if(h!==0){r[s][1]=f.substring(f.length-h)+r[s][1];f=f.substring(0,f.length-h);c=c.substring(0,c.length-h)}}var b=u+l;if(c.length===0&&f.length===0){r.splice(s-b,b);s=s-b}else if(c.length===0){r.splice(s-b,b,[e,f]);s=s-b+1}else if(f.length===0){r.splice(s-b,b,[t,c]);s=s-b+1}else{r.splice(s-b,b,[t,c],[e,f]);s=s-b+2}}if(s!==0&&r[s-1][0]===n){r[s-1][1]+=r[s][1];r.splice(s,1)}else{s++}u=0;l=0;c="";f="";break}}if(r[r.length-1][1]===""){r.pop()}var q=false;s=1;while(s<r.length-1){if(r[s-1][0]===n&&r[s+1][0]===n){if(r[s][1].substring(r[s][1].length-r[s-1][1].length)===r[s-1][1]){r[s][1]=r[s-1][1]+r[s][1].substring(0,r[s][1].length-r[s-1][1].length);r[s+1][1]=r[s-1][1]+r[s+1][1];r.splice(s-1,1);q=true}else if(r[s][1].substring(0,r[s+1][1].length)==r[s+1][1]){r[s-1][1]+=r[s+1][1];r[s][1]=r[s][1].substring(r[s+1][1].length)+r[s+1][1];r.splice(s+1,1);q=true}}s++}if(q){w(r,i)}}function m(t){return t>=55296&&t<=56319}function g(t){return t>=56320&&t<=57343}function y(t){return g(t.charCodeAt(0))}function k(t){return m(t.charCodeAt(t.length-1))}function x(t){var e=[];for(var n=0;n<t.length;n++){if(t[n][1].length>0){e.push(t[n])}}return e}function j(r,i,s,l){if(k(r)||y(l)){return null}return x([[n,r],[t,i],[e,s],[n,l]])}function A(t,e,n){var r=typeof n==="number"?{index:n,length:0}:n.oldRange;var i=typeof n==="number"?null:n.newRange;var s=t.length;var l=e.length;if(r.length===0&&(i===null||i.length===0)){var o=r.index;var u=t.slice(0,o);var a=t.slice(o);var c=i?i.index:null;t:{var f=o+l-s;if(c!==null&&c!==f){break t}if(f<0||f>l){break t}var h=e.slice(0,f);var d=e.slice(f);if(d!==a){break t}var v=Math.min(o,f);var p=u.slice(0,v);var b=h.slice(0,v);if(p!==b){break t}var q=u.slice(v);var w=h.slice(v);return j(p,q,w,a)}t:{if(c!==null&&c!==o){break t}var m=o;var h=e.slice(0,m);var d=e.slice(m);if(h!==u){break t}var g=Math.min(s-m,l-m);var y=a.slice(a.length-g);var k=d.slice(d.length-g);if(y!==k){break t}var q=a.slice(0,a.length-g);var w=d.slice(0,d.length-g);return j(u,q,w,y)}}if(r.length>0&&i&&i.length===0){t:{var p=t.slice(0,r.index);var y=t.slice(r.index+r.length);var v=p.length;var g=y.length;if(l<v+g){break t}var b=e.slice(0,v);var k=e.slice(l-g);if(p!==b||y!==k){break t}var q=t.slice(v,s-g);var w=e.slice(v,l-g);return j(p,q,w,y)}}return null}function O(t,e,n,i){return r(t,e,n,i,true)}O.INSERT=e;O.DELETE=t;O.EQUAL=n;Zy=O;return Zy}var Qy={exports:{}};var Yy;function Jy(){if(Yy)return Qy.exports;Yy=1;(function(t,e){var n=200;var r="__lodash_hash_undefined__";var i=9007199254740991;var s="[object Arguments]",l="[object Array]",o="[object Boolean]",u="[object Date]",a="[object Error]",c="[object Function]",f="[object GeneratorFunction]",h="[object Map]",d="[object Number]",v="[object Object]",p="[object Promise]",b="[object RegExp]",q="[object Set]",w="[object String]",m="[object Symbol]",g="[object WeakMap]";var y="[object ArrayBuffer]",k="[object DataView]",x="[object Float32Array]",j="[object Float64Array]",A="[object Int8Array]",O="[object Int16Array]",M="[object Int32Array]",E="[object Uint8Array]",_="[object Uint8ClampedArray]",T="[object Uint16Array]",N="[object Uint32Array]";var L=/[\\^$.*+?()[\]{}|]/g;var $=/\w*$/;var S=/^\[object .+?Constructor\]$/;var z=/^(?:0|[1-9]\d*)$/;var R={};R[s]=R[l]=R[y]=R[k]=R[o]=R[u]=R[x]=R[j]=R[A]=R[O]=R[M]=R[h]=R[d]=R[v]=R[b]=R[q]=R[w]=R[m]=R[E]=R[_]=R[T]=R[N]=true;R[a]=R[c]=R[g]=false;var I=typeof Fy=="object"&&Fy&&Fy.Object===Object&&Fy;var C=typeof self=="object"&&self&&self.Object===Object&&self;var B=I||C||Function("return this")();var D=e&&!e.nodeType&&e;var H=D&&"object"=="object"&&t&&!t.nodeType&&t;var V=H&&H.exports===D;function U(t,e){t.set(e[0],e[1]);return t}function F(t,e){t.add(e);return t}function P(t,e){var n=-1,r=t?t.length:0;while(++n<r){if(e(t[n],n,t)===false){break}}return t}function W(t,e){var n=-1,r=e.length,i=t.length;while(++n<r){t[i+n]=e[n]}return t}function Z(t,e,n,r){var i=-1,s=t?t.length:0;while(++i<s){n=e(n,t[i],i,t)}return n}function K(t,e){var n=-1,r=Array(t);while(++n<t){r[n]=e(n)}return r}function G(t,e){return t==null?undefined:t[e]}function Q(t){var e=false;if(t!=null&&typeof t.toString!="function"){try{e=!!(t+"")}catch(t){}}return e}function Y(t){var e=-1,n=Array(t.size);t.forEach((function(t,r){n[++e]=[r,t]}));return n}function J(t,e){return function(n){return t(e(n))}}function X(t){var e=-1,n=Array(t.size);t.forEach((function(t){n[++e]=t}));return n}var tt=Array.prototype,et=Function.prototype,nt=Object.prototype;var rt=B["__core-js_shared__"];var it=function(){var t=/[^.]+$/.exec(rt&&rt.keys&&rt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var st=et.toString;var lt=nt.hasOwnProperty;var ot=nt.toString;var ut=RegExp("^"+st.call(lt).replace(L,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var at=V?B.Buffer:undefined,ct=B.Symbol,ft=B.Uint8Array,ht=J(Object.getPrototypeOf,Object),dt=Object.create,vt=nt.propertyIsEnumerable,pt=tt.splice;var bt=Object.getOwnPropertySymbols,qt=at?at.isBuffer:undefined,wt=J(Object.keys,Object);var mt=Ae(B,"DataView"),gt=Ae(B,"Map"),yt=Ae(B,"Promise"),kt=Ae(B,"Set"),xt=Ae(B,"WeakMap"),jt=Ae(Object,"create");var At=ze(mt),Ot=ze(gt),Mt=ze(yt),Et=ze(kt),_t=ze(xt);var Tt=ct?ct.prototype:undefined,Nt=Tt?Tt.valueOf:undefined;function Lt(t){var e=-1,n=t?t.length:0;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function $t(){this.__data__=jt?jt(null):{}}function St(t){return this.has(t)&&delete this.__data__[t]}function zt(t){var e=this.__data__;if(jt){var n=e[t];return n===r?undefined:n}return lt.call(e,t)?e[t]:undefined}function Rt(t){var e=this.__data__;return jt?e[t]!==undefined:lt.call(e,t)}function It(t,e){var n=this.__data__;n[t]=jt&&e===undefined?r:e;return this}Lt.prototype.clear=$t;Lt.prototype["delete"]=St;Lt.prototype.get=zt;Lt.prototype.has=Rt;Lt.prototype.set=It;function Ct(t){var e=-1,n=t?t.length:0;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Bt(){this.__data__=[]}function Dt(t){var e=this.__data__,n=ie(e,t);if(n<0){return false}var r=e.length-1;if(n==r){e.pop()}else{pt.call(e,n,1)}return true}function Ht(t){var e=this.__data__,n=ie(e,t);return n<0?undefined:e[n][1]}function Vt(t){return ie(this.__data__,t)>-1}function Ut(t,e){var n=this.__data__,r=ie(n,t);if(r<0){n.push([t,e])}else{n[r][1]=e}return this}Ct.prototype.clear=Bt;Ct.prototype["delete"]=Dt;Ct.prototype.get=Ht;Ct.prototype.has=Vt;Ct.prototype.set=Ut;function Ft(t){var e=-1,n=t?t.length:0;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Pt(){this.__data__={hash:new Lt,map:new(gt||Ct),string:new Lt}}function Wt(t){return je(this,t)["delete"](t)}function Zt(t){return je(this,t).get(t)}function Kt(t){return je(this,t).has(t)}function Gt(t,e){je(this,t).set(t,e);return this}Ft.prototype.clear=Pt;Ft.prototype["delete"]=Wt;Ft.prototype.get=Zt;Ft.prototype.has=Kt;Ft.prototype.set=Gt;function Qt(t){this.__data__=new Ct(t)}function Yt(){this.__data__=new Ct}function Jt(t){return this.__data__["delete"](t)}function Xt(t){return this.__data__.get(t)}function te(t){return this.__data__.has(t)}function ee(t,e){var r=this.__data__;if(r instanceof Ct){var i=r.__data__;if(!gt||i.length<n-1){i.push([t,e]);return this}r=this.__data__=new Ft(i)}r.set(t,e);return this}Qt.prototype.clear=Yt;Qt.prototype["delete"]=Jt;Qt.prototype.get=Xt;Qt.prototype.has=te;Qt.prototype.set=ee;function ne(t,e){var n=Be(t)||Ce(t)?K(t.length,String):[];var r=n.length,i=!!r;for(var s in t){if(lt.call(t,s)&&!(i&&(s=="length"||Ne(s,r)))){n.push(s)}}return n}function re(t,e,n){var r=t[e];if(!(lt.call(t,e)&&Ie(r,n))||n===undefined&&!(e in t)){t[e]=n}}function ie(t,e){var n=t.length;while(n--){if(Ie(t[n][0],e)){return n}}return-1}function se(t,e){return t&&ye(e,Ze(e),t)}function le(t,e,n,r,i,l,o){var u;if(r){u=l?r(t,i,l,o):r(t)}if(u!==undefined){return u}if(!Pe(t)){return t}var a=Be(t);if(a){u=Ee(t);if(!e){return ge(t,u)}}else{var h=Me(t),d=h==c||h==f;if(Ve(t)){return he(t,e)}if(h==v||h==s||d&&!l){if(Q(t)){return l?t:{}}u=_e(d?{}:t);if(!e){return ke(t,se(u,t))}}else{if(!R[h]){return l?t:{}}u=Te(t,h,le,e)}}o||(o=new Qt);var p=o.get(t);if(p){return p}o.set(t,u);if(!a){var b=n?xe(t):Ze(t)}P(b||t,(function(i,s){if(b){s=i;i=t[s]}re(u,s,le(i,e,n,r,s,t,o))}));return u}function oe(t){return Pe(t)?dt(t):{}}function ue(t,e,n){var r=e(t);return Be(t)?r:W(r,n(t))}function ae(t){return ot.call(t)}function ce(t){if(!Pe(t)||$e(t)){return false}var e=Ue(t)||Q(t)?ut:S;return e.test(ze(t))}function fe(t){if(!Se(t)){return wt(t)}var e=[];for(var n in Object(t)){if(lt.call(t,n)&&n!="constructor"){e.push(n)}}return e}function he(t,e){if(e){return t.slice()}var n=new t.constructor(t.length);t.copy(n);return n}function de(t){var e=new t.constructor(t.byteLength);new ft(e).set(new ft(t));return e}function ve(t,e){var n=e?de(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function pe(t,e,n){var r=e?n(Y(t),true):Y(t);return Z(r,U,new t.constructor)}function be(t){var e=new t.constructor(t.source,$.exec(t));e.lastIndex=t.lastIndex;return e}function qe(t,e,n){var r=e?n(X(t),true):X(t);return Z(r,F,new t.constructor)}function we(t){return Nt?Object(Nt.call(t)):{}}function me(t,e){var n=e?de(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ge(t,e){var n=-1,r=t.length;e||(e=Array(r));while(++n<r){e[n]=t[n]}return e}function ye(t,e,n,r){n||(n={});var i=-1,s=e.length;while(++i<s){var l=e[i];var o=undefined;re(n,l,o===undefined?t[l]:o)}return n}function ke(t,e){return ye(t,Oe(t),e)}function xe(t){return ue(t,Ze,Oe)}function je(t,e){var n=t.__data__;return Le(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Ae(t,e){var n=G(t,e);return ce(n)?n:undefined}var Oe=bt?J(bt,Object):Ke;var Me=ae;if(mt&&Me(new mt(new ArrayBuffer(1)))!=k||gt&&Me(new gt)!=h||yt&&Me(yt.resolve())!=p||kt&&Me(new kt)!=q||xt&&Me(new xt)!=g){Me=function(t){var e=ot.call(t),n=e==v?t.constructor:undefined,r=n?ze(n):undefined;if(r){switch(r){case At:return k;case Ot:return h;case Mt:return p;case Et:return q;case _t:return g}}return e}}function Ee(t){var e=t.length,n=t.constructor(e);if(e&&typeof t[0]=="string"&&lt.call(t,"index")){n.index=t.index;n.input=t.input}return n}function _e(t){return typeof t.constructor=="function"&&!Se(t)?oe(ht(t)):{}}function Te(t,e,n,r){var i=t.constructor;switch(e){case y:return de(t);case o:case u:return new i(+t);case k:return ve(t,r);case x:case j:case A:case O:case M:case E:case _:case T:case N:return me(t,r);case h:return pe(t,r,n);case d:case w:return new i(t);case b:return be(t);case q:return qe(t,r,n);case m:return we(t)}}function Ne(t,e){e=e==null?i:e;return!!e&&(typeof t=="number"||z.test(t))&&(t>-1&&t%1==0&&t<e)}function Le(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function $e(t){return!!it&&it in t}function Se(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||nt;return t===n}function ze(t){if(t!=null){try{return st.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Re(t){return le(t,true,true)}function Ie(t,e){return t===e||t!==t&&e!==e}function Ce(t){return He(t)&&lt.call(t,"callee")&&(!vt.call(t,"callee")||ot.call(t)==s)}var Be=Array.isArray;function De(t){return t!=null&&Fe(t.length)&&!Ue(t)}function He(t){return We(t)&&De(t)}var Ve=qt||Ge;function Ue(t){var e=Pe(t)?ot.call(t):"";return e==c||e==f}function Fe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=i}function Pe(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function We(t){return!!t&&typeof t=="object"}function Ze(t){return De(t)?ne(t):fe(t)}function Ke(){return[]}function Ge(){return false}t.exports=Re})(Qy,Qy.exports);return Qy.exports}var Xy={exports:{}};var tk;function ek(){if(tk)return Xy.exports;tk=1;(function(t,e){var n=200;var r="__lodash_hash_undefined__";var i=1,s=2;var l=9007199254740991;var o="[object Arguments]",u="[object Array]",a="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",h="[object Error]",d="[object Function]",v="[object GeneratorFunction]",p="[object Map]",b="[object Number]",q="[object Null]",w="[object Object]",m="[object Promise]",g="[object Proxy]",y="[object RegExp]",k="[object Set]",x="[object String]",j="[object Symbol]",A="[object Undefined]",O="[object WeakMap]";var M="[object ArrayBuffer]",E="[object DataView]",_="[object Float32Array]",T="[object Float64Array]",N="[object Int8Array]",L="[object Int16Array]",$="[object Int32Array]",S="[object Uint8Array]",z="[object Uint8ClampedArray]",R="[object Uint16Array]",I="[object Uint32Array]";var C=/[\\^$.*+?()[\]{}|]/g;var B=/^\[object .+?Constructor\]$/;var D=/^(?:0|[1-9]\d*)$/;var H={};H[_]=H[T]=H[N]=H[L]=H[$]=H[S]=H[z]=H[R]=H[I]=true;H[o]=H[u]=H[M]=H[c]=H[E]=H[f]=H[h]=H[d]=H[p]=H[b]=H[w]=H[y]=H[k]=H[x]=H[O]=false;var V=typeof Fy=="object"&&Fy&&Fy.Object===Object&&Fy;var U=typeof self=="object"&&self&&self.Object===Object&&self;var F=V||U||Function("return this")();var P=e&&!e.nodeType&&e;var W=P&&"object"=="object"&&t&&!t.nodeType&&t;var Z=W&&W.exports===P;var K=Z&&V.process;var G=function(){try{return K&&K.binding&&K.binding("util")}catch(t){}}();var Q=G&&G.isTypedArray;function Y(t,e){var n=-1,r=t==null?0:t.length,i=0,s=[];while(++n<r){var l=t[n];if(e(l,n,t)){s[i++]=l}}return s}function J(t,e){var n=-1,r=e.length,i=t.length;while(++n<r){t[i+n]=e[n]}return t}function X(t,e){var n=-1,r=t==null?0:t.length;while(++n<r){if(e(t[n],n,t)){return true}}return false}function tt(t,e){var n=-1,r=Array(t);while(++n<t){r[n]=e(n)}return r}function et(t){return function(e){return t(e)}}function nt(t,e){return t.has(e)}function rt(t,e){return t==null?undefined:t[e]}function it(t){var e=-1,n=Array(t.size);t.forEach((function(t,r){n[++e]=[r,t]}));return n}function st(t,e){return function(n){return t(e(n))}}function lt(t){var e=-1,n=Array(t.size);t.forEach((function(t){n[++e]=t}));return n}var ot=Array.prototype,ut=Function.prototype,at=Object.prototype;var ct=F["__core-js_shared__"];var ft=ut.toString;var ht=at.hasOwnProperty;var dt=function(){var t=/[^.]+$/.exec(ct&&ct.keys&&ct.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var vt=at.toString;var pt=RegExp("^"+ft.call(ht).replace(C,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var bt=Z?F.Buffer:undefined,qt=F.Symbol,wt=F.Uint8Array,mt=at.propertyIsEnumerable,gt=ot.splice,yt=qt?qt.toStringTag:undefined;var kt=Object.getOwnPropertySymbols,xt=bt?bt.isBuffer:undefined,jt=st(Object.keys,Object);var At=Oe(F,"DataView"),Ot=Oe(F,"Map"),Mt=Oe(F,"Promise"),Et=Oe(F,"Set"),_t=Oe(F,"WeakMap"),Tt=Oe(Object,"create");var Nt=ze(At),Lt=ze(Ot),$t=ze(Mt),St=ze(Et),zt=ze(_t);var Rt=qt?qt.prototype:undefined,It=Rt?Rt.valueOf:undefined;function Ct(t){var e=-1,n=t==null?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Bt(){this.__data__=Tt?Tt(null):{};this.size=0}function Dt(t){var e=this.has(t)&&delete this.__data__[t];this.size-=e?1:0;return e}function Ht(t){var e=this.__data__;if(Tt){var n=e[t];return n===r?undefined:n}return ht.call(e,t)?e[t]:undefined}function Vt(t){var e=this.__data__;return Tt?e[t]!==undefined:ht.call(e,t)}function Ut(t,e){var n=this.__data__;this.size+=this.has(t)?0:1;n[t]=Tt&&e===undefined?r:e;return this}Ct.prototype.clear=Bt;Ct.prototype["delete"]=Dt;Ct.prototype.get=Ht;Ct.prototype.has=Vt;Ct.prototype.set=Ut;function Ft(t){var e=-1,n=t==null?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Pt(){this.__data__=[];this.size=0}function Wt(t){var e=this.__data__,n=he(e,t);if(n<0){return false}var r=e.length-1;if(n==r){e.pop()}else{gt.call(e,n,1)}--this.size;return true}function Zt(t){var e=this.__data__,n=he(e,t);return n<0?undefined:e[n][1]}function Kt(t){return he(this.__data__,t)>-1}function Gt(t,e){var n=this.__data__,r=he(n,t);if(r<0){++this.size;n.push([t,e])}else{n[r][1]=e}return this}Ft.prototype.clear=Pt;Ft.prototype["delete"]=Wt;Ft.prototype.get=Zt;Ft.prototype.has=Kt;Ft.prototype.set=Gt;function Qt(t){var e=-1,n=t==null?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}function Yt(){this.size=0;this.__data__={hash:new Ct,map:new(Ot||Ft),string:new Ct}}function Jt(t){var e=Ae(this,t)["delete"](t);this.size-=e?1:0;return e}function Xt(t){return Ae(this,t).get(t)}function te(t){return Ae(this,t).has(t)}function ee(t,e){var n=Ae(this,t),r=n.size;n.set(t,e);this.size+=n.size==r?0:1;return this}Qt.prototype.clear=Yt;Qt.prototype["delete"]=Jt;Qt.prototype.get=Xt;Qt.prototype.has=te;Qt.prototype.set=ee;function ne(t){var e=-1,n=t==null?0:t.length;this.__data__=new Qt;while(++e<n){this.add(t[e])}}function re(t){this.__data__.set(t,r);return this}function ie(t){return this.__data__.has(t)}ne.prototype.add=ne.prototype.push=re;ne.prototype.has=ie;function se(t){var e=this.__data__=new Ft(t);this.size=e.size}function le(){this.__data__=new Ft;this.size=0}function oe(t){var e=this.__data__,n=e["delete"](t);this.size=e.size;return n}function ue(t){return this.__data__.get(t)}function ae(t){return this.__data__.has(t)}function ce(t,e){var r=this.__data__;if(r instanceof Ft){var i=r.__data__;if(!Ot||i.length<n-1){i.push([t,e]);this.size=++r.size;return this}r=this.__data__=new Qt(i)}r.set(t,e);this.size=r.size;return this}se.prototype.clear=le;se.prototype["delete"]=oe;se.prototype.get=ue;se.prototype.has=ae;se.prototype.set=ce;function fe(t,e){var n=Ce(t),r=!n&&Ie(t),i=!n&&!r&&De(t),s=!n&&!r&&!i&&We(t),l=n||r||i||s,o=l?tt(t.length,String):[],u=o.length;for(var a in t){if(ht.call(t,a)&&!(l&&(a=="length"||i&&(a=="offset"||a=="parent")||s&&(a=="buffer"||a=="byteLength"||a=="byteOffset")||Te(a,u)))){o.push(a)}}return o}function he(t,e){var n=t.length;while(n--){if(Re(t[n][0],e)){return n}}return-1}function de(t,e,n){var r=e(t);return Ce(t)?r:J(r,n(t))}function ve(t){if(t==null){return t===undefined?A:q}return yt&&yt in Object(t)?Me(t):Se(t)}function pe(t){return Pe(t)&&ve(t)==o}function be(t,e,n,r,i){if(t===e){return true}if(t==null||e==null||!Pe(t)&&!Pe(e)){return t!==t&&e!==e}return qe(t,e,n,r,be,i)}function qe(t,e,n,r,s,l){var a=Ce(t),c=Ce(e),f=a?u:_e(t),h=c?u:_e(e);f=f==o?w:f;h=h==o?w:h;var d=f==w,v=h==w,p=f==h;if(p&&De(t)){if(!De(e)){return false}a=true;d=false}if(p&&!d){l||(l=new se);return a||We(t)?ye(t,e,n,r,s,l):ke(t,e,f,n,r,s,l)}if(!(n&i)){var b=d&&ht.call(t,"__wrapped__"),q=v&&ht.call(e,"__wrapped__");if(b||q){var m=b?t.value():t,g=q?e.value():e;l||(l=new se);return s(m,g,n,r,l)}}if(!p){return false}l||(l=new se);return xe(t,e,n,r,s,l)}function we(t){if(!Fe(t)||Le(t)){return false}var e=Ve(t)?pt:B;return e.test(ze(t))}function me(t){return Pe(t)&&Ue(t.length)&&!!H[ve(t)]}function ge(t){if(!$e(t)){return jt(t)}var e=[];for(var n in Object(t)){if(ht.call(t,n)&&n!="constructor"){e.push(n)}}return e}function ye(t,e,n,r,l,o){var u=n&i,a=t.length,c=e.length;if(a!=c&&!(u&&c>a)){return false}var f=o.get(t);if(f&&o.get(e)){return f==e}var h=-1,d=true,v=n&s?new ne:undefined;o.set(t,e);o.set(e,t);while(++h<a){var p=t[h],b=e[h];if(r){var q=u?r(b,p,h,e,t,o):r(p,b,h,t,e,o)}if(q!==undefined){if(q){continue}d=false;break}if(v){if(!X(e,(function(t,e){if(!nt(v,e)&&(p===t||l(p,t,n,r,o))){return v.push(e)}}))){d=false;break}}else if(!(p===b||l(p,b,n,r,o))){d=false;break}}o["delete"](t);o["delete"](e);return d}function ke(t,e,n,r,l,o,u){switch(n){case E:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset){return false}t=t.buffer;e=e.buffer;case M:if(t.byteLength!=e.byteLength||!o(new wt(t),new wt(e))){return false}return true;case c:case f:case b:return Re(+t,+e);case h:return t.name==e.name&&t.message==e.message;case y:case x:return t==e+"";case p:var a=it;case k:var d=r&i;a||(a=lt);if(t.size!=e.size&&!d){return false}var v=u.get(t);if(v){return v==e}r|=s;u.set(t,e);var q=ye(a(t),a(e),r,l,o,u);u["delete"](t);return q;case j:if(It){return It.call(t)==It.call(e)}}return false}function xe(t,e,n,r,s,l){var o=n&i,u=je(t),a=u.length,c=je(e),f=c.length;if(a!=f&&!o){return false}var h=a;while(h--){var d=u[h];if(!(o?d in e:ht.call(e,d))){return false}}var v=l.get(t);if(v&&l.get(e)){return v==e}var p=true;l.set(t,e);l.set(e,t);var b=o;while(++h<a){d=u[h];var q=t[d],w=e[d];if(r){var m=o?r(w,q,d,e,t,l):r(q,w,d,t,e,l)}if(!(m===undefined?q===w||s(q,w,n,r,l):m)){p=false;break}b||(b=d=="constructor")}if(p&&!b){var g=t.constructor,y=e.constructor;if(g!=y&&("constructor"in t&&"constructor"in e)&&!(typeof g=="function"&&g instanceof g&&typeof y=="function"&&y instanceof y)){p=false}}l["delete"](t);l["delete"](e);return p}function je(t){return de(t,Ze,Ee)}function Ae(t,e){var n=t.__data__;return Ne(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Oe(t,e){var n=rt(t,e);return we(n)?n:undefined}function Me(t){var e=ht.call(t,yt),n=t[yt];try{t[yt]=undefined;var r=true}catch(t){}var i=vt.call(t);if(r){if(e){t[yt]=n}else{delete t[yt]}}return i}var Ee=!kt?Ke:function(t){if(t==null){return[]}t=Object(t);return Y(kt(t),(function(e){return mt.call(t,e)}))};var _e=ve;if(At&&_e(new At(new ArrayBuffer(1)))!=E||Ot&&_e(new Ot)!=p||Mt&&_e(Mt.resolve())!=m||Et&&_e(new Et)!=k||_t&&_e(new _t)!=O){_e=function(t){var e=ve(t),n=e==w?t.constructor:undefined,r=n?ze(n):"";if(r){switch(r){case Nt:return E;case Lt:return p;case $t:return m;case St:return k;case zt:return O}}return e}}function Te(t,e){e=e==null?l:e;return!!e&&(typeof t=="number"||D.test(t))&&(t>-1&&t%1==0&&t<e)}function Ne(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Le(t){return!!dt&&dt in t}function $e(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||at;return t===n}function Se(t){return vt.call(t)}function ze(t){if(t!=null){try{return ft.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Re(t,e){return t===e||t!==t&&e!==e}var Ie=pe(function(){return arguments}())?pe:function(t){return Pe(t)&&ht.call(t,"callee")&&!mt.call(t,"callee")};var Ce=Array.isArray;function Be(t){return t!=null&&Ue(t.length)&&!Ve(t)}var De=xt||Ge;function He(t,e){return be(t,e)}function Ve(t){if(!Fe(t)){return false}var e=ve(t);return e==d||e==v||e==a||e==g}function Ue(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}function Fe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Pe(t){return t!=null&&typeof t=="object"}var We=Q?et(Q):me;function Ze(t){return Be(t)?fe(t):ge(t)}function Ke(){return[]}function Ge(){return false}t.exports=He})(Xy,Xy.exports);return Xy.exports}var nk={};var rk;function ik(){if(rk)return nk;rk=1;Object.defineProperty(nk,"__esModule",{value:true});const t=Jy();const e=ek();var n;(function(n){function r(e={},n={},r=false){if(typeof e!=="object"){e={}}if(typeof n!=="object"){n={}}let i=t(n);if(!r){i=Object.keys(i).reduce(((t,e)=>{if(i[e]!=null){t[e]=i[e]}return t}),{})}for(const t in e){if(e[t]!==undefined&&n[t]===undefined){i[t]=e[t]}}return Object.keys(i).length>0?i:undefined}n.compose=r;function i(t={},n={}){if(typeof t!=="object"){t={}}if(typeof n!=="object"){n={}}const r=Object.keys(t).concat(Object.keys(n)).reduce(((r,i)=>{if(!e(t[i],n[i])){r[i]=n[i]===undefined?null:n[i]}return r}),{});return Object.keys(r).length>0?r:undefined}n.diff=i;function s(t={},e={}){t=t||{};const n=Object.keys(e).reduce(((n,r)=>{if(e[r]!==t[r]&&t[r]!==undefined){n[r]=e[r]}return n}),{});return Object.keys(t).reduce(((n,r)=>{if(t[r]!==e[r]&&e[r]===undefined){n[r]=null}return n}),n)}n.invert=s;function l(t,e,n=false){if(typeof t!=="object"){return e}if(typeof e!=="object"){return undefined}if(!n){return e}const r=Object.keys(e).reduce(((n,r)=>{if(t[r]===undefined){n[r]=e[r]}return n}),{});return Object.keys(r).length>0?r:undefined}n.transform=l})(n||(n={}));nk.default=n;return nk}var sk={};var lk;function ok(){if(lk)return sk;lk=1;Object.defineProperty(sk,"__esModule",{value:true});var t;(function(t){function e(t){if(typeof t.delete==="number"){return t.delete}else if(typeof t.retain==="number"){return t.retain}else if(typeof t.retain==="object"&&t.retain!==null){return 1}else{return typeof t.insert==="string"?t.insert.length:1}}t.length=e})(t||(t={}));sk.default=t;return sk}var uk={};var ak;function ck(){if(ak)return uk;ak=1;Object.defineProperty(uk,"__esModule",{value:true});const t=ok();class e{constructor(t){this.ops=t;this.index=0;this.offset=0}hasNext(){return this.peekLength()<Infinity}next(e){if(!e){e=Infinity}const n=this.ops[this.index];if(n){const r=this.offset;const i=t.default.length(n);if(e>=i-r){e=i-r;this.index+=1;this.offset=0}else{this.offset+=e}if(typeof n.delete==="number"){return{delete:e}}else{const t={};if(n.attributes){t.attributes=n.attributes}if(typeof n.retain==="number"){t.retain=e}else if(typeof n.retain==="object"&&n.retain!==null){t.retain=n.retain}else if(typeof n.insert==="string"){t.insert=n.insert.substr(r,e)}else{t.insert=n.insert}return t}}else{return{retain:Infinity}}}peek(){return this.ops[this.index]}peekLength(){if(this.ops[this.index]){return t.default.length(this.ops[this.index])-this.offset}else{return Infinity}}peekType(){const t=this.ops[this.index];if(t){if(typeof t.delete==="number"){return"delete"}else if(typeof t.retain==="number"||typeof t.retain==="object"&&t.retain!==null){return"retain"}else{return"insert"}}return"retain"}rest(){if(!this.hasNext()){return[]}else if(this.offset===0){return this.ops.slice(this.index)}else{const t=this.offset;const e=this.index;const n=this.next();const r=this.ops.slice(this.index);this.offset=t;this.index=e;return[n].concat(r)}}}uk.default=e;return uk}var fk;function hk(){if(fk)return Wy.exports;fk=1;(function(t,e){Object.defineProperty(e,"__esModule",{value:true});e.AttributeMap=e.OpIterator=e.Op=void 0;const n=Gy();const r=Jy();const i=ek();const s=ik();e.AttributeMap=s.default;const l=ok();e.Op=l.default;const o=ck();e.OpIterator=o.default;const u=String.fromCharCode(0);const a=(t,e)=>{if(typeof t!=="object"||t===null){throw new Error(`cannot retain a ${typeof t}`)}if(typeof e!=="object"||e===null){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 c{constructor(t){if(Array.isArray(t)){this.ops=t}else if(t!=null&&Array.isArray(t.ops)){this.ops=t.ops}else{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={};if(typeof t==="string"&&t.length===0){return this}n.insert=t;if(e!=null&&typeof e==="object"&&Object.keys(e).length>0){n.attributes=e}return this.push(n)}delete(t){if(t<=0){return this}return this.push({delete:t})}retain(t,e){if(typeof t==="number"&&t<=0){return this}const n={retain:t};if(e!=null&&typeof e==="object"&&Object.keys(e).length>0){n.attributes=e}return this.push(n)}push(t){let e=this.ops.length;let n=this.ops[e-1];t=r(t);if(typeof n==="object"){if(typeof t.delete==="number"&&typeof n.delete==="number"){this.ops[e-1]={delete:n.delete+t.delete};return this}if(typeof n.delete==="number"&&t.insert!=null){e-=1;n=this.ops[e-1];if(typeof n!=="object"){this.ops.unshift(t);return this}}if(i(t.attributes,n.attributes)){if(typeof t.insert==="string"&&typeof n.insert==="string"){this.ops[e-1]={insert:n.insert+t.insert};if(typeof t.attributes==="object"){this.ops[e-1].attributes=t.attributes}return this}else if(typeof t.retain==="number"&&typeof n.retain==="number"){this.ops[e-1]={retain:n.retain+t.retain};if(typeof t.attributes==="object"){this.ops[e-1].attributes=t.attributes}return this}}}if(e===this.ops.length){this.ops.push(t)}else{this.ops.splice(e,0,t)}return this}chop(){const t=this.ops[this.ops.length-1];if(t&&typeof t.retain==="number"&&!t.attributes){this.ops.pop()}return 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=[];const n=[];this.forEach((r=>{const i=t(r)?e:n;i.push(r)}));return[e,n]}reduce(t,e){return this.ops.reduce(t,e)}changeLength(){return this.reduce(((t,e)=>{if(e.insert){return t+l.default.length(e)}else if(e.delete){return t-e.delete}return t}),0)}length(){return this.reduce(((t,e)=>t+l.default.length(e)),0)}slice(t=0,e=Infinity){const n=[];const r=new o.default(this.ops);let i=0;while(i<e&&r.hasNext()){let s;if(i<t){s=r.next(t-i)}else{s=r.next(e-i);n.push(s)}i+=l.default.length(s)}return new c(n)}compose(t){const e=new o.default(this.ops);const n=new o.default(t.ops);const r=[];const l=n.peek();if(l!=null&&typeof l.retain==="number"&&l.attributes==null){let t=l.retain;while(e.peekType()==="insert"&&e.peekLength()<=t){t-=e.peekLength();r.push(e.next())}if(l.retain-t>0){n.next(l.retain-t)}}const u=new c(r);while(e.hasNext()||n.hasNext()){if(n.peekType()==="insert"){u.push(n.next())}else if(e.peekType()==="delete"){u.push(e.next())}else{const t=Math.min(e.peekLength(),n.peekLength());const r=e.next(t);const l=n.next(t);if(l.retain){const o={};if(typeof r.retain==="number"){o.retain=typeof l.retain==="number"?t:l.retain}else{if(typeof l.retain==="number"){if(r.retain==null){o.insert=r.insert}else{o.retain=r.retain}}else{const t=r.retain==null?"insert":"retain";const[e,n,i]=a(r[t],l.retain);const s=c.getHandler(e);o[t]={[e]:s.compose(n,i,t==="retain")}}}const f=s.default.compose(r.attributes,l.attributes,typeof r.retain==="number");if(f){o.attributes=f}u.push(o);if(!n.hasNext()&&i(u.ops[u.ops.length-1],o)){const t=new c(e.rest());return u.concat(t).chop()}}else if(typeof l.delete==="number"&&(typeof r.retain==="number"||typeof r.retain==="object"&&r.retain!==null)){u.push(l)}}}return u.chop()}concat(t){const e=new c(this.ops.slice());if(t.ops.length>0){e.push(t.ops[0]);e.ops=e.ops.concat(t.ops.slice(1))}return e}diff(t,e){if(this.ops===t.ops){return new c}const r=[this,t].map((e=>e.map((n=>{if(n.insert!=null){return typeof n.insert==="string"?n.insert:u}const r=e===t?"on":"with";throw new Error("diff() called "+r+" non-document")})).join("")));const l=new c;const a=n(r[0],r[1],e,true);const f=new o.default(this.ops);const h=new o.default(t.ops);a.forEach((t=>{let e=t[1].length;while(e>0){let r=0;switch(t[0]){case n.INSERT:r=Math.min(h.peekLength(),e);l.push(h.next(r));break;case n.DELETE:r=Math.min(e,f.peekLength());f.next(r);l.delete(r);break;case n.EQUAL:r=Math.min(f.peekLength(),h.peekLength(),e);const t=f.next(r);const o=h.next(r);if(i(t.insert,o.insert)){l.retain(r,s.default.diff(t.attributes,o.attributes))}else{l.push(o).delete(r)}break}e-=r}}));return l.chop()}eachLine(t,e="\n"){const n=new o.default(this.ops);let r=new c;let i=0;while(n.hasNext()){if(n.peekType()!=="insert"){return}const s=n.peek();const o=l.default.length(s)-n.peekLength();const u=typeof s.insert==="string"?s.insert.indexOf(e,o)-o:-1;if(u<0){r.push(n.next())}else if(u>0){r.push(n.next(u))}else{if(t(r,n.next(1).attributes||{},i)===false){return}i+=1;r=new c}}if(r.length()>0){t(r,{},i)}}invert(t){const e=new c;this.reduce(((n,r)=>{if(r.insert){e.delete(l.default.length(r))}else if(typeof r.retain==="number"&&r.attributes==null){e.retain(r.retain);return n+r.retain}else if(r.delete||typeof r.retain==="number"){const i=r.delete||r.retain;const o=t.slice(n,n+i);o.forEach((t=>{if(r.delete){e.push(t)}else if(r.retain&&r.attributes){e.retain(l.default.length(t),s.default.invert(r.attributes,t.attributes))}}));return n+i}else if(typeof r.retain==="object"&&r.retain!==null){const i=t.slice(n,n+1);const l=new o.default(i.ops).next();const[u,f,h]=a(r.retain,l.insert);const d=c.getHandler(u);e.retain({[u]:d.invert(f,h)},s.default.invert(r.attributes,l.attributes));return n+1}return n}),0);return e.chop()}transform(t,e=false){e=!!e;if(typeof t==="number"){return this.transformPosition(t,e)}const n=t;const r=new o.default(this.ops);const i=new o.default(n.ops);const u=new c;while(r.hasNext()||i.hasNext()){if(r.peekType()==="insert"&&(e||i.peekType()!=="insert")){u.retain(l.default.length(r.next()))}else if(i.peekType()==="insert"){u.push(i.next())}else{const t=Math.min(r.peekLength(),i.peekLength());const n=r.next(t);const l=i.next(t);if(n.delete){continue}else if(l.delete){u.push(l)}else{const r=n.retain;const i=l.retain;let o=typeof i==="object"&&i!==null?i:t;if(typeof r==="object"&&r!==null&&typeof i==="object"&&i!==null){const t=Object.keys(r)[0];if(t===Object.keys(i)[0]){const n=c.getHandler(t);if(n){o={[t]:n.transform(r[t],i[t],e)}}}}u.retain(o,s.default.transform(n.attributes,l.attributes,e))}}}return u.chop()}transformPosition(t,e=false){e=!!e;const n=new o.default(this.ops);let r=0;while(n.hasNext()&&r<=t){const i=n.peekLength();const s=n.peekType();n.next();if(s==="delete"){t-=Math.min(i,t-r);continue}else if(s==="insert"&&(r<t||!e)){t+=i}r+=i}return t}}c.Op=l.default;c.OpIterator=o.default;c.AttributeMap=s.default;c.handlers={};e.default=c;{t.exports=c;t.exports.default=c}})(Wy,Wy.exports);return Wy.exports}var dk=hk();var vk=Py(dk);class pk extends Sy{static value(){return undefined}optimize(){if(this.prev||this.next){this.remove()}}length(){return 0}value(){return""}}pk.blotName="break";pk.tagName="BR";let bk=class t extends Vy{};const qk={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function wk(t){return t.replace(/[&<>"']/g,(t=>qk[t]))}class mk extends Oy{static allowedChildren=[mk,pk,Sy,bk];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(t,e){const n=mk.order.indexOf(t);const r=mk.order.indexOf(e);if(n>=0||r>=0){return n-r}if(t===e){return 0}if(t<e){return-1}return 1}formatAt(t,e,n,r){if(mk.compare(this.statics.blotName,n)<0&&this.scroll.query(n,ty.BLOT)){const i=this.isolate(t,e);if(r){i.wrap(n,r)}}else{super.formatAt(t,e,n,r)}}optimize(t){super.optimize(t);if(this.parent instanceof mk&&mk.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t);t.wrap(this)}}}const gk=1;class yk extends _y{cache={};delta(){if(this.cache.delta==null){this.cache.delta=xk(this)}return this.cache.delta}deleteAt(t,e){super.deleteAt(t,e);this.cache={}}formatAt(t,e,n,r){if(e<=0)return;if(this.scroll.query(n,ty.BLOCK)){if(t+e===this.length()){this.format(n,r)}}else{super.formatAt(t,Math.min(e,this.length()-t-1),n,r)}this.cache={}}insertAt(t,e,n){if(n!=null){super.insertAt(t,e,n);this.cache={};return}if(e.length===0)return;const r=e.split("\n");const i=r.shift();if(i.length>0){if(t<this.length()-1||this.children.tail==null){super.insertAt(Math.min(t,this.length()-1),i)}else{this.children.tail.insertAt(this.children.tail.length(),i)}this.cache={}}let s=this;r.reduce(((t,e)=>{s=s.split(t,true);s.insertAt(0,e);return e.length}),t+i.length)}insertBefore(t,e){const{head:n}=this.children;super.insertBefore(t,e);if(n instanceof pk){n.remove()}this.cache={}}length(){if(this.cache.length==null){this.cache.length=super.length()+gk}return this.cache.length}moveChildren(t,e){super.moveChildren(t,e);this.cache={}}optimize(t){super.optimize(t);this.cache={}}path(t){return super.path(t,true)}removeChild(t){super.removeChild(t);this.cache={}}split(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(e&&(t===0||t>=this.length()-gk)){const e=this.clone();if(t===0){this.parent.insertBefore(e,this);return this}this.parent.insertBefore(e,this.next);return e}const n=super.split(t,e);this.cache={};return n}}yk.blotName="block";yk.tagName="P";yk.defaultChild=pk;yk.allowedChildren=[pk,mk,Sy,bk];class kk extends Sy{attach(){super.attach();this.attributes=new hy(this.domNode)}delta(){return(new vk).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const n=this.scroll.query(t,ty.BLOCK_ATTRIBUTE);if(n!=null){this.attributes.attribute(n,e)}}formatAt(t,e,n,r){this.format(n,r)}insertAt(t,e,n){if(n!=null){super.insertAt(t,e,n);return}const r=e.split("\n");const i=r.pop();const s=r.map((t=>{const e=this.scroll.create(yk.blotName);e.insertAt(0,t);return e}));const l=this.split(t);s.forEach((t=>{this.parent.insertBefore(t,l)}));if(i){this.parent.insertBefore(this.scroll.create("text",i),l)}}}kk.scope=ty.BLOCK_BLOT;function xk(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return t.descendants(qy).reduce(((t,n)=>{if(n.length()===0){return t}return t.insert(n.value(),jk(n,{},e))}),new vk).insert("\n",jk(t))}function jk(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(t==null)return e;if("formats"in t&&typeof t.formats==="function"){e={...e,...t.formats()};if(n){delete e["code-token"]}}if(t.parent==null||t.parent.statics.blotName==="scroll"||t.parent.statics.scope!==t.statics.scope){return e}return jk(t.parent,e,n)}class Ak extends Sy{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){return undefined}constructor(t,e,n){super(t,e);this.selection=n;this.textNode=document.createTextNode(Ak.CONTENTS);this.domNode.appendChild(this.textNode);this.savedLength=0}detach(){if(this.parent!=null)this.parent.removeChild(this)}format(t,e){if(this.savedLength!==0){super.format(t,e);return}let n=this;let r=0;while(n!=null&&n.statics.scope!==ty.BLOCK_BLOT){r+=n.offset(n.parent);n=n.parent}if(n!=null){this.savedLength=Ak.CONTENTS.length;n.optimize();n.formatAt(r,Ak.CONTENTS.length,t,e);this.savedLength=0}}index(t,e){if(t===this.textNode)return 0;return super.index(t,e)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove();this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const t=this.selection.getNativeRange();while(this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode){this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode)}const e=this.prev instanceof bk?this.prev:null;const n=e?e.length():0;const r=this.next instanceof bk?this.next:null;const i=r?r.text:"";const{textNode:s}=this;const l=s.data.split(Ak.CONTENTS).join("");s.data=Ak.CONTENTS;let o;if(e){o=e;if(l||r){e.insertAt(e.length(),l+i);if(r){r.remove()}}}else if(r){o=r;r.insertAt(0,l)}else{const t=document.createTextNode(l);o=this.scroll.create(t);this.parent.insertBefore(o,this)}this.remove();if(t){const i=(t,i)=>{if(e&&t===e.domNode){return i}if(t===s){return n+i-1}if(r&&t===r.domNode){return n+l.length+i}return null};const u=i(t.start.node,t.start.offset);const a=i(t.end.node,t.end.offset);if(u!==null&&a!==null){return{startNode:o.domNode,startOffset:u,endNode:o.domNode,endOffset:a}}}return null}update(t,e){if(t.some((t=>t.type==="characterData"&&t.target===this.textNode))){const t=this.restore();if(t)e.range=t}}optimize(t){super.optimize(t);let{parent:e}=this;while(e){if(e.domNode.tagName==="A"){this.savedLength=Ak.CONTENTS.length;e.isolate(this.offset(e),this.length()).unwrap();this.savedLength=0;break}e=e.parent}}value(){return""}}var Ok={exports:{}};var Mk;function Ek(){if(Mk)return Ok.exports;Mk=1;(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}if(Object.create){r.prototype=Object.create(null);if(!(new r).__proto__)n=false}function i(t,e,n){this.fn=t;this.context=e;this.once=n||false}function s(t,e,r,s,l){if(typeof r!=="function"){throw new TypeError("The listener must be a function")}var o=new i(r,s||t,l),u=n?n+e:e;if(!t._events[u])t._events[u]=o,t._eventsCount++;else if(!t._events[u].fn)t._events[u].push(o);else t._events[u]=[t._events[u],o];return t}function l(t,e){if(--t._eventsCount===0)t._events=new r;else delete t._events[e]}function o(){this._events=new r;this._eventsCount=0}o.prototype.eventNames=function t(){var r=[],i,s;if(this._eventsCount===0)return r;for(s in i=this._events){if(e.call(i,s))r.push(n?s.slice(1):s)}if(Object.getOwnPropertySymbols){return r.concat(Object.getOwnPropertySymbols(i))}return r};o.prototype.listeners=function t(e){var r=n?n+e:e,i=this._events[r];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,l=i.length,o=new Array(l);s<l;s++){o[s]=i[s].fn}return o};o.prototype.listenerCount=function t(e){var r=n?n+e:e,i=this._events[r];if(!i)return 0;if(i.fn)return 1;return i.length};o.prototype.emit=function t(e,r,i,s,l,o){var u=n?n+e:e;if(!this._events[u])return false;var a=this._events[u],c=arguments.length,f,h;if(a.fn){if(a.once)this.removeListener(e,a.fn,undefined,true);switch(c){case 1:return a.fn.call(a.context),true;case 2:return a.fn.call(a.context,r),true;case 3:return a.fn.call(a.context,r,i),true;case 4:return a.fn.call(a.context,r,i,s),true;case 5:return a.fn.call(a.context,r,i,s,l),true;case 6:return a.fn.call(a.context,r,i,s,l,o),true}for(h=1,f=new Array(c-1);h<c;h++){f[h-1]=arguments[h]}a.fn.apply(a.context,f)}else{var d=a.length,v;for(h=0;h<d;h++){if(a[h].once)this.removeListener(e,a[h].fn,undefined,true);switch(c){case 1:a[h].fn.call(a[h].context);break;case 2:a[h].fn.call(a[h].context,r);break;case 3:a[h].fn.call(a[h].context,r,i);break;case 4:a[h].fn.call(a[h].context,r,i,s);break;default:if(!f)for(v=1,f=new Array(c-1);v<c;v++){f[v-1]=arguments[v]}a[h].fn.apply(a[h].context,f)}}}return true};o.prototype.on=function t(e,n,r){return s(this,e,n,r,false)};o.prototype.once=function t(e,n,r){return s(this,e,n,r,true)};o.prototype.removeListener=function t(e,r,i,s){var o=n?n+e:e;if(!this._events[o])return this;if(!r){l(this,o);return this}var u=this._events[o];if(u.fn){if(u.fn===r&&(!s||u.once)&&(!i||u.context===i)){l(this,o)}}else{for(var a=0,c=[],f=u.length;a<f;a++){if(u[a].fn!==r||s&&!u[a].once||i&&u[a].context!==i){c.push(u[a])}}if(c.length)this._events[o]=c.length===1?c[0]:c;else l(this,o)}return this};o.prototype.removeAllListeners=function t(e){var i;if(e){i=n?n+e:e;if(this._events[i])l(this,i)}else{this._events=new r;this._eventsCount=0}return this};o.prototype.off=o.prototype.removeListener;o.prototype.addListener=o.prototype.on;o.prefixed=n;o.EventEmitter=o;{t.exports=o}})(Ok);return Ok.exports}var _k=Ek();var Tk=Py(_k);var Nk=new WeakMap;const Lk=["error","warn","log","info"];let $k="warn";function Sk(t){if($k){if(Lk.indexOf(t)<=Lk.indexOf($k)){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}console[t](...n)}}}function zk(t){return Lk.reduce(((e,n)=>{e[n]=Sk.bind(console,n,t);return e}),{})}zk.level=t=>{$k=t};Sk.level=zk.level;const Rk=zk("quill:events");const Ik=["selectionchange","mousedown","mouseup","click"];Ik.forEach((t=>{document.addEventListener(t,(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}Array.from(document.querySelectorAll(".ql-container")).forEach((t=>{const n=Nk.get(t);if(n&&n.emitter){n.emitter.handleDOM(...e)}}))}))}));class Ck extends Tk{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super();this.domListeners={};this.on("error",Rk.error)}emit(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}Rk.log.call(Rk,...e);return super.emit(...e)}handleDOM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}(this.domListeners[t.type]||[]).forEach((e=>{let{node:r,handler:i}=e;if(t.target===r||r.contains(t.target)){i(t,...n)}}))}listenDOM(t,e,n){if(!this.domListeners[t]){this.domListeners[t]=[]}this.domListeners[t].push({node:e,handler:n})}}const Bk=zk("quill:selection");class Dk{constructor(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;this.index=t;this.length=e}}class Hk{constructor(t,e){this.emitter=e;this.scroll=t;this.composing=false;this.mouseDown=false;this.root=this.scroll.domNode;this.cursor=this.scroll.create("cursor",this);this.savedRange=new Dk(0,0);this.lastRange=this.savedRange;this.lastNative=null;this.handleComposition();this.handleDragging();this.emitter.listenDOM("selectionchange",document,(()=>{if(!this.mouseDown&&!this.composing){setTimeout(this.update.bind(this,Ck.sources.USER),1)}}));this.emitter.on(Ck.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const t=this.getNativeRange();if(t==null)return;if(t.start.node===this.cursor.textNode)return;this.emitter.once(Ck.events.SCROLL_UPDATE,((e,n)=>{try{if(this.root.contains(t.start.node)&&this.root.contains(t.end.node)){this.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}const r=n.some((t=>t.type==="characterData"||t.type==="childList"||t.type==="attributes"&&t.target===this.root));this.update(r?Ck.sources.SILENT:e)}catch(t){}}))}));this.emitter.on(Ck.events.SCROLL_OPTIMIZE,((t,e)=>{if(e.range){const{startNode:t,startOffset:n,endNode:r,endOffset:i}=e.range;this.setNativeRange(t,n,r,i);this.update(Ck.sources.SILENT)}}));this.update(Ck.sources.SILENT)}handleComposition(){this.emitter.on(Ck.events.COMPOSITION_BEFORE_START,(()=>{this.composing=true}));this.emitter.on(Ck.events.COMPOSITION_END,(()=>{this.composing=false;if(this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout((()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=true}));this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=false;this.update(Ck.sources.USER)}))}focus(){if(this.hasFocus())return;this.root.focus({preventScroll:true});this.setRange(this.savedRange)}format(t,e){this.scroll.update();const n=this.getNativeRange();if(n==null||!n.native.collapsed||this.scroll.query(t,ty.BLOCK))return;if(n.start.node!==this.cursor.textNode){const t=this.scroll.find(n.start.node,false);if(t==null)return;if(t instanceof qy){const e=t.split(n.start.offset);t.parent.insertBefore(this.cursor,e)}else{t.insertBefore(this.cursor,n.start.node)}this.cursor.attach()}this.cursor.format(t,e);this.scroll.optimize();this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length);this.update()}getBounds(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;const n=this.scroll.length();t=Math.min(t,n-1);e=Math.min(t+e,n-1)-t;let r;let[i,s]=this.scroll.leaf(t);if(i==null)return null;if(e>0&&s===i.length()){const[e]=this.scroll.leaf(t+1);if(e){const[n]=this.scroll.line(t);const[r]=this.scroll.line(t+1);if(n===r){i=e;s=0}}}[r,s]=i.position(s,true);const l=document.createRange();if(e>0){l.setStart(r,s);[i,s]=this.scroll.leaf(t+e);if(i==null)return null;[r,s]=i.position(s,true);l.setEnd(r,s);return l.getBoundingClientRect()}let o="left";let u;if(r instanceof Text){if(!r.data.length){return null}if(s<r.data.length){l.setStart(r,s);l.setEnd(r,s+1)}else{l.setStart(r,s-1);l.setEnd(r,s);o="right"}u=l.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;u=i.domNode.getBoundingClientRect();if(s>0)o="right"}return{bottom:u.top+u.height,height:u.height,left:u[o],right:u[o],top:u.top,width:0}}getNativeRange(){const t=document.getSelection();if(t==null||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(e==null)return null;const n=this.normalizeNative(e);Bk.info("getNativeRange",n);return n}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected){return[null,null]}const e=this.getNativeRange();if(e==null)return[null,null];const n=this.normalizedToRange(e);return[n,e]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Vk(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];if(!t.native.collapsed){e.push([t.end.node,t.end.offset])}const n=e.map((t=>{const[e,n]=t;const r=this.scroll.find(e,true);const i=r.offset(this.scroll);if(n===0){return i}if(r instanceof qy){return i+r.index(e,n)}return i+r.length()}));const r=Math.min(Math.max(...n),this.scroll.length()-1);const i=Math.min(r,...n);return new Dk(i,r-i)}normalizeNative(t){if(!Vk(this.root,t.startContainer)||!t.collapsed&&!Vk(this.root,t.endContainer)){return null}const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};[e.start,e.end].forEach((t=>{let{node:e,offset:n}=t;while(!(e instanceof Text)&&e.childNodes.length>0){if(e.childNodes.length>n){e=e.childNodes[n];n=0}else if(e.childNodes.length===n){e=e.lastChild;if(e instanceof Text){n=e.data.length}else if(e.childNodes.length>0){n=e.childNodes.length}else{n=e.childNodes.length+1}}else{break}}t.node=e;t.offset=n}));return e}rangeToNative(t){const e=this.scroll.length();const n=(t,n)=>{t=Math.min(e-1,t);const[r,i]=this.scroll.leaf(t);return r?r.position(i,n):[null,-1]};return[...n(t.index,false),...n(t.index+t.length,true)]}setNativeRange(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t;let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:e;let i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;Bk.info("setNativeRange",t,e,n,r);if(t!=null&&(this.root.parentNode==null||t.parentNode==null||n.parentNode==null)){return}const s=document.getSelection();if(s==null)return;if(t!=null){if(!this.hasFocus())this.root.focus({preventScroll:true});const{native:l}=this.getNativeRange()||{};if(l==null||i||t!==l.startContainer||e!==l.startOffset||n!==l.endContainer||r!==l.endOffset){if(t instanceof Element&&t.tagName==="BR"){e=Array.from(t.parentNode.childNodes).indexOf(t);t=t.parentNode}if(n instanceof Element&&n.tagName==="BR"){r=Array.from(n.parentNode.childNodes).indexOf(n);n=n.parentNode}const i=document.createRange();i.setStart(t,e);i.setEnd(n,r);s.removeAllRanges();s.addRange(i)}}else{s.removeAllRanges();this.root.blur()}}setRange(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:Ck.sources.API;if(typeof e==="string"){n=e;e=false}Bk.info("setRange",t);if(t!=null){const n=this.rangeToNative(t);this.setNativeRange(...n,e)}else{this.setNativeRange(null)}this.update(n)}update(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Ck.sources.USER;const e=this.lastRange;const[n,r]=this.getRange();this.lastRange=n;this.lastNative=r;if(this.lastRange!=null){this.savedRange=this.lastRange}if(!mv(e,this.lastRange)){if(!this.composing&&r!=null&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const t=this.cursor.restore();if(t){this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}}const n=[Ck.events.SELECTION_CHANGE,Sa(this.lastRange),Sa(e),t];this.emitter.emit(Ck.events.EDITOR_CHANGE,...n);if(t!==Ck.sources.SILENT){this.emitter.emit(...n)}}}}function Vk(t,e){return t.contains(e)}const Uk=/^[ -~]*$/;class Fk{constructor(t){this.scroll=t;this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const n=Gk(t);const r=new vk;const i=Yk(n.ops.slice());i.reduce(((t,n)=>{const i=dk.Op.length(n);let s=n.attributes||{};let l=false;let o=false;if(n.insert!=null){r.retain(i);if(typeof n.insert==="string"){const r=n.insert;o=!r.endsWith("\n")&&(e<=t||!!this.scroll.descendant(kk,t)[0]);this.scroll.insertAt(t,r);const[i,l]=this.scroll.line(t);let u=yp({},jk(i));if(i instanceof yk){const[t]=i.descendant(qy,l);if(t){u=yp(u,jk(t))}}s=dk.AttributeMap.diff(u,s)||{}}else if(typeof n.insert==="object"){const r=Object.keys(n.insert)[0];if(r==null)return t;const i=this.scroll.query(r,ty.INLINE)!=null;if(i){if(e<=t||!!this.scroll.descendant(kk,t)[0]){o=true}}else if(t>0){const[e,n]=this.scroll.descendant(qy,t-1);if(e instanceof bk){const t=e.value();if(t[n]!=="\n"){l=true}}else if(e instanceof Sy&&e.statics.scope===ty.INLINE_BLOT){l=true}}this.scroll.insertAt(t,r,n.insert[r]);if(i){const[e]=this.scroll.descendant(qy,t);if(e){const t=yp({},jk(e));s=dk.AttributeMap.diff(t,s)||{}}}}e+=i}else{r.push(n);if(n.retain!==null&&typeof n.retain==="object"){const e=Object.keys(n.retain)[0];if(e==null)return t;this.scroll.updateEmbedAt(t,e,n.retain[e])}}Object.keys(s).forEach((e=>{this.scroll.formatAt(t,i,e,s[e])}));const u=l?1:0;const a=o?1:0;e+=u+a;r.retain(u);r.delete(a);return t+i+u+a}),0);r.reduce(((t,e)=>{if(typeof e.delete==="number"){this.scroll.deleteAt(t,e.delete);return t}return t+dk.Op.length(e)}),0);this.scroll.batchEnd();this.scroll.optimize();return this.update(n)}deleteText(t,e){this.scroll.deleteAt(t,e);return this.update((new vk).retain(t).delete(e))}formatLine(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};this.scroll.update();Object.keys(n).forEach((r=>{this.scroll.lines(t,Math.max(e,1)).forEach((t=>{t.format(r,n[r])}))}));this.scroll.optimize();const r=(new vk).retain(t).retain(e,Sa(n));return this.update(r)}formatText(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};Object.keys(n).forEach((r=>{this.scroll.formatAt(t,e,r,n[r])}));const r=(new vk).retain(t).retain(e,Sa(n));return this.update(r)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce(((t,e)=>t.concat(e.delta())),new vk)}getFormat(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;let n=[];let r=[];if(e===0){this.scroll.path(t).forEach((t=>{const[e]=t;if(e instanceof yk){n.push(e)}else if(e instanceof qy){r.push(e)}}))}else{n=this.scroll.lines(t,e);r=this.scroll.descendants(qy,t,e)}const[i,s]=[n,r].map((t=>{const e=t.shift();if(e==null)return{};let n=jk(e);while(Object.keys(n).length>0){const e=t.shift();if(e==null)return n;n=Zk(jk(e),n)}return n}));return{...i,...s}}getHTML(t,e){const[n,r]=this.scroll.line(t);if(n){const i=n.length();const s=n.length()>=r+e;if(s&&!(r===0&&e===i)){return Wk(n,r,e,true)}return Wk(this.scroll,t,e,true)}return""}getText(t,e){return this.getContents(t,e).filter((t=>typeof t.insert==="string")).map((t=>t.insert)).join("")}insertContents(t,e){const n=Gk(e);const r=(new vk).retain(t).concat(n);this.scroll.insertContents(t,n);return this.update(r)}insertEmbed(t,e,n){this.scroll.insertAt(t,e,n);return this.update((new vk).retain(t).insert({[e]:n}))}insertText(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n");this.scroll.insertAt(t,e);Object.keys(n).forEach((r=>{this.scroll.formatAt(t,e.length,r,n[r])}));return this.update((new vk).retain(t).insert(e,Sa(n)))}isBlank(){if(this.scroll.children.length===0)return true;if(this.scroll.children.length>1)return false;const t=this.scroll.children.head;if(t?.statics.blotName!==yk.blotName)return false;const e=t;if(e.children.length>1)return false;return e.children.head instanceof pk}removeFormat(t,e){const n=this.getText(t,e);const[r,i]=this.scroll.line(t+e);let s=0;let l=new vk;if(r!=null){s=r.length()-i;l=r.delta().slice(i,i+s-1).insert("\n")}const o=this.getContents(t,e+s);const u=o.diff((new vk).insert(n).concat(l));const a=(new vk).retain(t).concat(u);return this.applyDelta(a)}update(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:undefined;const r=this.delta;if(e.length===1&&e[0].type==="characterData"&&e[0].target.data.match(Uk)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target);const s=jk(i);const l=i.offset(this.scroll);const o=e[0].oldValue.replace(Ak.CONTENTS,"");const u=(new vk).insert(o);const a=(new vk).insert(i.value());const c=n&&{oldRange:Qk(n.oldRange,-l),newRange:Qk(n.newRange,-l)};const f=(new vk).retain(l).concat(u.diff(a,c));t=f.reduce(((t,e)=>{if(e.insert){return t.insert(e.insert,s)}return t.push(e)}),new vk);this.delta=r.compose(t)}else{this.delta=this.getDelta();if(!t||!mv(r.compose(t),this.delta)){t=r.diff(this.delta,n)}}return t}}function Pk(t,e,n){if(t.length===0){const[t]=Kk(n.pop());if(e<=0){return`</li></${t}>`}return`</li></${t}>${Pk([],e-1,n)}`}const[{child:r,offset:i,length:s,indent:l,type:o},...u]=t;const[a,c]=Kk(o);if(l>e){n.push(o);if(l===e+1){return`<${a}><li${c}>${Wk(r,i,s)}${Pk(u,l,n)}`}return`<${a}><li>${Pk(t,e+1,n)}`}const f=n[n.length-1];if(l===e&&o===f){return`</li><li${c}>${Wk(r,i,s)}${Pk(u,l,n)}`}const[h]=Kk(n.pop());return`</li></${h}>${Pk(t,e-1,n)}`}function Wk(t,e,n){let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if("html"in t&&typeof t.html==="function"){return t.html(e,n)}if(t instanceof bk){const r=wk(t.value().slice(e,e+n));return r.replaceAll(" ","&nbsp;")}if(t instanceof ky){if(t.statics.blotName==="list-container"){const r=[];t.children.forEachAt(e,n,((t,e,n)=>{const i="formats"in t&&typeof t.formats==="function"?t.formats():{};r.push({child:t,offset:e,length:n,indent:i.indent||0,type:i.list})}));return Pk(r,-1,[])}const i=[];t.children.forEachAt(e,n,((t,e,n)=>{i.push(Wk(t,e,n))}));if(r||t.statics.blotName==="list"){return i.join("")}const{outerHTML:s,innerHTML:l}=t.domNode;const[o,u]=s.split(`>${l}<`);if(o==="<table"){return`<table style="border: 1px solid #000;">${i.join("")}<${u}`}return`${o}>${i.join("")}<${u}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function Zk(t,e){return Object.keys(e).reduce(((n,r)=>{if(t[r]==null)return n;const i=e[r];if(i===t[r]){n[r]=i}else if(Array.isArray(i)){if(i.indexOf(t[r])<0){n[r]=i.concat([t[r]])}else{n[r]=i}}else{n[r]=[i,t[r]]}return n}),{})}function Kk(t){const e=t==="ordered"?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Gk(t){return t.reduce(((t,e)=>{if(typeof e.insert==="string"){const n=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(n,e.attributes)}return t.push(e)}),new vk)}function Qk(t,e){let{index:n,length:r}=t;return new Dk(n+e,r)}function Yk(t){const e=[];t.forEach((t=>{if(typeof t.insert==="string"){const n=t.insert.split("\n");n.forEach(((n,r)=>{if(r)e.push({insert:"\n",attributes:t.attributes});if(n)e.push({insert:n,attributes:t.attributes})}))}else{e.push(t)}}));return e}class Jk{static DEFAULTS={};constructor(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.quill=t;this.options=e}}const Xk="\ufeff";class tx extends Sy{constructor(t,e){super(t,e);this.contentNode=document.createElement("span");this.contentNode.setAttribute("contenteditable","false");Array.from(this.domNode.childNodes).forEach((t=>{this.contentNode.appendChild(t)}));this.leftGuard=document.createTextNode(Xk);this.rightGuard=document.createTextNode(Xk);this.domNode.appendChild(this.leftGuard);this.domNode.appendChild(this.contentNode);this.domNode.appendChild(this.rightGuard)}index(t,e){if(t===this.leftGuard)return 0;if(t===this.rightGuard)return 1;return super.index(t,e)}restore(t){let e=null;let n;const r=t.data.split(Xk).join("");if(t===this.leftGuard){if(this.prev instanceof bk){const t=this.prev.length();this.prev.insertAt(t,r);e={startNode:this.prev.domNode,startOffset:t+r.length}}else{n=document.createTextNode(r);this.parent.insertBefore(this.scroll.create(n),this);e={startNode:n,startOffset:r.length}}}else if(t===this.rightGuard){if(this.next instanceof bk){this.next.insertAt(0,r);e={startNode:this.next.domNode,startOffset:r.length}}else{n=document.createTextNode(r);this.parent.insertBefore(this.scroll.create(n),this.next);e={startNode:n,startOffset:r.length}}}t.data=Xk;return e}update(t,e){t.forEach((t=>{if(t.type==="characterData"&&(t.target===this.leftGuard||t.target===this.rightGuard)){const n=this.restore(t.target);if(n)e.range=n}}))}}class ex{isComposing=false;constructor(t,e){this.scroll=t;this.emitter=e;this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(t=>{if(!this.isComposing){this.handleCompositionStart(t)}}));this.scroll.domNode.addEventListener("compositionend",(t=>{if(this.isComposing){queueMicrotask((()=>{this.handleCompositionEnd(t)}))}}))}handleCompositionStart(t){const e=t.target instanceof Node?this.scroll.find(t.target,true):null;if(e&&!(e instanceof tx)){this.emitter.emit(Ck.events.COMPOSITION_BEFORE_START,t);this.scroll.batchStart();this.emitter.emit(Ck.events.COMPOSITION_START,t);this.isComposing=true}}handleCompositionEnd(t){this.emitter.emit(Ck.events.COMPOSITION_BEFORE_END,t);this.scroll.batchEnd();this.emitter.emit(Ck.events.COMPOSITION_END,t);this.isComposing=false}}class nx{static DEFAULTS={modules:{}};static themes={default:nx};modules={};constructor(t,e){this.quill=t;this.options=e}init(){Object.keys(this.options.modules).forEach((t=>{if(this.modules[t]==null){this.addModule(t)}}))}addModule(t){const e=this.quill.constructor.import(`modules/${t}`);this.modules[t]=new e(this.quill,this.options.modules[t]||{});return this.modules[t]}}const rx=t=>t.parentElement||t.getRootNode().host||null;const ix=t=>{const e=t.getBoundingClientRect();const n="offsetWidth"in t&&Math.abs(e.width)/t.offsetWidth||1;const r="offsetHeight"in t&&Math.abs(e.height)/t.offsetHeight||1;return{top:e.top,right:e.left+t.clientWidth*n,bottom:e.top+t.clientHeight*r,left:e.left}};const sx=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e};const lx=(t,e,n,r,i,s)=>{if(t<n&&e>r){return 0}if(t<n){return-(n-t+i)}if(e>r){return e-t>r-n?t+i-n:e-r+s}return 0};const ox=(t,e)=>{const n=t.ownerDocument;let r=e;let i=t;while(i){const t=i===n.body;const e=t?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:ix(i);const s=getComputedStyle(i);const l=lx(r.left,r.right,e.left,e.right,sx(s.scrollPaddingLeft),sx(s.scrollPaddingRight));const o=lx(r.top,r.bottom,e.top,e.bottom,sx(s.scrollPaddingTop),sx(s.scrollPaddingBottom));if(l||o){if(t){n.defaultView?.scrollBy(l,o)}else{const{scrollLeft:t,scrollTop:e}=i;if(o){i.scrollTop+=o}if(l){i.scrollLeft+=l}const n=i.scrollLeft-t;const s=i.scrollTop-e;r={left:r.left-n,top:r.top-s,right:r.right-n,bottom:r.bottom-s}}}i=t||s.position==="fixed"?null:rx(i)}};const ux=100;const ax=["block","break","cursor","inline","scroll","text"];const cx=(t,e,n)=>{const r=new iy;ax.forEach((t=>{const n=e.query(t);if(n)r.register(n)}));t.forEach((t=>{let i=e.query(t);if(!i){n.error(`Cannot register "${t}" specified in "formats" config. Are you sure it was registered?`)}let s=0;while(i){r.register(i);i="blotName"in i?i.requiredContainer??null:null;s+=1;if(s>ux){n.error(`Cycle detected in registering blot requiredContainer: "${t}"`);break}}}));return r};const fx=zk("quill");const hx=new iy;ky.uiClass="ql-ui";class dx{static DEFAULTS={bounds:null,modules:{clipboard:true,keyboard:true,history:true,uploader:true},placeholder:"",readOnly:false,registry:hx,theme:"default"};static events=Ck.events;static sources=Ck.sources;static version="2.0.3";static imports={delta:vk,parchment:Uy,"core/module":Jk,"core/theme":nx};static debug(t){if(t===true){t="log"}zk.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return Nk.get(t)||hx.find(t,e)}static import(t){if(this.imports[t]==null){fx.error(`Cannot import ${t}. Are you sure it was registered?`)}return this.imports[t]}static register(){if(typeof(arguments.length<=0?undefined:arguments[0])!=="string"){const t=arguments.length<=0?undefined:arguments[0];const e=!!(arguments.length<=1?undefined:arguments[1]);const n="attrName"in t?t.attrName:t.blotName;if(typeof n==="string"){this.register(`formats/${n}`,t,e)}else{Object.keys(t).forEach((n=>{this.register(n,t[n],e)}))}}else{const t=arguments.length<=0?undefined:arguments[0];const e=arguments.length<=1?undefined:arguments[1];const n=!!(arguments.length<=2?undefined:arguments[2]);if(this.imports[t]!=null&&!n){fx.warn(`Overwriting ${t} with`,e)}this.imports[t]=e;if((t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!=="boolean"&&e.blotName!=="abstract"){hx.register(e)}if(typeof e.register==="function"){e.register(hx)}}}constructor(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.options=qx(t,e);this.container=this.options.container;if(this.container==null){fx.error("Invalid Quill container",t);return}if(this.options.debug){dx.debug(this.options.debug)}const n=this.container.innerHTML.trim();this.container.classList.add("ql-container");this.container.innerHTML="";Nk.set(this.container,this);this.root=this.addContainer("ql-editor");this.root.classList.add("ql-blank");this.emitter=new Ck;const r=By.blotName;const i=this.options.registry.query(r);if(!i||!("blotName"in i)){throw new Error(`Cannot initialize Quill without "${r}" blot`)}this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter});this.editor=new Fk(this.scroll);this.selection=new Hk(this.scroll,this.emitter);this.composition=new ex(this.scroll,this.emitter);this.theme=new this.options.theme(this,this.options);this.keyboard=this.theme.addModule("keyboard");this.clipboard=this.theme.addModule("clipboard");this.history=this.theme.addModule("history");this.uploader=this.theme.addModule("uploader");this.theme.addModule("input");this.theme.addModule("uiNode");this.theme.init();this.emitter.on(Ck.events.EDITOR_CHANGE,(t=>{if(t===Ck.events.TEXT_CHANGE){this.root.classList.toggle("ql-blank",this.editor.isBlank())}}));this.emitter.on(Ck.events.SCROLL_UPDATE,((t,e)=>{const n=this.selection.lastRange;const[r]=this.selection.getRange();const i=n&&r?{oldRange:n,newRange:r}:undefined;wx.call(this,(()=>this.editor.update(null,e,i)),t)}));this.emitter.on(Ck.events.SCROLL_EMBED_UPDATE,((t,e)=>{const n=this.selection.lastRange;const[r]=this.selection.getRange();const i=n&&r?{oldRange:n,newRange:r}:undefined;wx.call(this,(()=>{const n=(new vk).retain(t.offset(this)).retain({[t.statics.blotName]:e});return this.editor.update(n,[],i)}),dx.sources.USER)}));if(n){const t=this.clipboard.convert({html:`${n}<p><br></p>`,text:"\n"});this.setContents(t)}this.history.clear();if(this.options.placeholder){this.root.setAttribute("data-placeholder",this.options.placeholder)}if(this.options.readOnly){this.disable()}this.allowReadOnlyEdits=false}addContainer(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(typeof t==="string"){const e=t;t=document.createElement("div");t.classList.add(e)}this.container.insertBefore(t,e);return t}blur(){this.selection.setRange(null)}deleteText(t,e,n){[t,e,,n]=mx(t,e,n);return wx.call(this,(()=>this.editor.deleteText(t,e)),n,t,-1*e)}disable(){this.enable(false)}editReadOnly(t){this.allowReadOnlyEdits=true;const e=t();this.allowReadOnlyEdits=false;return e}enable(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.scroll.enable(t);this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.selection.focus();if(!t.preventScroll){this.scrollSelectionIntoView()}}format(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:Ck.sources.API;return wx.call(this,(()=>{const n=this.getSelection(true);let r=new vk;if(n==null)return r;if(this.scroll.query(t,ty.BLOCK)){r=this.editor.formatLine(n.index,n.length,{[t]:e})}else if(n.length===0){this.selection.format(t,e);return r}else{r=this.editor.formatText(n.index,n.length,{[t]:e})}this.setSelection(n,Ck.sources.SILENT);return r}),n)}formatLine(t,e,n,r,i){let s;[t,e,s,i]=mx(t,e,n,r,i);return wx.call(this,(()=>this.editor.formatLine(t,e,s)),i,t,0)}formatText(t,e,n,r,i){let s;[t,e,s,i]=mx(t,e,n,r,i);return wx.call(this,(()=>this.editor.formatText(t,e,s)),i,t,0)}getBounds(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;let n=null;if(typeof t==="number"){n=this.selection.getBounds(t,e)}else{n=this.selection.getBounds(t.index,t.length)}if(!n)return null;const r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.getLength()-t;[t,e]=mx(t,e);return this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.getSelection(true);let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(typeof t==="number"){return this.editor.getFormat(t,e)}return this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Number.MAX_VALUE;if(typeof t!=="number"){return this.scroll.lines(t.index,t.length)}return this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(t)this.focus();this.update();return this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;let e=arguments.length>1?arguments[1]:undefined;if(typeof t==="number"){e=e??this.getLength()-t}[t,e]=mx(t,e);return this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;let e=arguments.length>1?arguments[1]:undefined;if(typeof t==="number"){e=e??this.getLength()-t}[t,e]=mx(t,e);return this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,n){let r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:dx.sources.API;return wx.call(this,(()=>this.editor.insertEmbed(t,e,n)),r,t)}insertText(t,e,n,r,i){let s;[t,,s,i]=mx(t,0,n,r,i);return wx.call(this,(()=>this.editor.insertText(t,e,s)),i,t,e.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(t,e,n){[t,e,,n]=mx(t,e,n);return wx.call(this,(()=>this.editor.removeFormat(t,e)),n,t)}scrollRectIntoView(t){ox(this.root,t)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.");this.scrollSelectionIntoView()}scrollSelectionIntoView(){const t=this.selection.lastRange;const e=t&&this.selection.getBounds(t.index,t.length);if(e){this.scrollRectIntoView(e)}}setContents(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Ck.sources.API;return wx.call(this,(()=>{t=new vk(t);const e=this.getLength();const n=this.editor.deleteText(0,e);const r=this.editor.insertContents(0,t);const i=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(i)}),e)}setSelection(t,e,n){if(t==null){this.selection.setRange(null,e||dx.sources.API)}else{[t,e,,n]=mx(t,e,n);this.selection.setRange(new Dk(Math.max(0,t),e),n);if(n!==Ck.sources.SILENT){this.scrollSelectionIntoView()}}}setText(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Ck.sources.API;const n=(new vk).insert(t);return this.setContents(n,e)}update(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Ck.sources.USER;const e=this.scroll.update(t);this.selection.update(t);return e}updateContents(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Ck.sources.API;return wx.call(this,(()=>{t=new vk(t);return this.editor.applyDelta(t)}),e,true)}}function vx(t){return typeof t==="string"?document.querySelector(t):t}function px(t){return Object.entries(t??{}).reduce(((t,e)=>{let[n,r]=e;return{...t,[n]:r===true?{}:r}}),{})}function bx(t){return Object.fromEntries(Object.entries(t).filter((t=>t[1]!==undefined)))}function qx(t,e){const n=vx(t);if(!n){throw new Error("Invalid Quill container")}const r=!e.theme||e.theme===dx.DEFAULTS.theme;const i=r?nx:dx.import(`themes/${e.theme}`);if(!i){throw new Error(`Invalid theme ${e.theme}. Did you register it?`)}const{modules:s,...l}=dx.DEFAULTS;const{modules:o,...u}=i.DEFAULTS;let a=px(e.modules);if(a!=null&&a.toolbar&&a.toolbar.constructor!==Object){a={...a,toolbar:{container:a.toolbar}}}const c=yp({},px(s),px(o),a);const f={...l,...bx(u),...bx(e)};let h=e.registry;if(h){if(e.formats){fx.warn('Ignoring "formats" option because "registry" is specified')}}else{h=e.formats?cx(e.formats,f.registry,fx):f.registry}return{...f,registry:h,container:n,theme:i,modules:Object.entries(c).reduce(((t,e)=>{let[n,r]=e;if(!r)return t;const i=dx.import(`modules/${n}`);if(i==null){fx.error(`Cannot load ${n} module. Are you sure you registered it?`);return t}return{...t,[n]:yp({},i.DEFAULTS||{},r)}}),{}),bounds:vx(f.bounds)}}function wx(t,e,n,r){if(!this.isEnabled()&&e===Ck.sources.USER&&!this.allowReadOnlyEdits){return new vk}let i=n==null?null:this.getSelection();const s=this.editor.delta;const l=t();if(i!=null){if(n===true){n=i.index}if(r==null){i=gx(i,l,e)}else if(r!==0){i=gx(i,n,r,e)}this.setSelection(i,Ck.sources.SILENT)}if(l.length()>0){const t=[Ck.events.TEXT_CHANGE,l,s,e];this.emitter.emit(Ck.events.EDITOR_CHANGE,...t);if(e!==Ck.sources.SILENT){this.emitter.emit(...t)}}return l}function mx(t,e,n,r,i){let s={};if(typeof t.index==="number"&&typeof t.length==="number"){if(typeof e!=="number"){i=r;r=n;n=e;e=t.length;t=t.index}else{e=t.length;t=t.index}}else if(typeof e!=="number"){i=r;r=n;n=e;e=0}if(typeof n==="object"){s=n;i=r}else if(typeof n==="string"){if(r!=null){s[n]=r}else{i=n}}i=i||Ck.sources.API;return[t,e,s,i]}function gx(t,e,n,r){const i=typeof n==="number"?n:0;if(t==null)return null;let s;let l;if(e&&typeof e.transformPosition==="function"){[s,l]=[t.index,t.index+t.length].map((t=>e.transformPosition(t,r!==Ck.sources.USER)))}else{[s,l]=[t.index,t.index+t.length].map((t=>{if(t<e||t===e&&r===Ck.sources.USER)return t;if(i>=0){return t+i}return Math.max(e,t+i)}))}return new Dk(s,l-s)}class yx extends Ly{}function kx(t){return t instanceof yk||t instanceof kk}function xx(t){return typeof t.updateContent==="function"}class jx extends By{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=yk;static allowedChildren=[yk,kk,yx];constructor(t,e,n){let{emitter:r}=n;super(t,e);this.emitter=r;this.batch=false;this.optimize();this.enable();this.domNode.addEventListener("dragstart",(t=>this.handleDragStart(t)))}batchStart(){if(!Array.isArray(this.batch)){this.batch=[]}}batchEnd(){if(!this.batch)return;const t=this.batch;this.batch=false;this.update(t)}emitMount(t){this.emitter.emit(Ck.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(Ck.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(Ck.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[n,r]=this.line(t);const[i]=this.line(t+e);super.deleteAt(t,e);if(i!=null&&n!==i&&r>0){if(n instanceof kk||i instanceof kk){this.optimize();return}const t=i.children.head instanceof pk?null:i.children.head;n.moveChildren(i,t);n.remove()}this.optimize()}enable(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,e,n,r){super.formatAt(t,e,n,r);this.optimize()}insertAt(t,e,n){if(t>=this.length()){if(n==null||this.scroll.query(e,ty.BLOCK)==null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t);if(n==null&&e.endsWith("\n")){t.insertAt(0,e.slice(0,-1),n)}else{t.insertAt(0,e,n)}}else{const t=this.scroll.create(e,n);this.appendChild(t)}}else{super.insertAt(t,e,n)}this.optimize()}insertBefore(t,e){if(t.statics.scope===ty.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(t);super.insertBefore(n,e)}else{super.insertBefore(t,e)}}insertContents(t,e){const n=this.deltaToRenderBlocks(e.concat((new vk).insert("\n")));const r=n.pop();if(r==null)return;this.batchStart();const i=n.shift();if(i){const e=i.type==="block"&&(i.delta.length()===0||!this.descendant(kk,t)[0]&&t<this.length());const n=i.type==="block"?i.delta:(new vk).insert({[i.key]:i.value});Ax(this,t,n);const r=i.type==="block"?1:0;const s=t+n.length()+r;if(e){this.insertAt(s-1,"\n")}const l=jk(this.line(t)[0]);const o=dk.AttributeMap.diff(l,i.attributes)||{};Object.keys(o).forEach((t=>{this.formatAt(s-1,1,t,o[t])}));t=s}let[s,l]=this.children.find(t);if(n.length){if(s){s=s.split(l);l=0}n.forEach((t=>{if(t.type==="block"){const e=this.createBlock(t.attributes,s||undefined);Ax(e,0,t.delta)}else{const e=this.create(t.key,t.value);this.insertBefore(e,s||undefined);Object.keys(t.attributes).forEach((n=>{e.format(n,t.attributes[n])}))}}))}if(r.type==="block"&&r.delta.length()){const t=s?s.offset(s.scroll)+l:this.length();Ax(this,t,r.delta)}this.batchEnd();this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(t){const e=this.path(t).pop();if(!e){return[null,-1]}const[n,r]=e;return n instanceof qy?[n,r]:[null,-1]}line(t){if(t===this.length()){return this.line(t-1)}return this.descendant(kx,t)}lines(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Number.MAX_VALUE;const n=(t,e,r)=>{let i=[];let s=r;t.children.forEachAt(e,r,((t,e,r)=>{if(kx(t)){i.push(t)}else if(t instanceof Ly){i=i.concat(n(t,e,s))}s-=r}));return i};return n(this,t,e)}optimize(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this.batch)return;super.optimize(t,e);if(t.length>0){this.emitter.emit(Ck.events.SCROLL_OPTIMIZE,t,e)}}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch){if(Array.isArray(t)){this.batch=this.batch.concat(t)}return}let e=Ck.sources.USER;if(typeof t==="string"){e=t}if(!Array.isArray(t)){t=this.observer.takeRecords()}t=t.filter((t=>{let{target:e}=t;const n=this.find(e,true);return n&&!xx(n)}));if(t.length>0){this.emitter.emit(Ck.events.SCROLL_BEFORE_UPDATE,e,t)}super.update(t.concat([]));if(t.length>0){this.emitter.emit(Ck.events.SCROLL_UPDATE,e,t)}}updateEmbedAt(t,e,n){const[r]=this.descendant((t=>t instanceof kk),t);if(r&&r.statics.blotName===e&&xx(r)){r.updateContent(n)}}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let n=new vk;t.forEach((t=>{const r=t?.insert;if(!r)return;if(typeof r==="string"){const i=r.split("\n");i.slice(0,-1).forEach((r=>{n.insert(r,t.attributes);e.push({type:"block",delta:n,attributes:t.attributes??{}});n=new vk}));const s=i[i.length-1];if(s){n.insert(s,t.attributes)}}else{const i=Object.keys(r)[0];if(!i)return;if(this.query(i,ty.INLINE)){n.push(t)}else{if(n.length()){e.push({type:"block",delta:n,attributes:{}})}n=new vk;e.push({type:"blockEmbed",key:i,value:r[i],attributes:t.attributes??{}})}}}));if(n.length()){e.push({type:"block",delta:n,attributes:{}})}return e}createBlock(t,e){let n;const r={};Object.entries(t).forEach((t=>{let[e,i]=t;const s=this.query(e,ty.BLOCK&ty.BLOT)!=null;if(s){n=e}else{r[e]=i}}));const i=this.create(n||this.statics.defaultChild.blotName,n?t[n]:undefined);this.insertBefore(i,e||undefined);const s=i.length();Object.entries(r).forEach((t=>{let[e,n]=t;i.formatAt(0,s,e,n)}));return i}}function Ax(t,e,n){n.reduce(((e,n)=>{const r=dk.Op.length(n);let i=n.attributes||{};if(n.insert!=null){if(typeof n.insert==="string"){const r=n.insert;t.insertAt(e,r);const[s]=t.descendant(qy,e);const l=jk(s);i=dk.AttributeMap.diff(l,i)||{}}else if(typeof n.insert==="object"){const r=Object.keys(n.insert)[0];if(r==null)return e;t.insertAt(e,r,n.insert[r]);const s=t.scroll.query(r,ty.INLINE)!=null;if(s){const[n]=t.descendant(qy,e);const r=jk(n);i=dk.AttributeMap.diff(r,i)||{}}}}Object.keys(i).forEach((n=>{t.formatAt(e,r,n,i[n])}));return e+r}),e)}const Ox={scope:ty.BLOCK,whitelist:["right","center","justify"]};const Mx=new ey("align","align",Ox);const Ex=new oy("align","ql-align",Ox);const _x=new cy("align","text-align",Ox);class Tx extends cy{value(t){let e=super.value(t);if(!e.startsWith("rgb("))return e;e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");const n=e.split(",").map((t=>`00${parseInt(t,10).toString(16)}`.slice(-2))).join("");return`#${n}`}}const Nx=new oy("color","ql-color",{scope:ty.INLINE});const Lx=new Tx("color","color",{scope:ty.INLINE});const $x=new oy("background","ql-bg",{scope:ty.INLINE});const Sx=new Tx("background","background-color",{scope:ty.INLINE});class zx extends yx{static create(t){const e=super.create(t);e.setAttribute("spellcheck","false");return e}code(t,e){return this.children.map((t=>t.length()<=1?"":t.domNode.innerText)).join("\n").slice(t,t+e)}html(t,e){return`<pre>\n${wk(this.code(t,e))}\n</pre>`}}class Rx extends yk{static TAB=" ";static register(){dx.register(zx)}}class Ix extends mk{}Ix.blotName="code";Ix.tagName="CODE";Rx.blotName="code-block";Rx.className="ql-code-block";Rx.tagName="DIV";zx.blotName="code-block-container";zx.className="ql-code-block-container";zx.tagName="DIV";zx.allowedChildren=[Rx];Rx.allowedChildren=[bk,pk,Ak];Rx.requiredContainer=zx;const Cx={scope:ty.BLOCK,whitelist:["rtl"]};const Bx=new ey("direction","dir",Cx);const Dx=new oy("direction","ql-direction",Cx);const Hx=new cy("direction","direction",Cx);const Vx={scope:ty.INLINE,whitelist:["serif","monospace"]};const Ux=new oy("font","ql-font",Vx);class Fx extends cy{value(t){return super.value(t).replace(/["']/g,"")}}const Px=new Fx("font","font-family",Vx);const Wx=new oy("size","ql-size",{scope:ty.INLINE,whitelist:["small","large","huge"]});const Zx=new cy("size","font-size",{scope:ty.INLINE,whitelist:["10px","18px","32px"]});const Kx=zk("quill:keyboard");const Gx=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Qx extends Jk{static match(t,e){if(["altKey","ctrlKey","metaKey","shiftKey"].some((n=>!!e[n]!==t[n]&&e[n]!==null))){return false}return e.key===t.key||e.key===t.which}constructor(t,e){super(t,e);this.bindings={};Object.keys(this.options.bindings).forEach((t=>{if(this.options.bindings[t]){this.addBinding(this.options.bindings[t])}}));this.addBinding({key:"Enter",shiftKey:null},this.handleEnter);this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{}));if(/Firefox/i.test(navigator.userAgent)){this.addBinding({key:"Backspace"},{collapsed:true},this.handleBackspace);this.addBinding({key:"Delete"},{collapsed:true},this.handleDelete)}else{this.addBinding({key:"Backspace"},{collapsed:true,prefix:/^.?$/},this.handleBackspace);this.addBinding({key:"Delete"},{collapsed:true,suffix:/^.?$/},this.handleDelete)}this.addBinding({key:"Backspace"},{collapsed:false},this.handleDeleteRange);this.addBinding({key:"Delete"},{collapsed:false},this.handleDeleteRange);this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:true,offset:0},this.handleBackspace);this.listen()}addBinding(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};const r=nj(t);if(r==null){Kx.warn("Attempted to add invalid keyboard binding",r);return}if(typeof e==="function"){e={handler:e}}if(typeof n==="function"){n={handler:n}}const i=Array.isArray(r.key)?r.key:[r.key];i.forEach((t=>{const i={...r,key:t,...e,...n};this.bindings[i.key]=this.bindings[i.key]||[];this.bindings[i.key].push(i)}))}listen(){this.quill.root.addEventListener("keydown",(t=>{if(t.defaultPrevented||t.isComposing)return;const e=t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace");if(e)return;const n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]);const r=n.filter((e=>Qx.match(t,e)));if(r.length===0)return;const i=dx.find(t.target,true);if(i&&i.scroll!==this.quill.scroll)return;const s=this.quill.getSelection();if(s==null||!this.quill.hasFocus())return;const[l,o]=this.quill.getLine(s.index);const[u,a]=this.quill.getLeaf(s.index);const[c,f]=s.length===0?[u,a]:this.quill.getLeaf(s.index+s.length);const h=u instanceof Vy?u.value().slice(0,a):"";const d=c instanceof Vy?c.value().slice(f):"";const v={collapsed:s.length===0,empty:s.length===0&&l.length()<=1,format:this.quill.getFormat(s),line:l,offset:o,prefix:h,suffix:d,event:t};const p=r.some((t=>{if(t.collapsed!=null&&t.collapsed!==v.collapsed){return false}if(t.empty!=null&&t.empty!==v.empty){return false}if(t.offset!=null&&t.offset!==v.offset){return false}if(Array.isArray(t.format)){if(t.format.every((t=>v.format[t]==null))){return false}}else if(typeof t.format==="object"){if(!Object.keys(t.format).every((e=>{if(t.format[e]===true)return v.format[e]!=null;if(t.format[e]===false)return v.format[e]==null;return mv(t.format[e],v.format[e])}))){return false}}if(t.prefix!=null&&!t.prefix.test(v.prefix)){return false}if(t.suffix!=null&&!t.suffix.test(v.suffix)){return false}return t.handler.call(this,s,v,t)!==true}));if(p){t.preventDefault()}}))}handleBackspace(t,e){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(t.index===0||this.quill.getLength()<=1)return;let r={};const[i]=this.quill.getLine(t.index);let s=(new vk).retain(t.index-n).delete(n);if(e.offset===0){const[e]=this.quill.getLine(t.index-1);if(e){const n=e.statics.blotName==="block"&&e.length()<=1;if(!n){const e=i.formats();const n=this.quill.getFormat(t.index-1,1);r=dk.AttributeMap.diff(e,n)||{};if(Object.keys(r).length>0){const e=(new vk).retain(t.index+i.length()-2).retain(1,r);s=s.compose(e)}}}}this.quill.updateContents(s,dx.sources.USER);this.quill.focus()}handleDelete(t,e){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-n)return;let r={};const[i]=this.quill.getLine(t.index);let s=(new vk).retain(t.index).delete(n);if(e.offset>=i.length()-1){const[e]=this.quill.getLine(t.index+1);if(e){const n=i.formats();const l=this.quill.getFormat(t.index,1);r=dk.AttributeMap.diff(n,l)||{};if(Object.keys(r).length>0){s=s.retain(e.length()-1).retain(1,r)}}}this.quill.updateContents(s,dx.sources.USER);this.quill.focus()}handleDeleteRange(t){rj({range:t,quill:this.quill});this.quill.focus()}handleEnter(t,e){const n=Object.keys(e.format).reduce(((t,n)=>{if(this.quill.scroll.query(n,ty.BLOCK)&&!Array.isArray(e.format[n])){t[n]=e.format[n]}return t}),{});const r=(new vk).retain(t.index).delete(t.length).insert("\n",n);this.quill.updateContents(r,dx.sources.USER);this.quill.setSelection(t.index+1,dx.sources.SILENT);this.quill.focus()}}const Yx={bindings:{bold:tj("bold"),italic:tj("italic"),underline:tj("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){if(e.collapsed&&e.offset!==0)return true;this.quill.format("indent","+1",dx.sources.USER);return false}},outdent:{key:"Tab",shiftKey:true,format:["blockquote","indent","list"],handler(t,e){if(e.collapsed&&e.offset!==0)return true;this.quill.format("indent","-1",dx.sources.USER);return false}},"outdent backspace":{key:"Backspace",collapsed:true,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){if(e.format.indent!=null){this.quill.format("indent","-1",dx.sources.USER)}else if(e.format.list!=null){this.quill.format("list",false,dx.sources.USER)}}},"indent code-block":Jx(true),"outdent code-block":Jx(false),"remove tab":{key:"Tab",shiftKey:true,collapsed:true,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,dx.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return true;this.quill.history.cutoff();const n=(new vk).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(n,dx.sources.USER);this.quill.history.cutoff();this.quill.setSelection(t.index+1,dx.sources.SILENT);return false}},"blockquote empty enter":{key:"Enter",collapsed:true,format:["blockquote"],empty:true,handler(){this.quill.format("blockquote",false,dx.sources.USER)}},"list empty enter":{key:"Enter",collapsed:true,format:["list"],empty:true,handler(t,e){const n={list:false};if(e.format.indent){n.indent=false}this.quill.formatLine(t.index,t.length,n,dx.sources.USER)}},"checklist enter":{key:"Enter",collapsed:true,format:{list:"checked"},handler(t){const[e,n]=this.quill.getLine(t.index);const r={...e.formats(),list:"checked"};const i=(new vk).retain(t.index).insert("\n",r).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,dx.sources.USER);this.quill.setSelection(t.index+1,dx.sources.SILENT);this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:true,format:["header"],suffix:/^$/,handler(t,e){const[n,r]=this.quill.getLine(t.index);const i=(new vk).retain(t.index).insert("\n",e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,dx.sources.USER);this.quill.setSelection(t.index+1,dx.sources.SILENT);this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:true,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:true,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(t){const e=this.quill.getModule("table");if(e){const[n,r,i,s]=e.getTable(t);const l=ij(n,r,i,s);if(l==null)return;let o=n.offset();if(l<0){const e=(new vk).retain(o).insert("\n");this.quill.updateContents(e,dx.sources.USER);this.quill.setSelection(t.index+1,t.length,dx.sources.SILENT)}else if(l>0){o+=n.length();const t=(new vk).retain(o).insert("\n");this.quill.updateContents(t,dx.sources.USER);this.quill.setSelection(o,dx.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:n,line:r}=e;const i=r.offset(this.quill.scroll);if(n.shiftKey){this.quill.setSelection(i-1,dx.sources.USER)}else{this.quill.setSelection(i+r.length(),dx.sources.USER)}}},"list autofill":{key:" ",shiftKey:null,collapsed:true,format:{"code-block":false,blockquote:false,table:false},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(this.quill.scroll.query("list")==null)return true;const{length:n}=e.prefix;const[r,i]=this.quill.getLine(t.index);if(i>n)return true;let s;switch(e.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(t.index," ",dx.sources.USER);this.quill.history.cutoff();const l=(new vk).retain(t.index-i).delete(n+1).retain(r.length()-2-i).retain(1,{list:s});this.quill.updateContents(l,dx.sources.USER);this.quill.history.cutoff();this.quill.setSelection(t.index-n,dx.sources.SILENT);return false}},"code exit":{key:"Enter",collapsed:true,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,n]=this.quill.getLine(t.index);let r=2;let i=e;while(i!=null&&i.length()<=1&&i.formats()["code-block"]){i=i.prev;r-=1;if(r<=0){const r=(new vk).retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(r,dx.sources.USER);this.quill.setSelection(t.index-1,dx.sources.SILENT);return false}}return true}},"embed left":Xx("ArrowLeft",false),"embed left shift":Xx("ArrowLeft",true),"embed right":Xx("ArrowRight",false),"embed right shift":Xx("ArrowRight",true),"table down":ej(false),"table up":ej(true)}};Qx.DEFAULTS=Yx;function Jx(t){return{key:"Tab",shiftKey:!t,format:{"code-block":true},handler(e,n){let{event:r}=n;const i=this.quill.scroll.query("code-block");const{TAB:s}=i;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,s,dx.sources.USER);this.quill.setSelection(e.index+s.length,dx.sources.SILENT);return}const l=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:u}=e;l.forEach(((e,n)=>{if(t){e.insertAt(0,s);if(n===0){o+=s.length}else{u+=s.length}}else if(e.domNode.textContent.startsWith(s)){e.deleteAt(0,s.length);if(n===0){o-=s.length}else{u-=s.length}}}));this.quill.update(dx.sources.USER);this.quill.setSelection(o,u,dx.sources.SILENT)}}}function Xx(t,e){const n=t==="ArrowLeft"?"prefix":"suffix";return{key:t,shiftKey:e,altKey:null,[n]:/^$/,handler(n){let{index:r}=n;if(t==="ArrowRight"){r+=n.length+1}const[i]=this.quill.getLeaf(r);if(!(i instanceof Sy))return true;if(t==="ArrowLeft"){if(e){this.quill.setSelection(n.index-1,n.length+1,dx.sources.USER)}else{this.quill.setSelection(n.index-1,dx.sources.USER)}}else if(e){this.quill.setSelection(n.index,n.length+1,dx.sources.USER)}else{this.quill.setSelection(n.index+n.length+1,dx.sources.USER)}return false}}}function tj(t){return{key:t[0],shortKey:true,handler(e,n){this.quill.format(t,!n.format[t],dx.sources.USER)}}}function ej(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:true,format:["table"],handler(e,n){const r=t?"prev":"next";const i=n.line;const s=i.parent[r];if(s!=null){if(s.statics.blotName==="table-row"){let t=s.children.head;let e=i;while(e.prev!=null){e=e.prev;t=t.next}const r=t.offset(this.quill.scroll)+Math.min(n.offset,t.length()-1);this.quill.setSelection(r,0,dx.sources.USER)}}else{const e=i.table()[r];if(e!=null){if(t){this.quill.setSelection(e.offset(this.quill.scroll)+e.length()-1,0,dx.sources.USER)}else{this.quill.setSelection(e.offset(this.quill.scroll),0,dx.sources.USER)}}}return false}}}function nj(t){if(typeof t==="string"||typeof t==="number"){t={key:t}}else if(typeof t==="object"){t=Sa(t)}else{return null}if(t.shortKey){t[Gx]=t.shortKey;delete t.shortKey}return t}function rj(t){let{quill:e,range:n}=t;const r=e.getLines(n);let i={};if(r.length>1){const t=r[0].formats();const e=r[r.length-1].formats();i=dk.AttributeMap.diff(e,t)||{}}e.deleteText(n,dx.sources.USER);if(Object.keys(i).length>0){e.formatLine(n.index,1,i,dx.sources.USER)}e.setSelection(n.index,dx.sources.SILENT)}function ij(t,e,n,r){if(e.prev==null&&e.next==null){if(n.prev==null&&n.next==null){return r===0?-1:1}return n.prev==null?-1:1}if(e.prev==null){return-1}if(e.next==null){return 1}return null}const sj=/font-weight:\s*normal/;const lj=["P","OL","UL"];const oj=t=>t&&lj.includes(t.tagName);const uj=t=>{Array.from(t.querySelectorAll("br")).filter((t=>oj(t.previousElementSibling)&&oj(t.nextElementSibling))).forEach((t=>{t.parentNode?.removeChild(t)}))};const aj=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter((t=>t.getAttribute("style")?.match(sj))).forEach((e=>{const n=t.createDocumentFragment();n.append(...e.childNodes);e.parentNode?.replaceChild(n,e)}))};function cj(t){if(t.querySelector('[id^="docs-internal-guid-"]')){aj(t);uj(t)}}const fj=/\bmso-list:[^;]*ignore/i;const hj=/\bmso-list:[^;]*\bl(\d+)/i;const dj=/\bmso-list:[^;]*\blevel(\d+)/i;const vj=(t,e)=>{const n=t.getAttribute("style");const r=n?.match(hj);if(!r){return null}const i=Number(r[1]);const s=n?.match(dj);const l=s?Number(s[1]):1;const o=new RegExp(`@list l${i}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i");const u=e.match(o);const a=u&&u[1]==="bullet"?"bullet":"ordered";return{id:i,indent:l,type:a,element:t}};const pj=t=>{const e=Array.from(t.querySelectorAll("[style*=mso-list]"));const n=[];const r=[];e.forEach((t=>{const e=(t.getAttribute("style")||"").match(fj);if(e){n.push(t)}else{r.push(t)}}));n.forEach((t=>t.parentNode?.removeChild(t)));const i=t.documentElement.innerHTML;const s=r.map((t=>vj(t,i))).filter((t=>t));while(s.length){const t=[];let e=s.shift();while(e){t.push(e);e=s.length&&s[0]?.element===e.element.nextElementSibling&&s[0].id===e.id?s.shift():null}const n=document.createElement("ul");t.forEach((t=>{const e=document.createElement("li");e.setAttribute("data-list",t.type);if(t.indent>1){e.setAttribute("class",`ql-indent-${t.indent-1}`)}e.innerHTML=t.element.innerHTML;n.appendChild(e)}));const r=t[0]?.element;const{parentNode:i}=r??{};if(r){i?.replaceChild(n,r)}t.slice(1).forEach((t=>{let{element:e}=t;i?.removeChild(e)}))}};function bj(t){if(t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"){pj(t)}}const qj=[bj,cj];const wj=t=>{if(t.documentElement){qj.forEach((e=>{e(t)}))}};const mj=zk("quill:clipboard");const gj=[[Node.TEXT_NODE,Vj],[Node.TEXT_NODE,Bj],["br",Sj],[Node.ELEMENT_NODE,Bj],[Node.ELEMENT_NODE,$j],[Node.ELEMENT_NODE,Lj],[Node.ELEMENT_NODE,Dj],["li",Ij],["ol, ul",Cj],["pre",zj],["tr",Hj],["b",Nj("bold")],["i",Nj("italic")],["strike",Nj("strike")],["style",Rj]];const yj=[Mx,Bx].reduce(((t,e)=>{t[e.keyName]=e;return t}),{});const kj=[_x,Sx,Lx,Hx,Px,Zx].reduce(((t,e)=>{t[e.keyName]=e;return t}),{});class xj extends Jk{static DEFAULTS={matchers:[]};constructor(t,e){super(t,e);this.quill.root.addEventListener("copy",(t=>this.onCaptureCopy(t,false)));this.quill.root.addEventListener("cut",(t=>this.onCaptureCopy(t,true)));this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this));this.matchers=[];gj.concat(this.options.matchers??[]).forEach((t=>{let[e,n]=t;this.addMatcher(e,n)}))}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:n}=t;let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(r[Rx.blotName]){return(new vk).insert(n||"",{[Rx.blotName]:r[Rx.blotName]})}if(!e){return(new vk).insert(n||"",r)}const i=this.convertHTML(e);if(Aj(i,"\n")&&(i.ops[i.ops.length-1].attributes==null||r.table)){return i.compose((new vk).retain(i.length()-1).delete(1))}return i}normalizeHTML(t){wj(t)}convertHTML(t){const e=(new DOMParser).parseFromString(t,"text/html");this.normalizeHTML(e);const n=e.body;const r=new WeakMap;const[i,s]=this.prepareMatching(n,r);return Tj(this.quill.scroll,n,i,s,r)}dangerouslyPasteHTML(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:dx.sources.API;if(typeof t==="string"){const n=this.convert({html:t,text:""});this.quill.setContents(n,e);this.quill.setSelection(0,dx.sources.SILENT)}else{const r=this.convert({html:e,text:""});this.quill.updateContents((new vk).retain(t).concat(r),n);this.quill.setSelection(t+r.length(),dx.sources.SILENT)}}onCaptureCopy(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(t.defaultPrevented)return;t.preventDefault();const[n]=this.quill.selection.getRange();if(n==null)return;const{html:r,text:i}=this.onCopy(n,e);t.clipboardData?.setData("text/plain",i);t.clipboardData?.setData("text/html",r);if(e){rj({range:n,quill:this.quill})}}normalizeURIList(t){return t.split(/\r?\n/).filter((t=>t[0]!=="#")).join("\n")}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(true);if(e==null)return;const n=t.clipboardData?.getData("text/html");let r=t.clipboardData?.getData("text/plain");if(!n&&!r){const e=t.clipboardData?.getData("text/uri-list");if(e){r=this.normalizeURIList(e)}}const i=Array.from(t.clipboardData?.files||[]);if(!n&&i.length>0){this.quill.uploader.upload(e,i);return}if(n&&i.length>0){const t=(new DOMParser).parseFromString(n,"text/html");if(t.body.childElementCount===1&&t.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(e,i);return}}this.onPaste(e,{html:n,text:r})}onCopy(t){const e=this.quill.getText(t);const n=this.quill.getSemanticHTML(t);return{html:n,text:e}}onPaste(t,e){let{text:n,html:r}=e;const i=this.quill.getFormat(t.index);const s=this.convert({text:n,html:r},i);mj.log("onPaste",s,{text:n,html:r});const l=(new vk).retain(t.index).delete(t.length).concat(s);this.quill.updateContents(l,dx.sources.USER);this.quill.setSelection(l.length()-t.length,dx.sources.SILENT);this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const n=[];const r=[];this.matchers.forEach((i=>{const[s,l]=i;switch(s){case Node.TEXT_NODE:r.push(l);break;case Node.ELEMENT_NODE:n.push(l);break;default:Array.from(t.querySelectorAll(s)).forEach((t=>{if(e.has(t)){const n=e.get(t);n?.push(l)}else{e.set(t,[l])}}));break}}));return[n,r]}}function jj(t,e,n,r){if(!r.query(e)){return t}return t.reduce(((t,r)=>{if(!r.insert)return t;if(r.attributes&&r.attributes[e]){return t.push(r)}const i=n?{[e]:n}:{};return t.insert(r.insert,{...i,...r.attributes})}),new vk)}function Aj(t,e){let n="";for(let r=t.ops.length-1;r>=0&&n.length<e.length;--r){const e=t.ops[r];if(typeof e.insert!=="string")break;n=e.insert+n}return n.slice(-1*e.length)===e}function Oj(t,e){if(!(t instanceof Element))return false;const n=e.query(t);if(n&&n.prototype instanceof Sy)return false;return["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(t.tagName.toLowerCase())}function Mj(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Oj(t.previousElementSibling,e)&&!Oj(t.nextElementSibling,e)}const Ej=new WeakMap;function _j(t){if(t==null)return false;if(!Ej.has(t)){if(t.tagName==="PRE"){Ej.set(t,true)}else{Ej.set(t,_j(t.parentNode))}}return Ej.get(t)}function Tj(t,e,n,r,i){if(e.nodeType===e.TEXT_NODE){return r.reduce(((n,r)=>r(e,n,t)),new vk)}if(e.nodeType===e.ELEMENT_NODE){return Array.from(e.childNodes||[]).reduce(((s,l)=>{let o=Tj(t,l,n,r,i);if(l.nodeType===e.ELEMENT_NODE){o=n.reduce(((e,n)=>n(l,e,t)),o);o=(i.get(l)||[]).reduce(((e,n)=>n(l,e,t)),o)}return s.concat(o)}),new vk)}return new vk}function Nj(t){return(e,n,r)=>jj(n,t,true,r)}function Lj(t,e,n){const r=ey.keys(t);const i=oy.keys(t);const s=cy.keys(t);const l={};r.concat(i).concat(s).forEach((e=>{let r=n.query(e,ty.ATTRIBUTE);if(r!=null){l[r.attrName]=r.value(t);if(l[r.attrName])return}r=yj[e];if(r!=null&&(r.attrName===e||r.keyName===e)){l[r.attrName]=r.value(t)||undefined}r=kj[e];if(r!=null&&(r.attrName===e||r.keyName===e)){r=kj[e];l[r.attrName]=r.value(t)||undefined}}));return Object.entries(l).reduce(((t,e)=>{let[r,i]=e;return jj(t,r,i,n)}),e)}function $j(t,e,n){const r=n.query(t);if(r==null)return e;if(r.prototype instanceof Sy){const e={};const i=r.value(t);if(i!=null){e[r.blotName]=i;return(new vk).insert(e,r.formats(t,n))}}else{if(r.prototype instanceof _y&&!Aj(e,"\n")){e.insert("\n")}if("blotName"in r&&"formats"in r&&typeof r.formats==="function"){return jj(e,r.blotName,r.formats(t,n),n)}}return e}function Sj(t,e){if(!Aj(e,"\n")){e.insert("\n")}return e}function zj(t,e,n){const r=n.query("code-block");const i=r&&"formats"in r&&typeof r.formats==="function"?r.formats(t,n):true;return jj(e,"code-block",i,n)}function Rj(){return new vk}function Ij(t,e,n){const r=n.query(t);if(r==null||r.blotName!=="list"||!Aj(e,"\n")){return e}let i=-1;let s=t.parentNode;while(s!=null){if(["OL","UL"].includes(s.tagName)){i+=1}s=s.parentNode}if(i<=0)return e;return e.reduce(((t,e)=>{if(!e.insert)return t;if(e.attributes&&typeof e.attributes.indent==="number"){return t.push(e)}return t.insert(e.insert,{indent:i,...e.attributes||{}})}),new vk)}function Cj(t,e,n){const r=t;let i=r.tagName==="OL"?"ordered":"bullet";const s=r.getAttribute("data-checked");if(s){i=s==="true"?"checked":"unchecked"}return jj(e,"list",i,n)}function Bj(t,e,n){if(!Aj(e,"\n")){if(Oj(t,n)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement)){return e.insert("\n")}if(e.length()>0&&t.nextSibling){let r=t.nextSibling;while(r!=null){if(Oj(r,n)){return e.insert("\n")}const t=n.query(r);if(t&&t.prototype instanceof kk){return e.insert("\n")}r=r.firstChild}}}return e}function Dj(t,e,n){const r={};const i=t.style||{};if(i.fontStyle==="italic"){r.italic=true}if(i.textDecoration==="underline"){r.underline=true}if(i.textDecoration==="line-through"){r.strike=true}if(i.fontWeight?.startsWith("bold")||parseInt(i.fontWeight,10)>=700){r.bold=true}e=Object.entries(r).reduce(((t,e)=>{let[r,i]=e;return jj(t,r,i,n)}),e);if(parseFloat(i.textIndent||0)>0){return(new vk).insert("\t").concat(e)}return e}function Hj(t,e,n){const r=t.parentElement?.tagName==="TABLE"?t.parentElement:t.parentElement?.parentElement;if(r!=null){const i=Array.from(r.querySelectorAll("tr"));const s=i.indexOf(t)+1;return jj(e,"table",s,n)}return e}function Vj(t,e,n){let r=t.data;if(t.parentElement?.tagName==="O:P"){return e.insert(r.trim())}if(!_j(t)){if(r.trim().length===0&&r.includes("\n")&&!Mj(t,n)){return e}r=r.replace(/[^\S\u00a0]/g," ");r=r.replace(/ {2,}/g," ");if(t.previousSibling==null&&t.parentElement!=null&&Oj(t.parentElement,n)||t.previousSibling instanceof Element&&Oj(t.previousSibling,n)){r=r.replace(/^ /,"")}if(t.nextSibling==null&&t.parentElement!=null&&Oj(t.parentElement,n)||t.nextSibling instanceof Element&&Oj(t.nextSibling,n)){r=r.replace(/ $/,"")}r=r.replaceAll(" "," ")}return e.insert(r)}class Uj extends Jk{static DEFAULTS={delay:1e3,maxStack:100,userOnly:false};lastRecorded=0;ignoreChange=false;stack={undo:[],redo:[]};currentRange=null;constructor(t,e){super(t,e);this.quill.on(dx.events.EDITOR_CHANGE,((t,e,n,r)=>{if(t===dx.events.SELECTION_CHANGE){if(e&&r!==dx.sources.SILENT){this.currentRange=e}}else if(t===dx.events.TEXT_CHANGE){if(!this.ignoreChange){if(!this.options.userOnly||r===dx.sources.USER){this.record(e,n)}else{this.transform(e)}}this.currentRange=Zj(this.currentRange,e)}}));this.quill.keyboard.addBinding({key:"z",shortKey:true},this.undo.bind(this));this.quill.keyboard.addBinding({key:["z","Z"],shortKey:true,shiftKey:true},this.redo.bind(this));if(/Win/i.test(navigator.platform)){this.quill.keyboard.addBinding({key:"y",shortKey:true},this.redo.bind(this))}this.quill.root.addEventListener("beforeinput",(t=>{if(t.inputType==="historyUndo"){this.undo();t.preventDefault()}else if(t.inputType==="historyRedo"){this.redo();t.preventDefault()}}))}change(t,e){if(this.stack[t].length===0)return;const n=this.stack[t].pop();if(!n)return;const r=this.quill.getContents();const i=n.delta.invert(r);this.stack[e].push({delta:i,range:Zj(n.range,i)});this.lastRecorded=0;this.ignoreChange=true;this.quill.updateContents(n.delta,dx.sources.USER);this.ignoreChange=false;this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(t.ops.length===0)return;this.stack.redo=[];let n=t.invert(e);let r=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const t=this.stack.undo.pop();if(t){n=n.compose(t.delta);r=t.range}}else{this.lastRecorded=i}if(n.length()===0)return;this.stack.undo.push({delta:n,range:r});if(this.stack.undo.length>this.options.maxStack){this.stack.undo.shift()}}redo(){this.change("redo","undo")}transform(t){Fj(this.stack.undo,t);Fj(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range){this.quill.setSelection(t.range,dx.sources.USER)}else{const e=Wj(this.quill.scroll,t.delta);this.quill.setSelection(e,dx.sources.USER)}}}function Fj(t,e){let n=e;for(let e=t.length-1;e>=0;e-=1){const r=t[e];t[e]={delta:n.transform(r.delta,true),range:r.range&&Zj(r.range,n)};n=r.delta.transform(n);if(t[e].delta.length()===0){t.splice(e,1)}}}function Pj(t,e){const n=e.ops[e.ops.length-1];if(n==null)return false;if(n.insert!=null){return typeof n.insert==="string"&&n.insert.endsWith("\n")}if(n.attributes!=null){return Object.keys(n.attributes).some((e=>t.query(e,ty.BLOCK)!=null))}return false}function Wj(t,e){const n=e.reduce(((t,e)=>t+(e.delete||0)),0);let r=e.length()-n;if(Pj(t,e)){r-=1}return r}function Zj(t,e){if(!t)return t;const n=e.transformPosition(t.index);const r=e.transformPosition(t.index+t.length);return{index:n,length:r-n}}class Kj extends Jk{constructor(t,e){super(t,e);t.root.addEventListener("drop",(e=>{e.preventDefault();let n=null;if(document.caretRangeFromPoint){n=document.caretRangeFromPoint(e.clientX,e.clientY)}else if(document.caretPositionFromPoint){const t=document.caretPositionFromPoint(e.clientX,e.clientY);n=document.createRange();n.setStart(t.offsetNode,t.offset);n.setEnd(t.offsetNode,t.offset)}const r=n&&t.selection.normalizeNative(n);if(r){const n=t.selection.normalizedToRange(r);if(e.dataTransfer?.files){this.upload(n,e.dataTransfer.files)}}}))}upload(t,e){const n=[];Array.from(e).forEach((t=>{if(t&&this.options.mimetypes?.includes(t.type)){n.push(t)}}));if(n.length>0){this.options.handler.call(this,t,n)}}}Kj.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image")){return}const n=e.map((t=>new Promise((e=>{const n=new FileReader;n.onload=()=>{e(n.result)};n.readAsDataURL(t)}))));Promise.all(n).then((e=>{const n=e.reduce(((t,e)=>t.insert({image:e})),(new vk).retain(t.index).delete(t.length));this.quill.updateContents(n,Ck.sources.USER);this.quill.setSelection(t.index+e.length,Ck.sources.SILENT)}))}};const Gj=["insertText","insertReplacementText"];class Qj extends Jk{constructor(t,e){super(t,e);t.root.addEventListener("beforeinput",(t=>{this.handleBeforeInput(t)}));if(!/Android/i.test(navigator.userAgent)){t.on(dx.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}}deleteRange(t){rj({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";if(t.length===0)return false;if(e){const n=this.quill.getFormat(t.index,1);this.deleteRange(t);this.quill.updateContents((new vk).retain(t.index).insert(e,n),dx.sources.USER)}else{this.deleteRange(t)}this.quill.setSelection(t.index+e.length,0,dx.sources.SILENT);return true}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!Gj.includes(t.inputType)){return}const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===true){return}const n=Yj(t);if(n==null){return}const r=this.quill.selection.normalizeNative(e);const i=r?this.quill.selection.normalizedToRange(r):null;if(i&&this.replaceText(i,n)){t.preventDefault()}}handleCompositionStart(){const t=this.quill.getSelection();if(t){this.replaceText(t)}}}function Yj(t){if(typeof t.data==="string"){return t.data}if(t.dataTransfer?.types.includes("text/plain")){return t.dataTransfer.getData("text/plain")}return null}const Jj=/Mac/i.test(navigator.platform);const Xj=100;const tA=t=>{if(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"){return true}if(Jj&&t.key==="a"&&t.ctrlKey===true){return true}return false};class eA extends Jk{isListening=false;selectionChangeDeadline=0;constructor(t,e){super(t,e);this.handleArrowKeys();this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,e){let{line:n,event:r}=e;if(!(n instanceof ky)||!n.uiNode){return true}const i=getComputedStyle(n.domNode)["direction"]==="rtl";if(i&&r.key!=="ArrowRight"||!i&&r.key!=="ArrowLeft"){return true}this.quill.setSelection(t.index-1,t.length+(r.shiftKey?1:0),dx.sources.USER);return false}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(t=>{if(!t.defaultPrevented&&tA(t)){this.ensureListeningToSelectionChange()}}))}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+Xj;if(this.isListening)return;this.isListening=true;const t=()=>{this.isListening=false;if(Date.now()<=this.selectionChangeDeadline){this.handleSelectionChange()}};document.addEventListener("selectionchange",t,{once:true})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const e=t.getRangeAt(0);if(e.collapsed!==true||e.startOffset!==0)return;const n=this.quill.scroll.find(e.startContainer);if(!(n instanceof ky)||!n.uiNode)return;const r=document.createRange();r.setStartAfter(n.uiNode);r.setEndAfter(n.uiNode);t.removeAllRanges();t.addRange(r)}}dx.register({"blots/block":yk,"blots/block/embed":kk,"blots/break":pk,"blots/container":yx,"blots/cursor":Ak,"blots/embed":tx,"blots/inline":mk,"blots/scroll":jx,"blots/text":bk,"modules/clipboard":xj,"modules/history":Uj,"modules/keyboard":Qx,"modules/uploader":Kj,"modules/input":Qj,"modules/uiNode":eA});class nA extends oy{add(t,e){let n=0;if(e==="+1"||e==="-1"){const r=this.value(t)||0;n=e==="+1"?r+1:r-1}else if(typeof e==="number"){n=e}if(n===0){this.remove(t);return true}return super.add(t,n.toString())}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||undefined}}const rA=new nA("indent","ql-indent",{scope:ty.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class iA extends yk{static blotName="blockquote";static tagName="blockquote"}class sA extends yk{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(t){return this.tagName.indexOf(t.tagName)+1}}class lA extends yx{}lA.blotName="list-container";lA.tagName="OL";class oA extends yk{static create(t){const e=super.create();e.setAttribute("data-list",t);return e}static formats(t){return t.getAttribute("data-list")||undefined}static register(){dx.register(lA)}constructor(t,e){super(t,e);const n=e.ownerDocument.createElement("span");const r=n=>{if(!t.isEnabled())return;const r=this.statics.formats(e,t);if(r==="checked"){this.format("list","unchecked");n.preventDefault()}else if(r==="unchecked"){this.format("list","checked");n.preventDefault()}};n.addEventListener("mousedown",r);n.addEventListener("touchstart",r);this.attachUI(n)}format(t,e){if(t===this.statics.blotName&&e){this.domNode.setAttribute("data-list",e)}else{super.format(t,e)}}}oA.blotName="list";oA.tagName="LI";lA.allowedChildren=[oA];oA.requiredContainer=lA;class uA extends mk{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return true}optimize(t){super.optimize(t);if(this.domNode.tagName!==this.statics.tagName[0]){this.replaceWith(this.statics.blotName)}}}class aA extends uA{static blotName="italic";static tagName=["EM","I"]}class cA extends mk{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(t){const e=super.create(t);e.setAttribute("href",this.sanitize(t));e.setAttribute("rel","noopener noreferrer");e.setAttribute("target","_blank");return e}static formats(t){return t.getAttribute("href")}static sanitize(t){return fA(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){if(t!==this.statics.blotName||!e){super.format(t,e)}else{this.domNode.setAttribute("href",this.constructor.sanitize(e))}}}function fA(t,e){const n=document.createElement("a");n.href=t;const r=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(r)>-1}class hA extends mk{static blotName="script";static tagName=["SUB","SUP"];static create(t){if(t==="super"){return document.createElement("sup")}if(t==="sub"){return document.createElement("sub")}return super.create(t)}static formats(t){if(t.tagName==="SUB")return"sub";if(t.tagName==="SUP")return"super";return undefined}}class dA extends uA{static blotName="strike";static tagName=["S","STRIKE"]}class vA extends mk{static blotName="underline";static tagName="U"}class pA extends tx{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(t){if(window.katex==null){throw new Error("Formula module requires KaTeX.")}const e=super.create(t);if(typeof t==="string"){window.katex.render(t,e,{throwOnError:false,errorColor:"#f00"});e.setAttribute("data-value",t)}return e}static value(t){return t.getAttribute("data-value")}html(){const{formula:t}=this.value();return`<span>${t}</span>`}}const bA=["alt","height","width"];class qA extends Sy{static blotName="image";static tagName="IMG";static create(t){const e=super.create(t);if(typeof t==="string"){e.setAttribute("src",this.sanitize(t))}return e}static formats(t){return bA.reduce(((e,n)=>{if(t.hasAttribute(n)){e[n]=t.getAttribute(n)}return e}),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return fA(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){if(bA.indexOf(t)>-1){if(e){this.domNode.setAttribute(t,e)}else{this.domNode.removeAttribute(t)}}else{super.format(t,e)}}}const wA=["height","width"];class mA extends kk{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(t){const e=super.create(t);e.setAttribute("frameborder","0");e.setAttribute("allowfullscreen","true");e.setAttribute("src",this.sanitize(t));return e}static formats(t){return wA.reduce(((e,n)=>{if(t.hasAttribute(n)){e[n]=t.getAttribute(n)}return e}),{})}static sanitize(t){return cA.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){if(wA.indexOf(t)>-1){if(e){this.domNode.setAttribute(t,e)}else{this.domNode.removeAttribute(t)}}else{super.format(t,e)}}html(){const{video:t}=this.value();return`<a href="${t}">${t}</a>`}}const gA=new oy("code-token","hljs",{scope:ty.INLINE});class yA extends mk{static formats(t,e){while(t!=null&&t!==e.domNode){if(t.classList&&t.classList.contains(Rx.className)){return super.formats(t,e)}t=t.parentNode}return undefined}constructor(t,e,n){super(t,e,n);gA.add(this.domNode,n)}format(t,e){if(t!==yA.blotName){super.format(t,e)}else if(e){gA.add(this.domNode,e)}else{gA.remove(this.domNode);this.domNode.classList.remove(this.statics.className)}}optimize(){super.optimize(...arguments);if(!gA.value(this.domNode)){this.unwrap()}}}yA.blotName="code-token";yA.className="ql-token";class kA extends Rx{static create(t){const e=super.create(t);if(typeof t==="string"){e.setAttribute("data-language",t)}return e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){if(t===this.statics.blotName&&e){this.domNode.setAttribute("data-language",e)}else{super.format(t,e)}}replaceWith(t,e){this.formatAt(0,this.length(),yA.blotName,false);return super.replaceWith(t,e)}}class xA extends zx{attach(){super.attach();this.forceNext=false;this.scroll.emitMount(this)}format(t,e){if(t===kA.blotName){this.forceNext=true;this.children.forEach((n=>{n.format(t,e)}))}}formatAt(t,e,n,r){if(n===kA.blotName){this.forceNext=true}super.formatAt(t,e,n,r)}highlight(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(this.children.head==null)return;const n=Array.from(this.domNode.childNodes).filter((t=>t!==this.uiNode));const r=`${n.map((t=>t.textContent)).join("\n")}\n`;const i=kA.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==r){if(r.trim().length>0||this.cachedText==null){const e=this.children.reduce(((t,e)=>t.concat(xk(e,false))),new vk);const n=t(r,i);e.diff(n).reduce(((t,e)=>{let{retain:n,attributes:r}=e;if(!n)return t;if(r){Object.keys(r).forEach((e=>{if([kA.blotName,yA.blotName].includes(e)){this.formatAt(t,n,e,r[e])}}))}return t+n}),0)}this.cachedText=r;this.forceNext=false}}html(t,e){const[n]=this.children.find(t);const r=n?kA.formats(n.domNode):"plain";return`<pre data-language="${r}">\n${wk(this.code(t,e))}\n</pre>`}optimize(t){super.optimize(t);if(this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=kA.formats(this.children.head.domNode);if(t!==this.uiNode.value){this.uiNode.value=t}}}}xA.allowedChildren=[kA];kA.requiredContainer=xA;kA.allowedChildren=[yA,Ak,bk,pk];const jA=(t,e,n)=>{if(typeof t.versionString==="string"){const r=t.versionString.split(".")[0];if(parseInt(r,10)>=11){return t.highlight(n,{language:e}).value}}return t.highlight(e,n).value};class AA extends Jk{static register(){dx.register(yA,true);dx.register(kA,true);dx.register(xA,true)}constructor(t,e){super(t,e);if(this.options.hljs==null){throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.")}this.languages=this.options.languages.reduce(((t,e)=>{let{key:n}=e;t[n]=true;return t}),{});this.highlightBlot=this.highlightBlot.bind(this);this.initListener();this.initTimer()}initListener(){this.quill.on(dx.events.SCROLL_BLOT_MOUNT,(t=>{if(!(t instanceof xA))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((t=>{let{key:n,label:r}=t;const i=e.ownerDocument.createElement("option");i.textContent=r;i.setAttribute("value",n);e.appendChild(i)}));e.addEventListener("change",(()=>{t.format(kA.blotName,e.value);this.quill.root.focus();this.highlight(t,true)}));if(t.uiNode==null){t.attachUI(e);if(t.children.head){e.value=kA.formats(t.children.head.domNode)}}}))}initTimer(){let t=null;this.quill.on(dx.events.SCROLL_OPTIMIZE,(()=>{if(t){clearTimeout(t)}t=setTimeout((()=>{this.highlight();t=null}),this.options.interval)}))}highlight(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(this.quill.selection.composing)return;this.quill.update(dx.sources.USER);const n=this.quill.getSelection();const r=t==null?this.quill.scroll.descendants(xA):[t];r.forEach((t=>{t.highlight(this.highlightBlot,e)}));this.quill.update(dx.sources.SILENT);if(n!=null){this.quill.setSelection(n,dx.sources.SILENT)}}highlightBlot(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"plain";e=this.languages[e]?e:"plain";if(e==="plain"){return wk(t).split("\n").reduce(((t,n,r)=>{if(r!==0){t.insert("\n",{[Rx.blotName]:e})}return t.insert(n)}),new vk)}const n=this.quill.root.ownerDocument.createElement("div");n.classList.add(Rx.className);n.innerHTML=jA(this.options.hljs,e,t);return Tj(this.quill.scroll,n,[(t,e)=>{const n=gA.value(t);if(n){return e.compose((new vk).retain(e.length(),{[yA.blotName]:n}))}return e}],[(t,n)=>t.data.split("\n").reduce(((t,n,r)=>{if(r!==0)t.insert("\n",{[Rx.blotName]:e});return t.insert(n)}),n)],new WeakMap)}}AA.DEFAULTS={hljs:(()=>window.hljs)(),interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class OA extends yk{static blotName="table";static tagName="TD";static create(t){const e=super.create();if(t){e.setAttribute("data-row",t)}else{e.setAttribute("data-row",TA())}return e}static formats(t){if(t.hasAttribute("data-row")){return t.getAttribute("data-row")}return undefined}cellOffset(){if(this.parent){return this.parent.children.indexOf(this)}return-1}format(t,e){if(t===OA.blotName&&e){this.domNode.setAttribute("data-row",e)}else{super.format(t,e)}}row(){return this.parent}rowOffset(){if(this.row()){return this.row().rowOffset()}return-1}table(){return this.row()&&this.row().table()}}class MA extends yx{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats();const e=this.children.tail.formats();const n=this.next.children.head.formats();const r=this.next.children.tail.formats();return t.table===e.table&&t.table===n.table&&t.table===r.table}return false}optimize(t){super.optimize(t);this.children.forEach((t=>{if(t.next==null)return;const e=t.formats();const n=t.next.formats();if(e.table!==n.table){const e=this.splitAfter(t);if(e){e.optimize()}if(this.prev){this.prev.optimize()}}}))}rowOffset(){if(this.parent){return this.parent.children.indexOf(this)}return-1}table(){return this.parent&&this.parent.parent}}class EA extends yx{static blotName="table-body";static tagName="TBODY"}class _A extends yx{static blotName="table-container";static tagName="TABLE";balanceCells(){const t=this.descendants(MA);const e=t.reduce(((t,e)=>Math.max(e.children.length,t)),0);t.forEach((t=>{new Array(e-t.children.length).fill(0).forEach((()=>{let e;if(t.children.head!=null){e=OA.formats(t.children.head.domNode)}const n=this.scroll.create(OA.blotName,e);t.appendChild(n);n.optimize()}))}))}cells(t){return this.rows().map((e=>e.children.at(t)))}deleteColumn(t){const[e]=this.descendant(EA);if(e==null||e.children.head==null)return;e.children.forEach((e=>{const n=e.children.at(t);if(n!=null){n.remove()}}))}insertColumn(t){const[e]=this.descendant(EA);if(e==null||e.children.head==null)return;e.children.forEach((e=>{const n=e.children.at(t);const r=OA.formats(e.children.head.domNode);const i=this.scroll.create(OA.blotName,r);e.insertBefore(i,n)}))}insertRow(t){const[e]=this.descendant(EA);if(e==null||e.children.head==null)return;const n=TA();const r=this.scroll.create(MA.blotName);e.children.head.children.forEach((()=>{const t=this.scroll.create(OA.blotName,n);r.appendChild(t)}));const i=e.children.at(t);e.insertBefore(r,i)}rows(){const t=this.children.head;if(t==null)return[];return t.children.map((t=>t))}}_A.allowedChildren=[EA];EA.requiredContainer=_A;EA.allowedChildren=[MA];MA.requiredContainer=EA;MA.allowedChildren=[OA];OA.requiredContainer=MA;function TA(){const t=Math.random().toString(36).slice(2,6);return`row-${t}`}class NA extends Jk{static register(){dx.register(OA);dx.register(MA);dx.register(EA);dx.register(_A)}constructor(){super(...arguments);this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(_A).forEach((t=>{t.balanceCells()}))}deleteColumn(){const[t,,e]=this.getTable();if(e==null)return;t.deleteColumn(e.cellOffset());this.quill.update(dx.sources.USER)}deleteRow(){const[,t]=this.getTable();if(t==null)return;t.remove();this.quill.update(dx.sources.USER)}deleteTable(){const[t]=this.getTable();if(t==null)return;const e=t.offset();t.remove();this.quill.update(dx.sources.USER);this.quill.setSelection(e,dx.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[e,n]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==OA.blotName){return[null,null,null,-1]}const r=e.parent;const i=r.parent.parent;return[i,r,e,n]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[n,r,i]=this.getTable(e);if(i==null)return;const s=i.cellOffset();n.insertColumn(s+t);this.quill.update(dx.sources.USER);let l=r.rowOffset();if(t===0){l+=1}this.quill.setSelection(e.index+l,e.length,dx.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[n,r,i]=this.getTable(e);if(i==null)return;const s=r.rowOffset();n.insertRow(s+t);this.quill.update(dx.sources.USER);if(t>0){this.quill.setSelection(e,dx.sources.SILENT)}else{this.quill.setSelection(e.index+r.children.length,e.length,dx.sources.SILENT)}}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const n=this.quill.getSelection();if(n==null)return;const r=new Array(t).fill(0).reduce((t=>{const n=new Array(e).fill("\n").join("");return t.insert(n,{table:TA()})}),(new vk).retain(n.index));this.quill.updateContents(r,dx.sources.USER);this.quill.setSelection(n.index,dx.sources.SILENT);this.balanceTables()}listenBalanceCells(){this.quill.on(dx.events.SCROLL_OPTIMIZE,(t=>{t.some((t=>{if(["TD","TR","TBODY","TABLE"].includes(t.target.tagName)){this.quill.once(dx.events.TEXT_CHANGE,((t,e,n)=>{if(n!==dx.sources.USER)return;this.balanceTables()}));return true}return false}))}))}}const LA=zk("quill:toolbar");class $A extends Jk{constructor(t,e){super(t,e);if(Array.isArray(this.options.container)){const e=document.createElement("div");e.setAttribute("role","toolbar");zA(e,this.options.container);t.container?.parentNode?.insertBefore(e,t.container);this.container=e}else if(typeof this.options.container==="string"){this.container=document.querySelector(this.options.container)}else{this.container=this.options.container}if(!(this.container instanceof HTMLElement)){LA.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar");this.controls=[];this.handlers={};if(this.options.handlers){Object.keys(this.options.handlers).forEach((t=>{const e=this.options.handlers?.[t];if(e){this.addHandler(t,e)}}))}Array.from(this.container.querySelectorAll("button, select")).forEach((t=>{this.attach(t)}));this.quill.on(dx.events.EDITOR_CHANGE,(()=>{const[t]=this.quill.selection.getRange();this.update(t)}))}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find((t=>t.indexOf("ql-")===0));if(!e)return;e=e.slice("ql-".length);if(t.tagName==="BUTTON"){t.setAttribute("type","button")}if(this.handlers[e]==null&&this.quill.scroll.query(e)==null){LA.warn("ignoring attaching to nonexistent format",e,t);return}const n=t.tagName==="SELECT"?"change":"click";t.addEventListener(n,(n=>{let r;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const e=t.options[t.selectedIndex];if(e.hasAttribute("selected")){r=false}else{r=e.value||false}}else{if(t.classList.contains("ql-active")){r=false}else{r=t.value||!t.hasAttribute("value")}n.preventDefault()}this.quill.focus();const[i]=this.quill.selection.getRange();if(this.handlers[e]!=null){this.handlers[e].call(this,r)}else if(this.quill.scroll.query(e).prototype instanceof Sy){r=prompt(`Enter ${e}`);if(!r)return;this.quill.updateContents((new vk).retain(i.index).delete(i.length).insert({[e]:r}),dx.sources.USER)}else{this.quill.format(e,r,dx.sources.USER)}this.update(i)}));this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach((n=>{const[r,i]=n;if(i.tagName==="SELECT"){let n=null;if(t==null){n=null}else if(e[r]==null){n=i.querySelector("option[selected]")}else if(!Array.isArray(e[r])){let t=e[r];if(typeof t==="string"){t=t.replace(/"/g,'\\"')}n=i.querySelector(`option[value="${t}"]`)}if(n==null){i.value="";i.selectedIndex=-1}else{n.selected=true}}else if(t==null){i.classList.remove("ql-active");i.setAttribute("aria-pressed","false")}else if(i.hasAttribute("value")){const t=e[r];const n=t===i.getAttribute("value")||t!=null&&t.toString()===i.getAttribute("value")||t==null&&!i.getAttribute("value");i.classList.toggle("ql-active",n);i.setAttribute("aria-pressed",n.toString())}else{const t=e[r]!=null;i.classList.toggle("ql-active",t);i.setAttribute("aria-pressed",t.toString())}}))}}$A.DEFAULTS={};function SA(t,e,n){const r=document.createElement("button");r.setAttribute("type","button");r.classList.add(`ql-${e}`);r.setAttribute("aria-pressed","false");if(n!=null){r.value=n;r.setAttribute("aria-label",`${e}: ${n}`)}else{r.setAttribute("aria-label",e)}t.appendChild(r)}function zA(t,e){if(!Array.isArray(e[0])){e=[e]}e.forEach((e=>{const n=document.createElement("span");n.classList.add("ql-formats");e.forEach((t=>{if(typeof t==="string"){SA(n,t)}else{const e=Object.keys(t)[0];const r=t[e];if(Array.isArray(r)){RA(n,e,r)}else{SA(n,e,r)}}}));t.appendChild(n)}))}function RA(t,e,n){const r=document.createElement("select");r.classList.add(`ql-${e}`);n.forEach((t=>{const e=document.createElement("option");if(t!==false){e.setAttribute("value",String(t))}else{e.setAttribute("selected","selected")}r.appendChild(e)}));t.appendChild(r)}$A.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(t==null)return;if(t.length===0){const t=this.quill.getFormat();Object.keys(t).forEach((t=>{if(this.quill.scroll.query(t,ty.INLINE)!=null){this.quill.format(t,false,dx.sources.USER)}}))}else{this.quill.removeFormat(t.index,t.length,dx.sources.USER)}},direction(t){const{align:e}=this.quill.getFormat();if(t==="rtl"&&e==null){this.quill.format("align","right",dx.sources.USER)}else if(!t&&e==="right"){this.quill.format("align",false,dx.sources.USER)}this.quill.format("direction",t,dx.sources.USER)},indent(t){const e=this.quill.getSelection();const n=this.quill.getFormat(e);const r=parseInt(n.indent||0,10);if(t==="+1"||t==="-1"){let e=t==="+1"?1:-1;if(n.direction==="rtl")e*=-1;this.quill.format("indent",r+e,dx.sources.USER)}},link(t){if(t===true){t=prompt("Enter link URL:")}this.quill.format("link",t,dx.sources.USER)},list(t){const e=this.quill.getSelection();const n=this.quill.getFormat(e);if(t==="check"){if(n.list==="checked"||n.list==="unchecked"){this.quill.format("list",false,dx.sources.USER)}else{this.quill.format("list","unchecked",dx.sources.USER)}}else{this.quill.format("list",t,dx.sources.USER)}}}};const IA='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>';const CA='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>';const BA='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>';const DA='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>';const HA='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>';const VA='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>';const UA='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>';const FA='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>';const PA='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>';const WA='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>';const ZA='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>';const KA='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>';const GA='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>';const QA='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>';const YA='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>';const JA='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>';const XA='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>';const tO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>';const eO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>';const nO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>';const rO='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>';const iO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>';const sO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>';const lO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>';const oO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>';const uO='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>';const aO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>';const cO='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>';const fO='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>';const hO='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>';const dO='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>';const vO='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>';const pO='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>';var bO={align:{"":IA,center:CA,right:BA,justify:DA},background:HA,blockquote:VA,bold:UA,clean:FA,code:PA,"code-block":PA,color:WA,direction:{"":ZA,rtl:KA},formula:GA,header:{1:QA,2:YA,3:JA,4:XA,5:tO,6:eO},italic:nO,image:rO,indent:{"+1":iO,"-1":sO},link:lO,list:{bullet:oO,check:uO,ordered:aO},script:{sub:cO,super:fO},strike:hO,table:dO,underline:vO,video:pO};const qO='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let wO=0;function mO(t,e){t.setAttribute(e,`${!(t.getAttribute(e)==="true")}`)}class gO{constructor(t){this.select=t;this.container=document.createElement("span");this.buildPicker();this.select.style.display="none";this.select.parentNode.insertBefore(this.container,this.select);this.label.addEventListener("mousedown",(()=>{this.togglePicker()}));this.label.addEventListener("keydown",(t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape();t.preventDefault();break}}));this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded");mO(this.label,"aria-expanded");mO(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");e.tabIndex="0";e.setAttribute("role","button");e.classList.add("ql-picker-item");const n=t.getAttribute("value");if(n){e.setAttribute("data-value",n)}if(t.textContent){e.setAttribute("data-label",t.textContent)}e.addEventListener("click",(()=>{this.selectItem(e,true)}));e.addEventListener("keydown",(t=>{switch(t.key){case"Enter":this.selectItem(e,true);t.preventDefault();break;case"Escape":this.escape();t.preventDefault();break}}));return e}buildLabel(){const t=document.createElement("span");t.classList.add("ql-picker-label");t.innerHTML=qO;t.tabIndex="0";t.setAttribute("role","button");t.setAttribute("aria-expanded","false");this.container.appendChild(t);return t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options");t.setAttribute("aria-hidden","true");t.tabIndex="-1";t.id=`ql-picker-options-${wO}`;wO+=1;this.label.setAttribute("aria-controls",t.id);this.options=t;Array.from(this.select.options).forEach((e=>{const n=this.buildItem(e);t.appendChild(n);if(e.selected===true){this.selectItem(n)}}));this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach((t=>{this.container.setAttribute(t.name,t.value)}));this.container.classList.add("ql-picker");this.label=this.buildLabel();this.buildOptions()}escape(){this.close();setTimeout((()=>this.label.focus()),1)}close(){this.container.classList.remove("ql-expanded");this.label.setAttribute("aria-expanded","false");this.options.setAttribute("aria-hidden","true")}selectItem(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;const n=this.container.querySelector(".ql-selected");if(t===n)return;if(n!=null){n.classList.remove("ql-selected")}if(t==null)return;t.classList.add("ql-selected");this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t);if(t.hasAttribute("data-value")){this.label.setAttribute("data-value",t.getAttribute("data-value"))}else{this.label.removeAttribute("data-value")}if(t.hasAttribute("data-label")){this.label.setAttribute("data-label",t.getAttribute("data-label"))}else{this.label.removeAttribute("data-label")}if(e){this.select.dispatchEvent(new Event("change"));this.close()}}update(){let t;if(this.select.selectedIndex>-1){const e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex];this.selectItem(e)}else{this.selectItem(null)}const e=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class yO extends gO{constructor(t,e){super(t);this.label.innerHTML=e;this.container.classList.add("ql-color-picker");Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((t=>{t.classList.add("ql-primary")}))}buildItem(t){const e=super.buildItem(t);e.style.backgroundColor=t.getAttribute("value")||"";return e}selectItem(t,e){super.selectItem(t,e);const n=this.label.querySelector(".ql-color-label");const r=t?t.getAttribute("data-value")||"":"";if(n){if(n.tagName==="line"){n.style.stroke=r}else{n.style.fill=r}}}}class kO extends gO{constructor(t,e){super(t);this.container.classList.add("ql-icon-picker");Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((t=>{t.innerHTML=e[t.getAttribute("data-value")||""]}));this.defaultItem=this.container.querySelector(".ql-selected");this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const n=t||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}const xO=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class jO{constructor(t,e){this.quill=t;this.boundsContainer=e||document.body;this.root=t.addContainer("ql-tooltip");this.root.innerHTML=this.constructor.TEMPLATE;if(xO(this.quill.root)){this.quill.root.addEventListener("scroll",(()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}))}this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){const e=t.left+t.width/2-this.root.offsetWidth/2;const n=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`;this.root.style.top=`${n}px`;this.root.classList.remove("ql-flip");const r=this.boundsContainer.getBoundingClientRect();const i=this.root.getBoundingClientRect();let s=0;if(i.right>r.right){s=r.right-i.right;this.root.style.left=`${e+s}px`}if(i.left<r.left){s=r.left-i.left;this.root.style.left=`${e+s}px`}if(i.bottom>r.bottom){const e=i.bottom-i.top;const r=t.bottom-t.top+e;this.root.style.top=`${n-r}px`;this.root.classList.add("ql-flip")}return s}show(){this.root.classList.remove("ql-editing");this.root.classList.remove("ql-hidden")}}const AO=[false,"center","right","justify"];const OO=["#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"];const MO=[false,"serif","monospace"];const EO=["1","2","3",false];const _O=["small",false,"large","huge"];class TO extends nx{constructor(t,e){super(t,e);const n=e=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",n);return}if(this.tooltip!=null&&!this.tooltip.root.contains(e.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()){this.tooltip.hide()}if(this.pickers!=null){this.pickers.forEach((t=>{if(!t.container.contains(e.target)){t.close()}}))}};t.emitter.listenDOM("click",document.body,n)}addModule(t){const e=super.addModule(t);if(t==="toolbar"){this.extendToolbar(e)}return e}buildButtons(t,e){Array.from(t).forEach((t=>{const n=t.getAttribute("class")||"";n.split(/\s+/).forEach((n=>{if(!n.startsWith("ql-"))return;n=n.slice("ql-".length);if(e[n]==null)return;if(n==="direction"){t.innerHTML=e[n][""]+e[n].rtl}else if(typeof e[n]==="string"){t.innerHTML=e[n]}else{const r=t.value||"";if(r!=null&&e[n][r]){t.innerHTML=e[n][r]}}}))}))}buildPickers(t,e){this.pickers=Array.from(t).map((t=>{if(t.classList.contains("ql-align")){if(t.querySelector("option")==null){$O(t,AO)}if(typeof e.align==="object"){return new kO(t,e.align)}}if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){const n=t.classList.contains("ql-background")?"background":"color";if(t.querySelector("option")==null){$O(t,OO,n==="background"?"#ffffff":"#000000")}return new yO(t,e[n])}if(t.querySelector("option")==null){if(t.classList.contains("ql-font")){$O(t,MO)}else if(t.classList.contains("ql-header")){$O(t,EO)}else if(t.classList.contains("ql-size")){$O(t,_O)}}return new gO(t)}));const n=()=>{this.pickers.forEach((t=>{t.update()}))};this.quill.on(Ck.events.EDITOR_CHANGE,n)}}TO.DEFAULTS=yp({},nx.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");if(t==null){t=document.createElement("input");t.setAttribute("type","file");t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", "));t.classList.add("ql-image");t.addEventListener("change",(()=>{const e=this.quill.getSelection(true);this.quill.uploader.upload(e,t.files);t.value=""}));this.container.appendChild(t)}t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class NO extends jO{constructor(t,e){super(t,e);this.textbox=this.root.querySelector('input[type="text"]');this.listen()}listen(){this.textbox.addEventListener("keydown",(t=>{if(t.key==="Enter"){this.save();t.preventDefault()}else if(t.key==="Escape"){this.cancel();t.preventDefault()}}))}cancel(){this.hide();this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"link";let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;this.root.classList.remove("ql-hidden");this.root.classList.add("ql-editing");if(this.textbox==null)return;if(e!=null){this.textbox.value=e}else if(t!==this.root.getAttribute("data-mode")){this.textbox.value=""}const n=this.quill.getBounds(this.quill.selection.savedRange);if(n!=null){this.position(n)}this.textbox.select();this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||"");this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:true})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:e}=this.quill.root;if(this.linkRange){this.quill.formatText(this.linkRange,"link",t,Ck.sources.USER);delete this.linkRange}else{this.restoreFocus();this.quill.format("link",t,Ck.sources.USER)}this.quill.root.scrollTop=e;break}case"video":{t=LO(t)}case"formula":{if(!t)break;const e=this.quill.getSelection(true);if(e!=null){const n=e.index+e.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),t,Ck.sources.USER);if(this.root.getAttribute("data-mode")==="formula"){this.quill.insertText(n+1," ",Ck.sources.USER)}this.quill.setSelection(n+2,Ck.sources.USER)}break}}this.textbox.value="";this.hide()}}function LO(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(e){return`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`}if(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)){return`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`}return t}function $O(t,e){let n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;e.forEach((e=>{const r=document.createElement("option");if(e===n){r.setAttribute("selected","selected")}else{r.setAttribute("value",String(e))}t.appendChild(r)}))}const SO=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class zO extends NO{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(t,e){super(t,e);this.quill.on(Ck.events.EDITOR_CHANGE,((t,e,n,r)=>{if(t!==Ck.events.SELECTION_CHANGE)return;if(e!=null&&e.length>0&&r===Ck.sources.USER){this.show();this.root.style.left="0px";this.root.style.width="";this.root.style.width=`${this.root.offsetWidth}px`;const t=this.quill.getLines(e.index,e.length);if(t.length===1){const t=this.quill.getBounds(e);if(t!=null){this.position(t)}}else{const n=t[t.length-1];const r=this.quill.getIndex(n);const i=Math.min(n.length()-1,e.index+e.length-r);const s=this.quill.getBounds(new Dk(r,i));if(s!=null){this.position(s)}}}else if(document.activeElement!==this.textbox&&this.quill.hasFocus()){this.hide()}}))}listen(){super.listen();this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")}));this.quill.on(Ck.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const e=this.quill.getBounds(t);if(e!=null){this.position(e)}}}),1)}))}cancel(){this.show()}position(t){const e=super.position(t);const n=this.root.querySelector(".ql-tooltip-arrow");n.style.marginLeft="";if(e!==0){n.style.marginLeft=`${-1*e-n.offsetWidth/2}px`}return e}}class RO extends TO{constructor(t,e){if(e.modules.toolbar!=null&&e.modules.toolbar.container==null){e.modules.toolbar.container=SO}super(t,e);this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new zO(this.quill,this.options.bounds);if(t.container!=null){this.tooltip.root.appendChild(t.container);this.buildButtons(t.container.querySelectorAll("button"),bO);this.buildPickers(t.container.querySelectorAll("select"),bO)}}}RO.DEFAULTS=yp({},TO.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(!t){this.quill.format("link",false,dx.sources.USER)}else{this.quill.theme.tooltip.edit()}}}}}});const IO=[[{header:["1","2","3",false]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class CO extends NO{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen();this.root.querySelector("a.ql-action").addEventListener("click",(t=>{if(this.root.classList.contains("ql-editing")){this.save()}else{this.edit("link",this.preview.textContent)}t.preventDefault()}));this.root.querySelector("a.ql-remove").addEventListener("click",(t=>{if(this.linkRange!=null){const t=this.linkRange;this.restoreFocus();this.quill.formatText(t,"link",false,Ck.sources.USER);delete this.linkRange}t.preventDefault();this.hide()}));this.quill.on(Ck.events.SELECTION_CHANGE,((t,e,n)=>{if(t==null)return;if(t.length===0&&n===Ck.sources.USER){const[e,n]=this.quill.scroll.descendant(cA,t.index);if(e!=null){this.linkRange=new Dk(t.index-n,e.length());const r=cA.formats(e.domNode);this.preview.textContent=r;this.preview.setAttribute("href",r);this.show();const i=this.quill.getBounds(this.linkRange);if(i!=null){this.position(i)}return}}else{delete this.linkRange}this.hide()}))}show(){super.show();this.root.removeAttribute("data-mode")}}class BO extends TO{constructor(t,e){if(e.modules.toolbar!=null&&e.modules.toolbar.container==null){e.modules.toolbar.container=IO}super(t,e);this.quill.container.classList.add("ql-snow")}extendToolbar(t){if(t.container!=null){t.container.classList.add("ql-snow");this.buildButtons(t.container.querySelectorAll("button"),bO);this.buildPickers(t.container.querySelectorAll("select"),bO);this.tooltip=new CO(this.quill,this.options.bounds);if(t.container.querySelector(".ql-link")){this.quill.keyboard.addBinding({key:"k",shortKey:true},((e,n)=>{t.handlers.link.call(t,!n.format.link)}))}}}}BO.DEFAULTS=yp({},TO.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const t=this.quill.getSelection();if(t==null||t.length===0)return;let e=this.quill.getText(t);if(/^\S+@\S+\.\S+$/.test(e)&&e.indexOf("mailto:")!==0){e=`mailto:${e}`}const{tooltip:n}=this.quill.theme;n.edit("link",e)}else{this.quill.format("link",false,dx.sources.USER)}}}}}});dx.register({"attributors/attribute/direction":Bx,"attributors/class/align":Ex,"attributors/class/background":$x,"attributors/class/color":Nx,"attributors/class/direction":Dx,"attributors/class/font":Ux,"attributors/class/size":Wx,"attributors/style/align":_x,"attributors/style/background":Sx,"attributors/style/color":Lx,"attributors/style/direction":Hx,"attributors/style/font":Px,"attributors/style/size":Zx},true);dx.register({"formats/align":Ex,"formats/direction":Dx,"formats/indent":rA,"formats/background":Sx,"formats/color":Lx,"formats/font":Ux,"formats/size":Wx,"formats/blockquote":iA,"formats/code-block":Rx,"formats/header":sA,"formats/list":oA,"formats/bold":uA,"formats/code":Ix,"formats/italic":aA,"formats/link":cA,"formats/script":hA,"formats/strike":dA,"formats/underline":vA,"formats/formula":pA,"formats/image":qA,"formats/video":mA,"modules/syntax":AA,"modules/table":NA,"modules/toolbar":$A,"themes/bubble":RO,"themes/snow":BO,"ui/icons":bO,"ui/picker":gO,"ui/icon-picker":kO,"ui/color-picker":yO,"ui/tooltip":jO},true);const DO=t=>Boolean(t.tagName);const HO=t=>{try{if(typeof document.createElement("div").attachShadow({mode:"open"}).getSelection==="function"){return t.getSelection().getRangeAt(0)}const e=window.getSelection();if(typeof e.getComposedRanges==="function"){return e.getComposedRanges(t)[0]}return e.getRangeAt(0)}catch(t){return null}};const VO=t=>{const e=()=>t.root.getRootNode();t.selection.hasFocus=()=>e().activeElement===t.root;t.selection.getNativeRange=()=>{const n=HO(e());return Boolean(n)?t.selection.normalizeNative(n):null};t.selection.setNativeRange=(e,n,r=e,i=n,s=false)=>{if([e===null||e===void 0?void 0:e.parentNode,t.root.parentNode,r===null||r===void 0?void 0:r.parentNode].some((t=>t==null))){return}const l=window.getSelection();if(!t.selection.hasFocus())t.root.focus();const o=(t.selection.getNativeRange()||{}).native;if(!Boolean(o)||s||e!==o.startContainer||n!==o.startOffset||r!==o.endContainer||i!==o.endOffset){if(DO(e)&&e.tagName==="BR"){n=[].indexOf.call(e.parentNode.childNodes,e);e=e.parentNode}if(DO(r)&&r.tagName==="BR"){i=[].indexOf.call(r.parentNode.childNodes,r);r=r.parentNode}l.setBaseAndExtent(e,n,r,i)}};document.addEventListener("selectionchange",(()=>{t.selection.update()}))};const UO=(t,{value:e,modules:n,readOnly:r,placeholder:s,handleTextChange:l,handleFocus:o,handleBlur:u})=>{const a={toolbar:[["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]]};const c=new dx(t.querySelector("div"),{theme:"snow",modules:n||a,readOnly:r,placeholder:s});if(i(e)&&/<[a-z][\s\S]*>/i.test(e)){c.clipboard.dangerouslyPasteHTML(e)}else if(i(e)){c.setText(e)}const f=t.querySelector(".ql-editor");f.addEventListener("focus",o);f.addEventListener("blur",u);c.on("text-change",l);VO(c);return c};const FO="/*!\n * Quill Editor v2.0.3\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked]>.ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked]>.ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor>*{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li>.ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked]>.ql-ui,.ql-editor li[data-list=unchecked]>.ql-ui{color:#777}.ql-editor li[data-list=bullet]>.ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked]>.ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked]>.ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered]>.ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1>.ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2>.ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3>.ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4>.ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5>.ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6>.ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7>.ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8>.ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9>.ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl>.ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-snow.ql-toolbar:after,.ql-snow .ql-toolbar:after{clear:both;content:'';display:table}.ql-snow.ql-toolbar button,.ql-snow .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-snow.ql-toolbar button svg,.ql-snow .ql-toolbar button svg{float:left;height:100%}.ql-snow.ql-toolbar button:active:hover,.ql-snow .ql-toolbar button:active:hover{outline:none}.ql-snow.ql-toolbar input.ql-image[type=file],.ql-snow .ql-toolbar input.ql-image[type=file]{display:none}.ql-snow.ql-toolbar button:hover,.ql-snow .ql-toolbar button:hover,.ql-snow.ql-toolbar button:focus,.ql-snow .ql-toolbar button:focus,.ql-snow.ql-toolbar button.ql-active,.ql-snow .ql-toolbar button.ql-active,.ql-snow.ql-toolbar .ql-picker-label:hover,.ql-snow .ql-toolbar .ql-picker-label:hover,.ql-snow.ql-toolbar .ql-picker-label.ql-active,.ql-snow .ql-toolbar .ql-picker-label.ql-active,.ql-snow.ql-toolbar .ql-picker-item:hover,.ql-snow .ql-toolbar .ql-picker-item:hover,.ql-snow.ql-toolbar .ql-picker-item.ql-selected,.ql-snow .ql-toolbar .ql-picker-item.ql-selected{color:#06c}.ql-snow.ql-toolbar button:hover .ql-fill,.ql-snow .ql-toolbar button:hover .ql-fill,.ql-snow.ql-toolbar button:focus .ql-fill,.ql-snow .ql-toolbar button:focus .ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#06c}.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke,.ql-snow.ql-toolbar button:focus .ql-stroke,.ql-snow .ql-toolbar button:focus .ql-stroke,.ql-snow.ql-toolbar button.ql-active .ql-stroke,.ql-snow .ql-toolbar button.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow.ql-toolbar button:hover .ql-stroke-miter,.ql-snow .ql-toolbar button:hover .ql-stroke-miter,.ql-snow.ql-toolbar button:focus .ql-stroke-miter,.ql-snow .ql-toolbar button:focus .ql-stroke-miter,.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow.ql-toolbar button:hover:not(.ql-active),.ql-snow .ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow{box-sizing:border-box}.ql-snow *{box-sizing:border-box}.ql-snow .ql-hidden{display:none}.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:'';display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-thin,.ql-snow .ql-stroke.ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor code,.ql-snow .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-snow .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-snow .ql-picker-label::before{display:inline-block;line-height:22px}.ql-snow .ql-picker-options{background-color:#fff;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-snow .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#ccc;z-index:2}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-snow .ql-color-picker,.ql-snow .ql-icon-picker{width:28px}.ql-snow .ql-color-picker .ql-picker-label,.ql-snow .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-label svg,.ql-snow .ql-icon-picker .ql-picker-label svg{right:4px}.ql-snow .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-snow .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-snow .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-snow .ql-picker.ql-header{width:98px}.ql-snow .ql-picker.ql-header .ql-picker-label::before,.ql-snow .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-snow .ql-picker.ql-font{width:108px}.ql-snow .ql-picker.ql-font .ql-picker-label::before,.ql-snow .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-snow .ql-picker.ql-size{width:98px}.ql-snow .ql-picker.ql-size .ql-picker-label::before,.ql-snow .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-snow .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-snow .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-toolbar.ql-snow{border:1px solid #ccc;box-sizing:border-box;font-family:'Helvetica Neue','Helvetica','Arial',sans-serif;padding:8px}.ql-toolbar.ql-snow .ql-formats{margin-right:15px}.ql-toolbar.ql-snow .ql-picker-label{border:1px solid transparent}.ql-toolbar.ql-snow .ql-picker-options{border:1px solid transparent;box-shadow:rgba(0,0,0,0.2) 0 2px 8px}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:#ccc}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc}.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover{border-color:#000}.ql-toolbar.ql-snow+.ql-container.ql-snow{border-top:0}.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:\"Visit URL:\";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';margin-left:16px;padding-right:8px}.ql-snow .ql-tooltip a.ql-remove::before{content:'Remove';margin-left:8px}.ql-snow .ql-tooltip a{line-height:26px}.ql-snow .ql-tooltip.ql-editing a.ql-preview,.ql-snow .ql-tooltip.ql-editing a.ql-remove{display:none}.ql-snow .ql-tooltip.ql-editing input[type=text]{display:inline-block}.ql-snow .ql-tooltip.ql-editing a.ql-action::after{border-right:0;content:'Save';padding-right:0}.ql-snow .ql-tooltip[data-mode=link]::before{content:\"Enter link:\"}.ql-snow .ql-tooltip[data-mode=formula]::before{content:\"Enter formula:\"}.ql-snow .ql-tooltip[data-mode=video]::before{content:\"Enter video:\"}.ql-snow a{color:#06c}.ql-container.ql-snow{border:1px solid #ccc}";const PO=FO+"";const WO='.mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);word-break:break-word}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}.mg-c-input__wrapper{display:flex;width:100%;flex-direction:column;border-width:var(--mg-c-input-border-width);border-style:solid;border-color:var(--mg-c-input-color-border);border-radius:var(--mg-c-input-border-radius);background-color:var(--mg-b-color-light)}.mg-c-input__wrapper:focus-within{box-shadow:0 0 var(--mg-b-size-4) var(--mg-c-input-color-box-shadow-focus);outline:Highlight auto .1rem;outline:-webkit-focus-ring-color auto .1rem}.mg-c-input--has-error .mg-c-input__wrapper{border-color:var(--mg-b-color-danger)}.mg-c-input--disabled .mg-c-input__wrapper{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input--rich-text-editor .mg-c-input__readonly-value p{margin:0}.mg-c-input--rich-text-editor .mg-c-input__readonly-value p:not(:first-child){margin-top:1em}.mg-c-input--rich-text-editor .ql-toolbar{display:flex;flex-wrap:wrap;padding:var(--mg-b-size-8);border:0;border-radius:var(--mg-c-input-border-radius) var(--mg-c-input-border-radius) 0 0;background:var(--mg-b-color-neutral-0);border-block-end-width:var(--mg-c-input-border-width);border-block-end-color:var(--mg-c-input-color-border);border-block-end-style:solid}.mg-c-input--rich-text-editor .ql-toolbar .ql-formats{display:inline-flex;margin:inherit;gap:.2rem}.mg-c-input--rich-text-editor .ql-toolbar .ql-formats:not(:last-child)::after{width:.1rem;height:var(--mg-b-size-16);background:var(--mg-c-input-color-border);content:"";margin-block:var(--mg-b-size-8);margin-inline:var(--mg-b-size-8)}.mg-c-input--rich-text-editor .ql-toolbar button{display:flex;min-width:var(--mg-b-size-32);height:var(--mg-b-size-32);align-items:center;justify-content:center;padding:var(--mg-b-size-4);border:.1rem solid rgba(0,0,0,0);border-radius:var(--mg-b-size-radius);color:var(--mg-b-color-dark);float:inherit;transition-duration:.2s;transition-property:background-color,border-color;transition-timing-function:ease-in-out}.mg-c-input--rich-text-editor .ql-toolbar button .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button:hover .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button:focus .ql-fill,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active .ql-fill{fill:currentcolor}.mg-c-input--rich-text-editor .ql-toolbar button:hover .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button:focus .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active .ql-stroke,.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke{stroke:currentcolor}.mg-c-input--rich-text-editor .ql-toolbar button svg{width:var(--mg-b-size-20);height:var(--mg-b-size-20)}.mg-c-input--rich-text-editor .ql-toolbar button:focus{color:var(--mg-b-color-dark)}.mg-c-input--rich-text-editor .ql-toolbar button:focus-visible,.mg-c-input--rich-text-editor .ql-toolbar button:hover,.mg-c-input--rich-text-editor .ql-toolbar button.ql-active{border-color:var(--mg-b-color-neutral-70);background:var(--mg-b-color-neutral-20);color:var(--mg-b-color-dark)}.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke{stroke-width:.12rem}.mg-c-input--rich-text-editor .ql-toolbar button .ql-stroke.ql-thin{stroke-width:.1rem}.mg-c-input--rich-text-editor .ql-toolbar button.ql-bold .ql-stroke{stroke-width:.2rem}.mg-c-input--rich-text-editor .ql-container{border:0;border-radius:0 0 var(--mg-c-input-border-radius) var(--mg-c-input-border-radius);margin:0 .1rem .1rem;background:var(--mg-b-color-neutral-0)}.mg-c-input--rich-text-editor .ql-editor{min-height:calc(calc(var(--mg-b-font-size) * var(--mg-b-line-height) * var(--mg-c-input-rich-text-editor-rows, 3)) + calc((var(--mg-b-size-min-height) - var(--mg-b-font-size) * var(--mg-b-line-height)) / 2));padding:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-8);color:var(--mg-b-color-dark);font-size:var(--mg-b-font-size)}.mg-c-input--rich-text-editor .ql-editor.ql-blank::before{right:var(--mg-b-size-8);left:var(--mg-b-size-8)}.mg-c-input--rich-text-editor .ql-editor p:not(:first-child){margin-top:1em}.mg-c-input--rich-text-editor.mg-c-input--disabled .ql-toolbar{pointer-events:none}.mg-c-input--rich-text-editor.mg-c-input--has-error .ql-toolbar{border-color:var(--mg-b-color-danger)}';const ZO=class{constructor(n){t(this,n);this.inputValid=e(this,"input-valid");this.valueChange=e(this,"value-change");this.hasDisplayedError=false;this.classFocus="mg-u-is-focused";this.value="";this.labelOnTop=false;this.labelHide=false;this.rows=5;this.required=false;this.readonly=false;this.disabled=false;this.tooltipPosition="input";this.classCollection=new s(["mg-c-input--rich-text-editor"]);this.isEmpty=()=>{const t=this.getTextContent();return!(i(t)&&t!=="\n")};this.getTextContent=()=>this.value.replace(/<[^>]*>/g,"").trim();this.getPatternValidity=()=>this.pattern===undefined||new RegExp(`^${this.pattern}$`,"u").test(this.getTextContent());this.checkValidity=()=>{this.setValidity(this.readonly||this.disabled||(this.required?!this.isEmpty():true)&&this.getPatternValidity())};this.setErrorMessage=t=>{this.errorMessage=undefined;if(this.valid)return;else if(i(t)){this.errorMessage=t}else if(this.required&&this.isEmpty()){this.errorMessage=this.messages.errors.required}else if(!this.getPatternValidity()){this.errorMessage=this.patternErrorMessage}};this.handleFocus=()=>{this.classCollection.add(this.classFocus);this.classCollection=new s(this.classCollection.classes)};this.handleBlur=()=>{this.classCollection.delete(this.classFocus);this.classCollection=new s(this.classCollection.classes);if(!this.readonly){this.checkValidity();this.setErrorMessage();if(!this.valid){this.hasDisplayedError=true}}};this.handleTextChange=()=>{const t=this.editor.getSemanticHTML();this.value=t;this.valueChange.emit(t);this.checkValidity();if(this.hasDisplayedError){this.setErrorMessage()}}}watchReadonly(t){if(t)this.classCollection.add(o);else this.classCollection.delete(o)}watchDisabled(t){var e,n;if(t){this.classCollection.add(u);(e=this.editor)===null||e===void 0?void 0:e.disable()}else{this.classCollection.delete(u);(n=this.editor)===null||n===void 0?void 0:n.enable()}}handleValidityChange(){if(this.editor!==undefined&&this.editor!==null){this.checkValidity();if(this.hasDisplayedError){this.setErrorMessage();this.hasDisplayedError=false}}}validatePattern(t){if(t!==undefined&&!(i(this.pattern)&&i(this.patternErrorMessage))){throw new Error(`<mg-input-rich-text-editor> props "pattern" and "patternErrorMessage" must be non-empty string and paired. Passed value: "pattern='${l(this.pattern)}'" and "patternErrorMessage='${l(this.patternErrorMessage)}'".`)}}async setFocus(){var t;(t=this.editor)===null||t===void 0?void 0:t.focus()}async getHTML(){return new Promise((t=>{requestAnimationFrame((()=>{t(this.editor.getSemanticHTML())}))}))}async getText(){return new Promise((t=>{requestAnimationFrame((()=>{t(this.editor.getText())}))}))}async displayError(){return new Promise((t=>{requestAnimationFrame((()=>{this.checkValidity();this.setErrorMessage();this.hasDisplayedError=this.invalid;t()}))}))}async setError(t,e){if(typeof t!=="boolean"){throw new Error('<mg-input-rich-text-editor> method "setError()" param "valid" must be a boolean.')}else if(!i(e)){throw new Error('<mg-input-rich-text-editor> method "setError()" param "errorMessage" must be a string.')}else{this.setValidity(t);this.setErrorMessage(t?undefined:e);this.hasDisplayedError=this.invalid}}async reset(){if(!this.readonly){this.value="";this.editor.setText("");return new Promise((t=>{requestAnimationFrame((()=>{this.checkValidity();this.errorMessage=undefined;this.hasDisplayedError=false;t()}))}))}}setValidity(t){const e=this.valid;this.valid=t;this.invalid=!this.valid;if(this.valid!==e){this.inputValid.emit(this.valid)}}componentWillLoad(){this.messages=a(this.element).messages;this.element.style.setProperty("--mg-c-input-rich-text-editor-rows",this.rows.toString());this.validatePattern(this.pattern);this.validatePattern(this.patternErrorMessage);this.watchReadonly(this.readonly);this.watchDisabled(this.disabled);return setTimeout((()=>{this.checkValidity()}),0)}componentDidLoad(){if(!this.readonly){this.editor=UO(this.wrapperElement,{modules:this.modules,readOnly:this.readonly||this.disabled,placeholder:this.placeholder,value:this.value,handleTextChange:this.handleTextChange,handleBlur:this.handleBlur,handleFocus:this.handleFocus})}}render(){return n("mg-input",{key:"b11d79ea82720eff4256206374e179efaefa9268",identifier:this.identifier,class:this.classCollection.join(),label:this.label,labelOnTop:this.labelOnTop,labelHide:this.labelHide,required:this.required,tooltip:this.tooltip,tooltipPosition:this.tooltipPosition,helpText:this.helpText,errorMessage:this.hasDisplayedError?this.errorMessage:undefined},this.readonly?n("div",{class:"mg-c-input__readonly-value",innerHTML:this.value}):n("div",{ref:t=>{this.wrapperElement=t},id:this.identifier,class:"mg-c-input__wrapper"},n("div",null)))}get element(){return r(this)}static get watchers(){return{readonly:["watchReadonly","handleValidityChange"],disabled:["watchDisabled","handleValidityChange"],required:["handleValidityChange"],pattern:["validatePattern"],patternErrorMessage:["validatePattern"]}}};ZO.style=PO+WO;export{ZO as mg_input_rich_text_editor};
11
+ //# sourceMappingURL=p-e7a7c651.entry.js.map