diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d5e5cb..03b744d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### 1.5.9 - 添加保存快捷键回调 +- quill升级到2.0.1 ### 1.5.8 - 更改quill.snow.css引入方式 diff --git a/dist/quill-react-commercial.min.css b/dist/quill-react-commercial.min.css index 147cd50..70dad68 100644 --- a/dist/quill-react-commercial.min.css +++ b/dist/quill-react-commercial.min.css @@ -104,7 +104,7 @@ XCode style (c) Angel Garcia } /*! - * Quill Editor v2.0.0-rc.5 + * Quill Editor v2.0.1 * https://quilljs.com * Copyright (c) 2017-2024, Slab * Copyright (c) 2014, Jason Chen diff --git a/dist/quill-react-commercial.min.js b/dist/quill-react-commercial.min.js index 6e00542..28d0277 100644 --- a/dist/quill-react-commercial.min.js +++ b/dist/quill-react-commercial.min.js @@ -8,5 +8,5 @@ * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var Rd=4294967295,Id=Array.prototype,jd=Object.prototype.hasOwnProperty,Bd=i?i.iterator:void 0,Dd=Math.max,zd=Math.min,Ud=function(e){return function(t,n,r){if(null==r){var i=T(n),s=i&&Nn(n),o=s&&s.length&&Nl(n,s);(o?o.length:i)||(r=n,n=t,t=this)}return e(t,n,r)}}(Ic);Te.after=wd.after,Te.ary=wd.ary,Te.assign=Sd.assign,Te.assignIn=Sd.assignIn,Te.assignInWith=Sd.assignInWith,Te.assignWith=Sd.assignWith,Te.at=Sd.at,Te.before=wd.before,Te.bind=wd.bind,Te.bindAll=Cd.bindAll,Te.bindKey=wd.bindKey,Te.castArray=_d.castArray,Te.chain=qd.chain,Te.chunk=vd.chunk,Te.compact=vd.compact,Te.concat=vd.concat,Te.cond=Cd.cond,Te.conforms=Cd.conforms,Te.constant=Cd.constant,Te.countBy=yd.countBy,Te.create=Sd.create,Te.curry=wd.curry,Te.curryRight=wd.curryRight,Te.debounce=wd.debounce,Te.defaults=Sd.defaults,Te.defaultsDeep=Sd.defaultsDeep,Te.defer=wd.defer,Te.delay=wd.delay,Te.difference=vd.difference,Te.differenceBy=vd.differenceBy,Te.differenceWith=vd.differenceWith,Te.drop=vd.drop,Te.dropRight=vd.dropRight,Te.dropRightWhile=vd.dropRightWhile,Te.dropWhile=vd.dropWhile,Te.fill=vd.fill,Te.filter=yd.filter,Te.flatMap=yd.flatMap,Te.flatMapDeep=yd.flatMapDeep,Te.flatMapDepth=yd.flatMapDepth,Te.flatten=vd.flatten,Te.flattenDeep=vd.flattenDeep,Te.flattenDepth=vd.flattenDepth,Te.flip=wd.flip,Te.flow=Cd.flow,Te.flowRight=Cd.flowRight,Te.fromPairs=vd.fromPairs,Te.functions=Sd.functions,Te.functionsIn=Sd.functionsIn,Te.groupBy=yd.groupBy,Te.initial=vd.initial,Te.intersection=vd.intersection,Te.intersectionBy=vd.intersectionBy,Te.intersectionWith=vd.intersectionWith,Te.invert=Sd.invert,Te.invertBy=Sd.invertBy,Te.invokeMap=yd.invokeMap,Te.iteratee=Cd.iteratee,Te.keyBy=yd.keyBy,Te.keys=Nn,Te.keysIn=Sd.keysIn,Te.map=yd.map,Te.mapKeys=Sd.mapKeys,Te.mapValues=Sd.mapValues,Te.matches=Cd.matches,Te.matchesProperty=Cd.matchesProperty,Te.memoize=wd.memoize,Te.merge=Sd.merge,Te.mergeWith=Sd.mergeWith,Te.method=Cd.method,Te.methodOf=Cd.methodOf,Te.mixin=Ud,Te.negate=Dc,Te.nthArg=Cd.nthArg,Te.omit=Sd.omit,Te.omitBy=Sd.omitBy,Te.once=wd.once,Te.orderBy=yd.orderBy,Te.over=Cd.over,Te.overArgs=wd.overArgs,Te.overEvery=Cd.overEvery,Te.overSome=Cd.overSome,Te.partial=wd.partial,Te.partialRight=wd.partialRight,Te.partition=yd.partition,Te.pick=Sd.pick,Te.pickBy=Sd.pickBy,Te.property=Cd.property,Te.propertyOf=Cd.propertyOf,Te.pull=vd.pull,Te.pullAll=vd.pullAll,Te.pullAllBy=vd.pullAllBy,Te.pullAllWith=vd.pullAllWith,Te.pullAt=vd.pullAt,Te.range=Cd.range,Te.rangeRight=Cd.rangeRight,Te.rearg=wd.rearg,Te.reject=yd.reject,Te.remove=vd.remove,Te.rest=wd.rest,Te.reverse=vd.reverse,Te.sampleSize=yd.sampleSize,Te.set=Sd.set,Te.setWith=Sd.setWith,Te.shuffle=yd.shuffle,Te.slice=vd.slice,Te.sortBy=yd.sortBy,Te.sortedUniq=vd.sortedUniq,Te.sortedUniqBy=vd.sortedUniqBy,Te.split=Od.split,Te.spread=wd.spread,Te.tail=vd.tail,Te.take=vd.take,Te.takeRight=vd.takeRight,Te.takeRightWhile=vd.takeRightWhile,Te.takeWhile=vd.takeWhile,Te.tap=qd.tap,Te.throttle=wd.throttle,Te.thru=Dh,Te.toArray=_d.toArray,Te.toPairs=Sd.toPairs,Te.toPairsIn=Sd.toPairsIn,Te.toPath=Cd.toPath,Te.toPlainObject=_d.toPlainObject,Te.transform=Sd.transform,Te.unary=wd.unary,Te.union=vd.union,Te.unionBy=vd.unionBy,Te.unionWith=vd.unionWith,Te.uniq=vd.uniq,Te.uniqBy=vd.uniqBy,Te.uniqWith=vd.uniqWith,Te.unset=Sd.unset,Te.unzip=vd.unzip,Te.unzipWith=vd.unzipWith,Te.update=Sd.update,Te.updateWith=Sd.updateWith,Te.values=Sd.values,Te.valuesIn=Sd.valuesIn,Te.without=vd.without,Te.words=Od.words,Te.wrap=wd.wrap,Te.xor=vd.xor,Te.xorBy=vd.xorBy,Te.xorWith=vd.xorWith,Te.zip=vd.zip,Te.zipObject=vd.zipObject,Te.zipObjectDeep=vd.zipObjectDeep,Te.zipWith=vd.zipWith,Te.entries=Sd.toPairs,Te.entriesIn=Sd.toPairsIn,Te.extend=Sd.assignIn,Te.extendWith=Sd.assignInWith,Ud(Te,Te),Te.add=Ed.add,Te.attempt=Cd.attempt,Te.camelCase=Od.camelCase,Te.capitalize=Od.capitalize,Te.ceil=Ed.ceil,Te.clamp=Nd,Te.clone=_d.clone,Te.cloneDeep=_d.cloneDeep,Te.cloneDeepWith=_d.cloneDeepWith,Te.cloneWith=_d.cloneWith,Te.conformsTo=_d.conformsTo,Te.deburr=Od.deburr,Te.defaultTo=Cd.defaultTo,Te.divide=Ed.divide,Te.endsWith=Od.endsWith,Te.eq=_d.eq,Te.escape=Od.escape,Te.escapeRegExp=Od.escapeRegExp,Te.every=yd.every,Te.find=yd.find,Te.findIndex=vd.findIndex,Te.findKey=Sd.findKey,Te.findLast=yd.findLast,Te.findLastIndex=vd.findLastIndex,Te.findLastKey=Sd.findLastKey,Te.floor=Ed.floor,Te.forEach=yd.forEach,Te.forEachRight=yd.forEachRight,Te.forIn=Sd.forIn,Te.forInRight=Sd.forInRight,Te.forOwn=Sd.forOwn,Te.forOwnRight=Sd.forOwnRight,Te.get=Sd.get,Te.gt=_d.gt,Te.gte=_d.gte,Te.has=Sd.has,Te.hasIn=Sd.hasIn,Te.head=vd.head,Te.identity=P,Te.includes=yd.includes,Te.indexOf=vd.indexOf,Te.inRange=kd,Te.invoke=Sd.invoke,Te.isArguments=_d.isArguments,Te.isArray=x,Te.isArrayBuffer=_d.isArrayBuffer,Te.isArrayLike=_d.isArrayLike,Te.isArrayLikeObject=_d.isArrayLikeObject,Te.isBoolean=_d.isBoolean,Te.isBuffer=_d.isBuffer,Te.isDate=_d.isDate,Te.isElement=_d.isElement,Te.isEmpty=_d.isEmpty,Te.isEqual=_d.isEqual,Te.isEqualWith=_d.isEqualWith,Te.isError=_d.isError,Te.isFinite=_d.isFinite,Te.isFunction=_d.isFunction,Te.isInteger=_d.isInteger,Te.isLength=_d.isLength,Te.isMap=_d.isMap,Te.isMatch=_d.isMatch,Te.isMatchWith=_d.isMatchWith,Te.isNaN=_d.isNaN,Te.isNative=_d.isNative,Te.isNil=_d.isNil,Te.isNull=_d.isNull,Te.isNumber=_d.isNumber,Te.isObject=T,Te.isObjectLike=_d.isObjectLike,Te.isPlainObject=_d.isPlainObject,Te.isRegExp=_d.isRegExp,Te.isSafeInteger=_d.isSafeInteger,Te.isSet=_d.isSet,Te.isString=_d.isString,Te.isSymbol=_d.isSymbol,Te.isTypedArray=_d.isTypedArray,Te.isUndefined=_d.isUndefined,Te.isWeakMap=_d.isWeakMap,Te.isWeakSet=_d.isWeakSet,Te.join=vd.join,Te.kebabCase=Od.kebabCase,Te.last=Ra,Te.lastIndexOf=vd.lastIndexOf,Te.lowerCase=Od.lowerCase,Te.lowerFirst=Od.lowerFirst,Te.lt=_d.lt,Te.lte=_d.lte,Te.max=Ed.max,Te.maxBy=Ed.maxBy,Te.mean=Ed.mean,Te.meanBy=Ed.meanBy,Te.min=Ed.min,Te.minBy=Ed.minBy,Te.stubArray=Cd.stubArray,Te.stubFalse=Cd.stubFalse,Te.stubObject=Cd.stubObject,Te.stubString=Cd.stubString,Te.stubTrue=Cd.stubTrue,Te.multiply=Ed.multiply,Te.nth=vd.nth,Te.noop=Cd.noop,Te.now=xd,Te.pad=Od.pad,Te.padEnd=Od.padEnd,Te.padStart=Od.padStart,Te.parseInt=Od.parseInt,Te.random=Ad,Te.reduce=yd.reduce,Te.reduceRight=yd.reduceRight,Te.repeat=Od.repeat,Te.replace=Od.replace,Te.result=Sd.result,Te.round=Ed.round,Te.sample=yd.sample,Te.size=yd.size,Te.snakeCase=Od.snakeCase,Te.some=yd.some,Te.sortedIndex=vd.sortedIndex,Te.sortedIndexBy=vd.sortedIndexBy,Te.sortedIndexOf=vd.sortedIndexOf,Te.sortedLastIndex=vd.sortedLastIndex,Te.sortedLastIndexBy=vd.sortedLastIndexBy,Te.sortedLastIndexOf=vd.sortedLastIndexOf,Te.startCase=Od.startCase,Te.startsWith=Od.startsWith,Te.subtract=Ed.subtract,Te.sum=Ed.sum,Te.sumBy=Ed.sumBy,Te.template=Od.template,Te.times=Cd.times,Te.toFinite=_d.toFinite,Te.toInteger=$,Te.toLength=_d.toLength,Te.toLower=Od.toLower,Te.toNumber=_d.toNumber,Te.toSafeInteger=_d.toSafeInteger,Te.toString=_d.toString,Te.toUpper=Od.toUpper,Te.trim=Od.trim,Te.trimEnd=Od.trimEnd,Te.trimStart=Od.trimStart,Te.truncate=Od.truncate,Te.unescape=Od.unescape,Te.uniqueId=Cd.uniqueId,Te.upperCase=Od.upperCase,Te.upperFirst=Od.upperFirst,Te.each=yd.forEach,Te.eachRight=yd.forEachRight,Te.first=vd.head,Ud(Te,function(){var e={};return na(Te,(function(t,n){jd.call(Te.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Te.VERSION="4.17.21",(Te.templateSettings=Od.templateSettings).imports._=Te,He(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Te[e].placeholder=Te})),He(["drop","take"],(function(e,t){we.prototype[e]=function(n){n=void 0===n?1:Dd($(n),0);var r=this.__filtered__&&!t?new we(this):this.clone();return r.__filtered__?r.__takeCount__=zd(n,r.__takeCount__):r.__views__.push({size:zd(n,Rd),type:e+(r.__dir__<0?"Right":"")}),r},we.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),He(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;we.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xo(e),type:n}),t.__filtered__=t.__filtered__||r,t}})),He(["head","last"],(function(e,t){var n="take"+(t?"Right":"");we.prototype[e]=function(){return this[n](1).value()[0]}})),He(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");we.prototype[e]=function(){return this.__filtered__?new we(this):this[n](1)}})),we.prototype.compact=function(){return this.filter(P)},we.prototype.find=function(e){return this.filter(e).head()},we.prototype.findLast=function(e){return this.reverse().find(e)},we.prototype.invokeMap=Ft((function(e,t){return"function"==typeof e?new we(this):this.map((function(n){return tc(n,e,t)}))})),we.prototype.reject=function(e){return this.filter(Dc(Xo(e)))},we.prototype.slice=function(e,t){e=$(e);var n=this;return n.__filtered__&&(e>0||t<0)?new we(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=$(t))<0?n.dropRight(-t):n.take(t-e)),n)},we.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},we.prototype.toArray=function(){return this.take(Rd)},na(we.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Te[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);i&&(Te.prototype[t]=function(){var t=this.__wrapped__,o=r?[1]:arguments,a=t instanceof we,l=o[0],c=a||x(t),u=function(e){var t=i.apply(Te,ir([e],o));return r&&h?t[0]:t};c&&n&&"function"==typeof l&&1!=l.length&&(a=c=!1);var h=this.__chain__,d=!!this.__actions__.length,f=s&&!h,p=a&&!d;if(!s&&c){t=p?t:new we(this);var g=e.apply(t,o);return g.__actions__.push({func:Dh,args:[u],thisArg:void 0}),new Se(g,h)}return f&&p?e.apply(this,o):(g=this.thru(u),f?r?g.value()[0]:g.value():g)})})),He(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Id[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Te.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(x(i)?i:[],e)}return this[n]((function(n){return t.apply(x(n)?n:[],e)}))}})),na(we.prototype,(function(e,t){var n=Te[t];if(n){var r=n.name+"";jd.call(Ne,r)||(Ne[r]=[]),Ne[r].push({name:t,func:n})}})),Ne[mt(void 0,2).name]=[{name:"wrapper",func:void 0}],we.prototype.clone=function(){var e=new we(this.__wrapped__);return e.__actions__=qe(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=qe(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=qe(this.__views__),e},we.prototype.reverse=function(){if(this.__filtered__){var e=new we(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},we.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=x(e),r=t<0,i=n?e.length:0,s=function(e,t,n){for(var r=-1,i=n.length;++r(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))($d||{});class Pd{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const r=$d.TYPE&$d.ATTRIBUTE;this.scope=null!=n.scope?n.scope&$d.LEVEL|r:$d.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map((e=>e.name))}add(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)}canAdd(e,t){return null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1)}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class Hd extends Error{constructor(e){super(e="[Parchment] "+e),this.message=e,this.name=this.constructor.name}}const Fd=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(null==e)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,r){const i=this.query(n);if(null==i)throw new Hd(`Unable to create ${n} blot`);const s=i,o=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:s.create(r),a=new s(t,o,r);return e.blots.set(a.domNode,a),a}find(t,n=!1){return e.find(t,n)}query(e,t=$d.ANY){let n;return"string"==typeof e?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof e?e&$d.LEVEL&$d.BLOCK?n=this.types.block:e&$d.LEVEL&$d.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((e=>(n=this.classes[e],!!n))),n=n||this.tags[e.tagName]),null==n?null:"scope"in n&&t&$d.LEVEL&n.scope&&t&$d.TYPE&n.scope?n:null}register(...e){return e.map((e=>{const t="blotName"in e,n="attrName"in e;if(!t&&!n)throw new Hd("Invalid definition");if(t&&"abstract"===e.blotName)throw new Hd("Cannot register abstract class");const r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=e,n?"string"==typeof e.keyName&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map((e=>e.toUpperCase())):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach((t=>{(null==this.tags[t]||null==e.className)&&(this.tags[t]=e)})))),e}))}};Fd.blots=new WeakMap;let Wd=Fd;function Kd(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter((e=>0===e.indexOf(`${t}-`)))}const Vd=class extends Pd{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((e=>e.split("-").slice(0,-1).join("-")))}add(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0)}remove(e){Kd(e,this.keyName).forEach((t=>{e.classList.remove(t)})),0===e.classList.length&&e.removeAttribute("class")}value(e){const t=(Kd(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function Gd(e){const t=e.split("-"),n=t.slice(1).map((e=>e[0].toUpperCase()+e.slice(1))).join("");return t[0]+n}const Zd=class extends Pd{static keys(e){return(e.getAttribute("style")||"").split(";").map((e=>e.split(":")[0].trim()))}add(e,t){return!!this.canAdd(e,t)&&(e.style[Gd(this.keyName)]=t,!0)}remove(e){e.style[Gd(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Gd(this.keyName)];return this.canAdd(e,t)?t:""}};const Qd=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Wd.find(this.domNode);if(null==e)return;const t=Pd.keys(this.domNode),n=Vd.keys(this.domNode),r=Zd.keys(this.domNode);t.concat(n).concat(r).forEach((t=>{const n=e.scroll.query(t,$d.ATTRIBUTE);n instanceof Pd&&(this.attributes[n.attrName]=n)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const n=this.attributes[t].value(this.domNode);e.format(t,n)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((e=>{this.attributes[e].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}},Xd=class{constructor(e,t){this.scroll=e,this.domNode=t,Wd.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(null==this.tagName)throw new Hd("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?("string"==typeof e?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof e&&(n=e),t="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){null!=this.parent&&this.parent.removeChild(this),Wd.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){const i=this.isolate(e,t);if(null!=this.scroll.query(n,$d.BLOT)&&r)i.wrap(n,r);else if(null!=this.scroll.query(n,$d.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);i.wrap(e),e.format(n,r)}}insertAt(e,t,n){const r=null==n?this.scroll.create("text",t):this.scroll.create(t,n),i=this.split(e);this.parent.insertBefore(r,i||void 0)}isolate(e,t){const n=this.split(e);if(null==n)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return null==this.parent||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return 0===e?this:this.next}update(e,t){}wrap(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new Hd(`Cannot wrap ${e}`);return n.appendChild(this),n}};Xd.blotName="abstract";let Yd=Xd;const Jd=class extends Yd{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Jd.scope=$d.INLINE_BLOT;const ef=Jd;class tf{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let n=t();for(;n&&e>0;)e-=1,n=t();return n}contains(e){const t=this.iterator();let n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){const t=this.iterator();let n=t(),r=0;for(;n;){if(n===e)return r;r+=1,n=t()}return-1}insertBefore(e,t){null!=e&&(this.remove(e),e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,n=this.head;for(;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return null!=e&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let r=n();for(;r;){const i=r.length();if(es?n(a,e-s,Math.min(t,s+r-e)):n(a,0,Math.min(r,e+t-s)),s+=r,a=o()}}map(e){return this.reduce(((t,n)=>(t.push(e(n)),t)),[])}reduce(e,t){const n=this.iterator();let r=n();for(;r;)t=e(t,r),r=n();return t}}function nf(e,t){const n=t.find(e);if(n)return n;try{return t.create(e)}catch{const n=t.create($d.INLINE);return Array.from(e.childNodes).forEach((e=>{n.domNode.appendChild(e)})),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}const rf=class e extends Yd{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new tf,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=nf(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof Hd)return;throw e}}))}deleteAt(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,((e,t,n)=>{e.deleteAt(t,n)}))}descendant(t,n=0){const[r,i]=this.children.find(n);return null==t.blotName&&t(r)||null!=t.blotName&&r instanceof t?[r,i]:r instanceof e?r.descendant(t,i):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let i=[],s=r;return this.children.forEachAt(n,r,((n,r,o)=>{(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&i.push(n),n instanceof e&&(i=i.concat(n.descendants(t,r,s))),s-=o})),i}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach((n=>{t||this.statics.allowedChildren.some((e=>n instanceof e))||(n.statics.scope===$d.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())}))}formatAt(e,t,n,r){this.children.forEachAt(e,t,((e,t,i)=>{e.formatAt(t,i,n,r)}))}insertAt(e,t,n){const[r,i]=this.children.find(e);if(r)r.insertAt(i,t,n);else{const e=null==n?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){null!=e.parent&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,null!=t&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((n=>{e.insertBefore(n,t)}))}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,n=!1){const[r,i]=this.children.find(t,n),s=[[this,t]];return r instanceof e?s.concat(r.path(i,n)):(null!=r&&s.push([r,i]),s)}removeChild(e){this.children.remove(e)}replaceWith(t,n){const r="string"==typeof t?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),((e,r,i)=>{const s=e.split(r,t);null!=s&&n.appendChild(s)})),n}splitAfter(e){const t=this.clone();for(;null!=e.next;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const n=[],r=[];e.forEach((e=>{e.target===this.domNode&&"childList"===e.type&&(n.push(...e.addedNodes),r.push(...e.removedNodes))})),r.forEach((e=>{if(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const t=this.scroll.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===this.domNode)&&t.detach()})),n.filter((e=>e.parentNode===this.domNode&&e!==this.uiNode)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((e=>{let t=null;null!=e.nextSibling&&(t=this.scroll.find(e.nextSibling));const n=nf(e,this.scroll);(n.next!==t||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))})),this.enforceAllowedChildren()}};rf.uiClass="";const sf=rf;const of=class e extends sf{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Qd(this.domNode)}format(t,n){if(t!==this.statics.blotName||n){const e=this.scroll.query(t,$d.INLINE);if(null==e)return;e instanceof Pd?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}else this.children.forEach((t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)})),this.unwrap()}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.formats()[n]||this.scroll.query(n,$d.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const r=this.next;r instanceof e&&r.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}wrap(t,n){const r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};of.allowedChildren=[of,ef],of.blotName="inline",of.scope=$d.INLINE_BLOT,of.tagName="SPAN";const af=of,lf=class e extends sf{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Qd(this.domNode)}format(t,n){const r=this.scroll.query(t,$d.BLOCK);null!=r&&(r instanceof Pd?this.attributes.attribute(r,n):t!==this.statics.blotName||n?n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n):this.replaceWith(e.blotName))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.scroll.query(n,$d.BLOCK)?this.format(n,r):super.formatAt(e,t,n,r)}insertAt(e,t,n){if(null==n||null!=this.scroll.query(t,$d.INLINE))super.insertAt(e,t,n);else{const r=this.split(e);if(null==r)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}};lf.blotName="block",lf.scope=$d.BLOCK_BLOT,lf.tagName="P",lf.allowedChildren=[af,lf,ef];const cf=lf,uf=class extends sf{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};uf.blotName="container",uf.scope=$d.BLOCK_BLOT;const hf=uf;const df=class extends ef{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){0===e&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},ff={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},pf=class extends sf{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((e=>{this.update(e)})),this.observer.observe(this.domNode,ff),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=$d.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),0===e&&t===this.length()?this.children.forEach((e=>{e.remove()})):super.deleteAt(e,t)}formatAt(e,t,n,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());const i=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&i(e.parent))},s=e=>{n.has(e.domNode)&&(e instanceof sf&&e.children.forEach(s),n.delete(e.domNode),e.optimize(t))};let o=e;for(let t=0;o.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach((e=>{const t=this.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(i(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach((e=>{const t=this.find(e,!1);i(t,!1),t instanceof sf&&t.children.forEach((e=>{i(e,!1)}))}))):"attributes"===e.type&&i(t.prev)),i(t))})),this.children.forEach(s),o=Array.from(this.observer.takeRecords()),r=o.slice();r.length>0;)e.push(r.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map((e=>{const t=this.find(e.target,!0);return null==t?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)})).forEach((e=>{null!=e&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)})),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};pf.blotName="scroll",pf.defaultChild=cf,pf.allowedChildren=[cf,hf],pf.scope=$d.BLOCK_BLOT,pf.tagName="DIV";const gf=pf,mf=class e extends ef{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){null==n?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some((e=>"characterData"===e.type&&e.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};mf.blotName="text",mf.scope=$d.INLINE_BLOT;const bf=mf;var vf=Object.freeze({__proto__:null,Attributor:Pd,AttributorStore:Qd,BlockBlot:cf,ClassAttributor:Vd,ContainerBlot:hf,EmbedBlot:df,InlineBlot:af,LeafBlot:ef,ParentBlot:sf,Registry:Wd,Scope:$d,ScrollBlot:gf,StyleAttributor:Zd,TextBlot:bf}),yf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wf={},_f={get exports(){return wf},set exports(e){wf=e}},Ef=-1,Nf=1,kf=0;function Af(e,t,n,r,i){if(e===t)return e?[[kf,e]]:[];if(null!=n){var s=function(e,t,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,i="number"==typeof n?null:n.newRange,s=e.length,o=t.length;if(0===r.length&&(null===i||0===i.length)){var a=r.index,l=e.slice(0,a),c=e.slice(a),u=i?i.index:null,h=a+o-s;if((null===u||u===h)&&!(h<0||h>o)){var d=t.slice(0,h);if((g=t.slice(h))===c){var f=Math.min(a,h);if((b=l.slice(0,f))===(y=d.slice(0,f)))return $f(b,l.slice(f),d.slice(f),c)}}if(null===u||u===a){var p=a,g=(d=t.slice(0,p),t.slice(p));if(d===l){var m=Math.min(s-p,o-p);if((v=c.slice(c.length-m))===(x=g.slice(g.length-m)))return $f(l,c.slice(0,c.length-m),g.slice(0,g.length-m),v)}}}if(r.length>0&&i&&0===i.length){var b=e.slice(0,r.index),v=e.slice(r.index+r.length);if(!(o<(f=b.length)+(m=v.length))){var y=t.slice(0,f),x=t.slice(o-m);if(b===y&&v===x)return $f(b,e.slice(f,s-m),t.slice(f,o-m),v)}}return null}(e,t,n);if(s)return s}var o=qf(e,t),a=e.substring(0,o);o=Cf(e=e.substring(o),t=t.substring(o));var l=e.substring(e.length-o),c=function(e,t){var n;if(!e)return[[Nf,t]];if(!t)return[[Ef,e]];var r=e.length>t.length?e:t,i=e.length>t.length?t:e,s=r.indexOf(i);if(-1!==s)return n=[[Nf,r.substring(0,s)],[kf,i],[Nf,r.substring(s+i.length)]],e.length>t.length&&(n[0][0]=n[2][0]=Ef),n;if(1===i.length)return[[Ef,e],[Nf,t]];var o=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,i,s,o,c]:null}var s,o,a,l,c,u=i(n,r,Math.ceil(n.length/4)),h=i(n,r,Math.ceil(n.length/2));if(!u&&!h)return null;s=h?u&&u[4].length>h[4].length?u:h:u;e.length>t.length?(o=s[0],a=s[1],l=s[2],c=s[3]):(l=s[0],c=s[1],o=s[2],a=s[3]);var d=s[4];return[o,a,l,c,d]}(e,t);if(o){var a=o[0],l=o[1],c=o[2],u=o[3],h=o[4],d=Af(a,c),f=Af(l,u);return d.concat([[kf,h]],f)}return function(e,t){for(var n=e.length,r=t.length,i=Math.ceil((n+r)/2),s=i,o=2*i,a=new Array(o),l=new Array(o),c=0;cn)f+=2;else if(y>r)d+=2;else if(h){if((_=s+u-b)>=0&&_=(w=n-l[_]))return Sf(e,t,N,y)}}for(var x=-m+p;x<=m-g;x+=2){for(var w,_=s+x,E=(w=x===-m||x!==m&&l[_-1]n)g+=2;else if(E>r)p+=2;else if(!h){if((v=s+u-x)>=0&&v=(w=n-w))return Sf(e,t,N,y)}}}}return[[Ef,e],[Nf,t]]}(e,t)}(e=e.substring(0,e.length-o),t=t.substring(0,t.length-o));return a&&c.unshift([kf,a]),l&&c.push([kf,l]),jf(c,i),r&&function(e){var t=!1,n=[],r=0,i=null,s=0,o=0,a=0,l=0,c=0;for(;s0?n[r-1]:-1,o=0,a=0,l=0,c=0,i=null,t=!0)),s++;t&&jf(e);(function(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(Tf),s=r.match(Tf),o=i&&n.match(Lf),a=s&&r.match(Lf),l=o&&n.match(Mf),c=a&&r.match(Mf),u=l&&e.match(Rf),h=c&&t.match(If);return u||h?5:l||c?4:i&&!o&&a?3:o||a?2:i||s?1:0}var n=1;for(;n=h&&(h=d,l=r,c=i,u=s)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=c,u?e[n+1][1]=u:(e.splice(n+1,1),n--))}n++}})(e),s=1;for(;s=f?(d>=u.length/2||d>=h.length/2)&&(e.splice(s,0,[kf,h.substring(0,d)]),e[s-1][1]=u.substring(0,u.length-d),e[s+1][1]=h.substring(d),s++):(f>=u.length/2||f>=h.length/2)&&(e.splice(s,0,[kf,u.substring(0,f)]),e[s-1][0]=Nf,e[s-1][1]=h.substring(0,h.length-f),e[s+1][0]=Ef,e[s+1][1]=u.substring(f),s++),s++}s++}}(c),c}function Sf(e,t,n,r){var i=e.substring(0,n),s=t.substring(0,r),o=e.substring(n),a=t.substring(r),l=Af(i,s),c=Af(o,a);return l.concat(c)}function qf(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,s=0;nr?e=e.substring(n-r):n=0&&Uf(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),o=c+o,a=c+a,!e[l][1]){e.splice(l,1),r--;var u=l-1;e[u]&&e[u][0]===Nf&&(s++,a=e[u][1]+a,u--),e[u]&&e[u][0]===Ef&&(i++,o=e[u][1]+o,u--),l=u}}if(zf(e[r][1])){c=e[r][1].charAt(0);e[r][1]=e[r][1].slice(1),o+=c,a+=c}}if(r0||a.length>0){o.length>0&&a.length>0&&(0!==(n=qf(a,o))&&(l>=0?e[l][1]+=a.substring(0,n):(e.splice(0,0,[kf,a.substring(0,n)]),r++),a=a.substring(n),o=o.substring(n)),0!==(n=Cf(a,o))&&(e[r][1]=a.substring(a.length-n)+e[r][1],a=a.substring(0,a.length-n),o=o.substring(0,o.length-n)));var h=s+i;0===o.length&&0===a.length?(e.splice(r-h,h),r-=h):0===o.length?(e.splice(r-h,h,[Nf,a]),r=r-h+1):0===a.length?(e.splice(r-h,h,[Ef,o]),r=r-h+1):(e.splice(r-h,h,[Ef,o],[Nf,a]),r=r-h+2)}0!==r&&e[r-1][0]===kf?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,s=0,i=0,o="",a=""}""===e[e.length-1][1]&&e.pop();var d=!1;for(r=1;r=55296&&e<=56319}function Df(e){return e>=56320&&e<=57343}function zf(e){return Df(e.charCodeAt(0))}function Uf(e){return Bf(e.charCodeAt(e.length-1))}function $f(e,t,n,r){return Uf(e)||zf(r)?null:function(e){for(var t=[],n=0;n0&&t.push(e[n]);return t}([[kf,e],[Ef,t],[Nf,n],[kf,r]])}function Pf(e,t,n,r){return Af(e,t,n,r,!0)}Pf.INSERT=Nf,Pf.DELETE=Ef,Pf.EQUAL=kf;var Hf=Pf,Ff={};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",s="[object Boolean]",o="[object Date]",a="[object Function]",l="[object GeneratorFunction]",c="[object Map]",u="[object Number]",h="[object Object]",d="[object Promise]",f="[object RegExp]",p="[object Set]",g="[object String]",m="[object Symbol]",b="[object WeakMap]",v="[object ArrayBuffer]",y="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",_="[object Int8Array]",E="[object Int16Array]",N="[object Int32Array]",k="[object Uint8Array]",A="[object Uint8ClampedArray]",S="[object Uint16Array]",q="[object Uint32Array]",O=/\w*$/,C=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,L={};L[i]=L["[object Array]"]=L[v]=L[y]=L[s]=L[o]=L[x]=L[w]=L[_]=L[E]=L[N]=L[c]=L[u]=L[h]=L[f]=L[p]=L[g]=L[m]=L[k]=L[A]=L[S]=L[q]=!0,L["[object Error]"]=L[a]=L[b]=!1;var M="object"==typeof yf&&yf&&yf.Object===Object&&yf,R="object"==typeof self&&self&&self.Object===Object&&self,I=M||R||Function("return this")(),j=t&&!t.nodeType&&t,B=j&&e&&!e.nodeType&&e,D=B&&B.exports===j;function z(e,t){return e.set(t[0],t[1]),e}function U(e,t){return e.add(t),e}function $(e,t,n,r){var i=-1,s=e?e.length:0;for(r&&s&&(n=e[++i]);++i-1},ke.prototype.set=function(e,t){var n=this.__data__,r=Ce(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Ne,map:new(de||ke),string:new Ne}},Ae.prototype.delete=function(e){return Ie(this,e).delete(e)},Ae.prototype.get=function(e){return Ie(this,e).get(e)},Ae.prototype.has=function(e){return Ie(this,e).has(e)},Ae.prototype.set=function(e,t){return Ie(this,e).set(e,t),this},Se.prototype.clear=function(){this.__data__=new ke},Se.prototype.delete=function(e){return this.__data__.delete(e)},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ke){var r=n.__data__;if(!de||r.length<199)return r.push([e,t]),this;n=this.__data__=new Ae(r)}return n.set(e,t),this};var Be=le?F(le,Object):function(){return[]},De=function(e){return J.call(e)};function ze(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||T.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=r}(e.length)&&!Ke(e)}var We=ce||function(){return!1};function Ke(e){var t=Ve(e)?J.call(e):"";return t==a||t==l}function Ve(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ge(e){return Fe(e)?qe(e):function(e){if(!Ue(e))return ue(e);var t=[];for(var n in Object(e))Y.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}({get exports(){return Ff},set exports(e){Ff=e}},Ff);var Wf={};!function(e,t){var n="__lodash_hash_undefined__",r=1,i=2,s=9007199254740991,o="[object Arguments]",a="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",h="[object Error]",d="[object Function]",f="[object GeneratorFunction]",p="[object Map]",g="[object Number]",m="[object Null]",b="[object Object]",v="[object Promise]",y="[object Proxy]",x="[object RegExp]",w="[object Set]",_="[object String]",E="[object Symbol]",N="[object Undefined]",k="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",q=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,C={};C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C[o]=C[a]=C[A]=C[c]=C[S]=C[u]=C[h]=C[d]=C[p]=C[g]=C[b]=C[x]=C[w]=C[_]=C[k]=!1;var T="object"==typeof yf&&yf&&yf.Object===Object&&yf,L="object"==typeof self&&self&&self.Object===Object&&self,M=T||L||Function("return this")(),R=t&&!t.nodeType&&t,I=R&&e&&!e.nodeType&&e,j=I&&I.exports===R,B=j&&T.process,D=function(){try{return B&&B.binding&&B.binding("util")}catch(e){}}(),z=D&&D.isTypedArray;function U(e,t){for(var n=-1,r=null==e?0:e.length;++nc))return!1;var h=a.get(e);if(h&&a.get(t))return h==t;var d=-1,f=!0,p=n&i?new Ee:void 0;for(a.set(e,t),a.set(t,e);++d-1},we.prototype.set=function(e,t){var n=this.__data__,r=Ae(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},_e.prototype.clear=function(){this.size=0,this.__data__={hash:new xe,map:new(le||we),string:new xe}},_e.prototype.delete=function(e){var t=Re(this,e).delete(e);return this.size-=t?1:0,t},_e.prototype.get=function(e){return Re(this,e).get(e)},_e.prototype.has=function(e){return Re(this,e).has(e)},_e.prototype.set=function(e,t){var n=Re(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Ee.prototype.add=Ee.prototype.push=function(e){return this.__data__.set(e,n),this},Ee.prototype.has=function(e){return this.__data__.has(e)},Ne.prototype.clear=function(){this.__data__=new we,this.size=0},Ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ne.prototype.get=function(e){return this.__data__.get(e)},Ne.prototype.has=function(e){return this.__data__.has(e)},Ne.prototype.set=function(e,t){var n=this.__data__;if(n instanceof we){var r=n.__data__;if(!le||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _e(r)}return n.set(e,t),this.size=n.size,this};var je=ie?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,s=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=s}function Ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ve(e){return null!=e&&"object"==typeof e}var Ge=z?function(e){return function(t){return e(t)}}(z):function(e){return Ve(e)&&We(e.length)&&!!C[Se(e)]};function Ze(e){return null!=(t=e)&&We(t.length)&&!Fe(t)?ke(e):Te(e);var t}e.exports=function(e,t){return Oe(e,t)}}({get exports(){return Wf},set exports(e){Wf=e}},Wf);var Kf={};Object.defineProperty(Kf,"__esModule",{value:!0});const Vf=Ff,Gf=Wf;var Zf;!function(e){e.compose=function(e={},t={},n=!1){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});let r=Vf(t);n||(r=Object.keys(r).reduce(((e,t)=>(null!=r[t]&&(e[t]=r[t]),e)),{}));for(const n in e)void 0!==e[n]&&void 0===t[n]&&(r[n]=e[n]);return Object.keys(r).length>0?r:void 0},e.diff=function(e={},t={}){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});const n=Object.keys(e).concat(Object.keys(t)).reduce(((n,r)=>(Gf(e[r],t[r])||(n[r]=void 0===t[r]?null:t[r]),n)),{});return Object.keys(n).length>0?n:void 0},e.invert=function(e={},t={}){e=e||{};const n=Object.keys(t).reduce(((n,r)=>(t[r]!==e[r]&&void 0!==e[r]&&(n[r]=t[r]),n)),{});return Object.keys(e).reduce(((n,r)=>(e[r]!==t[r]&&void 0===t[r]&&(n[r]=null),n)),n)},e.transform=function(e,t,n=!1){if("object"!=typeof e)return t;if("object"!=typeof t)return;if(!n)return t;const r=Object.keys(t).reduce(((n,r)=>(void 0===e[r]&&(n[r]=t[r]),n)),{});return Object.keys(r).length>0?r:void 0}}(Zf||(Zf={})),Kf.default=Zf;var Qf,Xf={};Object.defineProperty(Xf,"__esModule",{value:!0}),function(e){e.length=function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"object"==typeof e.retain&&null!==e.retain?1:"string"==typeof e.insert?e.insert.length:1}}(Qf||(Qf={})),Xf.default=Qf;var Yf={};Object.defineProperty(Yf,"__esModule",{value:!0});const Jf=Xf;Yf.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const n=this.offset,r=Jf.default.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};{const r={};return t.attributes&&(r.attributes=t.attributes),"number"==typeof t.retain?r.retain=e:"object"==typeof t.retain&&null!==t.retain?r.retain=t.retain:"string"==typeof t.insert?r.insert=t.insert.substr(n,e):r.insert=t.insert,r}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?Jf.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?"number"==typeof e.delete?"delete":"number"==typeof e.retain||"object"==typeof e.retain&&null!==e.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}}return[]}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const n=Hf,r=Ff,i=Wf,s=Kf;t.AttributeMap=s.default;const o=Xf;t.Op=o.default;const a=Yf;t.OpIterator=a.default;const l=String.fromCharCode(0),c=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw new Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]};class u{constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const n={};return"string"==typeof e&&0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=r(e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,n=this.ops[t-1],"object"!=typeof n))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],n=[];return this.forEach((r=>{(e(r)?t:n).push(r)})),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce(((e,t)=>t.insert?e+o.default.length(t):t.delete?e-t.delete:e),0)}length(){return this.reduce(((e,t)=>e+o.default.length(t)),0)}slice(e=0,t=1/0){const n=[],r=new a.default(this.ops);let i=0;for(;i0&&n.next(o.retain-e)}const l=new u(r);for(;t.hasNext()||n.hasNext();)if("insert"===n.peekType())l.push(n.next());else if("delete"===t.peekType())l.push(t.next());else{const e=Math.min(t.peekLength(),n.peekLength()),r=t.next(e),o=n.next(e);if(o.retain){const a={};if("number"==typeof r.retain)a.retain="number"==typeof o.retain?e:o.retain;else if("number"==typeof o.retain)null==r.retain?a.insert=r.insert:a.retain=r.retain;else{const e=null==r.retain?"insert":"retain",[t,n,i]=c(r[e],o.retain),s=u.getHandler(t);a[e]={[t]:s.compose(n,i,"retain"===e)}}const h=s.default.compose(r.attributes,o.attributes,"number"==typeof r.retain);if(h&&(a.attributes=h),l.push(a),!n.hasNext()&&i(l.ops[l.ops.length-1],a)){const e=new u(t.rest());return l.concat(e).chop()}}else"number"==typeof o.delete&&("number"==typeof r.retain||"object"==typeof r.retain&&null!==r.retain)&&l.push(o)}return l.chop()}concat(e){const t=new u(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new u;const r=[this,e].map((t=>t.map((n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:l;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join(""))),o=new u,c=n(r[0],r[1],t,!0),h=new a.default(this.ops),d=new a.default(e.ops);return c.forEach((e=>{let t=e[1].length;for(;t>0;){let r=0;switch(e[0]){case n.INSERT:r=Math.min(d.peekLength(),t),o.push(d.next(r));break;case n.DELETE:r=Math.min(t,h.peekLength()),h.next(r),o.delete(r);break;case n.EQUAL:r=Math.min(h.peekLength(),d.peekLength(),t);const e=h.next(r),a=d.next(r);i(e.insert,a.insert)?o.retain(r,s.default.diff(e.attributes,a.attributes)):o.push(a).delete(r)}t-=r}})),o.chop()}eachLine(e,t="\n"){const n=new a.default(this.ops);let r=new u,i=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const s=n.peek(),a=o.default.length(s)-n.peekLength(),l="string"==typeof s.insert?s.insert.indexOf(t,a)-a:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(!1===e(r,n.next(1).attributes||{},i))return;i+=1,r=new u}}r.length()>0&&e(r,{},i)}invert(e){const t=new u;return this.reduce(((n,r)=>{if(r.insert)t.delete(o.default.length(r));else{if("number"==typeof r.retain&&null==r.attributes)return t.retain(r.retain),n+r.retain;if(r.delete||"number"==typeof r.retain){const i=r.delete||r.retain;return e.slice(n,n+i).forEach((e=>{r.delete?t.push(e):r.retain&&r.attributes&&t.retain(o.default.length(e),s.default.invert(r.attributes,e.attributes))})),n+i}if("object"==typeof r.retain&&null!==r.retain){const i=e.slice(n,n+1),o=new a.default(i.ops).next(),[l,h,d]=c(r.retain,o.insert),f=u.getHandler(l);return t.retain({[l]:f.invert(h,d)},s.default.invert(r.attributes,o.attributes)),n+1}}return n}),0),t.chop()}transform(e,t=!1){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);const n=e,r=new a.default(this.ops),i=new a.default(n.ops),l=new u;for(;r.hasNext()||i.hasNext();)if("insert"!==r.peekType()||!t&&"insert"===i.peekType())if("insert"===i.peekType())l.push(i.next());else{const e=Math.min(r.peekLength(),i.peekLength()),n=r.next(e),o=i.next(e);if(n.delete)continue;if(o.delete)l.push(o);else{const r=n.retain,i=o.retain;let a="object"==typeof i&&null!==i?i:e;if("object"==typeof r&&null!==r&&"object"==typeof i&&null!==i){const e=Object.keys(r)[0];if(e===Object.keys(i)[0]){const n=u.getHandler(e);n&&(a={[e]:n.transform(r[e],i[e],t)})}}l.retain(a,s.default.transform(n.attributes,o.attributes,t))}}else l.retain(o.default.length(r.next()));return l.chop()}transformPosition(e,t=!1){t=!!t;const n=new a.default(this.ops);let r=0;for(;n.hasNext()&&r<=e;){const i=n.peekLength(),s=n.peekType();n.next(),"delete"!==s?("insert"===s&&(r"']/g,(e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e])))}class ip extends af{static allowedChildren=[ip,tp,df,np];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const n=ip.order.indexOf(e),r=ip.order.indexOf(t);return n>=0||r>=0?n-r:e===t?0:e0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}}let sp=class extends cf{cache={};delta(){return null==this.cache.delta&&(this.cache.delta=ap(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,$d.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(null!=n)return super.insertAt(e,t,n),void(this.cache={});if(0===t.length)return;const r=t.split("\n"),i=r.shift();i.length>0&&(e(s=s.split(e,!0),s.insertAt(0,t),t.length)),e+i.length)}insertBefore(e,t){const{head:n}=this.children;super.insertBefore(e,t),n instanceof tp&&n.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t&&(0===e||e>=this.length()-1)){const t=this.clone();return 0===e?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}const n=super.split(e,t);return this.cache={},n}};sp.blotName="block",sp.tagName="P",sp.defaultChild=tp,sp.allowedChildren=[tp,ip,df,np];let op=class extends df{attach(){super.attach(),this.attributes=new Qd(this.domNode)}delta(){return(new ep).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const n=this.scroll.query(e,$d.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(null!=n)return void super.insertAt(e,t,n);const r=t.split("\n"),i=r.pop(),s=r.map((e=>{const t=this.scroll.create(sp.blotName);return t.insertAt(0,e),t})),o=this.split(e);s.forEach((e=>{this.parent.insertBefore(e,o)})),i&&this.parent.insertBefore(this.scroll.create("text",i),o)}};function ap(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.descendants(ef).reduce(((e,n)=>0===n.length()?e:e.insert(n.value(),lp(n,{},t))),new ep).insert("\n",lp(e))}function lp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==e?t:("formats"in e&&"function"==typeof e.formats&&(t={...t,...e.formats()},n&&delete t["code-token"]),null==e.parent||"scroll"===e.parent.statics.blotName||e.parent.statics.scope!==e.statics.scope?t:lp(e.parent,t,n))}op.scope=$d.BLOCK_BLOT;class cp extends df{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,n){super(e,t),this.selection=n,this.textNode=document.createTextNode(cp.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(e,t){if(0!==this.savedLength)return void super.format(e,t);let n=this,r=0;for(;null!=n&&n.statics.scope!==$d.BLOCK_BLOT;)r+=n.offset(n.parent),n=n.parent;null!=n&&(this.savedLength=cp.CONTENTS.length,n.optimize(),n.formatAt(r,cp.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return null;const e=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof np?this.prev:null,n=t?t.length():0,r=this.next instanceof np?this.next:null,i=r?r.text:"",{textNode:s}=this,o=s.data.split(cp.CONTENTS).join("");let a;if(s.data=cp.CONTENTS,t)a=t,(o||r)&&(t.insertAt(t.length(),o+i),r&&r.remove());else if(r)a=r,r.insertAt(0,o);else{const e=document.createTextNode(o);a=this.scroll.create(e),this.parent.insertBefore(a,this)}if(this.remove(),e){const i=(e,i)=>t&&e===t.domNode?i:e===s?n+i-1:r&&e===r.domNode?n+o.length+i:null,l=i(e.start.node,e.start.offset),c=i(e.end.node,e.end.offset);if(null!==l&&null!==c)return{startNode:a.domNode,startOffset:l,endNode:a.domNode,endOffset:c}}return null}update(e,t){if(e.some((e=>"characterData"===e.type&&e.target===this.textNode))){const e=this.restore();e&&(t.range=e)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if("A"===t.domNode.tagName){this.savedLength=cp.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var up={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,r,s,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,s||e,o),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=new Array(s);i1?t-1:0),r=1;r(t[n]=pp.bind(console,n,e),t)),{})}gp.level=e=>{fp=e},pp.level=gp.level;const mp=gp("quill:events");["selectionchange","mousedown","mouseup","click"].forEach((e=>{document.addEventListener(e,(function(){for(var e=arguments.length,t=new Array(e),n=0;n{const n=hp.get(e);n&&n.emitter&&n.emitter.handleDOM(...t)}))}))}));class bp extends up{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",mp.error)}emit(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r{let{node:r,handler:i}=t;(e.target===r||r.contains(e.target))&&i(e,...n)}))}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}}const vp=gp("quill:selection");class yp{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=e,this.length=t}}class xp{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new yp(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,bp.sources.USER),1)})),this.emitter.on(bp.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const e=this.getNativeRange();null!=e&&e.start.node!==this.cursor.textNode&&this.emitter.once(bp.events.SCROLL_UPDATE,((t,n)=>{try{this.root.contains(e.start.node)&&this.root.contains(e.end.node)&&this.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset);const r=n.some((e=>"characterData"===e.type||"childList"===e.type||"attributes"===e.type&&e.target===this.root));this.update(r?bp.sources.SILENT:t)}catch(e){}}))})),this.emitter.on(bp.events.SCROLL_OPTIMIZE,((e,t)=>{if(t.range){const{startNode:e,startOffset:n,endNode:r,endOffset:i}=t.range;this.setNativeRange(e,n,r,i),this.update(bp.sources.SILENT)}})),this.update(bp.sources.SILENT)}handleComposition(){this.emitter.on(bp.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(bp.events.COMPOSITION_END,(()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout((()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(bp.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!this.scroll.query(e,$d.BLOCK)){if(n.start.node!==this.cursor.textNode){const e=this.scroll.find(n.start.node,!1);if(null==e)return;if(e instanceof ef){const t=e.split(n.start.offset);e.parent.insertBefore(this.cursor,t)}else e.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.scroll.length();let r;e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let[i,s]=this.scroll.leaf(e);if(null==i)return null;if(t>0&&s===i.length()){const[t]=this.scroll.leaf(e+1);if(t){const[n]=this.scroll.line(e),[r]=this.scroll.line(e+1);n===r&&(i=t,s=0)}}[r,s]=i.position(s,!0);const o=document.createRange();if(t>0)return o.setStart(r,s),[i,s]=this.scroll.leaf(e+t),null==i?null:([r,s]=i.position(s,!0),o.setEnd(r,s),o.getBoundingClientRect());let a,l="left";if(r instanceof Text){if(!r.data.length)return null;s0&&(l="right")}return{bottom:a.top+a.height,height:a.height,left:a[l],right:a[l],top:a.top,width:0}}getNativeRange(){const e=document.getSelection();if(null==e||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(null==t)return null;const n=this.normalizeNative(t);return vp.info("getNativeRange",n),n}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();if(null==t)return[null,null];return[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&wp(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const n=t.map((e=>{const[t,n]=e,r=this.scroll.find(t,!0),i=r.offset(this.scroll);return 0===n?i:r instanceof ef?i+r.index(t,n):i+r.length()})),r=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(r,...n);return new yp(i,r-i)}normalizeNative(e){if(!wp(this.root,e.startContainer)||!e.collapsed&&!wp(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((e=>{let{node:t,offset:n}=e;for(;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else{if(t.childNodes.length!==n)break;t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length>0?t.childNodes.length:t.childNodes.length+1}e.node=t,e.offset=n})),t}rangeToNative(e){const t=this.scroll.length(),n=(e,n)=>{e=Math.min(t-1,e);const[r,i]=this.scroll.leaf(e);return r?r.position(i,n):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(vp.info("setNativeRange",e,t,n,r),null!=e&&(null==this.root.parentNode||null==e.parentNode||null==n.parentNode))return;const s=document.getSelection();if(null!=s)if(null!=e){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(null==o||i||e!==o.startContainer||t!==o.startOffset||n!==o.endContainer||r!==o.endOffset){e instanceof Element&&"BR"===e.tagName&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&"BR"===n.tagName&&(r=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const i=document.createRange();i.setStart(e,t),i.setEnd(n,r),s.removeAllRanges(),s.addRange(i)}}else s.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:bp.sources.API;if("string"==typeof t&&(n=t,t=!1),vp.info("setRange",e),null!=e){const n=this.rangeToNative(e);this.setNativeRange(...n,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bp.sources.USER;const t=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,this.lastNative=r,null!=this.lastRange&&(this.savedRange=this.lastRange),!cc(t,this.lastRange)){if(!this.composing&&null!=r&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const e=this.cursor.restore();e&&this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}const n=[bp.events.SELECTION_CHANGE,no(this.lastRange),no(t),e];this.emitter.emit(bp.events.EDITOR_CHANGE,...n),e!==bp.sources.SILENT&&this.emitter.emit(...n)}}}function wp(e,t){try{t.parentNode}catch(e){return!1}return e.contains(t)}const _p=/^[ -~]*$/;class Ep{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const n=qp(e),r=new ep,i=function(e){const t=[];return e.forEach((e=>{if("string"==typeof e.insert){e.insert.split("\n").forEach(((n,r)=>{r&&t.push({insert:"\n",attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}))}else t.push(e)})),t}(n.ops.slice());return i.reduce(((e,n)=>{const i=wf.Op.length(n);let s=n.attributes||{},o=!1,a=!1;if(null!=n.insert){if(r.retain(i),"string"==typeof n.insert){const r=n.insert;a=!r.endsWith("\n")&&(t<=e||!!this.scroll.descendant(op,e)[0]),this.scroll.insertAt(e,r);const[i,o]=this.scroll.line(e);let l=Lc({},lp(i));if(i instanceof sp){const[e]=i.descendant(ef,o);e&&(l=Lc(l,lp(e)))}s=wf.AttributeMap.diff(l,s)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return e;const i=null!=this.scroll.query(r,$d.INLINE);if(i)(t<=e||this.scroll.descendant(op,e)[0])&&(a=!0);else if(e>0){const[t,n]=this.scroll.descendant(ef,e-1);if(t instanceof np){"\n"!==t.value()[n]&&(o=!0)}else t instanceof df&&t.statics.scope===$d.INLINE_BLOT&&(o=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),i){const[t]=this.scroll.descendant(ef,e);if(t){const e=Lc({},lp(t));s=wf.AttributeMap.diff(e,s)||{}}}}t+=i}else if(r.push(n),null!==n.retain&&"object"==typeof n.retain){const t=Object.keys(n.retain)[0];if(null==t)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(s).forEach((t=>{this.scroll.formatAt(e,i,t,s[t])}));const l=o?1:0,c=a?1:0;return t+=l+c,r.retain(l),r.delete(c),e+i+l+c}),0),r.reduce(((e,t)=>"number"==typeof t.delete?(this.scroll.deleteAt(e,t.delete),e):e+wf.Op.length(t)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new ep).retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach((r=>{this.scroll.lines(e,Math.max(t,1)).forEach((e=>{e.format(r,n[r])}))})),this.scroll.optimize();const r=(new ep).retain(e).retain(t,no(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(n).forEach((r=>{this.scroll.formatAt(e,t,r,n[r])}));const r=(new ep).retain(e).retain(t,no(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce(((e,t)=>e.concat(t.delta())),new ep)}getFormat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===t?this.scroll.path(e).forEach((e=>{const[t]=e;t instanceof sp?n.push(t):t instanceof ef&&r.push(t)})):(n=this.scroll.lines(e,t),r=this.scroll.descendants(ef,e,t));const[i,s]=[n,r].map((e=>{const t=e.shift();if(null==t)return{};let n=lp(t);for(;Object.keys(n).length>0;){const t=e.shift();if(null==t)return n;n=Ap(lp(t),n)}return n}));return{...i,...s}}getHTML(e,t){const[n,r]=this.scroll.line(e);if(n){const i=n.length();return!(n.length()>=r+t)||0===r&&t===i?kp(this.scroll,e,t,!0):kp(n,r,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter((e=>"string"==typeof e.insert)).map((e=>e.insert)).join("")}insertContents(e,t){const n=qp(t),r=(new ep).retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new ep).retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(n).forEach((r=>{this.scroll.formatAt(e,t.length,r,n[r])})),this.update((new ep).retain(e).insert(t,no(n)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==sp.blotName)return!1;const t=e;return!(t.children.length>1)&&t.children.head instanceof tp}removeFormat(e,t){const n=this.getText(e,t),[r,i]=this.scroll.line(e+t);let s=0,o=new ep;null!=r&&(s=r.length()-i,o=r.delta().slice(i,i+s-1).insert("\n"));const a=this.getContents(e,t+s).diff((new ep).insert(n).concat(o)),l=(new ep).retain(e).concat(a);return this.applyDelta(l)}update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const r=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(_p)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),s=lp(i),o=i.offset(this.scroll),a=t[0].oldValue.replace(cp.CONTENTS,""),l=(new ep).insert(a),c=(new ep).insert(i.value()),u=n&&{oldRange:Op(n.oldRange,-o),newRange:Op(n.newRange,-o)};e=(new ep).retain(o).concat(l.diff(c,u)).reduce(((e,t)=>t.insert?e.insert(t.insert,s):e.push(t)),new ep),this.delta=r.compose(e)}else this.delta=this.getDelta(),e&&cc(r.compose(e),this.delta)||(e=r.diff(this.delta,n));return e}}function Np(e,t,n){if(0===e.length){const[e]=Sp(n.pop());return t<=0?``:`${Np([],t-1,n)}`}const[{child:r,offset:i,length:s,indent:o,type:a},...l]=e,[c,u]=Sp(a);if(o>t)return n.push(a),o===t+1?`<${c}>${kp(r,i,s)}${Np(l,o,n)}`:`<${c}>
  • ${Np(e,t+1,n)}`;const h=n[n.length-1];if(o===t&&a===h)return`
  • ${kp(r,i,s)}${Np(l,o,n)}`;const[d]=Sp(n.pop());return`${Np(e,t-1,n)}`}function kp(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in e&&"function"==typeof e.html)return e.html(t,n);if(e instanceof np)return rp(e.value().slice(t,t+n));if(e instanceof sf){if("list-container"===e.statics.blotName){const r=[];return e.children.forEachAt(t,n,((e,t,n)=>{const i="formats"in e&&"function"==typeof e.formats?e.formats():{};r.push({child:e,offset:t,length:n,indent:i.indent||0,type:i.list})})),Np(r,-1,[])}const i=[];if(e.children.forEachAt(t,n,((e,t,n)=>{i.push(kp(e,t,n))})),r||"list"===e.statics.blotName)return i.join("");const{outerHTML:s,innerHTML:o}=e.domNode,[a,l]=s.split(`>${o}<`);return"${i.join("")}<${l}`:`${a}>${i.join("")}<${l}`}return e.domNode instanceof Element?e.domNode.outerHTML:""}function Ap(e,t){return Object.keys(t).reduce(((n,r)=>{if(null==e[r])return n;const i=t[r];return i===e[r]?n[r]=i:Array.isArray(i)?i.indexOf(e[r])<0?n[r]=i.concat([e[r]]):n[r]=i:n[r]=[i,e[r]],n}),{})}function Sp(e){const t="ordered"===e?"ol":"ul";switch(e){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function qp(e){return e.reduce(((e,t)=>{if("string"==typeof t.insert){const n=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(n,t.attributes)}return e.push(t)}),new ep)}function Op(e,t){let{index:n,length:r}=e;return new yp(n+t,r)}let Cp=class{static DEFAULTS={};constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=e,this.options=t}};const Tp="\ufeff";class Lp extends df{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((e=>{this.contentNode.appendChild(e)})),this.leftGuard=document.createTextNode(Tp),this.rightGuard=document.createTextNode(Tp),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t,n=null;const r=e.data.split(Tp).join("");if(e===this.leftGuard)if(this.prev instanceof np){const e=this.prev.length();this.prev.insertAt(e,r),n={startNode:this.prev.domNode,startOffset:e+r.length}}else t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this),n={startNode:t,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof np?(this.next.insertAt(0,r),n={startNode:this.next.domNode,startOffset:r.length}):(t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this.next),n={startNode:t,startOffset:r.length}));return e.data=Tp,n}update(e,t){e.forEach((e=>{if("characterData"===e.type&&(e.target===this.leftGuard||e.target===this.rightGuard)){const n=this.restore(e.target);n&&(t.range=n)}}))}}class Mp{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(e=>{this.isComposing||this.handleCompositionStart(e)})),this.scroll.domNode.addEventListener("compositionend",(e=>{this.isComposing&&queueMicrotask((()=>{this.handleCompositionEnd(e)}))}))}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;!t||t instanceof Lp||(this.emitter.emit(bp.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(bp.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(bp.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(bp.events.COMPOSITION_END,e),this.isComposing=!1}}class Rp{static DEFAULTS={modules:{}};static themes={default:Rp};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach((e=>{null==this.modules[e]&&this.addModule(e)}))}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const Ip=e=>{const t=e.getBoundingClientRect(),n="offsetWidth"in e&&Math.abs(t.width)/e.offsetWidth||1,r="offsetHeight"in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},jp=e=>{const t=parseInt(e,10);return Number.isNaN(t)?0:t},Bp=(e,t,n,r,i,s)=>er?0:er?t-e>r-n?e+i-n:t-r+s:0,Dp=["block","break","cursor","inline","scroll","text"],zp=gp("quill"),Up=new Wd;sf.uiClass="ql-ui";class $p{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Up,theme:"default"};static events=bp.events;static sources=bp.sources;static version="2.0.0-rc.5";static imports={delta:ep,parchment:vf,"core/module":Cp,"core/theme":Rp};static debug(e){!0===e&&(e="log"),gp.level(e)}static find(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return hp.get(e)||Up.find(e,t)}static import(e){return null==this.imports[e]&&zp.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e){const n="attrName"in e?e.attrName:e.blotName;"string"==typeof n?this.register(`formats/${n}`,e,t):Object.keys(e).forEach((n=>{this.register(n,e[n],t)}))}else null==this.imports[e]||n||zp.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&"boolean"!=typeof t&&"abstract"!==t.blotName&&Up.register(t),"function"==typeof t.register&&t.register(Up)}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(e,t){const n=Pp(e);if(!n)throw new Error("Invalid Quill container");const r=!t.theme||t.theme===$p.DEFAULTS.theme,i=r?Rp:$p.import(`themes/${t.theme}`);if(!i)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:s,...o}=$p.DEFAULTS,{modules:a,...l}=i.DEFAULTS,c=Lc({},Hp(s),Hp(a),Hp(t.modules));null!=c&&c.toolbar&&c.toolbar.constructor!==Object&&(c.toolbar={container:c.toolbar});const u={...o,...Fp(l),...Fp(t)};let h=t.registry;h?t.formats&&zp.warn('Ignoring "formats" option because "registry" is specified'):h=t.formats?((e,t,n)=>{const r=new Wd;return Dp.forEach((e=>{const n=t.query(e);n&&r.register(n)})),e.forEach((e=>{let i=t.query(e);i||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let s=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,s+=1,s>100){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}})),r})(t.formats,u.registry,zp):u.registry;return{...u,registry:h,container:n,theme:i,modules:Object.entries(c).reduce(((e,t)=>{let[n,r]=t;if(!r)return e;const i=$p.import(`modules/${n}`);return null==i?(zp.error(`Cannot load ${n} module. Are you sure you registered it?`),e):{...e,[n]:Lc({},i.DEFAULTS||{},r)}}),{}),bounds:Pp(u.bounds)}}(e,t),this.container=this.options.container,null==this.container)return void zp.error("Invalid Quill container",e);this.options.debug&&$p.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",hp.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new bp;const r=gf.blotName,i=this.options.registry.query(r);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${r}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Ep(this.scroll),this.selection=new xp(this.scroll,this.emitter),this.composition=new Mp(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(bp.events.EDITOR_CHANGE,(e=>{e===bp.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(bp.events.SCROLL_UPDATE,((e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),i=n&&r?{oldRange:n,newRange:r}:void 0;Wp.call(this,(()=>this.editor.update(null,t,i)),e)})),this.emitter.on(bp.events.SCROLL_EMBED_UPDATE,((e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),i=n&&r?{oldRange:n,newRange:r}:void 0;Wp.call(this,(()=>{const n=(new ep).retain(e.offset(this)).retain({[e.statics.blotName]:t});return this.editor.update(n,[],i)}),$p.sources.USER)})),n){const e=this.clipboard.convert({html:`${n}


    `,text:"\n"});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){const t=e;(e=document.createElement("div")).classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=Kp(e,t,n),Wp.call(this,(()=>this.editor.deleteText(e,t)),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:bp.sources.API;return Wp.call(this,(()=>{const n=this.getSelection(!0);let r=new ep;if(null==n)return r;if(this.scroll.query(e,$d.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else{if(0===n.length)return this.selection.format(e,t),r;r=this.editor.formatText(n.index,n.length,{[e]:t})}return this.setSelection(n,bp.sources.SILENT),r}),n)}formatLine(e,t,n,r,i){let s;return[e,t,s,i]=Kp(e,t,n,r,i),Wp.call(this,(()=>this.editor.formatLine(e,t,s)),i,e,0)}formatText(e,t,n,r,i){let s;return[e,t,s,i]=Kp(e,t,n,r,i),Wp.call(this,(()=>this.editor.formatText(e,t,s)),i,e,0)}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null;if(n="number"==typeof e?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e;return[e,t]=Kp(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=Kp(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=Kp(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$p.sources.API;return Wp.call(this,(()=>this.editor.insertEmbed(e,t,n)),r,e)}insertText(e,t,n,r,i){let s;return[e,,s,i]=Kp(e,0,n,r,i),Wp.call(this,(()=>this.editor.insertText(e,t,s)),i,e,t.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(e,t,n){return[e,t,,n]=Kp(e,t,n),Wp.call(this,(()=>this.editor.removeFormat(e,t)),n,e)}scrollRectIntoView(e){((e,t)=>{const n=e.ownerDocument;let r=t,i=e;for(;i;){const e=i===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:Ip(i),o=getComputedStyle(i),a=Bp(r.left,r.right,t.left,t.right,jp(o.scrollPaddingLeft),jp(o.scrollPaddingRight)),l=Bp(r.top,r.bottom,t.top,t.bottom,jp(o.scrollPaddingTop),jp(o.scrollPaddingBottom));if(a||l)if(e)n.defaultView?.scrollBy(a,l);else{const{scrollLeft:e,scrollTop:t}=i;l&&(i.scrollTop+=l),a&&(i.scrollLeft+=a);const n=i.scrollLeft-e,s=i.scrollTop-t;r={left:r.left-n,top:r.top-s,right:r.right-n,bottom:r.bottom-s}}i=e||"fixed"===o.position?null:(s=i).parentElement||s.getRootNode().host||null}var s})(this.root,e)}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 e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bp.sources.API;return Wp.call(this,(()=>{e=new ep(e);const t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(i)}),t)}setSelection(e,t,n){null==e?this.selection.setRange(null,t||$p.sources.API):([e,t,,n]=Kp(e,t,n),this.selection.setRange(new yp(Math.max(0,e),t),n),n!==bp.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bp.sources.API;const n=(new ep).insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bp.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bp.sources.API;return Wp.call(this,(()=>(e=new ep(e),this.editor.applyDelta(e))),t,!0)}}function Pp(e){return"string"==typeof e?document.querySelector(e):e}function Hp(e){return Object.entries(e??{}).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:!0===r?{}:r}}),{})}function Fp(e){return Object.fromEntries(Object.entries(e).filter((e=>void 0!==e[1])))}function Wp(e,t,n,r){if(!this.isEnabled()&&t===bp.sources.USER&&!this.allowReadOnlyEdits)return new ep;let i=null==n?null:this.getSelection();const s=this.editor.delta,o=e();if(null!=i&&(!0===n&&(n=i.index),null==r?i=Vp(i,o,t):0!==r&&(i=Vp(i,n,r,t)),this.setSelection(i,bp.sources.SILENT)),o.length()>0){const e=[bp.events.TEXT_CHANGE,o,s,t];this.emitter.emit(bp.events.EDITOR_CHANGE,...e),t!==bp.sources.SILENT&&this.emitter.emit(...e)}return o}function Kp(e,t,n,r,i){let s={};return"number"==typeof e.index&&"number"==typeof e.length?"number"!=typeof t?(i=r,r=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!=typeof t&&(i=r,r=n,n=t,t=0),"object"==typeof n?(s=n,i=r):"string"==typeof n&&(null!=r?s[n]=r:i=n),[e,t,s,i=i||bp.sources.API]}function Vp(e,t,n,r){const i="number"==typeof n?n:0;if(null==e)return null;let s,o;return t&&"function"==typeof t.transformPosition?[s,o]=[e.index,e.index+e.length].map((e=>t.transformPosition(e,r!==bp.sources.USER))):[s,o]=[e.index,e.index+e.length].map((e=>e=0?e+i:Math.max(t,e+i))),new yp(s,o-s)}let Gp=class extends hf{};function Zp(e){return e instanceof sp||e instanceof op}function Qp(e){return"function"==typeof e.updateContent}function Xp(e,t,n){n.reduce(((t,n)=>{const r=wf.Op.length(n);let i=n.attributes||{};if(null!=n.insert)if("string"==typeof n.insert){const r=n.insert;e.insertAt(t,r);const[s]=e.descendant(ef,t),o=lp(s);i=wf.AttributeMap.diff(o,i)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return t;e.insertAt(t,r,n.insert[r]);if(null!=e.scroll.query(r,$d.INLINE)){const[n]=e.descendant(ef,t),r=lp(n);i=wf.AttributeMap.diff(r,i)||{}}}return Object.keys(i).forEach((n=>{e.formatAt(t,r,n,i[n])})),t+r}),t)}const Yp={scope:$d.BLOCK,whitelist:["right","center","justify"]},Jp=new Pd("align","align",Yp),eg=new Vd("align","ql-align",Yp),tg=new Zd("align","text-align",Yp);class ng extends Zd{value(e){let t=super.value(e);if(!t.startsWith("rgb("))return t;t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");return`#${t.split(",").map((e=>`00${parseInt(e,10).toString(16)}`.slice(-2))).join("")}`}}const rg=new Vd("color","ql-color",{scope:$d.INLINE}),ig=new ng("color","color",{scope:$d.INLINE}),sg=new Vd("background","ql-bg",{scope:$d.INLINE}),og=new ng("background","background-color",{scope:$d.INLINE});class ag extends Gp{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map((e=>e.length()<=1?"":e.domNode.innerText)).join("\n").slice(e,e+t)}html(e,t){return`
    \n${rp(this.code(e,t))}\n
    `}}let lg=class extends sp{static TAB=" ";static register(){$p.register(ag)}};class cg extends ip{}cg.blotName="code",cg.tagName="CODE",lg.blotName="code-block",lg.className="ql-code-block",lg.tagName="DIV",ag.blotName="code-block-container",ag.className="ql-code-block-container",ag.tagName="DIV",ag.allowedChildren=[lg],lg.allowedChildren=[np,tp,cp],lg.requiredContainer=ag;const ug={scope:$d.BLOCK,whitelist:["rtl"]},hg=new Pd("direction","dir",ug),dg=new Vd("direction","ql-direction",ug),fg=new Zd("direction","direction",ug),pg={scope:$d.INLINE,whitelist:["serif","monospace"]},gg=new Vd("font","ql-font",pg);const mg=new class extends Zd{value(e){return super.value(e).replace(/["']/g,"")}}("font","font-family",pg),bg=new Vd("size","ql-size",{scope:$d.INLINE,whitelist:["small","large","huge"]}),vg=new Zd("size","font-size",{scope:$d.INLINE,whitelist:["10px","18px","32px"]}),yg=gp("quill:keyboard"),xg=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class wg extends Cp{static match(e,t){return!["altKey","ctrlKey","metaKey","shiftKey"].some((n=>!!t[n]!==e[n]&&null!==t[n]))&&(t.key===e.key||t.key===e.which)}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach((e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])})),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(e){if("string"==typeof e||"number"==typeof e)e={key:e};else{if("object"!=typeof e)return null;e=no(e)}e.shortKey&&(e[xg]=e.shortKey,delete e.shortKey);return e}(e);if(null==r)return void yg.warn("Attempted to add invalid keyboard binding",r);"function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n});(Array.isArray(r.key)?r.key:[r.key]).forEach((e=>{const i={...r,key:e,...t,...n};this.bindings[i.key]=this.bindings[i.key]||[],this.bindings[i.key].push(i)}))}listen(){this.quill.root.addEventListener("keydown",(e=>{if(e.defaultPrevented||e.isComposing)return;const t=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter((t=>wg.match(e,t)));if(0===t.length)return;const n=$p.find(e.target,!0);if(n&&n.scroll!==this.quill.scroll)return;const r=this.quill.getSelection();if(null==r||!this.quill.hasFocus())return;const[i,s]=this.quill.getLine(r.index),[o,a]=this.quill.getLeaf(r.index),[l,c]=0===r.length?[o,a]:this.quill.getLeaf(r.index+r.length),u=o instanceof bf?o.value().slice(0,a):"",h=l instanceof bf?l.value().slice(c):"",d={collapsed:0===r.length,empty:0===r.length&&i.length()<=1,format:this.quill.getFormat(r),line:i,offset:s,prefix:u,suffix:h,event:e};t.some((e=>{if(null!=e.collapsed&&e.collapsed!==d.collapsed)return!1;if(null!=e.empty&&e.empty!==d.empty)return!1;if(null!=e.offset&&e.offset!==d.offset)return!1;if(Array.isArray(e.format)){if(e.format.every((e=>null==d.format[e])))return!1}else if("object"==typeof e.format&&!Object.keys(e.format).every((t=>!0===e.format[t]?null!=d.format[t]:!1===e.format[t]?null==d.format[t]:cc(e.format[t],d.format[t]))))return!1;return!(null!=e.prefix&&!e.prefix.test(d.prefix))&&(!(null!=e.suffix&&!e.suffix.test(d.suffix))&&!0!==e.handler.call(this,r,d,e))}))&&e.preventDefault()}))}handleBackspace(e,t){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(0===e.index||this.quill.getLength()<=1)return;let r={};const[i]=this.quill.getLine(e.index);let s=(new ep).retain(e.index-n).delete(n);if(0===t.offset){const[t]=this.quill.getLine(e.index-1);if(t){if(!("block"===t.statics.blotName&&t.length()<=1)){const t=i.formats(),n=this.quill.getFormat(e.index-1,1);if(r=wf.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){const t=(new ep).retain(e.index+i.length()-2).retain(1,r);s=s.compose(t)}}}}this.quill.updateContents(s,$p.sources.USER),this.quill.focus()}handleDelete(e,t){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={};const[i]=this.quill.getLine(e.index);let s=(new ep).retain(e.index).delete(n);if(t.offset>=i.length()-1){const[t]=this.quill.getLine(e.index+1);if(t){const n=i.formats(),o=this.quill.getFormat(e.index,1);r=wf.AttributeMap.diff(n,o)||{},Object.keys(r).length>0&&(s=s.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(s,$p.sources.USER),this.quill.focus()}handleDeleteRange(e){Sg({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const n=Object.keys(t.format).reduce(((e,n)=>(this.quill.scroll.query(n,$d.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e)),{}),r=(new ep).retain(e.index).delete(e.length).insert("\n",n);this.quill.updateContents(r,$p.sources.USER),this.quill.setSelection(e.index+1,$p.sources.SILENT),this.quill.focus()}}const _g={bindings:{bold:kg("bold"),italic:kg("italic"),underline:kg("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","+1",$p.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","-1",$p.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(e,t){null!=t.format.indent?this.quill.format("indent","-1",$p.sources.USER):null!=t.format.list&&this.quill.format("list",!1,$p.sources.USER)}},"indent code-block":Eg(!0),"outdent code-block":Eg(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,$p.sources.USER)}},tab:{key:"Tab",handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();const n=(new ep).retain(e.index).delete(e.length).insert("\t");return this.quill.updateContents(n,$p.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,$p.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,$p.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(e,t){const n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,$p.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(e){const[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:"checked"},i=(new ep).retain(e.index).insert("\n",r).retain(t.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,$p.sources.USER),this.quill.setSelection(e.index+1,$p.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(e,t){const[n,r]=this.quill.getLine(e.index),i=(new ep).retain(e.index).insert("\n",t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,$p.sources.USER),this.quill.setSelection(e.index+1,$p.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(e){const t=this.quill.getModule("table");if(t){const[n,r,i,s]=t.getTable(e),o=function(e,t,n,r){if(null==t.prev&&null==t.next)return null==n.prev&&null==n.next?0===r?-1:1:null==n.prev?-1:1;if(null==t.prev)return-1;if(null==t.next)return 1;return null}(0,r,i,s);if(null==o)return;let a=n.offset();if(o<0){const t=(new ep).retain(a).insert("\n");this.quill.updateContents(t,$p.sources.USER),this.quill.setSelection(e.index+1,e.length,$p.sources.SILENT)}else if(o>0){a+=n.length();const e=(new ep).retain(a).insert("\n");this.quill.updateContents(e,$p.sources.USER),this.quill.setSelection(a,$p.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(e,t){const{event:n,line:r}=t,i=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(i-1,$p.sources.USER):this.quill.setSelection(i+r.length(),$p.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(null==this.quill.scroll.query("list"))return!0;const{length:n}=t.prefix,[r,i]=this.quill.getLine(e.index);if(i>n)return!0;let s;switch(t.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(e.index," ",$p.sources.USER),this.quill.history.cutoff();const o=(new ep).retain(e.index-i).delete(n+1).retain(r.length()-2-i).retain(1,{list:s});return this.quill.updateContents(o,$p.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,$p.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(e){const[t,n]=this.quill.getLine(e.index);let r=2,i=t;for(;null!=i&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,r-=1,r<=0){const r=(new ep).retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,$p.sources.USER),this.quill.setSelection(e.index-1,$p.sources.SILENT),!1}return!0}},"embed left":Ng("ArrowLeft",!1),"embed left shift":Ng("ArrowLeft",!0),"embed right":Ng("ArrowRight",!1),"embed right shift":Ng("ArrowRight",!0),"table down":Ag(!1),"table up":Ag(!0)}};function Eg(e){return{key:"Tab",shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n;const i=this.quill.scroll.query("code-block"),{TAB:s}=i;if(0===t.length&&!r.shiftKey)return this.quill.insertText(t.index,s,$p.sources.USER),void this.quill.setSelection(t.index+s.length,$p.sources.SILENT);const o=0===t.length?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:a,length:l}=t;o.forEach(((t,n)=>{e?(t.insertAt(0,s),0===n?a+=s.length:l+=s.length):t.domNode.textContent.startsWith(s)&&(t.deleteAt(0,s.length),0===n?a-=s.length:l-=s.length)})),this.quill.update($p.sources.USER),this.quill.setSelection(a,l,$p.sources.SILENT)}}}function Ng(e,t){const n="ArrowLeft"===e?"prefix":"suffix";return{key:e,shiftKey:t,altKey:null,[n]:/^$/,handler(n){let{index:r}=n;"ArrowRight"===e&&(r+=n.length+1);const[i]=this.quill.getLeaf(r);return!(i instanceof df)||("ArrowLeft"===e?t?this.quill.setSelection(n.index-1,n.length+1,$p.sources.USER):this.quill.setSelection(n.index-1,$p.sources.USER):t?this.quill.setSelection(n.index,n.length+1,$p.sources.USER):this.quill.setSelection(n.index+n.length+1,$p.sources.USER),!1)}}}function kg(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],$p.sources.USER)}}}function Ag(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,n){const r=e?"prev":"next",i=n.line,s=i.parent[r];if(null!=s){if("table-row"===s.statics.blotName){let e=s.children.head,t=i;for(;null!=t.prev;)t=t.prev,e=e.next;const r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,$p.sources.USER)}}else{const t=i.table()[r];null!=t&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,$p.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,$p.sources.USER))}return!1}}}function Sg(e){let{quill:t,range:n}=e;const r=t.getLines(n);let i={};if(r.length>1){const e=r[0].formats(),t=r[r.length-1].formats();i=wf.AttributeMap.diff(t,e)||{}}t.deleteText(n,$p.sources.USER),Object.keys(i).length>0&&t.formatLine(n.index,1,i,$p.sources.USER),t.setSelection(n.index,$p.sources.SILENT)}wg.DEFAULTS=_g;const qg=/font-weight:\s*normal/,Og=["P","OL","UL"],Cg=e=>e&&Og.includes(e.tagName);const Tg=/\bmso-list:[^;]*ignore/i,Lg=/\bmso-list:[^;]*\bl(\d+)/i,Mg=/\bmso-list:[^;]*\blevel(\d+)/i,Rg=e=>{const t=Array.from(e.querySelectorAll("[style*=mso-list]")),n=[],r=[];t.forEach((e=>{(e.getAttribute("style")||"").match(Tg)?n.push(e):r.push(e)})),n.forEach((e=>e.parentNode?.removeChild(e)));const i=e.documentElement.innerHTML,s=r.map((e=>((e,t)=>{const n=e.getAttribute("style"),r=n?.match(Lg);if(!r)return null;const i=Number(r[1]),s=n?.match(Mg),o=s?Number(s[1]):1,a=new RegExp(`@list l${i}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=t.match(a);return{id:i,indent:o,type:l&&"bullet"===l[1]?"bullet":"ordered",element:e}})(e,i))).filter((e=>e));for(;s.length;){const e=[];let t=s.shift();for(;t;)e.push(t),t=s.length&&s[0]?.element===t.element.nextElementSibling&&s[0].id===t.id?s.shift():null;const n=document.createElement("ul");e.forEach((e=>{const t=document.createElement("li");t.setAttribute("data-list",e.type),e.indent>1&&t.setAttribute("class","ql-indent-"+(e.indent-1)),t.innerHTML=e.element.innerHTML,n.appendChild(t)}));const r=e[0]?.element,{parentNode:i}=r??{};r&&i?.replaceChild(n,r),e.slice(1).forEach((e=>{let{element:t}=e;i?.removeChild(t)}))}};const Ig=[function(e){"urn:schemas-microsoft-com:office:word"===e.documentElement.getAttribute("xmlns:w")&&Rg(e)},function(e){e.querySelector('[id^="docs-internal-guid-"]')&&((e=>{Array.from(e.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(qg))).forEach((t=>{const n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)}))})(e),(e=>{Array.from(e.querySelectorAll("br")).filter((e=>Cg(e.previousElementSibling)&&Cg(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))})(e))}],jg=gp("quill:clipboard"),Bg=[[Node.TEXT_NODE,function(e,t,n){let r=e.data;if("O:P"===e.parentElement?.tagName)return t.insert(r.trim());if(!Fg(e)){if(0===r.trim().length&&r.includes("\n")&&!function(e,t){return e.previousElementSibling&&e.nextElementSibling&&!Pg(e.previousElementSibling,t)&&!Pg(e.nextElementSibling,t)}(e,n))return t;const i=(e,t)=>{const n=t.replace(/[^\u00a0]/g,"");return n.length<1&&e?" ":n};r=r.replace(/\r\n/g," ").replace(/\n/g," "),r=r.replace(/\s\s+/g,i.bind(i,!0)),(null==e.previousSibling&&null!=e.parentElement&&Pg(e.parentElement,n)||e.previousSibling instanceof Element&&Pg(e.previousSibling,n))&&(r=r.replace(/^\s+/,i.bind(i,!1))),(null==e.nextSibling&&null!=e.parentElement&&Pg(e.parentElement,n)||e.nextSibling instanceof Element&&Pg(e.nextSibling,n))&&(r=r.replace(/\s+$/,i.bind(i,!1)))}return t.insert(r)}],[Node.TEXT_NODE,Vg],["br",function(e,t){$g(t,"\n")||t.insert("\n");return t}],[Node.ELEMENT_NODE,Vg],[Node.ELEMENT_NODE,function(e,t,n){const r=n.query(e);if(null==r)return t;if(r.prototype instanceof df){const t={},i=r.value(e);if(null!=i)return t[r.blotName]=i,(new ep).insert(t,r.formats(e,n))}else if(r.prototype instanceof cf&&!$g(t,"\n")&&t.insert("\n"),"blotName"in r&&"formats"in r&&"function"==typeof r.formats)return Ug(t,r.blotName,r.formats(e,n),n);return t}],[Node.ELEMENT_NODE,function(e,t,n){const r=Pd.keys(e),i=Vd.keys(e),s=Zd.keys(e),o={};return r.concat(i).concat(s).forEach((t=>{let r=n.query(t,$d.ATTRIBUTE);null!=r&&(o[r.attrName]=r.value(e),o[r.attrName])||(r=Dg[t],null==r||r.attrName!==t&&r.keyName!==t||(o[r.attrName]=r.value(e)||void 0),r=zg[t],null==r||r.attrName!==t&&r.keyName!==t||(r=zg[t],o[r.attrName]=r.value(e)||void 0))})),Object.entries(o).reduce(((e,t)=>{let[r,i]=t;return Ug(e,r,i,n)}),t)}],[Node.ELEMENT_NODE,function(e,t,n){const r={},i=e.style||{};"italic"===i.fontStyle&&(r.italic=!0);"underline"===i.textDecoration&&(r.underline=!0);"line-through"===i.textDecoration&&(r.strike=!0);(i.fontWeight?.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0);if(t=Object.entries(r).reduce(((e,t)=>{let[r,i]=t;return Ug(e,r,i,n)}),t),parseFloat(i.textIndent||0)>0)return(new ep).insert("\t").concat(t);return t}],["li",function(e,t,n){const r=n.query(e);if(null==r||"list"!==r.blotName||!$g(t,"\n"))return t;let i=-1,s=e.parentNode;for(;null!=s;)["OL","UL"].includes(s.tagName)&&(i+=1),s=s.parentNode;return i<=0?t:t.reduce(((e,t)=>t.insert?t.attributes&&"number"==typeof t.attributes.indent?e.push(t):e.insert(t.insert,{indent:i,...t.attributes||{}}):e),new ep)}],["ol, ul",function(e,t,n){const r=e;let i="OL"===r.tagName?"ordered":"bullet";const s=r.getAttribute("data-checked");s&&(i="true"===s?"checked":"unchecked");return Ug(t,"list",i,n)}],["pre",function(e,t,n){const r=n.query("code-block"),i=!r||!("formats"in r)||"function"!=typeof r.formats||r.formats(e,n);return Ug(t,"code-block",i,n)}],["tr",function(e,t,n){const r="TABLE"===e.parentElement?.tagName?e.parentElement:e.parentElement?.parentElement;if(null!=r){return Ug(t,"table",Array.from(r.querySelectorAll("tr")).indexOf(e)+1,n)}return t}],["b",Kg("bold")],["i",Kg("italic")],["strike",Kg("strike")],["style",function(){return new ep}]],Dg=[Jp,hg].reduce(((e,t)=>(e[t.keyName]=t,e)),{}),zg=[tg,og,ig,fg,mg,vg].reduce(((e,t)=>(e[t.keyName]=t,e)),{});function Ug(e,t,n,r){return r.query(t)?e.reduce(((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);const i=n?{[t]:n}:{};return e.insert(r.insert,{...i,...r.attributes})}),new ep):e}function $g(e,t){let n="";for(let r=e.ops.length-1;r>=0&&n.lengthr(t,n,e)),new ep):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce(((s,o)=>{let a=Wg(e,o,n,r,i);return o.nodeType===t.ELEMENT_NODE&&(a=n.reduce(((t,n)=>n(o,t,e)),a),a=(i.get(o)||[]).reduce(((t,n)=>n(o,t,e)),a)),s.concat(a)}),new ep):new ep}function Kg(e){return(t,n,r)=>Ug(n,e,!0,r)}function Vg(e,t,n){if(!$g(t,"\n")){if(Pg(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert("\n");if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;null!=r;){if(Pg(r,n))return t.insert("\n");const e=n.query(r);if(e&&e.prototype instanceof op)return t.insert("\n");r=r.firstChild}}}return t}function Gg(e,t){let n=t;for(let t=e.length-1;t>=0;t-=1){const r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&Zg(r.range,n)},n=r.delta.transform(n),0===e[t].delta.length()&&e.splice(t,1)}}function Zg(e,t){if(!e)return e;const n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}class Qg extends Cp{constructor(e,t){super(e,t),e.root.addEventListener("drop",(t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){const e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}const r=n&&e.selection.normalizeNative(n);if(r){const n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}}))}upload(e,t){const n=[];Array.from(t).forEach((e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)})),n.length>0&&this.options.handler.call(this,e,n)}}Qg.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(e,t){const n=t.map((e=>new Promise((t=>{const n=new FileReader;n.onload=e=>{t(e.target.result)},n.readAsDataURL(e)}))));Promise.all(n).then((t=>{const n=t.reduce(((e,t)=>e.insert({image:t})),(new ep).retain(e.index).delete(e.length));this.quill.updateContents(n,bp.sources.USER),this.quill.setSelection(e.index+t.length,bp.sources.SILENT)}))}};const Xg=["insertText","insertReplacementText"];const Yg=/Mac/i.test(navigator.platform);$p.register({"blots/block":sp,"blots/block/embed":op,"blots/break":tp,"blots/container":Gp,"blots/cursor":cp,"blots/embed":Lp,"blots/inline":ip,"blots/scroll":class extends gf{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=sp;static allowedChildren=[sp,op,Gp];constructor(e,t,n){let{emitter:r}=n;super(e,t),this.emitter=r,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",(e=>this.handleDragStart(e)))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(bp.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(bp.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(bp.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[n,r]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),null!=i&&n!==i&&r>0){if(n instanceof op||i instanceof op)return void this.optimize();const e=i.children.head instanceof tp?null:i.children.head;n.moveChildren(i,e),n.remove()}this.optimize()}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(null==n||null==this.scroll.query(t,$d.BLOCK)){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e),null==n&&t.endsWith("\n")?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{const e=this.scroll.create(t,n);this.appendChild(e)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===$d.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){const n=this.deltaToRenderBlocks(t.concat((new ep).insert("\n"))),r=n.pop();if(null==r)return;this.batchStart();const i=n.shift();if(i){const t="block"===i.type&&(0===i.delta.length()||!this.descendant(op,e)[0]&&e{this.formatAt(s-1,1,e,a[e])})),e=s}let[s,o]=this.children.find(e);if(n.length&&(s&&(s=s.split(o),o=0),n.forEach((e=>{if("block"===e.type){Xp(this.createBlock(e.attributes,s||void 0),0,e.delta)}else{const t=this.create(e.key,e.value);this.insertBefore(t,s||void 0),Object.keys(e.attributes).forEach((n=>{t.format(n,e.attributes[n])}))}}))),"block"===r.type&&r.delta.length()){Xp(this,s?s.offset(s.scroll)+o:this.length(),r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[n,r]=t;return n instanceof ef?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Zp,e)}lines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const n=(e,t,r)=>{let i=[],s=r;return e.children.forEachAt(t,r,((e,t,r)=>{Zp(e)?i.push(e):e instanceof hf&&(i=i.concat(n(e,t,s))),s-=r})),i};return n(this,e,t)}optimize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(bp.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch)return void(Array.isArray(e)&&(this.batch=this.batch.concat(e)));let t=bp.sources.USER;"string"==typeof e&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),(e=e.filter((e=>{let{target:t}=e;const n=this.find(t,!0);return n&&!Qp(n)}))).length>0&&this.emitter.emit(bp.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(bp.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){const[r]=this.descendant((e=>e instanceof op),e);r&&r.statics.blotName===t&&Qp(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let n=new ep;return e.forEach((e=>{const r=e?.insert;if(r)if("string"==typeof r){const i=r.split("\n");i.slice(0,-1).forEach((r=>{n.insert(r,e.attributes),t.push({type:"block",delta:n,attributes:e.attributes??{}}),n=new ep}));const s=i[i.length-1];s&&n.insert(s,e.attributes)}else{const i=Object.keys(r)[0];if(!i)return;this.query(i,$d.INLINE)?n.push(e):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new ep,t.push({type:"blockEmbed",key:i,value:r[i],attributes:e.attributes??{}}))}})),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n;const r={};Object.entries(e).forEach((e=>{let[t,i]=e;null!=this.query(t,$d.BLOCK&$d.BLOT)?n=t:r[t]=i}));const i=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(i,t||void 0);const s=i.length();return Object.entries(r).forEach((e=>{let[t,n]=e;i.formatAt(0,s,t,n)})),i}},"blots/text":np,"modules/clipboard":class extends Cp{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",(e=>this.onCaptureCopy(e,!1))),this.quill.root.addEventListener("cut",(e=>this.onCaptureCopy(e,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Bg.concat(this.options.matchers??[]).forEach((e=>{let[t,n]=e;this.addMatcher(t,n)}))}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r[lg.blotName])return(new ep).insert(n||"",{[lg.blotName]:r[lg.blotName]});if(!t)return(new ep).insert(n||"",r);const i=this.convertHTML(t);return $g(i,"\n")&&(null==i.ops[i.ops.length-1].attributes||r.table)?i.compose((new ep).retain(i.length()-1).delete(1)):i}normalizeHTML(e){(e=>{e.documentElement&&Ig.forEach((t=>{t(e)}))})(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const n=t.body,r=new WeakMap,[i,s]=this.prepareMatching(n,r);return Wg(this.quill.scroll,n,i,s,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$p.sources.API;if("string"==typeof e){const n=this.convert({html:e,text:""});this.quill.setContents(n,t),this.quill.setSelection(0,$p.sources.SILENT)}else{const r=this.convert({html:t,text:""});this.quill.updateContents((new ep).retain(e).concat(r),n),this.quill.setSelection(e+r.length(),$p.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.defaultPrevented)return;e.preventDefault();const[n]=this.quill.selection.getRange();if(null==n)return;const{html:r,text:i}=this.onCopy(n,t);e.clipboardData?.setData("text/plain",i),e.clipboardData?.setData("text/html",r),t&&Sg({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter((e=>"#"!==e[0])).join("\n")}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(null==t)return;const n=e.clipboardData?.getData("text/html");let r=e.clipboardData?.getData("text/plain");if(!n&&!r){const t=e.clipboardData?.getData("text/uri-list");t&&(r=this.normalizeURIList(t))}const i=Array.from(e.clipboardData?.files||[]);if(!n&&i.length>0)this.quill.uploader.upload(t,i);else{if(n&&i.length>0){const e=(new DOMParser).parseFromString(n,"text/html");if(1===e.body.childElementCount&&"IMG"===e.body.firstElementChild?.tagName)return void this.quill.uploader.upload(t,i)}this.onPaste(t,{html:n,text:r})}}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t;const i=this.quill.getFormat(e.index),s=this.convert({text:n,html:r},i);jg.log("onPaste",s,{text:n,html:r});const o=(new ep).retain(e.index).delete(e.length).concat(s);this.quill.updateContents(o,$p.sources.USER),this.quill.setSelection(o.length()-e.length,$p.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const n=[],r=[];return this.matchers.forEach((i=>{const[s,o]=i;switch(s){case Node.TEXT_NODE:r.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(e.querySelectorAll(s)).forEach((e=>{if(t.has(e)){const n=t.get(e);n?.push(o)}else t.set(e,[o])}))}})),[n,r]}},"modules/history":class extends Cp{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on($p.events.EDITOR_CHANGE,((e,t,n,r)=>{e===$p.events.SELECTION_CHANGE?t&&r!==$p.sources.SILENT&&(this.currentRange=t):e===$p.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&r!==$p.sources.USER?this.transform(t):this.record(t,n)),this.currentRange=Zg(this.currentRange,t))})),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",(e=>{"historyUndo"===e.inputType?(this.undo(),e.preventDefault()):"historyRedo"===e.inputType&&(this.redo(),e.preventDefault())}))}change(e,t){if(0===this.stack[e].length)return;const n=this.stack[e].pop();if(!n)return;const r=this.quill.getContents(),i=n.delta.invert(r);this.stack[t].push({delta:i,range:Zg(n.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,$p.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(0===e.ops.length)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=i;0!==n.length()&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Gg(this.stack.undo,e),Gg(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,$p.sources.USER);else{const t=function(e,t){const n=t.reduce(((e,t)=>e+(t.delete||0)),0);let r=t.length()-n;(function(e,t){const n=t.ops[t.ops.length-1];if(null==n)return!1;if(null!=n.insert)return"string"==typeof n.insert&&n.insert.endsWith("\n");if(null!=n.attributes)return Object.keys(n.attributes).some((t=>null!=e.query(t,$d.BLOCK)));return!1})(e,t)&&(r-=1);return r}(this.quill.scroll,e.delta);this.quill.setSelection(t,$p.sources.USER)}}},"modules/keyboard":wg,"modules/uploader":Qg,"modules/input":class extends Cp{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(e=>{this.handleBeforeInput(e)})),/Android/i.test(navigator.userAgent)||e.on($p.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){Sg({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===e.length)return!1;if(t){const n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new ep).retain(e.index).insert(t,n),$p.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,$p.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Xg.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||!0===t.collapsed)return;const n=function(e){if("string"==typeof e.data)return e.data;if(e.dataTransfer?.types.includes("text/plain"))return e.dataTransfer.getData("text/plain");return null}(e);if(null==n)return;const r=this.quill.selection.normalizeNative(t),i=r?this.quill.selection.normalizedToRange(r):null;i&&this.replaceText(i,n)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}},"modules/uiNode":class extends Cp{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof sf&&n.uiNode))return!0;const i="rtl"===getComputedStyle(n.domNode).direction;return!!(i&&"ArrowRight"!==r.key||!i&&"ArrowLeft"!==r.key)||(this.quill.setSelection(e.index-1,e.length+(r.shiftKey?1:0),$p.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&(e=>"ArrowLeft"===e.key||"ArrowRight"===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key||"Home"===e.key||!(!Yg||"a"!==e.key||!0!==e.ctrlKey))(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+100,this.isListening)return;this.isListening=!0;document.addEventListener("selectionchange",(()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()}),{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(!0!==t.collapsed||0!==t.startOffset)return;const n=this.quill.scroll.find(t.startContainer);if(!(n instanceof sf&&n.uiNode))return;const r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}}});const Jg=new class extends Vd{add(e,t){let n=0;if("+1"===t||"-1"===t){const r=this.value(e)||0;n="+1"===t?r+1:r-1}else"number"==typeof t&&(n=t);return 0===n?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}("indent","ql-indent",{scope:$d.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class em extends Gp{}em.blotName="list-container",em.tagName="OL";let tm=class extends sp{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){$p.register(em)}constructor(e,t){super(e,t);const n=t.ownerDocument.createElement("span"),r=n=>{if(!e.isEnabled())return;const r=this.statics.formats(t,e);"checked"===r?(this.format("list","unchecked"),n.preventDefault()):"unchecked"===r&&(this.format("list","checked"),n.preventDefault())};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}};tm.blotName="list",tm.tagName="LI",em.allowedChildren=[tm],tm.requiredContainer=em;class nm extends ip{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}class rm extends ip{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return im(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("href",this.constructor.sanitize(t)):super.format(e,t)}}function im(e,t){const n=document.createElement("a");n.href=e;const r=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(r)>-1}const sm=["alt","height","width"];const om=["height","width"];const am=new Vd("code-token","hljs",{scope:$d.INLINE});class lm extends ip{static formats(e,t){for(;null!=e&&e!==t.domNode;){if(e.classList&&e.classList.contains(lg.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),am.add(this.domNode,n)}format(e,t){e!==lm.blotName?super.format(e,t):t?am.add(this.domNode,t):(am.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),am.value(this.domNode)||this.unwrap()}}lm.blotName="code-token",lm.className="ql-token";class cm extends lg{static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),lm.blotName,!1),super.replaceWith(e,t)}}class um extends ag{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===cm.blotName&&(this.forceNext=!0,this.children.forEach((n=>{n.format(e,t)})))}formatAt(e,t,n,r){n===cm.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,r)}highlight(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const n=`${Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).map((e=>e.textContent)).join("\n")}\n`,r=cm.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||null==this.cachedText){const t=this.children.reduce(((e,t)=>e.concat(ap(t,!1))),new ep),i=e(n,r);t.diff(i).reduce(((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach((t=>{[cm.blotName,lm.blotName].includes(t)&&this.formatAt(e,n,t,r[t])})),e+n):e}),0)}this.cachedText=n,this.forceNext=!1}}html(e,t){const[n]=this.children.find(e);return`
    \n${rp(this.code(e,t))}\n
    `}optimize(e){if(super.optimize(e),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const e=cm.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}um.allowedChildren=[cm],cm.requiredContainer=um,cm.allowedChildren=[lm,cp,np,tp];class hm extends Cp{static register(){$p.register(lm,!0),$p.register(cm,!0),$p.register(um,!0)}constructor(e,t){if(super(e,t),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((e,t)=>{let{key:n}=t;return e[n]=!0,e}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on($p.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof um))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((e=>{let{key:n,label:r}=e;const i=t.ownerDocument.createElement("option");i.textContent=r,i.setAttribute("value",n),t.appendChild(i)})),t.addEventListener("change",(()=>{e.format(cm.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),null==e.uiNode&&(e.attachUI(t),e.children.head&&(t.value=cm.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on($p.events.SCROLL_OPTIMIZE,(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.highlight(),e=null}),this.options.interval)}))}highlight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update($p.sources.USER);const n=this.quill.getSelection();(null==e?this.quill.scroll.descendants(um):[e]).forEach((e=>{e.highlight(this.highlightBlot,t)})),this.quill.update($p.sources.SILENT),null!=n&&this.quill.setSelection(n,$p.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(t=this.languages[t]?t:"plain","plain"===t)return rp(e).split("\n").reduce(((e,n,r)=>(0!==r&&e.insert("\n",{[lg.blotName]:t}),e.insert(n))),new ep);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(lg.className),n.innerHTML=((e,t,n)=>{if("string"==typeof e.versionString){const r=e.versionString.split(".")[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value})(this.options.hljs,t,e),Wg(this.quill.scroll,n,[(e,t)=>{const n=am.value(e);return n?t.compose((new ep).retain(t.length(),{[lm.blotName]:n})):t}],[(e,n)=>e.data.split("\n").reduce(((e,n,r)=>(0!==r&&e.insert("\n",{[lg.blotName]:t}),e.insert(n))),n)],new WeakMap)}}hm.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"}]};let dm=class e extends sp{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",mm()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,n){t===e.blotName&&n?this.domNode.setAttribute("data-row",n):super.format(t,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}},fm=class extends Gp{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach((e=>{if(null==e.next)return;const t=e.formats(),n=e.next.formats();if(t.table!==n.table){const t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}}))}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}},pm=class extends Gp{static blotName="table-body";static tagName="TBODY"},gm=class extends Gp{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(fm),t=e.reduce(((e,t)=>Math.max(t.children.length,e)),0);e.forEach((e=>{new Array(t-e.children.length).fill(0).forEach((()=>{let t;null!=e.children.head&&(t=dm.formats(e.children.head.domNode));const n=this.scroll.create(dm.blotName,t);e.appendChild(n),n.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(pm);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const n=t.children.at(e);null!=n&&n.remove()}))}insertColumn(e){const[t]=this.descendant(pm);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const n=t.children.at(e),r=dm.formats(t.children.head.domNode),i=this.scroll.create(dm.blotName,r);t.insertBefore(i,n)}))}insertRow(e){const[t]=this.descendant(pm);if(null==t||null==t.children.head)return;const n=mm(),r=this.scroll.create(fm.blotName);t.children.head.children.forEach((()=>{const e=this.scroll.create(dm.blotName,n);r.appendChild(e)}));const i=t.children.at(e);t.insertBefore(r,i)}rows(){const e=this.children.head;return null==e?[]:e.children.map((e=>e))}};function mm(){return`row-${Math.random().toString(36).slice(2,6)}`}gm.allowedChildren=[pm],pm.requiredContainer=gm,pm.allowedChildren=[fm],fm.requiredContainer=pm,fm.allowedChildren=[dm],dm.requiredContainer=fm;const bm=gp("quill:toolbar");let vm=class extends Cp{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const t=document.createElement("div");t.setAttribute("role","toolbar"),function(e,t){Array.isArray(t[0])||(t=[t]);t.forEach((t=>{const n=document.createElement("span");n.classList.add("ql-formats"),t.forEach((e=>{if("string"==typeof e)ym(n,e);else{const t=Object.keys(e)[0],r=e[t];Array.isArray(r)?function(e,t,n){const r=document.createElement("select");r.classList.add(`ql-${t}`),n.forEach((e=>{const t=document.createElement("option");!1!==e?t.setAttribute("value",String(e)):t.setAttribute("selected","selected"),r.appendChild(t)})),e.appendChild(r)}(n,t,r):ym(n,t,r)}})),e.appendChild(n)}))}(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((e=>{const t=this.options.handlers?.[e];t&&this.addHandler(e,t)})),Array.from(this.container.querySelectorAll("button, select")).forEach((e=>{this.attach(e)})),this.quill.on($p.events.EDITOR_CHANGE,(()=>{const[e]=this.quill.selection.getRange();this.update(e)}))):bm.error("Container required for toolbar",this.options)}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find((e=>0===e.indexOf("ql-")));if(!t)return;if(t=t.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[t]&&null==this.quill.scroll.query(t))return void bm.warn("ignoring attaching to nonexistent format",t,e);const n="SELECT"===e.tagName?"change":"click";e.addEventListener(n,(n=>{let r;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;const t=e.options[e.selectedIndex];r=!t.hasAttribute("selected")&&(t.value||!1)}else r=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),n.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(null!=this.handlers[t])this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof df){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents((new ep).retain(i.index).delete(i.length).insert({[t]:r}),$p.sources.USER)}else this.quill.format(t,r,$p.sources.USER);this.update(i)})),this.controls.push([t,e])}update(e){const t=null==e?{}:this.quill.getFormat(e);this.controls.forEach((n=>{const[r,i]=n;if("SELECT"===i.tagName){let n=null;if(null==e)n=null;else if(null==t[r])n=i.querySelector("option[selected]");else if(!Array.isArray(t[r])){let e=t[r];"string"==typeof e&&(e=e.replace(/"/g,'\\"')),n=i.querySelector(`option[value="${e}"]`)}null==n?(i.value="",i.selectedIndex=-1):n.selected=!0}else if(null==e)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const e=t[r],n=e===i.getAttribute("value")||null!=e&&e.toString()===i.getAttribute("value")||null==e&&!i.getAttribute("value");i.classList.toggle("ql-active",n),i.setAttribute("aria-pressed",n.toString())}else{const e=null!=t[r];i.classList.toggle("ql-active",e),i.setAttribute("aria-pressed",e.toString())}}))}};function ym(e,t,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),null!=n?(r.value=n,r.setAttribute("aria-label",`${t}: ${n}`)):r.setAttribute("aria-label",t),e.appendChild(r)}vm.DEFAULTS={},vm.DEFAULTS={container:null,handlers:{clean(){const e=this.quill.getSelection();if(null!=e)if(0===e.length){const e=this.quill.getFormat();Object.keys(e).forEach((e=>{null!=this.quill.scroll.query(e,$d.INLINE)&&this.quill.format(e,!1,$p.sources.USER)}))}else this.quill.removeFormat(e,$p.sources.USER)},direction(e){const{align:t}=this.quill.getFormat();"rtl"===e&&null==t?this.quill.format("align","right",$p.sources.USER):e||"right"!==t||this.quill.format("align",!1,$p.sources.USER),this.quill.format("direction",e,$p.sources.USER)},indent(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if("+1"===e||"-1"===e){let t="+1"===e?1:-1;"rtl"===n.direction&&(t*=-1),this.quill.format("indent",r+t,$p.sources.USER)}},link(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,$p.sources.USER)},list(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t);"check"===e?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,$p.sources.USER):this.quill.format("list","unchecked",$p.sources.USER):this.quill.format("list",e,$p.sources.USER)}}};const xm='';var wm={align:{"":'',center:'',right:'',justify:''},background:'',blockquote:'',bold:'',clean:'',code:xm,"code-block":xm,color:'',direction:{"":'',rtl:''},formula:'',header:{1:'',2:''},italic:'',image:'',indent:{"+1":'',"-1":''},link:'',list:{bullet:'',check:'',ordered:''},script:{sub:'',super:''},strike:'',table:'',underline:'',video:''};let _m=0;function Em(e,t){e.setAttribute(t,`${!("true"===e.getAttribute(t))}`)}class Nm{constructor(e){this.select=e,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",(e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault()}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Em(this.label,"aria-expanded"),Em(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const n=e.getAttribute("value");return n&&t.setAttribute("data-value",n),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",(()=>{this.selectItem(t,!0)})),t.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.selectItem(t,!0),e.preventDefault();break;case"Escape":this.escape(),e.preventDefault()}})),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML='',e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${_m}`,_m+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach((t=>{const n=this.buildItem(t);e.appendChild(n),!0===t.selected&&this.selectItem(n)})),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach((e=>{this.container.setAttribute(e.name,e.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(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.container.querySelector(".ql-selected");e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);const t=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class km extends Nm{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((e=>{e.classList.add("ql-primary")}))}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const n=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";n&&("line"===n.tagName?n.style.stroke=r:n.style.fill=r)}}class Am extends Nm{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((e=>{e.innerHTML=t[e.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const n=e||this.defaultItem;if(null!=n){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}class Sm{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(e=>{const{overflowY:t}=getComputedStyle(e,null);return"visible"!==t&&"clip"!==t})(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(e){const t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const r=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let s=0;if(i.right>r.right&&(s=r.right-i.right,this.root.style.left=`${t+s}px`),i.leftr.bottom){const t=i.bottom-i.top,r=e.bottom-e.top+t;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 qm=[!1,"center","right","justify"],Om=["#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"],Cm=[!1,"serif","monospace"],Tm=["1","2","3",!1],Lm=["small",!1,"large","huge"];class Mm extends Rp{constructor(e,t){super(e,t);const n=t=>{document.body.contains(e.root)?(null==this.tooltip||this.tooltip.root.contains(t.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach((e=>{e.container.contains(t.target)||e.close()}))):document.body.removeEventListener("click",n)};e.emitter.listenDOM("click",document.body,n)}addModule(e){const t=super.addModule(e);return"toolbar"===e&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach((e=>{(e.getAttribute("class")||"").split(/\s+/).forEach((n=>{if(n.startsWith("ql-")&&(n=n.slice(3),null!=t[n]))if("direction"===n)e.innerHTML=t[n][""]+t[n].rtl;else if("string"==typeof t[n])e.innerHTML=t[n];else{const r=e.value||"";null!=r&&t[n][r]&&(e.innerHTML=t[n][r])}}))}))}buildPickers(e,t){this.pickers=Array.from(e).map((e=>{if(e.classList.contains("ql-align")&&(null==e.querySelector("option")&&Im(e,qm),"object"==typeof t.align))return new Am(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){const n=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&Im(e,Om,"background"===n?"#ffffff":"#000000"),new km(e,t[n])}return null==e.querySelector("option")&&(e.classList.contains("ql-font")?Im(e,Cm):e.classList.contains("ql-header")?Im(e,Tm):e.classList.contains("ql-size")&&Im(e,Lm)),new Nm(e)}));this.quill.on(bp.events.EDITOR_CHANGE,(()=>{this.pickers.forEach((e=>{e.update()}))}))}}Mm.DEFAULTS=Lc({},Rp.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");null==e&&(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",(()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""})),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Rm extends Sm{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(e=>{"Enter"===e.key?(this.save(),e.preventDefault()):"Escape"===e.key&&(this.cancel(),e.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);null!=n&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,bp.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,bp.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=function(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(t)return`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`;if(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`;return e}(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(null!=t){const n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,bp.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(n+1," ",bp.sources.USER),this.quill.setSelection(n+2,bp.sources.USER)}break}}this.textbox.value="",this.hide()}}function Im(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach((t=>{const r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",String(t)),e.appendChild(r)}))}const jm=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Bm extends Rm{static TEMPLATE=['','
    ','','',"
    "].join("");constructor(e,t){super(e,t),this.quill.on(bp.events.EDITOR_CHANGE,((e,t,n,r)=>{if(e===bp.events.SELECTION_CHANGE)if(null!=t&&t.length>0&&r===bp.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const e=this.quill.getLines(t.index,t.length);if(1===e.length){const e=this.quill.getBounds(t);null!=e&&this.position(e)}else{const n=e[e.length-1],r=this.quill.getIndex(n),i=Math.min(n.length()-1,t.index+t.length-r),s=this.quill.getBounds(new yp(r,i));null!=s&&this.position(s)}}else 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(bp.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(null!=e){const t=this.quill.getBounds(e);null!=t&&this.position(t)}}),1)}))}cancel(){this.show()}position(e){const t=super.position(e),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",0!==t&&(n.style.marginLeft=-1*t-n.offsetWidth/2+"px"),t}}class Dm extends Mm{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=jm),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Bm(this.quill,this.options.bounds),null!=e.container&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),wm),this.buildPickers(e.container.querySelectorAll("select"),wm))}}Dm.DEFAULTS=Lc({},Mm.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});const zm=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Um extends Rm{static TEMPLATE=['','','',''].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",(e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(e=>{if(null!=this.linkRange){const e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,bp.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(bp.events.SELECTION_CHANGE,((e,t,n)=>{if(null!=e){if(0===e.length&&n===bp.sources.USER){const[t,n]=this.quill.scroll.descendant(rm,e.index);if(null!=t){this.linkRange=new yp(e.index-n,t.length());const r=rm.formats(t.domNode);this.preview.textContent=r,this.preview.setAttribute("href",r),this.show();const i=this.quill.getBounds(this.linkRange);return void(null!=i&&this.position(i))}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class $m extends Mm{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=zm),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){null!=e.container&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),wm),this.buildPickers(e.container.querySelectorAll("select"),wm),this.tooltip=new Um(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((t,n)=>{e.handlers.link.call(e,!n.format.link)})))}}$m.DEFAULTS=Lc({},Mm.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){const e=this.quill.getSelection();if(null==e||0===e.length)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&0!==t.indexOf("mailto:")&&(t=`mailto:${t}`);const{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1)}}}}}),$p.register({"attributors/attribute/direction":hg,"attributors/class/align":eg,"attributors/class/background":sg,"attributors/class/color":rg,"attributors/class/direction":dg,"attributors/class/font":gg,"attributors/class/size":bg,"attributors/style/align":tg,"attributors/style/background":og,"attributors/style/color":ig,"attributors/style/direction":fg,"attributors/style/font":mg,"attributors/style/size":vg},!0),$p.register({"formats/align":eg,"formats/direction":dg,"formats/indent":Jg,"formats/background":og,"formats/color":ig,"formats/font":gg,"formats/size":bg,"formats/blockquote":class extends sp{static blotName="blockquote";static tagName="blockquote"},"formats/code-block":lg,"formats/header":class extends sp{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}},"formats/list":tm,"formats/bold":nm,"formats/code":cg,"formats/italic":class extends nm{static blotName="italic";static tagName=["EM","I"]},"formats/link":rm,"formats/script":class extends ip{static blotName="script";static tagName=["SUB","SUP"];static create(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):super.create(e)}static formats(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}},"formats/strike":class extends nm{static blotName="strike";static tagName=["S","STRIKE"]},"formats/underline":class extends ip{static blotName="underline";static tagName="U"},"formats/formula":class extends Lp{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return"string"==typeof e&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`${e}`}},"formats/image":class extends df{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return sm.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return im(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){sm.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},"formats/video":class extends op{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return om.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),{})}static sanitize(e){return rm.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){om.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`${e}`}},"modules/syntax":hm,"modules/table":class extends Cp{static register(){$p.register(dm),$p.register(fm),$p.register(pm),$p.register(gm)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(gm).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();null!=t&&(e.deleteColumn(t.cellOffset()),this.quill.update($p.sources.USER))}deleteRow(){const[,e]=this.getTable();null!=e&&(e.remove(),this.quill.update($p.sources.USER))}deleteTable(){const[e]=this.getTable();if(null==e)return;const t=e.offset();e.remove(),this.quill.update($p.sources.USER),this.quill.setSelection(t,$p.sources.SILENT)}getTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==e)return[null,null,null,-1];const[t,n]=this.quill.getLine(e.index);if(null==t||t.statics.blotName!==dm.blotName)return[null,null,null,-1];const r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[n,r,i]=this.getTable(t);if(null==i)return;const s=i.cellOffset();n.insertColumn(s+e),this.quill.update($p.sources.USER);let o=r.rowOffset();0===e&&(o+=1),this.quill.setSelection(t.index+o,t.length,$p.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[n,r,i]=this.getTable(t);if(null==i)return;const s=r.rowOffset();n.insertRow(s+e),this.quill.update($p.sources.USER),e>0?this.quill.setSelection(t,$p.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,$p.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const n=this.quill.getSelection();if(null==n)return;const r=new Array(e).fill(0).reduce((e=>{const n=new Array(t).fill("\n").join("");return e.insert(n,{table:mm()})}),(new ep).retain(n.index));this.quill.updateContents(r,$p.sources.USER),this.quill.setSelection(n.index,$p.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on($p.events.SCROLL_OPTIMIZE,(e=>{e.some((e=>!!["TD","TR","TBODY","TABLE"].includes(e.target.tagName)&&(this.quill.once($p.events.TEXT_CHANGE,((e,t,n)=>{n===$p.sources.USER&&this.balanceTables()})),!0)))}))}},"modules/toolbar":vm,"themes/bubble":Dm,"themes/snow":$m,"ui/icons":wm,"ui/picker":Nm,"ui/icon-picker":Am,"ui/color-picker":km,"ui/tooltip":Sm},!0);var Pm=-1,Hm=1,Fm=0;function Wm(e,t,n,r){if(e===t)return e?[[Fm,e]]:[];if(null!=n){var i=function(e,t,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,i="number"==typeof n?null:n.newRange,s=e.length,o=t.length;if(0===r.length&&(null===i||0===i.length)){var a=r.index,l=e.slice(0,a),c=e.slice(a),u=i?i.index:null,h=a+o-s;if((null===u||u===h)&&!(h<0||h>o)){var d=t.slice(0,h);if((g=t.slice(h))===c){var f=Math.min(a,h);if((b=l.slice(0,f))===(y=d.slice(0,f)))return eb(b,l.slice(f),d.slice(f),c)}}if(null===u||u===a){var p=a,g=(d=t.slice(0,p),t.slice(p));if(d===l){var m=Math.min(s-p,o-p);if((v=c.slice(c.length-m))===(x=g.slice(g.length-m)))return eb(l,c.slice(0,c.length-m),g.slice(0,g.length-m),v)}}}if(r.length>0&&i&&0===i.length){var b=e.slice(0,r.index),v=e.slice(r.index+r.length);if(!(o<(f=b.length)+(m=v.length))){var y=t.slice(0,f),x=t.slice(o-m);if(b===y&&v===x)return eb(b,e.slice(f,s-m),t.slice(f,o-m),v)}}return null}(e,t,n);if(i)return i}var s=Vm(e,t),o=e.substring(0,s);s=Gm(e=e.substring(s),t=t.substring(s));var a=e.substring(e.length-s),l=function(e,t){var n;if(!e)return[[Hm,t]];if(!t)return[[Pm,e]];var r=e.length>t.length?e:t,i=e.length>t.length?t:e,s=r.indexOf(i);if(-1!==s)return n=[[Hm,r.substring(0,s)],[Fm,i],[Hm,r.substring(s+i.length)]],e.length>t.length&&(n[0][0]=n[2][0]=Pm),n;if(1===i.length)return[[Pm,e],[Hm,t]];var o=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,i,s,o,c]:null}var s,o,a,l,c,u=i(n,r,Math.ceil(n.length/4)),h=i(n,r,Math.ceil(n.length/2));if(!u&&!h)return null;s=h?u&&u[4].length>h[4].length?u:h:u;e.length>t.length?(o=s[0],a=s[1],l=s[2],c=s[3]):(l=s[0],c=s[1],o=s[2],a=s[3]);var d=s[4];return[o,a,l,c,d]}(e,t);if(o){var a=o[0],l=o[1],c=o[2],u=o[3],h=o[4],d=Wm(a,c),f=Wm(l,u);return d.concat([[Fm,h]],f)}return function(e,t){for(var n=e.length,r=t.length,i=Math.ceil((n+r)/2),s=i,o=2*i,a=new Array(o),l=new Array(o),c=0;cn)f+=2;else if(y>r)d+=2;else if(h){if((_=s+u-b)>=0&&_=(w=n-l[_]))return Km(e,t,N,y)}}for(var x=-m+p;x<=m-g;x+=2){for(var w,_=s+x,E=(w=x===-m||x!==m&&l[_-1]n)g+=2;else if(E>r)p+=2;else if(!h){if((v=s+u-x)>=0&&v=(w=n-w))return Km(e,t,N,y)}}}}return[[Pm,e],[Hm,t]]}(e,t)}(e=e.substring(0,e.length-s),t=t.substring(0,t.length-s));return o&&l.unshift([Fm,o]),a&&l.push([Fm,a]),Zm(l,r),l}function Km(e,t,n,r){var i=e.substring(0,n),s=t.substring(0,r),o=e.substring(n),a=t.substring(r),l=Wm(i,s),c=Wm(o,a);return l.concat(c)}function Vm(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,s=0;n=0&&Jm(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),o=c+o,a=c+a,!e[l][1]){e.splice(l,1),r--;var u=l-1;e[u]&&e[u][0]===Hm&&(s++,a=e[u][1]+a,u--),e[u]&&e[u][0]===Pm&&(i++,o=e[u][1]+o,u--),l=u}}if(Ym(e[r][1])){c=e[r][1].charAt(0);e[r][1]=e[r][1].slice(1),o+=c,a+=c}}if(r0||a.length>0){o.length>0&&a.length>0&&(0!==(n=Vm(a,o))&&(l>=0?e[l][1]+=a.substring(0,n):(e.splice(0,0,[Fm,a.substring(0,n)]),r++),a=a.substring(n),o=o.substring(n)),0!==(n=Gm(a,o))&&(e[r][1]=a.substring(a.length-n)+e[r][1],a=a.substring(0,a.length-n),o=o.substring(0,o.length-n)));var h=s+i;0===o.length&&0===a.length?(e.splice(r-h,h),r-=h):0===o.length?(e.splice(r-h,h,[Hm,a]),r=r-h+1):0===a.length?(e.splice(r-h,h,[Pm,o]),r=r-h+1):(e.splice(r-h,h,[Pm,o],[Hm,a]),r=r-h+2)}0!==r&&e[r-1][0]===Fm?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,s=0,i=0,o="",a=""}""===e[e.length-1][1]&&e.pop();var d=!1;for(r=1;r=55296&&e<=56319}function Xm(e){return e>=56320&&e<=57343}function Ym(e){return Xm(e.charCodeAt(0))}function Jm(e){return Qm(e.charCodeAt(e.length-1))}function eb(e,t,n,r){return Jm(e)||Ym(r)?null:function(e){for(var t=[],n=0;n0&&t.push(e[n]);return t}([[Fm,e],[Pm,t],[Hm,n],[Fm,r]])}function tb(e,t,n){return Wm(e,t,n,!0)}tb.INSERT=Hm,tb.DELETE=Pm,tb.EQUAL=Fm;var nb=tb,rb={},ib=yf&&yf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rb,"__esModule",{value:!0});var sb,ob=ib(Ff),ab=ib(Wf);!function(e){e.compose=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t={}),"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var r=ob.default(t);for(var i in n||(r=Object.keys(r).reduce((function(e,t){return null!=r[t]&&(e[t]=r[t]),e}),{})),e)void 0!==e[i]&&void 0===t[i]&&(r[i]=e[i]);return Object.keys(r).length>0?r:void 0},e.diff=function(e,t){void 0===e&&(e={}),void 0===t&&(t={}),"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var n=Object.keys(e).concat(Object.keys(t)).reduce((function(n,r){return ab.default(e[r],t[r])||(n[r]=void 0===t[r]?null:t[r]),n}),{});return Object.keys(n).length>0?n:void 0},e.invert=function(e,t){void 0===e&&(e={}),void 0===t&&(t={}),e=e||{};var n=Object.keys(t).reduce((function(n,r){return t[r]!==e[r]&&void 0!==e[r]&&(n[r]=t[r]),n}),{});return Object.keys(e).reduce((function(n,r){return e[r]!==t[r]&&void 0===t[r]&&(n[r]=null),n}),n)},e.transform=function(e,t,n){if(void 0===n&&(n=!1),"object"!=typeof e)return t;if("object"==typeof t){if(!n)return t;var r=Object.keys(t).reduce((function(n,r){return void 0===e[r]&&(n[r]=t[r]),n}),{});return Object.keys(r).length>0?r:void 0}}}(sb||(sb={})),rb.default=sb;var lb,cb,ub={},hb={};function db(){if(cb)return ub;cb=1;var e=yf&&yf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ub,"__esModule",{value:!0});var t,n=e(function(){if(lb)return hb;lb=1;var e=yf&&yf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hb,"__esModule",{value:!0});var t=e(db()),n=function(){function e(e){this.ops=e,this.index=0,this.offset=0}return e.prototype.hasNext=function(){return this.peekLength()<1/0},e.prototype.next=function(e){e||(e=1/0);var n=this.ops[this.index];if(n){var r=this.offset,i=t.default.length(n);if(e>=i-r?(e=i-r,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof n.delete)return{delete:e};var s={};return n.attributes&&(s.attributes=n.attributes),"number"==typeof n.retain?s.retain=e:"string"==typeof n.insert?s.insert=n.insert.substr(r,e):s.insert=n.insert,s}return{retain:1/0}},e.prototype.peek=function(){return this.ops[this.index]},e.prototype.peekLength=function(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0},e.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},e.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}return[]},e}();return hb.default=n,hb}());return function(e){e.iterator=function(e){return new n.default(e)},e.length=function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"string"==typeof e.insert?e.insert.length:1}}(t||(t={})),ub.default=t,ub}var fb=yf&&yf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},pb=fb(nb),gb=fb(Ff),mb=fb(Wf),bb=fb(rb),vb=fb(db()),yb=String.fromCharCode(0),xb=function(){function e(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}return e.prototype.insert=function(e,t){var n={};return"string"==typeof e&&0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))},e.prototype.delete=function(e){return e<=0?this:this.push({delete:e})},e.prototype.retain=function(e,t){if(e<=0)return this;var n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)},e.prototype.push=function(e){var t=this.ops.length,n=this.ops[t-1];if(e=gb.default(e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,"object"!=typeof(n=this.ops[t-1])))return this.ops.unshift(e),this;if(mb.default(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this},e.prototype.chop=function(){var e=this.ops[this.ops.length-1];return e&&e.retain&&!e.attributes&&this.ops.pop(),this},e.prototype.filter=function(e){return this.ops.filter(e)},e.prototype.forEach=function(e){this.ops.forEach(e)},e.prototype.map=function(e){return this.ops.map(e)},e.prototype.partition=function(e){var t=[],n=[];return this.forEach((function(r){(e(r)?t:n).push(r)})),[t,n]},e.prototype.reduce=function(e,t){return this.ops.reduce(e,t)},e.prototype.changeLength=function(){return this.reduce((function(e,t){return t.insert?e+vb.default.length(t):t.delete?e-t.delete:e}),0)},e.prototype.length=function(){return this.reduce((function(e,t){return e+vb.default.length(t)}),0)},e.prototype.slice=function(t,n){void 0===t&&(t=0),void 0===n&&(n=1/0);for(var r=[],i=vb.default.iterator(this.ops),s=0;s0&&r.next(s.retain-o)}for(var a=new e(i);n.hasNext()||r.hasNext();)if("insert"===r.peekType())a.push(r.next());else if("delete"===n.peekType())a.push(n.next());else{var l=Math.min(n.peekLength(),r.peekLength()),c=n.next(l),u=r.next(l);if("number"==typeof u.retain){var h={};"number"==typeof c.retain?h.retain=l:h.insert=c.insert;var d=bb.default.compose(c.attributes,u.attributes,"number"==typeof c.retain);if(d&&(h.attributes=d),a.push(h),!r.hasNext()&&mb.default(a.ops[a.ops.length-1],h)){var f=new e(n.rest());return a.concat(f).chop()}}else"number"==typeof u.delete&&"number"==typeof c.retain&&a.push(u)}return a.chop()},e.prototype.concat=function(t){var n=new e(this.ops.slice());return t.ops.length>0&&(n.push(t.ops[0]),n.ops=n.ops.concat(t.ops.slice(1))),n},e.prototype.diff=function(t,n){if(this.ops===t.ops)return new e;var r=[this,t].map((function(e){return e.map((function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:yb;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")})).join("")})),i=new e,s=pb.default(r[0],r[1],n),o=vb.default.iterator(this.ops),a=vb.default.iterator(t.ops);return s.forEach((function(e){for(var t=e[1].length;t>0;){var n=0;switch(e[0]){case pb.default.INSERT:n=Math.min(a.peekLength(),t),i.push(a.next(n));break;case pb.default.DELETE:n=Math.min(t,o.peekLength()),o.next(n),i.delete(n);break;case pb.default.EQUAL:n=Math.min(o.peekLength(),a.peekLength(),t);var r=o.next(n),s=a.next(n);mb.default(r.insert,s.insert)?i.retain(n,bb.default.diff(r.attributes,s.attributes)):i.push(s).delete(n)}t-=n}})),i.chop()},e.prototype.eachLine=function(t,n){void 0===n&&(n="\n");for(var r=vb.default.iterator(this.ops),i=new e,s=0;r.hasNext();){if("insert"!==r.peekType())return;var o=r.peek(),a=vb.default.length(o)-r.peekLength(),l="string"==typeof o.insert?o.insert.indexOf(n,a)-a:-1;if(l<0)i.push(r.next());else if(l>0)i.push(r.next(l));else{if(!1===t(i,r.next(1).attributes||{},s))return;s+=1,i=new e}}i.length()>0&&t(i,{},s)},e.prototype.invert=function(t){var n=new e;return this.reduce((function(e,r){if(r.insert)n.delete(vb.default.length(r));else{if(r.retain&&null==r.attributes)return n.retain(r.retain),e+r.retain;if(r.delete||r.retain&&r.attributes){var i=r.delete||r.retain;return t.slice(e,e+i).forEach((function(e){r.delete?n.push(e):r.retain&&r.attributes&&n.retain(vb.default.length(e),bb.default.invert(r.attributes,e.attributes))})),e+i}}return e}),0),n.chop()},e.prototype.transform=function(t,n){if(void 0===n&&(n=!1),n=!!n,"number"==typeof t)return this.transformPosition(t,n);for(var r=t,i=vb.default.iterator(this.ops),s=vb.default.iterator(r.ops),o=new e;i.hasNext()||s.hasNext();)if("insert"!==i.peekType()||!n&&"insert"===s.peekType())if("insert"===s.peekType())o.push(s.next());else{var a=Math.min(i.peekLength(),s.peekLength()),l=i.next(a),c=s.next(a);if(l.delete)continue;c.delete?o.push(c):o.retain(a,bb.default.transform(l.attributes,c.attributes,n))}else o.retain(vb.default.length(i.next()));return o.chop()},e.prototype.transformPosition=function(e,t){void 0===t&&(t=!1),t=!!t;for(var n=vb.default.iterator(this.ops),r=0;n.hasNext()&&r<=e;){var i=n.peekLength(),s=n.peekType();n.next(),"delete"!==s?("insert"===s&&(rArray.isArray(e)?e.map((e=>_b[t][e])):_b[t][e];function Nb(e){return/(?:(https?|ftp|file):\/\/)?[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/.test(e)}function kb(e,t){var n;null===(n=t.getModule("imageResize"))||void 0===n||n.hide(),e?"object"==typeof e?t.setContents(e):t.clipboard.dangerouslyPasteHTML(e):t.setText("")}const Ab=(e,t,n)=>{const r=e.getModule("toolbar");t.forEach((e=>{r.container.querySelectorAll(`.ql-${e}`).forEach((e=>{if(e.className.indexOf("ql-picker")>=0){const t=e.querySelector(".ql-picker-options");n?(t.setAttribute("style","display: none"),e.classList.add("picker-disable")):(t.setAttribute("style",""),e.classList.remove("picker-disable"))}else e.disabled=n}))}))},Sb=(e,t=200)=>{let n=null;return()=>{n||(n=setTimeout((()=>{e(),n=null}),t))}};class qb{constructor(e,t={}){this.quill=e,this.options=t,this.editorContainer=e.root.parentNode,this.imageHandler=t.imageHandler,this.uploadedImgsList=t.uploadedImgsList,this.quill.on("text-change",((t,n,r)=>{this.imageHandler&&this.imageHandler.imgUploadApi&&Sb((()=>{const t=e.container.querySelectorAll('img[src^="data:"]:not(img[data-status=uploading]):not(img[data-status=fail])');t&&t.length>0&&t.forEach((e=>{this.uploadBase64Img(e)}))}))(),this.onDelete()}))}uploadBase64Img(e){console.log("upload img");const t=e.getAttribute("src");if("string"==typeof t&&/data:image\/.*;base64,/.test(t)){const n=Eb(["imgStatusUploading","imgStatusFail"],this.options.i18n);e.setAttribute("data-status","uploading"),e.parentNode.classList.add("img-container"),e.parentNode.setAttribute("data-after",n[0]);const{uploadSuccCB:r,uploadFailCB:i}=this.imageHandler;this.b64ToUrl(t).then((t=>{e.setAttribute("src",t),e.setAttribute("data-status","success"),e.parentNode.setAttribute("data-after",""),this.uploadedImgsList.push(t),r&&r(t)})).catch((t=>{console.log(t),e.setAttribute("data-status","fail"),e.parentNode.setAttribute("data-after",n[1]),i&&i(t),e.parentNode.onclick=()=>this.uploadBase64Img(e)}))}}onDelete(){const e=this.quill.container.querySelectorAll(".img-container[data-after]");e&&e.length>0&&e.forEach((e=>{const t=e.querySelectorAll('img[src^="data:"]');t&&0!==t.length||(e.removeAttribute("data-after"),e.removeAttribute("class"))}))}b64ToUrl(e){return new Promise(((t,n)=>{const r=e.split(";"),i=r[0].split(":")[1],s=r[1].split(",")[1],o=qb.b64toBlob(s,i),{imgUploadApi:a}=this.imageHandler;qb.uploadImg(o,a,(e=>{t(e)}),(e=>{n(e)}))}))}static getImgUrls(e){return e.ops.filter((e=>e.insert&&e.insert.image)).map((e=>e.insert.image))}static b64toBlob(e,t,n){t=t||"",n=n||512;const r=atob(e),i=[];for(let e=0;e{try{const i=new FormData;i.append("file",e,e.name||`default.${e.type.split("/")[1]}`),t(i).then((e=>{n(e)})).catch((e=>{console.log("upload img error: ",e),r(e)}))}catch(e){console.log("uploadImg: ",e),r(e)}}}var Ob='';const Cb='',Tb='',Lb=(e,t,n)=>`${e}`,Mb={modules:["DisplaySize","Toolbar","Resize"],overlayStyles:{position:"absolute",zIndex:10,border:"1px dashed #dbc8ff"},handleStyles:{position:"absolute",height:"12px",width:"12px",backgroundColor:"white",border:"1px solid #777",opacity:"0.60"},displayStyles:{position:"absolute",padding:"4px 8px",textAlign:"center",backgroundColor:"white",color:"#333",border:"1px solid #e7e7e7",opacity:"0.70",cursor:"default"},toolbarStyles:{position:"absolute",top:"-12px",left:"calc(50% - 36px)",textAlign:"center",color:"#333",width:"72px",display:"flex",flexWrap:"wrap",justifyContent:"center"},toolbarButtonStyles:{display:"flex",width:"24px",height:"24px",background:"white",border:"1px solid #e7e7e7",cursor:"pointer",zIndex:12,justifyContent:"center",alignItems:"center"},toolbarButtonSvgStyles:{}};class Rb{constructor(e){this.overlay=e.overlay,this.img=e.img,this.options=e.options,this.requestUpdate=e.onUpdate}onCreate(){}onDestroy(){}onUpdate(){}}const Ib=$p.imports.parchment,jb=new Ib.StyleAttributor("float","float"),Bb=new Ib.StyleAttributor("margin","margin"),Db=new Ib.StyleAttributor("display","display");const zb={DisplaySize:class extends Rb{onCreate=()=>{this.display=document.createElement("div"),Object.assign(this.display.style,this.options.displayStyles),this.overlay.appendChild(this.display)};onDestroy(){}onUpdate=()=>{if(!this.display||!this.img)return;const e=this.getCurrentSize();if(this.display.innerHTML=e.join(" × "),e[0]>120&&e[1]>30)Object.assign(this.display.style,{right:"4px",bottom:"4px",left:"auto"});else if("right"===this.img.style.float){const e=this.display.getBoundingClientRect();Object.assign(this.display.style,{right:"auto",bottom:`-${e.height+4}px`,left:`-${e.width+4}px`})}else{const e=this.display.getBoundingClientRect();Object.assign(this.display.style,{right:`-${e.width+4}px`,bottom:`-${e.height+4}px`,left:"auto"})}};getCurrentSize=()=>[this.img.width,Math.round(this.img.width/this.img.naturalWidth*this.img.naturalHeight)]},Toolbar:class extends Rb{constructor(e){super(e),this.quill=e.quill,this.hide=e.hide,this.options=e.options}onCreate=()=>{this.toolbar=document.createElement("div"),Object.assign(this.toolbar.style,this.options.toolbarStyles),this.overlay.appendChild(this.toolbar),this._defineAlignments(),this._addToolbarButtons()};onDestroy(){}onUpdate(){}_defineAlignments=()=>{const e=this.quill.getIndex($p.find(this.img));this.alignments=[{icon:'\n \n \n \n',apply:()=>{Db.add(this.img,"inline"),jb.add(this.img,"left"),Bb.add(this.img,"0 1em 1em 0"),this.quill.formatLine(e+2,1,"align",!1)},isApplied:()=>"left"===jb.value(this.img)},{icon:'\n \n \n \n',apply:()=>{Db.add(this.img,"block"),jb.remove(this.img),Bb.add(this.img,"auto"),this.quill.formatLine(e+2,1,"align","center"),this.img.parentNode.classList.add("img-center")},isApplied:()=>"auto"===Bb.value(this.img)},{icon:'\n \n \n \n',apply:()=>{Db.add(this.img,"inline"),jb.add(this.img,"right"),Bb.add(this.img,"0 0 1em 1em"),this.quill.formatLine(e+2,1,"align","right"),this.img.parentNode.classList.add("float-right")},isApplied:()=>"right"===jb.value(this.img)},{icon:'',apply:()=>{let t;"auto"===Bb.value(this.img)?t="center":jb.value(this.img)&&(t=jb.value(this.img));const n=this.options.imgRemarkPre||Eb("imgRemarkPre",this.options.i18n);this.quill.insertText(e+1,`\n${n}`,{color:"#999999",size:"12px"}),this.quill.insertText(e+2+n.length,"\n",{align:t}),this.quill.setSelection(e+2+n.length,$p.sources.SILENT),this.img.setAttribute("data-remark","1")},isApplied:()=>"1"===this.img.getAttribute("data-remark")},{icon:Ob,apply:()=>{$p.find(this.img).deleteAt(0),this.hide()},isApplied:()=>!1}]};_addToolbarButtons=()=>{const e=[],t=Eb(["alignLeft","alignCenter","alignRight","imgRemarkLabel","deleteImg"],this.options.i18n);this.alignments.forEach(((n,r)=>{const i=document.createElement("span");e.push(i),i.innerHTML=Lb(n.icon,t[r]),i.addEventListener("click",(()=>{e.forEach(((e,t)=>{3!==t&&(e.style.filter="")})),n.isApplied()?(jb.remove(this.img),Bb.remove(this.img),Db.remove(this.img)):(this._selectButton(i),n.apply()),this.requestUpdate()})),Object.assign(i.style,this.options.toolbarButtonStyles),r>0&&(i.style.borderLeftWidth="0"),n.isApplied()&&this._selectButton(i),this.toolbar.appendChild(i)}))};_selectButton(e){e.style.filter="invert(20%)"}},Resize:class extends Rb{isMobile=function(){return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))}();onCreate=()=>{this.boxes=[],this.addBox("nwse-resize"),this.addBox("nesw-resize"),this.addBox("nwse-resize"),this.addBox("nesw-resize"),this.positionBoxes()};onDestroy=()=>{this.setCursor("")};positionBoxes=()=>{const e=-parseFloat(this.options.handleStyles.width)/2+"px",t=-parseFloat(this.options.handleStyles.height)/2+"px";[{left:e,top:t},{right:e,top:t},{right:e,bottom:t},{left:e,bottom:t}].forEach(((e,t)=>{Object.assign(this.boxes[t].style,e)}))};addBox=e=>{const t=document.createElement("div");Object.assign(t.style,this.options.handleStyles),t.style.cursor=e,t.style.width=`${this.options.handleStyles.width}px`,t.style.height=`${this.options.handleStyles.height}px`,this.isMobile?t.addEventListener("touchstart",this.handleMousedown,!1):t.addEventListener("mousedown",this.handleMousedown,!1),this.overlay.appendChild(t),this.boxes.push(t)};handleMousedown=e=>{this.dragBox=e.target,this.isMobile?this.dragStartX=e.touches[0].clientX:this.dragStartX=e.clientX,this.preDragWidth=this.img.width||this.img.naturalWidth,this.setCursor(this.dragBox.style.cursor),this.isMobile?(document.addEventListener("touchmove",this.handleDrag,!1),document.addEventListener("touchend",this.handleMouseup,!1)):(document.addEventListener("mousemove",this.handleDrag,!1),document.addEventListener("mouseup",this.handleMouseup,!1))};handleMouseup=()=>{this.setCursor(""),this.isMobile?(document.removeEventListener("touchmove",this.handleDrag),document.removeEventListener("touchend",this.handleMouseup)):(document.removeEventListener("mousemove",this.handleDrag),document.removeEventListener("mouseup",this.handleMouseup))};handleDrag=e=>{if(!this.img)return;let t;t=this.isMobile?e.touches[0].clientX:e.clientX;const n=t-this.dragStartX;this.dragBox===this.boxes[0]||this.dragBox===this.boxes[3]?this.img.width=Math.round(this.preDragWidth-n):this.img.width=Math.round(this.preDragWidth+n),this.requestUpdate()};setCursor=e=>{[document.body,this.img].forEach((t=>{t.style.cursor=e}))}}};const Ub=(e,t)=>t.some((t=>t instanceof RegExp?t.test(e):t===e)),$b=new Set(["https:","http:","file:"]);function Pb(e,t){if("string"!=typeof(t={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...t}).defaultProtocol||t.defaultProtocol.endsWith(":")||(t.defaultProtocol=`${t.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e))return((e,{stripHash:t})=>{const n=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(e);if(!n)throw new Error(`Invalid URL: ${e}`);let{type:r,data:i,hash:s}=n.groups;const o=r.split(";");s=t?"":s;let a=!1;"base64"===o[o.length-1]&&(o.pop(),a=!0);const l=o.shift()?.toLowerCase()??"",c=o.map((e=>{let[t,n=""]=e.split("=").map((e=>e.trim()));return"charset"===t&&(n=n.toLowerCase(),"us-ascii"===n)?"":`${t}${n?`=${n}`:""}`})).filter(Boolean),u=[...c];return a&&u.push("base64"),(u.length>0||l&&"text/plain"!==l)&&u.unshift(l),`data:${u.join(";")},${a?i.trim():i}${s?`#${s}`:""}`})(e,t);if((e=>{try{const{protocol:t}=new URL(e);return t.endsWith(":")&&!$b.has(t)}catch{return!1}})(e))return e;const n=e.startsWith("//");!n&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));const r=new URL(e);if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&"https:"===r.protocol&&(r.protocol="http:"),t.forceHttps&&"http:"===r.protocol&&(r.protocol="https:"),t.stripAuthentication&&(r.username="",r.password=""),t.stripHash?r.hash="":t.stripTextFragment&&(r.hash=r.hash.replace(/#?:~:text.*?$/i,"")),r.pathname){const e=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let t=0,n="";for(;;){const i=e.exec(r.pathname);if(!i)break;const s=i[0],o=i.index;n+=r.pathname.slice(t,o).replace(/\/{2,}/g,"/"),n+=s,t=o+s.length}n+=r.pathname.slice(t,r.pathname.length).replace(/\/{2,}/g,"/"),r.pathname=n}if(r.pathname)try{r.pathname=decodeURI(r.pathname)}catch{}if(!0===t.removeDirectoryIndex&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=r.pathname.split("/");const n=e[e.length-1];Ub(n,t.removeDirectoryIndex)&&(e=e.slice(0,-1),r.pathname=e.slice(1).join("/")+"/")}if(r.hostname&&(r.hostname=r.hostname.replace(/\.$/,""),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(r.hostname)&&(r.hostname=r.hostname.replace(/^www\./,""))),Array.isArray(t.removeQueryParameters))for(const e of[...r.searchParams.keys()])Ub(e,t.removeQueryParameters)&&r.searchParams.delete(e);if(Array.isArray(t.keepQueryParameters)||!0!==t.removeQueryParameters||(r.search=""),Array.isArray(t.keepQueryParameters)&&t.keepQueryParameters.length>0)for(const e of[...r.searchParams.keys()])Ub(e,t.keepQueryParameters)||r.searchParams.delete(e);if(t.sortQueryParameters){r.searchParams.sort();try{r.search=decodeURIComponent(r.search)}catch{}}t.removeTrailingSlash&&(r.pathname=r.pathname.replace(/\/$/,"")),t.removeExplicitPort&&r.port&&(r.port="");const i=e;return e=r.toString(),t.removeSingleSlash||"/"!==r.pathname||i.endsWith("/")||""!==r.hash||(e=e.replace(/\/$/,"")),(t.removeTrailingSlash||"/"===r.pathname)&&""===r.hash&&t.removeSingleSlash&&(e=e.replace(/\/$/,"")),n&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}const Hb={globalRegularExpression:/(https?:\/\/|www\.)[\w-\.]+\.[\w-\.]+(\/([\S]+)?)?/gi,urlRegularExpression:/(https?:\/\/|www\.)[\w-\.]+\.[\w-\.]+(\/([\S]+)?)?/gi,globalMailRegularExpression:/([\w-\.]+@[\w-\.]+\.[\w-\.]+)/gi,mailRegularExpression:/([\w-\.]+@[\w-\.]+\.[\w-\.]+)/gi,normalizeRegularExpression:/(https?:\/\/|www\.)[\S]+/i,normalizeUrlOptions:{stripWWW:!1}};const Fb=$p.import("blots/block/embed");class Wb extends Fb{}Wb.blotName="hr",Wb.tagName="hr";const Kb=$p.import("blots/block");$p.register("formats/horizontal",Wb);function Vb(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];"object"!=typeof n||Object.isFrozen(n)||Vb(n)})),e}var Gb=Vb,Zb=Vb;Gb.default=Zb;class Qb{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Xb(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Yb(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const Jb=e=>!!e.kind;class ev{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Xb(e)}openNode(e){if(!Jb(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){Jb(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}class tv{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{tv._collapse(e)})))}}class nv extends tv{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new ev(this,this.options).value()}finalize(){return!0}}function rv(e){return e?"string"==typeof e?e:e.source:null}const iv=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const sv="[a-zA-Z]\\w*",ov="[a-zA-Z_]\\w*",av="\\b\\d+(\\.\\d+)?",lv="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",cv="\\b(0b[01]+)",uv={begin:"\\\\[\\s\\S]",relevance:0},hv={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[uv]},dv={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[uv]},fv={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},pv=function(e,t,n={}){const r=Yb({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(fv),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},gv=pv("//","$"),mv=pv("/\\*","\\*/"),bv=pv("#","$"),vv={className:"number",begin:av,relevance:0},yv={className:"number",begin:lv,relevance:0},xv={className:"number",begin:cv,relevance:0},wv={className:"number",begin:av+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},_v={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[uv,{begin:/\[/,end:/\]/,relevance:0,contains:[uv]}]}]},Ev={className:"title",begin:sv,relevance:0},Nv={className:"title",begin:ov,relevance:0},kv={begin:"\\.\\s*"+ov,relevance:0};var Av=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:sv,UNDERSCORE_IDENT_RE:ov,NUMBER_RE:av,C_NUMBER_RE:lv,BINARY_NUMBER_RE:cv,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map((e=>rv(e))).join("")}(t,/.*\b/,e.binary,/\b.*/)),Yb({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:uv,APOS_STRING_MODE:hv,QUOTE_STRING_MODE:dv,PHRASAL_WORDS_MODE:fv,COMMENT:pv,C_LINE_COMMENT_MODE:gv,C_BLOCK_COMMENT_MODE:mv,HASH_COMMENT_MODE:bv,NUMBER_MODE:vv,C_NUMBER_MODE:yv,BINARY_NUMBER_MODE:xv,CSS_NUMBER_MODE:wv,REGEXP_MODE:_v,TITLE_MODE:Ev,UNDERSCORE_TITLE_MODE:Nv,METHOD_GUARD:kv,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function Sv(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function qv(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Sv,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Ov(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map((e=>rv(e))).join("|")+")"}(...e.illegal))}function Cv(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Tv(e,t){void 0===e.relevance&&(e.relevance=1)}const Lv=["of","and","for","in","not","or","if","then","parent","list","value"],Mv="keyword";function Rv(e,t,n=Mv){const r={};return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach((function(n){Object.assign(r,Rv(e[n],t,n))})),r;function i(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");r[n[0]]=[e,Iv(n[0],n[1])]}))}}function Iv(e,t){return t?Number(t):function(e){return Lv.includes(e.toLowerCase())}(e)?0:1}function jv(e,{plugins:t}){function n(t,n){return new RegExp(rv(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(function(e,t="|"){let n=0;return e.map((e=>{n+=1;const t=n;let r=rv(e),i="";for(;r.length>0;){const e=iv.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i})).map((e=>`(${e})`)).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new r;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Yb(e.classNameAliases||{}),function t(r,s){const o=r;if(r.isCompiled)return o;[Cv].forEach((e=>e(r,s))),e.compilerExtensions.forEach((e=>e(r,s))),r.__beforeBegin=null,[qv,Ov,Tv].forEach((e=>e(r,s))),r.isCompiled=!0;let a=null;if("object"==typeof r.keywords&&(a=r.keywords.$pattern,delete r.keywords.$pattern),r.keywords&&(r.keywords=Rv(r.keywords,e.case_insensitive)),r.lexemes&&a)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return a=a||r.lexemes||/\w+/,o.keywordPatternRe=n(a,!0),s&&(r.begin||(r.begin=/\B|\b/),o.beginRe=n(r.begin),r.endSameAsBegin&&(r.end=r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(o.endRe=n(r.end)),o.terminatorEnd=rv(r.end)||"",r.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(r.end?"|":"")+s.terminatorEnd)),r.illegal&&(o.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return Yb(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(Bv(e))return Yb(e,{starts:e.starts?Yb(e.starts):null});if(Object.isFrozen(e))return Yb(e);return e}("self"===e?r:e)}))),r.contains.forEach((function(e){t(e,o)})),r.starts&&t(r.starts,s),o.matcher=function(e){const t=new i;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function Bv(e){return!!e&&(e.endsWithParent||Bv(e.starts))}function Dv(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,Xb(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const zv={"after:highlightElement":({el:e,result:t,text:n})=>{const r=$v(e);if(!r.length)return;const i=document.createElement("div");i.innerHTML=t.value,t.value=function(e,t,n){let r=0,i="";const s=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function l(e){i+=""}function c(e){("start"===e.event?a:l)(e.node)}for(;e.length||t.length;){let t=o();if(i+=Xb(n.substring(r,t[0].offset)),r=t[0].offset,t===e){s.reverse().forEach(l);do{c(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===r);s.reverse().forEach(a)}else"start"===t[0].event?s.push(t[0].node):s.pop(),c(t.splice(0,1)[0])}return i+Xb(n.substr(r))}(r,$v(i),n)}};function Uv(e){return e.nodeName.toLowerCase()}function $v(e){const t=[];return function e(n,r){for(let i=n.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:r,node:i}),r=e(i,r),Uv(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:i}));return r}(e,0),t}const Pv={},Hv=e=>{console.error(e)},Fv=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Wv=(e,t)=>{Pv[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Pv[`${e}/${t}`]=!0)},Kv=Xb,Vv=Yb,Gv=Symbol("nomatch");var Zv=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const s=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:nv};function c(e){return l.noHighlightRe.test(e)}function u(e,t,n,r){let i="",s="";"object"==typeof t?(i=e,n=t.ignoreIllegals,s=t.language,r=void 0):(Wv("10.7.0","highlight(lang, code, ...args) has been deprecated."),Wv("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),s=e,i=t);const o={code:i,language:s};E("before:highlight",o);const a=o.result?o.result:h(o.language,o.code,n,r);return a.code=o.code,E("after:highlight",a),a}function h(e,n,s,a){function c(e,t){const n=w.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function u(){null!=N.subLanguage?function(){if(""===S)return;let e=null;if("string"==typeof N.subLanguage){if(!t[N.subLanguage])return void A.addText(S);e=h(N.subLanguage,S,!0,k[N.subLanguage]),k[N.subLanguage]=e.top}else e=d(S,N.subLanguage.length?N.subLanguage:null);N.relevance>0&&(q+=e.relevance),A.addSublanguage(e.emitter,e.language)}():function(){if(!N.keywords)return void A.addText(S);let e=0;N.keywordPatternRe.lastIndex=0;let t=N.keywordPatternRe.exec(S),n="";for(;t;){n+=S.substring(e,t.index);const r=c(N,t);if(r){const[e,i]=r;if(A.addText(n),n="",q+=i,e.startsWith("_"))n+=t[0];else{const n=w.classNameAliases[e]||e;A.addKeyword(t[0],n)}}else n+=t[0];e=N.keywordPatternRe.lastIndex,t=N.keywordPatternRe.exec(S)}n+=S.substr(e),A.addText(n)}(),S=""}function f(e){return e.className&&A.openNode(w.classNameAliases[e.className]||e.className),N=Object.create(e,{parent:{value:N}}),N}function p(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new Qb(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return p(e.parent,t,n)}function g(e){return 0===N.matcher.regexIndex?(S+=e[0],1):(T=!0,0)}function m(e){const t=e[0],n=e.rule,r=new Qb(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return g(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?S+=t:(n.excludeBegin&&(S+=t),u(),n.returnBegin||n.excludeBegin||(S=t)),f(n),n.returnBegin?0:t.length}function b(e){const t=e[0],r=n.substr(e.index),i=p(N,e,r);if(!i)return Gv;const s=N;s.skip?S+=t:(s.returnEnd||s.excludeEnd||(S+=t),u(),s.excludeEnd&&(S=t));do{N.className&&A.closeNode(),N.skip||N.subLanguage||(q+=N.relevance),N=N.parent}while(N!==i.parent);return i.starts&&(i.endSameAsBegin&&(i.starts.endRe=i.endRe),f(i.starts)),s.returnEnd?0:t.length}let v={};function y(t,r){const o=r&&r[0];if(S+=t,null==o)return u(),0;if("begin"===v.type&&"end"===r.type&&v.index===r.index&&""===o){if(S+=n.slice(r.index,r.index+1),!i){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=r,"begin"===r.type)return m(r);if("illegal"===r.type&&!s){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(N.className||"")+'"');throw e.mode=N,e}if("end"===r.type){const e=b(r);if(e!==Gv)return e}if("illegal"===r.type&&""===o)return 1;if(C>1e5&&C>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return S+=o,o.length}const w=x(e);if(!w)throw Hv(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const _=jv(w,{plugins:r});let E="",N=a||_;const k={},A=new l.__emitter(l);!function(){const e=[];for(let t=N;t!==w;t=t.parent)t.className&&e.unshift(t.className);e.forEach((e=>A.openNode(e)))}();let S="",q=0,O=0,C=0,T=!1;try{for(N.matcher.considerAll();;){C++,T?T=!1:N.matcher.considerAll(),N.matcher.lastIndex=O;const e=N.matcher.exec(n);if(!e)break;const t=y(n.substring(O,e.index),e);O=e.index+t}return y(n.substr(O)),A.closeAllNodes(),A.finalize(),E=A.toHTML(),{relevance:Math.floor(q),value:E,language:e,illegal:!1,emitter:A,top:N}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(O-100,O+100),mode:t.mode},sofar:E,relevance:0,value:Kv(n),emitter:A};if(i)return{illegal:!1,relevance:0,value:Kv(n),emitter:A,language:e,top:N,errorRaised:t};throw t}}function d(e,n){n=n||l.languages||Object.keys(t);const r=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:Kv(e),illegal:!1,top:a};return t.emitter.addText(e),t}(e),i=n.filter(x).filter(_).map((t=>h(t,e,!1)));i.unshift(r);const s=i.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(x(e.language).supersetOf===t.language)return 1;if(x(t.language).supersetOf===e.language)return-1}return 0})),[o,c]=s,u=o;return u.second_best=c,u}const f={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"
    "))}},p=/^(<[^>]+>|\t)+/gm,g={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(p,(e=>e.replace(/\t/g,l.tabReplace))))}};function m(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=l.languageDetectRe.exec(t);if(n){const t=x(n[1]);return t||(Fv(o.replace("{}",n[1])),Fv("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>c(e)||x(e)))}(e);if(c(r))return;E("before:highlightElement",{el:e,language:r}),t=e;const i=t.textContent,s=r?u(i,{language:r,ignoreIllegals:!0}):d(i);E("after:highlightElement",{el:e,result:s,text:i}),e.innerHTML=s.value,function(e,t,r){const i=t?n[t]:r;e.classList.add("hljs"),i&&e.classList.add(i)}(e,r,s.language),e.result={language:s.language,re:s.relevance,relavance:s.relevance},s.second_best&&(e.second_best={language:s.second_best.language,re:s.second_best.relevance,relavance:s.second_best.relevance})}const b=()=>{if(b.called)return;b.called=!0,Wv("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(m)};let v=!1;function y(){if("loading"===document.readyState)return void(v=!0);document.querySelectorAll("pre code").forEach(m)}function x(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function w(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function _(e){const t=x(e);return t&&!t.disableAutodetect}function E(e,t){const n=e;r.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){v&&y()}),!1),Object.assign(e,{highlight:u,highlightAuto:d,highlightAll:y,fixMarkup:function(e){return Wv("10.2.0","fixMarkup will be removed entirely in v11.0"),Wv("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(s,(e=>"\n"===e?l.useBR?"
    ":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e)):t;var t},highlightElement:m,highlightBlock:function(e){return Wv("10.7.0","highlightBlock will be removed entirely in v12.0"),Wv("10.7.0","Please use highlightElement now."),m(e)},configure:function(e){e.useBR&&(Wv("10.3.0","'useBR' will be removed entirely in v11.0"),Wv("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=Vv(l,e)},initHighlighting:b,initHighlightingOnLoad:function(){Wv("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),v=!0},registerLanguage:function(n,r){let s=null;try{s=r(e)}catch(e){if(Hv("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw e;Hv(e),s=a}s.name||(s.name=n),t[n]=s,s.rawDefinition=r.bind(null,e),s.aliases&&w(s.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:x,registerAliases:w,requireLanguage:function(e){Wv("10.4.0","requireLanguage will be removed entirely in v11."),Wv("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=x(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:_,inherit:Vv,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)},vuePlugin:Dv(e).VuePlugin}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString="10.7.3";for(const e in Av)"object"==typeof Av[e]&&Gb(Av[e]);return Object.assign(e,Av),e.addPlugin(f),e.addPlugin(zv),e.addPlugin(g),e}({}),Qv=Zv;const Xv="[A-Za-z$_][0-9A-Za-z$_]*",Yv=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Jv=["true","false","null","undefined","NaN","Infinity"],ey=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);function ty(e){return ny("(?=",e,")")}function ny(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}var ry=function(e){const t=Xv,n="<>",r="",i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];"<"!==r?">"===r&&(((e,{after:t})=>{const n="",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:n,end:r},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:s,contains:["self",e.inherit(e.TITLE_MODE,{begin:t}),v],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[v,e.inherit(e.TITLE_MODE,{begin:t})]},{variants:[{begin:"\\."+t},{begin:"\\$"+t}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},e.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:t}),"self",v]},{begin:"(get|set)\\s+(?="+t+"\\()",end:/\{/,keywords:"get set",contains:[e.inherit(e.TITLE_MODE,{begin:t}),{begin:/\(\)/},v]},{begin:/\$[(.]/}]}};function iy(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}var sy=function(e){const t={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:iy(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t,r]};r.contains.push(s);const o={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]},a=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp"},contains:[a,e.SHEBANG(),l,o,e.HASH_COMMENT_MODE,i,s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}};var oy=function(e){return{name:"Vim Script",keywords:{$pattern:/[!#@\w]+/,keyword:"N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu go gr grepa gu gv ha helpf helpg helpt hi hid his ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf quita qa rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank",built_in:"synIDtrans atan2 range matcharg did_filetype asin feedkeys xor argv complete_check add getwinposx getqflist getwinposy screencol clearmatches empty extend getcmdpos mzeval garbagecollect setreg ceil sqrt diff_hlID inputsecret get getfperm getpid filewritable shiftwidth max sinh isdirectory synID system inputrestore winline atan visualmode inputlist tabpagewinnr round getregtype mapcheck hasmapto histdel argidx findfile sha256 exists toupper getcmdline taglist string getmatches bufnr strftime winwidth bufexists strtrans tabpagebuflist setcmdpos remote_read printf setloclist getpos getline bufwinnr float2nr len getcmdtype diff_filler luaeval resolve libcallnr foldclosedend reverse filter has_key bufname str2float strlen setline getcharmod setbufvar index searchpos shellescape undofile foldclosed setqflist buflisted strchars str2nr virtcol floor remove undotree remote_expr winheight gettabwinvar reltime cursor tabpagenr finddir localtime acos getloclist search tanh matchend rename gettabvar strdisplaywidth type abs py3eval setwinvar tolower wildmenumode log10 spellsuggest bufloaded synconcealed nextnonblank server2client complete settabwinvar executable input wincol setmatches getftype hlID inputsave searchpair or screenrow line settabvar histadd deepcopy strpart remote_peek and eval getftime submatch screenchar winsaveview matchadd mkdir screenattr getfontname libcall reltimestr getfsize winnr invert pow getbufline byte2line soundfold repeat fnameescape tagfiles sin strwidth spellbadword trunc maparg log lispindent hostname setpos globpath remote_foreground getchar synIDattr fnamemodify cscope_connection stridx winbufnr indent min complete_add nr2char searchpairpos inputdialog values matchlist items hlexists strridx browsedir expand fmod pathshorten line2byte argc count getwinvar glob foldtextresult getreg foreground cosh matchdelete has char2nr simplify histget searchdecl iconv winrestcmd pumvisible writefile foldlevel haslocaldir keys cos matchstr foldtext histnr tan tempname getcwd byteidx getbufvar islocked escape eventhandler remote_send serverlist winrestview synstack pyeval prevnonblank readfile cindent filereadable changenr exp"},illegal:/;/,contains:[e.NUMBER_MODE,{className:"string",begin:"'",end:"'",illegal:"\\n"},{className:"string",begin:/"(\\"|\n\\|[^"\n])*"/},e.COMMENT('"',"$"),{className:"variable",begin:/[bwtglsav]:[\w\d_]*/},{className:"function",beginKeywords:"function function!",end:"$",relevance:0,contains:[e.TITLE_MODE,{className:"params",begin:"\\(",end:"\\)"}]},{className:"symbol",begin:/<[\w-]+>/}]}};function ay(e){return ly("(",e,")?")}function ly(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}var cy=function(e){const t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",i="("+n+"|"+ay(r)+"[a-zA-Z_]\\w*"+ay("<[^<>]+>")+")",s={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},o={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:ay(r)+e.IDENT_RE,relevance:0},u=ay(r)+e.IDENT_RE+"\\s*\\(",h={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"_Bool _Complex _Imaginary",_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"],literal:"true false nullptr NULL"},d={className:"function.dispatch",relevance:0,keywords:h,begin:ly(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,e.IDENT_RE,(f=/\s*\(/,ly("(?=",f,")")))};var f;const p=[d,l,s,t,e.C_BLOCK_COMMENT_MODE,a,o],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:p.concat([{begin:/\(/,end:/\)/,keywords:h,contains:p.concat(["self"]),relevance:0}]),relevance:0},m={className:"function",begin:"("+i+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[c],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,a]},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,o,a,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,o,a,s]}]},s,t,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"",keywords:h,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:h},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:o,keywords:h}}};var uy=function(e){const t={keyword:["abstract","as","base","break","case","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},s=e.inherit(i,{illegal:/\n/}),o={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(o,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]},u=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});o.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],a.contains=[u,l,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const h={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},f=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",p={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},h,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"meta-string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+f+"\\s+)+"+e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,d],relevance:0},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[h,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},p]}};const hy=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],dy=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],fy=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],py=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],gy=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse();function my(e){return function(...e){return e.map((e=>function(e){return e?"string"==typeof e?e:e.source:null}(e))).join("")}("(?=",e,")")}var by=function(e){const t=(e=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]}}))(e),n=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[e.C_BLOCK_COMMENT_MODE,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},e.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+fy.join("|")+")"},{begin:"::("+py.join("|")+")"}]},{className:"attribute",begin:"\\b("+gy.join("|")+")\\b"},{begin:":",end:"[;}]",contains:[t.HEXCOLOR,t.IMPORTANT,e.CSS_NUMBER_MODE,...n,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},{className:"built_in",begin:/[\w-]+(?=\()/}]},{begin:my(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:dy.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...n,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+hy.join("|")+")\\b"}]}};var vy=function(e){const t={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",literal:"true false iota nil",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{name:"Go",aliases:["golang"],keywords:t,illegal:")?",r="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",i={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]};const s=_y;return{name:"Java",aliases:["jsp"],keywords:r,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"class",beginKeywords:"class interface enum",end:/[{;=]/,excludeEnd:!0,relevance:1,keywords:"class interface enum",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"new throw return else",relevance:0},{className:"class",begin:"record\\s+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,excludeEnd:!0,end:/[{;=]/,keywords:r,contains:[{beginKeywords:"record"},{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"function",begin:"("+n+"\\s+)+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:r,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,s,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},s,i]}};var Ny=function(e){const t={literal:"true false null"},n=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],r=[e.QUOTE_STRING_MODE,e.C_NUMBER_MODE],i={end:",",endsWithParent:!0,excludeEnd:!0,contains:r,keywords:t},s={begin:/\{/,end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE],illegal:"\\n"},e.inherit(i,{begin:/:/})].concat(n),illegal:"\\S"},o={begin:"\\[",end:"\\]",contains:[e.inherit(i)],illegal:"\\S"};return r.push(s,o),n.forEach((function(e){r.push(e)})),{name:"JSON",contains:r,keywords:t,illegal:"\\S"}};var ky=function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:"@interface @class @protocol @implementation"};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{$pattern:t,keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.split(" ").join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}};var Ay=function(e){const t={className:"variable",begin:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*(?![A-Za-z0-9])(?![$])"},n={className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{begin:/\?>/}]},r={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},i=e.inherit(e.APOS_STRING_MODE,{illegal:null}),s=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(r)}),o=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(r)}),a={className:"string",contains:[e.BACKSLASH_ESCAPE,n],variants:[e.inherit(i,{begin:"b'",end:"'"}),e.inherit(s,{begin:'b"',end:'"'}),s,i,o]},l={className:"number",variants:[{begin:"\\b0b[01]+(?:_[01]+)*\\b"},{begin:"\\b0o[0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:e[+-]?\\d+)?"}],relevance:0},c={keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list match|0 mixed new object or private protected public real return string switch throw trait try unset use var void while xor yield",literal:"false null true",built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException UnhandledMatchError ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Stringable Throwable Traversable WeakReference WeakMap Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass"};return{aliases:["php3","php4","php5","php6","php7","php8"],case_insensitive:!0,keywords:c,contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$",{contains:[n]}),e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0,keywords:"__halt_compiler"}),n,{className:"keyword",begin:/\$this\b/},t,{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{className:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",t,e.C_BLOCK_COMMENT_MODE,a,l]}]},{className:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",relevance:0,end:";",contains:[e.UNDERSCORE_TITLE_MODE]},a,l]}};function Sy(e){return function(...e){return e.map((e=>function(e){return e?"string"==typeof e?e:e.source:null}(e))).join("")}("(?=",e,")")}var qy=function(e){const t={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},n={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/,end:/\}/,keywords:t,illegal:/#/},i={begin:/\{\{/,relevance:0},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,n],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,n],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,n,i,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,n,i,r]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,i,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},o="[0-9](_?[0-9])*",a=`(\\b(${o}))?\\.(${o})|\\b(${o})\\.`,l={className:"number",relevance:0,variants:[{begin:`(\\b(${o})|(${a}))[eE][+-]?(${o})[jJ]?\\b`},{begin:`(${a})[jJ]?`},{begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${o})[jJ]\\b`}]},c={className:"comment",begin:Sy(/# type:/),end:/$/,keywords:t,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},u={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,contains:["self",n,l,s,e.HASH_COMMENT_MODE]}]};return r.contains=[s,l,n],{name:"Python",aliases:["py","gyp","ipython"],keywords:t,illegal:/(<\/|->|\?)|=>/,contains:[n,l,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},s,c,e.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[e.UNDERSCORE_TITLE_MODE,u,{begin:/->/,endsWithParent:!0,keywords:t}]},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[l,u,s]}]}};function Oy(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}var Cy=function(e){const t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__",built_in:"proc lambda",literal:"true false nil"},r={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},s=[e.COMMENT("#","$",{contains:[r]}),e.COMMENT("^=begin","^=end",{contains:[r],relevance:10}),e.COMMENT("^__END__","\\n$")],o={className:"subst",begin:/#\{/,end:/\}/,keywords:n},a={className:"string",contains:[e.BACKSLASH_ESCAPE,o],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:/<<[-~]?'?(\w+)\n(?:[^\n]*\n)*?\s*\1\b/,returnBegin:!0,contains:[{begin:/<<[-~]?'?/},e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,o]})]}]},l="[0-9](_?[0-9])*",c={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${l}))?([eE][+-]?(${l})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},u={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:n},h=[a,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE,relevance:0}]}].concat(s)},{className:"function",begin:Oy(/def\s+/,(d=t+"\\s*(\\(|;|$)",Oy("(?=",d,")"))),relevance:0,keywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:t}),u].concat(s)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[a,{begin:t}],relevance:0},c,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:n},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,o],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(i,s),relevance:0}].concat(i,s);var d;o.contains=h,u.contains=h;const f=[{begin:/^\s*=>/,starts:{end:"$",contains:h}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",contains:h}}];return s.unshift(i),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:n,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(f).concat(s).concat(h)}};function Ty(e){return e?"string"==typeof e?e:e.source:null}function Ly(...e){return e.map((e=>Ty(e))).join("")}function My(...e){return"("+e.map((e=>Ty(e))).join("|")+")"}var Ry=function(e){const t=e.COMMENT("--","$"),n=["true","false","unknown"],r=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],o=i,a=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update ","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!i.includes(e))),l={begin:Ly(/\b/,My(...o),/\s*\(/),keywords:{built_in:o}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const r=n;return t=t||[],e.map((e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e))}(a,{when:e=>e.length<3}),literal:n,type:r,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:My(...s),keywords:{$pattern:/[\w\.]+/,keyword:a.concat(s),literal:n,type:r}},{className:"type",begin:My("double precision","large object","with timezone","without timezone")},l,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}};function Iy(e){return e?"string"==typeof e?e:e.source:null}function jy(e){return By("(?=",e,")")}function By(...e){return e.map((e=>Iy(e))).join("")}function Dy(...e){return"("+e.map((e=>Iy(e))).join("|")+")"}var zy=function(e){const t=By(/[A-Z_]/,By("(",/[A-Z0-9_.-]*:/,")?"),/[A-Z0-9_.-]*/),n={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"meta-keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=e.inherit(r,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"meta-string"}),o=e.inherit(e.QUOTE_STRING_MODE,{className:"meta-string"}),a={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[r,o,s,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[r,i,o,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},n,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[a],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[a],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:By(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:a}]},{className:"tag",begin:By(/<\//,jy(By(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}};var Uy=function(e){const t={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"},{begin:/\$\{/,end:/\}/}]},n={className:"string",variants:[{begin:'"""',end:'"""'},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:'[a-z]+"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t]},{className:"string",begin:'[a-z]+"""',end:'"""',contains:[t],relevance:10}]},r={className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},i={className:"title",begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,relevance:0},s={className:"class",beginKeywords:"class object trait type",end:/[:={\[\n;]/,excludeEnd:!0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{beginKeywords:"extends with",relevance:10},{begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[r]},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[r]},i]},o={className:"function",beginKeywords:"def",end:/[:={\[(\n;]/,excludeEnd:!0,contains:[i]};return{name:"Scala",keywords:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit"},contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"symbol",begin:"'\\w[\\w\\d_]*(?!')"},r,o,s,e.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"}]}};var $y=function(e){var t="('|\\.')+",n={relevance:0,contains:[{begin:t}]};return{name:"Matlab",keywords:{keyword:"arguments break case catch classdef continue else elseif end enumeration events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i|0 inf nan isnan isinf isfinite j|0 why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson max min nanmax nanmin mean nanmean type table readtable writetable sortrows sort figure plot plot3 scatter scatter3 cellfun legend intersect ismember procrustes hold num2cell "},illegal:'(//|"|#|/\\*|\\s+/\\w+)',contains:[{className:"function",beginKeywords:"function",end:"$",contains:[e.UNDERSCORE_TITLE_MODE,{className:"params",variants:[{begin:"\\(",end:"\\)"},{begin:"\\[",end:"\\]"}]}]},{className:"built_in",begin:/true|false/,relevance:0,starts:n},{begin:"[a-zA-Z][a-zA-Z_0-9]*"+t,relevance:0},{className:"number",begin:e.C_NUMBER_RE,relevance:0,starts:n},{className:"string",begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE,{begin:"''"}]},{begin:/\]|\}|\)/,relevance:0,starts:n},{className:"string",begin:'"',end:'"',contains:[e.BACKSLASH_ESCAPE,{begin:'""'}],starts:n},e.COMMENT("^\\s*%\\{\\s*$","^\\s*%\\}\\s*$"),e.COMMENT("%","$")]}};function Py(e){return e?"string"==typeof e?e:e.source:null}function Hy(e){return Fy("(?=",e,")")}function Fy(...e){return e.map((e=>Py(e))).join("")}function Wy(...e){return"("+e.map((e=>Py(e))).join("|")+")"}const Ky=e=>Fy(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Vy=["Protocol","Type"].map(Ky),Gy=["init","self"].map(Ky),Zy=["Any","Self"],Qy=["associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Xy=["false","nil","true"],Yy=["assignment","associativity","higherThan","left","lowerThan","none","right"],Jy=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],ex=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],tx=Wy(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),nx=Wy(tx,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),rx=Fy(tx,nx,"*"),ix=Wy(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),sx=Wy(ix,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ox=Fy(ix,sx,"*"),ax=Fy(/[A-Z]/,sx,"*"),lx=["autoclosure",Fy(/convention\(/,Wy("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Fy(/objc\(/,ox,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","testable","UIApplicationMain","unknown","usableFromInline"],cx=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];var ux=function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={className:"keyword",begin:Fy(/\./,Hy(Wy(...Vy,...Gy))),end:Wy(...Vy,...Gy),excludeBegin:!0},s={match:Fy(/\./,Wy(...Qy)),relevance:0},o=Qy.filter((e=>"string"==typeof e)).concat(["_|0"]),a={variants:[{className:"keyword",match:Wy(...Qy.filter((e=>"string"!=typeof e)).concat(Zy).map(Ky),...Gy)}]},l={$pattern:Wy(/\b\w+/,/#\w+/),keyword:o.concat(Jy),literal:Xy},c=[i,s,a],u=[{match:Fy(/\./,Wy(...ex)),relevance:0},{className:"built_in",match:Fy(/\b/,Wy(...ex),/(?=\()/)}],h={match:/->/,relevance:0},d=[h,{className:"operator",relevance:0,variants:[{match:rx},{match:`\\.(\\.|${nx})+`}]}],f="([0-9]_*)+",p="([0-9a-fA-F]_*)+",g={className:"number",relevance:0,variants:[{match:`\\b(${f})(\\.(${f}))?([eE][+-]?(${f}))?\\b`},{match:`\\b0x(${p})(\\.(${p}))?([pP][+-]?(${f}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},m=(e="")=>({className:"subst",variants:[{match:Fy(/\\/,e,/[0\\tnr"']/)},{match:Fy(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:Fy(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e="")=>({className:"subst",label:"interpol",begin:Fy(/\\/,e,/\(/),end:/\)/}),y=(e="")=>({begin:Fy(e,/"""/),end:Fy(/"""/,e),contains:[m(e),b(e),v(e)]}),x=(e="")=>({begin:Fy(e,/"/),end:Fy(/"/,e),contains:[m(e),v(e)]}),w={className:"string",variants:[y(),y("#"),y("##"),y("###"),x(),x("#"),x("##"),x("###")]},_={match:Fy(/`/,ox,/`/)},E=[_,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${sx}+`}],N=[{match:/(@|#)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:cx,contains:[...d,g,w]}]}},{className:"keyword",match:Fy(/@/,Wy(...lx))},{className:"meta",match:Fy(/@/,ox)}],k={match:Hy(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Fy(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,sx,"+")},{className:"type",match:ax,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Fy(/\s+&\s+/,Hy(ax)),relevance:0}]},A={begin://,keywords:l,contains:[...r,...c,...N,h,k]};k.contains.push(A);const S={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:Fy(ox,/\s*:/),keywords:"_|0",relevance:0},...r,...c,...u,...d,g,w,...E,...N,k]},q={beginKeywords:"func",contains:[{className:"title",match:Wy(_.match,ox,rx),endsParent:!0,relevance:0},t]},O={begin://,contains:[...r,k]},C={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:Wy(Hy(Fy(ox,/\s*:/)),Hy(Fy(ox,/\s+/,ox,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ox}]},...r,...c,...d,g,w,...N,k,S],endsParent:!0,illegal:/["']/},T={className:"function",match:Hy(/\bfunc\b/),contains:[q,O,C,t],illegal:[/\[/,/%/]},L={className:"function",match:/\b(subscript|init[?!]?)\s*(?=[<(])/,keywords:{keyword:"subscript init init? init!",$pattern:/\w+[?!]?/},contains:[O,C,t],illegal:/\[|%/},M={beginKeywords:"operator",end:e.MATCH_NOTHING_RE,contains:[{className:"title",match:rx,endsParent:!0,relevance:0}]},R={beginKeywords:"precedencegroup",end:e.MATCH_NOTHING_RE,contains:[{className:"title",match:ax,relevance:0},{begin:/{/,end:/}/,relevance:0,endsParent:!0,keywords:[...Yy,...Xy],contains:[k]}]};for(const e of w.variants){const t=e.contains.find((e=>"interpol"===e.label));t.keywords=l;const n=[...c,...u,...d,g,w,...E];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,T,L,{className:"class",beginKeywords:"struct protocol class extension enum",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},M,R,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...c,...u,...d,g,w,...E,...N,k,S]}};var hx=function(e){const t={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},n={className:"subst",variants:[{begin:/\$\{/,end:/\}/}],keywords:"true false null this is new super"},r={className:"string",variants:[{begin:"r'''",end:"'''"},{begin:'r"""',end:'"""'},{begin:"r'",end:"'",illegal:"\\n"},{begin:'r"',end:'"',illegal:"\\n"},{begin:"'''",end:"'''",contains:[e.BACKSLASH_ESCAPE,t,n]},{begin:'"""',end:'"""',contains:[e.BACKSLASH_ESCAPE,t,n]},{begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,n]},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,n]}]};n.contains=[e.C_NUMBER_MODE,r];const i=["Comparable","DateTime","Duration","Function","Iterable","Iterator","List","Map","Match","Object","Pattern","RegExp","Set","Stopwatch","String","StringBuffer","StringSink","Symbol","Type","Uri","bool","double","int","num","Element","ElementList"],s=i.map((e=>`${e}?`));return{name:"Dart",keywords:{keyword:"abstract as assert async await break case catch class const continue covariant default deferred do dynamic else enum export extends extension external factory false final finally for Function get hide if implements import in inferface is late library mixin new null on operator part required rethrow return set show static super switch sync this throw true try typedef var void while with yield",built_in:i.concat(s).concat(["Never","Null","dynamic","print","document","querySelector","querySelectorAll","window"]),$pattern:/[A-Za-z][A-Za-z0-9_]*\??/},contains:[r,e.COMMENT(/\/\*\*(?!\/)/,/\*\//,{subLanguage:"markdown",relevance:0}),e.COMMENT(/\/{3,} ?/,/$/,{contains:[{subLanguage:"markdown",begin:".",end:"$",relevance:0}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},e.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"},{begin:"=>"}]}};function dx(e,t){if("object"==typeof t)for(let n in t)e.style[n]=t[n]}function fx(e,t){let n=t.getBoundingClientRect();return{x:e.x-n.x-t.scrollLeft,y:e.y-n.y-t.scrollTop,x1:e.x-n.x-t.scrollLeft+e.width,y1:e.y-n.y-t.scrollTop+e.height,width:e.width,height:e.height}}function px(e,t){return e&&Object.keys(e).reduce(((n,r)=>t.includes(r)?n:Object.assign({},n,{[r]:e[r]})),{})}function gx(e){let t;if(t=e.path||e.composedPath&&e.composedPath(),null==t&&e.target){t=[];let n=e.target;for(t.push(n);n&&n.parentNode;)n=n.parentNode,t.push(n)}return t}class mx{constructor(e,t,n){if(!e)return null;this.table=e,this.quill=t,this.options=n,this.domNode=null,this.initColTool()}initColTool(){const e=this.quill.root.parentNode;this.table.getBoundingClientRect();const t=e.getBoundingClientRect(),n=this.table.parentNode.getBoundingClientRect();this.domNode=document.createElement("div"),this.domNode.classList.add("qlbt-col-tool"),this.updateToolCells(),e.appendChild(this.domNode),dx(this.domNode,{width:`${n.width}px`,height:"10px",left:`${n.left-t.left+e.scrollLeft}px`,top:n.top-t.top+e.scrollTop-10-5+"px"})}createToolCell(){const e=document.createElement("div");e.classList.add("qlbt-col-tool-cell");const t=document.createElement("div");return t.classList.add("qlbt-col-tool-cell-holder"),dx(e,{height:"10px"}),e.appendChild(t),e}updateToolCells(){const e=$p.find(this.table),t=e.children.tail.children.head.children,n=e.colGroup().children,r=function(e){return e.reduce(((e,t)=>{const n=t.formats().colspan;return e+=parseInt(n,10)}),0)}(t);let i=Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell"));for(let e=0;e=r?i[e].remove():(o=i[e],dx(o,{"min-width":`${s}px`})):(o=this.createToolCell(),this.domNode.appendChild(o),this.addColCellHolderHandler(o),dx(o,{"min-width":`${s}px`}))}}destroy(){return this.domNode.remove(),null}addColCellHolderHandler(e){const t=$p.find(this.table),n=e.querySelector(".qlbt-col-tool-cell-holder");let r=!1,i=0,s=0,o=0,a=0,l={},c={},u=null;const h=e=>{e.preventDefault(),r&&(s=e.clientX,o=a+s-i>=50?s-i:50-a,dx(u,{left:`${c.left+c.width-1+o}px`}))},d=f=>{f.preventDefault();const p=Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell")).indexOf(e),g=t.colGroup().children.at(p);r&&(g.format("width",a+o),dx(e,{"min-width":`${a+o}px`}),i=0,s=0,o=0,a=0,r=!1,n.classList.remove("dragging")),document.removeEventListener("mousemove",h,!1),document.removeEventListener("mouseup",d,!1),l={},c={},u.remove(),u=null,t.updateTableWidth();const m=this.quill.getModule("better-table").tableSelection;m&&m.clearSelection()};n.addEventListener("mousedown",(t=>{document.addEventListener("mousemove",h,!1),document.addEventListener("mouseup",d,!1),l=this.table.getBoundingClientRect(),c=e.getBoundingClientRect(),u=document.createElement("div"),dx(u,{position:"fixed",top:`${c.top}px`,left:c.left+c.width-1+"px",zIndex:"100",height:`${l.height+10+4}px`,width:"1px",backgroundColor:"#35A7ED"}),document.body.appendChild(u),r=!0,i=t.clientX,a=c.width,n.classList.add("dragging")}),!1)}colToolCells(){return Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell"))}}const bx=$p.import("blots/block");class vx extends bx{static create(e){"string"==typeof e&&(e={value:e});const t=super.create(e.value);return Nx.forEach((n=>{e[n]&&t.setAttribute(`data-${n}`,e[n])})),kx.forEach((n=>{e[n]&&t.setAttribute(`data-${n}`,e[n])})),t}static formats(e){const t={};return t.value=this.tagName.indexOf(e.tagName)+1,kx.concat(Nx).reduce(((t,n)=>(e.hasAttribute(`data-${n}`)&&(t[n]=e.getAttribute(`data-${n}`)||void 0),t)),t)}format(e,t){const{row:n,cell:r,rowspan:i,colspan:s}=vx.formats(this.domNode);e===vx.blotName?t?super.format(e,{value:t,row:n,cell:r,rowspan:i,colspan:s}):n?this.replaceWith(Sx.blotName,{row:n,cell:r,rowspan:i,colspan:s}):super.format(e,t):super.format(e,t)}optimize(e){const{row:t,rowspan:n,colspan:r}=vx.formats(this.domNode);if(!t||this.parent instanceof qx||this.wrap(qx.blotName,{row:t,colspan:r,rowspan:n}),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove();this.cache={}}}vx.blotName="header",vx.tagName=["H1","H2","H3","H4","H5","H6"];const yx=$p.import("blots/break"),xx=$p.import("blots/block"),wx=$p.import("blots/container"),_x=["width"],Ex={width:120},Nx=["row","cell"],kx=["rowspan","colspan"],Ax={rowspan:1,colspan:1};class Sx extends xx{static create(e){const t=super.create(e);return Nx.forEach((n=>{let r="row"===n?Ix:jx;t.setAttribute(`data-${n}`,e[n]||r())})),kx.forEach((n=>{t.setAttribute(`data-${n}`,e[n]||Ax[n])})),e["cell-bg"]&&t.setAttribute("data-cell-bg",e["cell-bg"]),t}static formats(e){return kx.concat(Nx).concat(["cell-bg"]).reduce(((t,n)=>(e.hasAttribute(`data-${n}`)&&(t[n]=e.getAttribute(`data-${n}`)||void 0),t)),{})}format(e,t){if(kx.concat(Nx).indexOf(e)>-1)t?this.domNode.setAttribute(`data-${e}`,t):this.domNode.removeAttribute(`data-${e}`);else if("cell-bg"===e)t?this.domNode.setAttribute("data-cell-bg",t):this.domNode.removeAttribute("data-cell-bg");else if("header"===e){if(!t)return;const{row:n,cell:r,rowspan:i,colspan:s}=Sx.formats(this.domNode);super.format(e,{value:t,row:n,cell:r,rowspan:i,colspan:s})}else super.format(e,t)}optimize(e){const t=this.domNode.getAttribute("data-row"),n=this.domNode.getAttribute("data-rowspan"),r=this.domNode.getAttribute("data-colspan"),i=this.domNode.getAttribute("data-cell-bg");!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName,{row:t,colspan:r,rowspan:n,"cell-bg":i}),super.optimize(e)}tableCell(){return this.parent}}Sx.blotName="table-cell-line",Sx.className="qlbt-cell-line",Sx.tagName="P";class qx extends wx{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head&&this.children.head.formats&&this.children.tail.formats&&this.next.children.head.formats&&this.next.children.tail.formats){const e=this.children.head.formats()[this.children.head.statics.blotName],t=this.children.tail.formats()[this.children.tail.statics.blotName],n=this.next.children.head.formats()[this.next.children.head.statics.blotName],r=this.next.children.tail.formats()[this.next.children.tail.statics.blotName];if(e&&t&&n&&r)return e.cell===t.cell&&e.cell===n.cell&&e.cell===r.cell}return!1}static create(e){const t=super.create(e);return t.setAttribute("data-row",e.row),kx.forEach((n=>{e[n]&&t.setAttribute(n,e[n])})),e["cell-bg"]&&(t.setAttribute("data-cell-bg",e["cell-bg"]),t.style.backgroundColor=e["cell-bg"]),t}static formats(e){const t={};return e.hasAttribute("data-row")&&(t.row=e.getAttribute("data-row")),e.hasAttribute("data-cell-bg")&&(t["cell-bg"]=e.getAttribute("data-cell-bg")),kx.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),t)}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}formats(){const e={};return this.domNode.hasAttribute("data-row")&&(e.row=this.domNode.getAttribute("data-row")),this.domNode.hasAttribute("data-cell-bg")&&(e["cell-bg"]=this.domNode.getAttribute("data-cell-bg")),kx.reduce(((e,t)=>(this.domNode.hasAttribute(t)&&(e[t]=this.domNode.getAttribute(t)),e)),e)}toggleAttribute(e,t){t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e)}formatChildren(e,t){this.children.forEach((n=>{n.format(e,t)}))}format(e,t){kx.indexOf(e)>-1?(this.toggleAttribute(e,t),this.formatChildren(e,t)):["row"].indexOf(e)>-1?(this.toggleAttribute(`data-${e}`,t),this.formatChildren(e,t)):"cell-bg"===e?(this.toggleAttribute("data-cell-bg",t),this.formatChildren(e,t),this.domNode.style.backgroundColor=t||"initial"):super.format(e,t)}optimize(e){const t=this.domNode.getAttribute("data-row");!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName,{row:t}),super.optimize(e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}qx.blotName="table",qx.tagName="TD";class Ox extends wx{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.row===t.row&&e.row===n.row&&e.row===r.row}return!1}static create(e){const t=super.create(e);return t.setAttribute("data-row",e.row),t}formats(){return["row"].reduce(((e,t)=>(this.domNode.hasAttribute(`data-${t}`)&&(e[t]=this.domNode.getAttribute(`data-${t}`)),e)),{})}optimize(e){!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}Ox.blotName="table-row",Ox.tagName="TR";class Cx extends wx{}Cx.blotName="table-body",Cx.tagName="TBODY";class Tx extends xx{static create(e){let t=super.create(e);return _x.forEach((n=>{t.setAttribute(`${n}`,e[n]||Ex[n])})),t}static formats(e){return _x.reduce(((t,n)=>(e.hasAttribute(`${n}`)&&(t[n]=e.getAttribute(`${n}`)||void 0),t)),{})}format(e,t){_x.indexOf(e)>-1?this.domNode.setAttribute(`${e}`,t||Ex[e]):super.format(e,t)}html(){return this.domNode.outerHTML}}Tx.blotName="table-col",Tx.tagName="col";class Lx extends wx{}Lx.blotName="table-col-group",Lx.tagName="colgroup";class Mx extends wx{static create(){return super.create()}constructor(e,t){super(e,t),this.updateTableWidth()}updateTableWidth(){setTimeout((()=>{const e=this.colGroup();if(!e)return;const t=e.children.reduce(((e,t)=>e+=parseInt(t.formats()[Tx.blotName].width,10)),0);this.domNode.style.width=`${t}px`}),0)}cells(e){return this.rows().map((t=>t.children.at(e)))}colGroup(){return this.children.head}deleteColumns(e,t=[],n){const[r]=this.descendants(Cx);if(null==r||null==r.children.head)return;const i=this.descendants(qx),s=[],o=[];if(i.forEach((t=>{const r=fx(t.domNode.getBoundingClientRect(),n);r.x+5>e.x&&r.x1-5e.x1-5&&o.push(t)})),s.length===i.length)return this.tableDestroy(),!0;t.forEach((e=>{this.colGroup().children.at(t[0]).remove()})),s.forEach((e=>{e.remove()})),o.forEach((e=>{const n=parseInt(e.formats().colspan,10);parseInt(e.formats().width,10),e.format("colspan",n-t.length)})),this.updateTableWidth()}deleteRow(e,t){const[n]=this.descendants(Cx);if(null==n||null==n.children.head)return;const r=this.descendants(qx),i=this.descendants(Ox),s=[],o=[],a=[],l=i.filter((n=>{const r=fx(n.domNode.getBoundingClientRect(),t);return r.y>e.y-5&&r.y1{const r=fx(n.domNode.getBoundingClientRect(),t);r.y>e.y-5&&r.y1e.y1-5&&(o.push(n),Math.abs(r.y-e.y)<5&&a.push(n))})),s.length===r.length)return void this.tableDestroy();const c=this.rows().reduce(((n,r)=>{let i=fx(r.domNode.getBoundingClientRect(),t);return i.y>e.y-5&&i.y1{const n=fx(e.domNode.getBoundingClientRect(),t),r=e.parent.next,i=r.children.reduce(((e,r)=>{const i=fx(r.domNode.getBoundingClientRect(),t);return Math.abs(n.x1-i.x)<5&&(e=r),e}),null);r.insertBefore(e,i),e.format("row",r.formats().row)})),s.forEach((e=>{e.remove()})),o.forEach((e=>{const t=parseInt(e.formats().rowspan,10);e.format("rowspan",t-c)})),l.forEach((e=>e.remove()))}tableDestroy(){const e=$p.find(this.scroll.domNode.parentNode),t=e.getModule("better-table");this.remove(),t.hideTableTools(),e.update($p.sources.USER)}insertCell(e,t){const n=jx(),r=e.formats().row,i=this.scroll.create(qx.blotName,Object.assign({},Ax,{row:r})),s=this.scroll.create(Sx.blotName,{row:r,cell:n});i.appendChild(s),t?e.insertBefore(i,t):e.appendChild(i)}insertColumn(e,t,n=!0,r){const[i]=this.descendants(Cx),[s]=this.descendants(Lx),o=this.descendants(Tx);let a=[],l=[],c=[];if(null==i||null==i.children.head)return;this.descendants(qx).forEach((t=>{const i=fx(t.domNode.getBoundingClientRect(),r);n?Math.abs(i.x1-e.x1)<5?a.push(t):e.x1-i.x>5&&e.x1-i.x1<-5&&l.push(t):Math.abs(i.x-e.x)<5?a.push(t):e.x-i.x>5&&e.x-i.x1<-5&&l.push(t)})),a.forEach((e=>{const t=n?e.next:e,r=jx(),i=e.parent,s=i.formats().row,o=e.formats(),a=this.scroll.create(qx.blotName,Object.assign({},Ax,{row:s,rowspan:o.rowspan})),l=this.scroll.create(Sx.blotName,{row:s,cell:r,rowspan:o.rowspan});a.appendChild(l),t?i.insertBefore(a,t):i.appendChild(a),c.push(a)}));const u=this.scroll.create(Tx.blotName,!0);let h=n?o[t].next:o[t];return h?s.insertBefore(u,h):s.appendChild(u),l.forEach((e=>{const t=e.formats().colspan;e.format("colspan",parseInt(t,10)+1),c.push(e)})),c.sort(((e,t)=>e.domNode.getBoundingClientRect().y-t.domNode.getBoundingClientRect().y)),this.updateTableWidth(),c}insertRow(e,t,n){const[r]=this.descendants(Cx);if(null==r||null==r.children.head)return;const i=this.descendants(qx),s=Ix(),o=this.scroll.create(Ox.blotName,{row:s});let a=[],l=[],c=[];i.forEach((r=>{const i=fx(r.domNode.getBoundingClientRect(),n);t?Math.abs(i.y1-e.y1)<5?a.push(r):e.y1-i.y>5&&e.y1-i.y1<-5&&l.push(r):Math.abs(i.y-e.y)<5?a.push(r):e.y-i.y>5&&e.y-i.y1<-5&&l.push(r)}));const u=(e,t)=>e.domNode.getBoundingClientRect().x-t.domNode.getBoundingClientRect().x;a.sort(u),a.forEach((e=>{const t=jx(),n=e.formats(),r=this.scroll.create(qx.blotName,Object.assign({},Ax,{row:s,colspan:n.colspan})),i=this.scroll.create(Sx.blotName,{row:s,cell:t,colspan:n.colspan}),a=this.scroll.create(yx.blotName);i.appendChild(a),r.appendChild(i),o.appendChild(r),c.push(r)})),l.forEach((e=>{const t=parseInt(e.formats().rowspan,10);e.format("rowspan",t+1),c.push(e)}));const h=this.rows().find((r=>{let i=fx(r.domNode.getBoundingClientRect(),n);return t?Math.abs(i.y-e.y-e.height)<5:Math.abs(i.y-e.y)<5}));return r.insertBefore(o,h),c.sort(u),c}mergeCells(e,t,n,r,i){const s=t.reduce(((e,t,i)=>(0!==i?(e&&t.moveChildren(e),t.remove()):(t.format("colspan",r),t.format("rowspan",n),e=t),e)),null);let o=s.domNode.getAttribute("data-row"),a=s.children.head.domNode.getAttribute("data-cell");return s.children.forEach((e=>{e.format("cell",a),e.format("row",o),e.format("colspan",r),e.format("rowspan",n)})),s}unmergeCells(e,t){let n={},r=1,i=1;e.forEach((e=>{if(n=e.formats(),r=n.rowspan,i=n.colspan,i>1){let t=e.next,n=e.row();e.format("colspan",1);for(let e=i;e>1;e--)this.insertCell(n,t)}if(r>1){let n=r,s=e.row().next;for(;n>1;){let r=s.children.reduce(((n,r)=>{let i=fx(e.domNode.getBoundingClientRect(),t),s=fx(r.domNode.getBoundingClientRect(),t);return Math.abs(i.x1-s.x)<5&&(n=r),n}),null);for(let e=i;e>0;e--)this.insertCell(s,r);n-=1,s=s.next}e.format("rowspan",1)}}))}rows(){const e=this.children.tail;return null==e?[]:e.children.map((e=>e))}}Mx.blotName="table-container",Mx.className="quill-better-table",Mx.tagName="TABLE";class Rx extends wx{constructor(e,t){super(e,t);const n=$p.find(e.domNode.parentNode);t.addEventListener("scroll",(e=>{const t=n.getModule("better-table");t.columnTool&&(t.columnTool.domNode.scrollLeft=e.target.scrollLeft),t.tableSelection&&t.tableSelection.selectedTds.length>0&&t.tableSelection.repositionHelpLines()}),!1)}table(){return this.children.head}}function Ix(){return`row-${Math.random().toString(36).slice(2,6)}`}function jx(){return`cell-${Math.random().toString(36).slice(2,6)}`}Rx.blotName="table-view",Rx.className="quill-better-table-wrapper",Rx.tagName="DIV",Rx.allowedChildren=[Mx],Mx.requiredContainer=Rx,Mx.allowedChildren=[Cx,Lx],Cx.requiredContainer=Mx,Cx.allowedChildren=[Ox],Ox.requiredContainer=Cx,Ox.allowedChildren=[qx],qx.requiredContainer=Ox,qx.allowedChildren=[Sx,vx],Sx.requiredContainer=qx,Lx.allowedChildren=[Tx],Lx.requiredContainer=Mx,Tx.requiredContainer=Lx;const Bx=["left","right","top","bottom"];class Dx{constructor(e,t,n){if(!e)return null;this.table=e,this.quill=t,this.options=n,this.boundary={},this.selectedTds=[],this.dragging=!1,this.selectingHandler=this.mouseDownHandler.bind(this),this.clearSelectionHandler=this.clearSelection.bind(this),this.helpLinesInitial(),this.quill.root.addEventListener("mousedown",this.selectingHandler,!1),this.quill.on("text-change",this.clearSelectionHandler)}helpLinesInitial(){let e=this.quill.root.parentNode;Bx.forEach((t=>{this[t]=document.createElement("div"),this[t].classList.add("qlbt-selection-line"),this[t].classList.add("qlbt-selection-line-"+t),dx(this[t],{position:"absolute",display:"none","background-color":"#6918b4"}),e.appendChild(this[t])}))}mouseDownHandler(e){if(0!==e.button||!e.target.closest(".quill-better-table"))return;this.quill.root.addEventListener("mousemove",i,!1),this.quill.root.addEventListener("mouseup",(function e(n){t.quill.root.removeEventListener("mousemove",i,!1),t.quill.root.removeEventListener("mouseup",e,!1),t.dragging=!1}),!1);const t=this,n=e.target.closest("td[data-row]"),r=fx(n.getBoundingClientRect(),this.quill.root.parentNode);function i(e){if(0!==e.button||!e.target.closest(".quill-better-table"))return;const i=e.target.closest("td[data-row]"),s=fx(i.getBoundingClientRect(),t.quill.root.parentNode);t.boundary=zx(r,s),t.correctBoundary(),t.selectedTds=t.computeSelectedTds(),t.repositionHelpLines(),n!==i&&t.quill.blur()}this.dragging=!0,this.boundary=zx(r,r),this.correctBoundary(),this.selectedTds=this.computeSelectedTds(),this.repositionHelpLines()}correctBoundary(){$p.find(this.table).descendants(qx).forEach((e=>{let{x:t,y:n,width:r,height:i}=fx(e.domNode.getBoundingClientRect(),this.quill.root.parentNode);(t+2>=this.boundary.x&&t+2<=this.boundary.x1||t-2+r>=this.boundary.x&&t-2+r<=this.boundary.x1)&&(n+2>=this.boundary.y&&n+2<=this.boundary.y1||n-2+i>=this.boundary.y&&n-2+i<=this.boundary.y1)&&(this.boundary=zx(this.boundary,{x:t,y:n,width:r,height:i}))}))}computeSelectedTds(){return $p.find(this.table).descendants(qx).reduce(((e,t)=>{let{x:n,y:r,width:i,height:s}=fx(t.domNode.getBoundingClientRect(),this.quill.root.parentNode);return n+2>=this.boundary.x&&n-2+i<=this.boundary.x1&&r+2>=this.boundary.y&&r-2+s<=this.boundary.y1&&e.push(t),e}),[])}repositionHelpLines(){const e=this.table.parentNode.scrollLeft;dx(this.left,{display:"block",left:this.boundary.x-e-1+"px",top:`${this.boundary.y}px`,height:`${this.boundary.height+1}px`,width:"1px"}),dx(this.right,{display:"block",left:this.boundary.x1-e+"px",top:`${this.boundary.y}px`,height:`${this.boundary.height+1}px`,width:"1px"}),dx(this.top,{display:"block",left:this.boundary.x-1-e+"px",top:`${this.boundary.y}px`,width:`${this.boundary.width+1}px`,height:"1px"}),dx(this.bottom,{display:"block",left:this.boundary.x-1-e+"px",top:`${this.boundary.y1+1}px`,width:`${this.boundary.width+1}px`,height:"1px"})}refreshHelpLinesPosition(){const e=fx(this.selectedTds[0].domNode.getBoundingClientRect(),this.quill.root.parentNode),t=fx(this.selectedTds[this.selectedTds.length-1].domNode.getBoundingClientRect(),this.quill.root.parentNode);this.boundary=zx(e,t),this.repositionHelpLines()}destroy(){return Bx.forEach((e=>{this[e].remove(),this[e]=null})),this.quill.root.removeEventListener("mousedown",this.selectingHandler,!1),this.quill.off("text-change",this.clearSelectionHandler),null}setSelection(e,t){this.boundary=zx(fx(e,this.quill.root.parentNode),fx(t,this.quill.root.parentNode)),this.correctBoundary(),this.selectedTds=this.computeSelectedTds(),this.repositionHelpLines()}clearSelection(){this.boundary={},this.selectedTds=[],Bx.forEach((e=>{this[e]&&dx(this[e],{display:"none"})}))}}function zx(e,t){let n=Math.min(e.x,t.x,e.x+e.width-1,t.x+t.width-1),r=Math.max(e.x,t.x,e.x+e.width-1,t.x+t.width-1),i=Math.min(e.y,t.y,e.y+e.height-1,t.y+t.height-1),s=Math.max(e.y,t.y,e.y+e.height-1,t.y+t.height-1);return{x:n,x1:r,y:i,y1:s,width:r-n,height:s-i}}const Ux=["white","red","yellow","blue"],$x={insertColumnRight:{text:"Insert Column Right",iconSrc:'',handler(){const e=$p.find(this.table);let t=Hx(this.columnToolCells,this.boundary,((e,t)=>Math.abs(e.x+e.width-t.x1)<=5),this.quill.root.parentNode);const n=e.insertColumn(this.boundary,t,!0,this.quill.root.parentNode);this.tableColumnTool.updateToolCells(),this.quill.update($p.sources.USER),this.quill.setSelection(this.quill.getIndex(n[0]),0,$p.sources.SILENT),this.tableSelection.setSelection(n[0].domNode.getBoundingClientRect(),n[0].domNode.getBoundingClientRect())}},insertColumnLeft:{text:"Insert Column Left",iconSrc:'',handler(){const e=$p.find(this.table);let t=Hx(this.columnToolCells,this.boundary,((e,t)=>Math.abs(e.x-t.x)<=5),this.quill.root.parentNode);const n=e.insertColumn(this.boundary,t,!1,this.quill.root.parentNode);this.tableColumnTool.updateToolCells(),this.quill.update($p.sources.USER),this.quill.setSelection(this.quill.getIndex(n[0]),0,$p.sources.SILENT),this.tableSelection.setSelection(n[0].domNode.getBoundingClientRect(),n[0].domNode.getBoundingClientRect())}},insertRowUp:{text:"Insert Row Above",iconSrc:'',handler(){const e=$p.find(this.table).insertRow(this.boundary,!1,this.quill.root.parentNode);this.quill.update($p.sources.USER),this.quill.setSelection(this.quill.getIndex(e[0]),0,$p.sources.SILENT),this.tableSelection.setSelection(e[0].domNode.getBoundingClientRect(),e[0].domNode.getBoundingClientRect())}},insertRowDown:{text:"Insert Row Below",iconSrc:'',handler(){const e=$p.find(this.table).insertRow(this.boundary,!0,this.quill.root.parentNode);this.quill.update($p.sources.USER),this.quill.setSelection(this.quill.getIndex(e[0]),0,$p.sources.SILENT),this.tableSelection.setSelection(e[0].domNode.getBoundingClientRect(),e[0].domNode.getBoundingClientRect())}},mergeCells:{text:"Merge Selected Cells",iconSrc:'',handler(){const e=$p.find(this.table),t=e.rows().reduce(((e,t)=>{let n=fx(t.domNode.getBoundingClientRect(),this.quill.root.parentNode);return n.y>this.boundary.y-5&&n.y+n.height{let n=fx(t.getBoundingClientRect(),this.quill.root.parentNode);return n.x>this.boundary.x-5&&n.x+n.width
    ")}value(){return this.buffer}span(e){this.buffer+=``}}class tv{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{tv._collapse(e)})))}}class nv extends tv{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new ev(this,this.options).value()}finalize(){return!0}}function rv(e){return e?"string"==typeof e?e:e.source:null}const iv=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const sv="[a-zA-Z]\\w*",ov="[a-zA-Z_]\\w*",av="\\b\\d+(\\.\\d+)?",lv="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",cv="\\b(0b[01]+)",uv={begin:"\\\\[\\s\\S]",relevance:0},hv={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[uv]},dv={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[uv]},fv={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},pv=function(e,t,n={}){const r=Yb({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(fv),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},gv=pv("//","$"),mv=pv("/\\*","\\*/"),bv=pv("#","$"),vv={className:"number",begin:av,relevance:0},yv={className:"number",begin:lv,relevance:0},xv={className:"number",begin:cv,relevance:0},wv={className:"number",begin:av+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},_v={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[uv,{begin:/\[/,end:/\]/,relevance:0,contains:[uv]}]}]},Ev={className:"title",begin:sv,relevance:0},Nv={className:"title",begin:ov,relevance:0},kv={begin:"\\.\\s*"+ov,relevance:0};var Av=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:sv,UNDERSCORE_IDENT_RE:ov,NUMBER_RE:av,C_NUMBER_RE:lv,BINARY_NUMBER_RE:cv,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map((e=>rv(e))).join("")}(t,/.*\b/,e.binary,/\b.*/)),Yb({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:uv,APOS_STRING_MODE:hv,QUOTE_STRING_MODE:dv,PHRASAL_WORDS_MODE:fv,COMMENT:pv,C_LINE_COMMENT_MODE:gv,C_BLOCK_COMMENT_MODE:mv,HASH_COMMENT_MODE:bv,NUMBER_MODE:vv,C_NUMBER_MODE:yv,BINARY_NUMBER_MODE:xv,CSS_NUMBER_MODE:wv,REGEXP_MODE:_v,TITLE_MODE:Ev,UNDERSCORE_TITLE_MODE:Nv,METHOD_GUARD:kv,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function Sv(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function qv(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Sv,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Ov(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map((e=>rv(e))).join("|")+")"}(...e.illegal))}function Cv(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Tv(e,t){void 0===e.relevance&&(e.relevance=1)}const Lv=["of","and","for","in","not","or","if","then","parent","list","value"],Mv="keyword";function Rv(e,t,n=Mv){const r={};return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach((function(n){Object.assign(r,Rv(e[n],t,n))})),r;function i(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");r[n[0]]=[e,Iv(n[0],n[1])]}))}}function Iv(e,t){return t?Number(t):function(e){return Lv.includes(e.toLowerCase())}(e)?0:1}function jv(e,{plugins:t}){function n(t,n){return new RegExp(rv(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(function(e,t="|"){let n=0;return e.map((e=>{n+=1;const t=n;let r=rv(e),i="";for(;r.length>0;){const e=iv.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i})).map((e=>`(${e})`)).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new r;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Yb(e.classNameAliases||{}),function t(r,s){const o=r;if(r.isCompiled)return o;[Cv].forEach((e=>e(r,s))),e.compilerExtensions.forEach((e=>e(r,s))),r.__beforeBegin=null,[qv,Ov,Tv].forEach((e=>e(r,s))),r.isCompiled=!0;let a=null;if("object"==typeof r.keywords&&(a=r.keywords.$pattern,delete r.keywords.$pattern),r.keywords&&(r.keywords=Rv(r.keywords,e.case_insensitive)),r.lexemes&&a)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return a=a||r.lexemes||/\w+/,o.keywordPatternRe=n(a,!0),s&&(r.begin||(r.begin=/\B|\b/),o.beginRe=n(r.begin),r.endSameAsBegin&&(r.end=r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(o.endRe=n(r.end)),o.terminatorEnd=rv(r.end)||"",r.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(r.end?"|":"")+s.terminatorEnd)),r.illegal&&(o.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return Yb(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(Bv(e))return Yb(e,{starts:e.starts?Yb(e.starts):null});if(Object.isFrozen(e))return Yb(e);return e}("self"===e?r:e)}))),r.contains.forEach((function(e){t(e,o)})),r.starts&&t(r.starts,s),o.matcher=function(e){const t=new i;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function Bv(e){return!!e&&(e.endsWithParent||Bv(e.starts))}function Dv(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,Xb(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const zv={"after:highlightElement":({el:e,result:t,text:n})=>{const r=$v(e);if(!r.length)return;const i=document.createElement("div");i.innerHTML=t.value,t.value=function(e,t,n){let r=0,i="";const s=[];function o(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function l(e){i+=""}function c(e){("start"===e.event?a:l)(e.node)}for(;e.length||t.length;){let t=o();if(i+=Xb(n.substring(r,t[0].offset)),r=t[0].offset,t===e){s.reverse().forEach(l);do{c(t.splice(0,1)[0]),t=o()}while(t===e&&t.length&&t[0].offset===r);s.reverse().forEach(a)}else"start"===t[0].event?s.push(t[0].node):s.pop(),c(t.splice(0,1)[0])}return i+Xb(n.substr(r))}(r,$v(i),n)}};function Uv(e){return e.nodeName.toLowerCase()}function $v(e){const t=[];return function e(n,r){for(let i=n.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:r,node:i}),r=e(i,r),Uv(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:i}));return r}(e,0),t}const Pv={},Hv=e=>{console.error(e)},Fv=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Wv=(e,t)=>{Pv[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Pv[`${e}/${t}`]=!0)},Kv=Xb,Vv=Yb,Gv=Symbol("nomatch");var Zv=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const s=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:nv};function c(e){return l.noHighlightRe.test(e)}function u(e,t,n,r){let i="",s="";"object"==typeof t?(i=e,n=t.ignoreIllegals,s=t.language,r=void 0):(Wv("10.7.0","highlight(lang, code, ...args) has been deprecated."),Wv("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),s=e,i=t);const o={code:i,language:s};E("before:highlight",o);const a=o.result?o.result:h(o.language,o.code,n,r);return a.code=o.code,E("after:highlight",a),a}function h(e,n,s,a){function c(e,t){const n=w.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function u(){null!=N.subLanguage?function(){if(""===S)return;let e=null;if("string"==typeof N.subLanguage){if(!t[N.subLanguage])return void A.addText(S);e=h(N.subLanguage,S,!0,k[N.subLanguage]),k[N.subLanguage]=e.top}else e=d(S,N.subLanguage.length?N.subLanguage:null);N.relevance>0&&(q+=e.relevance),A.addSublanguage(e.emitter,e.language)}():function(){if(!N.keywords)return void A.addText(S);let e=0;N.keywordPatternRe.lastIndex=0;let t=N.keywordPatternRe.exec(S),n="";for(;t;){n+=S.substring(e,t.index);const r=c(N,t);if(r){const[e,i]=r;if(A.addText(n),n="",q+=i,e.startsWith("_"))n+=t[0];else{const n=w.classNameAliases[e]||e;A.addKeyword(t[0],n)}}else n+=t[0];e=N.keywordPatternRe.lastIndex,t=N.keywordPatternRe.exec(S)}n+=S.substr(e),A.addText(n)}(),S=""}function f(e){return e.className&&A.openNode(w.classNameAliases[e.className]||e.className),N=Object.create(e,{parent:{value:N}}),N}function p(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new Qb(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return p(e.parent,t,n)}function g(e){return 0===N.matcher.regexIndex?(S+=e[0],1):(T=!0,0)}function m(e){const t=e[0],n=e.rule,r=new Qb(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return g(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?S+=t:(n.excludeBegin&&(S+=t),u(),n.returnBegin||n.excludeBegin||(S=t)),f(n),n.returnBegin?0:t.length}function b(e){const t=e[0],r=n.substr(e.index),i=p(N,e,r);if(!i)return Gv;const s=N;s.skip?S+=t:(s.returnEnd||s.excludeEnd||(S+=t),u(),s.excludeEnd&&(S=t));do{N.className&&A.closeNode(),N.skip||N.subLanguage||(q+=N.relevance),N=N.parent}while(N!==i.parent);return i.starts&&(i.endSameAsBegin&&(i.starts.endRe=i.endRe),f(i.starts)),s.returnEnd?0:t.length}let v={};function y(t,r){const o=r&&r[0];if(S+=t,null==o)return u(),0;if("begin"===v.type&&"end"===r.type&&v.index===r.index&&""===o){if(S+=n.slice(r.index,r.index+1),!i){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=r,"begin"===r.type)return m(r);if("illegal"===r.type&&!s){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(N.className||"")+'"');throw e.mode=N,e}if("end"===r.type){const e=b(r);if(e!==Gv)return e}if("illegal"===r.type&&""===o)return 1;if(C>1e5&&C>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return S+=o,o.length}const w=x(e);if(!w)throw Hv(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const _=jv(w,{plugins:r});let E="",N=a||_;const k={},A=new l.__emitter(l);!function(){const e=[];for(let t=N;t!==w;t=t.parent)t.className&&e.unshift(t.className);e.forEach((e=>A.openNode(e)))}();let S="",q=0,O=0,C=0,T=!1;try{for(N.matcher.considerAll();;){C++,T?T=!1:N.matcher.considerAll(),N.matcher.lastIndex=O;const e=N.matcher.exec(n);if(!e)break;const t=y(n.substring(O,e.index),e);O=e.index+t}return y(n.substr(O)),A.closeAllNodes(),A.finalize(),E=A.toHTML(),{relevance:Math.floor(q),value:E,language:e,illegal:!1,emitter:A,top:N}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(O-100,O+100),mode:t.mode},sofar:E,relevance:0,value:Kv(n),emitter:A};if(i)return{illegal:!1,relevance:0,value:Kv(n),emitter:A,language:e,top:N,errorRaised:t};throw t}}function d(e,n){n=n||l.languages||Object.keys(t);const r=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:Kv(e),illegal:!1,top:a};return t.emitter.addText(e),t}(e),i=n.filter(x).filter(_).map((t=>h(t,e,!1)));i.unshift(r);const s=i.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(x(e.language).supersetOf===t.language)return 1;if(x(t.language).supersetOf===e.language)return-1}return 0})),[o,c]=s,u=o;return u.second_best=c,u}const f={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"
    "))}},p=/^(<[^>]+>|\t)+/gm,g={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(p,(e=>e.replace(/\t/g,l.tabReplace))))}};function m(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=l.languageDetectRe.exec(t);if(n){const t=x(n[1]);return t||(Fv(o.replace("{}",n[1])),Fv("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>c(e)||x(e)))}(e);if(c(r))return;E("before:highlightElement",{el:e,language:r}),t=e;const i=t.textContent,s=r?u(i,{language:r,ignoreIllegals:!0}):d(i);E("after:highlightElement",{el:e,result:s,text:i}),e.innerHTML=s.value,function(e,t,r){const i=t?n[t]:r;e.classList.add("hljs"),i&&e.classList.add(i)}(e,r,s.language),e.result={language:s.language,re:s.relevance,relavance:s.relevance},s.second_best&&(e.second_best={language:s.second_best.language,re:s.second_best.relevance,relavance:s.second_best.relevance})}const b=()=>{if(b.called)return;b.called=!0,Wv("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(m)};let v=!1;function y(){if("loading"===document.readyState)return void(v=!0);document.querySelectorAll("pre code").forEach(m)}function x(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function w(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function _(e){const t=x(e);return t&&!t.disableAutodetect}function E(e,t){const n=e;r.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){v&&y()}),!1),Object.assign(e,{highlight:u,highlightAuto:d,highlightAll:y,fixMarkup:function(e){return Wv("10.2.0","fixMarkup will be removed entirely in v11.0"),Wv("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(s,(e=>"\n"===e?l.useBR?"
    ":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e)):t;var t},highlightElement:m,highlightBlock:function(e){return Wv("10.7.0","highlightBlock will be removed entirely in v12.0"),Wv("10.7.0","Please use highlightElement now."),m(e)},configure:function(e){e.useBR&&(Wv("10.3.0","'useBR' will be removed entirely in v11.0"),Wv("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=Vv(l,e)},initHighlighting:b,initHighlightingOnLoad:function(){Wv("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),v=!0},registerLanguage:function(n,r){let s=null;try{s=r(e)}catch(e){if(Hv("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw e;Hv(e),s=a}s.name||(s.name=n),t[n]=s,s.rawDefinition=r.bind(null,e),s.aliases&&w(s.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:x,registerAliases:w,requireLanguage:function(e){Wv("10.4.0","requireLanguage will be removed entirely in v11."),Wv("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=x(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:_,inherit:Vv,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)},vuePlugin:Dv(e).VuePlugin}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString="10.7.3";for(const e in Av)"object"==typeof Av[e]&&Gb(Av[e]);return Object.assign(e,Av),e.addPlugin(f),e.addPlugin(zv),e.addPlugin(g),e}({}),Qv=Zv;const Xv="[A-Za-z$_][0-9A-Za-z$_]*",Yv=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Jv=["true","false","null","undefined","NaN","Infinity"],ey=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);function ty(e){return ny("(?=",e,")")}function ny(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}var ry=function(e){const t=Xv,n="<>",r="",i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];"<"!==r?">"===r&&(((e,{after:t})=>{const n="",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:n,end:r},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:s,contains:["self",e.inherit(e.TITLE_MODE,{begin:t}),v],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[v,e.inherit(e.TITLE_MODE,{begin:t})]},{variants:[{begin:"\\."+t},{begin:"\\$"+t}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},e.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:t}),"self",v]},{begin:"(get|set)\\s+(?="+t+"\\()",end:/\{/,keywords:"get set",contains:[e.inherit(e.TITLE_MODE,{begin:t}),{begin:/\(\)/},v]},{begin:/\$[(.]/}]}};function iy(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}var sy=function(e){const t={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:iy(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t,r]};r.contains.push(s);const o={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]},a=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp"},contains:[a,e.SHEBANG(),l,o,e.HASH_COMMENT_MODE,i,s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}};var oy=function(e){return{name:"Vim Script",keywords:{$pattern:/[!#@\w]+/,keyword:"N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu go gr grepa gu gv ha helpf helpg helpt hi hid his ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf quita qa rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank",built_in:"synIDtrans atan2 range matcharg did_filetype asin feedkeys xor argv complete_check add getwinposx getqflist getwinposy screencol clearmatches empty extend getcmdpos mzeval garbagecollect setreg ceil sqrt diff_hlID inputsecret get getfperm getpid filewritable shiftwidth max sinh isdirectory synID system inputrestore winline atan visualmode inputlist tabpagewinnr round getregtype mapcheck hasmapto histdel argidx findfile sha256 exists toupper getcmdline taglist string getmatches bufnr strftime winwidth bufexists strtrans tabpagebuflist setcmdpos remote_read printf setloclist getpos getline bufwinnr float2nr len getcmdtype diff_filler luaeval resolve libcallnr foldclosedend reverse filter has_key bufname str2float strlen setline getcharmod setbufvar index searchpos shellescape undofile foldclosed setqflist buflisted strchars str2nr virtcol floor remove undotree remote_expr winheight gettabwinvar reltime cursor tabpagenr finddir localtime acos getloclist search tanh matchend rename gettabvar strdisplaywidth type abs py3eval setwinvar tolower wildmenumode log10 spellsuggest bufloaded synconcealed nextnonblank server2client complete settabwinvar executable input wincol setmatches getftype hlID inputsave searchpair or screenrow line settabvar histadd deepcopy strpart remote_peek and eval getftime submatch screenchar winsaveview matchadd mkdir screenattr getfontname libcall reltimestr getfsize winnr invert pow getbufline byte2line soundfold repeat fnameescape tagfiles sin strwidth spellbadword trunc maparg log lispindent hostname setpos globpath remote_foreground getchar synIDattr fnamemodify cscope_connection stridx winbufnr indent min complete_add nr2char searchpairpos inputdialog values matchlist items hlexists strridx browsedir expand fmod pathshorten line2byte argc count getwinvar glob foldtextresult getreg foreground cosh matchdelete has char2nr simplify histget searchdecl iconv winrestcmd pumvisible writefile foldlevel haslocaldir keys cos matchstr foldtext histnr tan tempname getcwd byteidx getbufvar islocked escape eventhandler remote_send serverlist winrestview synstack pyeval prevnonblank readfile cindent filereadable changenr exp"},illegal:/;/,contains:[e.NUMBER_MODE,{className:"string",begin:"'",end:"'",illegal:"\\n"},{className:"string",begin:/"(\\"|\n\\|[^"\n])*"/},e.COMMENT('"',"$"),{className:"variable",begin:/[bwtglsav]:[\w\d_]*/},{className:"function",beginKeywords:"function function!",end:"$",relevance:0,contains:[e.TITLE_MODE,{className:"params",begin:"\\(",end:"\\)"}]},{className:"symbol",begin:/<[\w-]+>/}]}};function ay(e){return ly("(",e,")?")}function ly(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}var cy=function(e){const t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",i="("+n+"|"+ay(r)+"[a-zA-Z_]\\w*"+ay("<[^<>]+>")+")",s={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},o={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:ay(r)+e.IDENT_RE,relevance:0},u=ay(r)+e.IDENT_RE+"\\s*\\(",h={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"_Bool _Complex _Imaginary",_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"],literal:"true false nullptr NULL"},d={className:"function.dispatch",relevance:0,keywords:h,begin:ly(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,e.IDENT_RE,(f=/\s*\(/,ly("(?=",f,")")))};var f;const p=[d,l,s,t,e.C_BLOCK_COMMENT_MODE,a,o],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:p.concat([{begin:/\(/,end:/\)/,keywords:h,contains:p.concat(["self"]),relevance:0}]),relevance:0},m={className:"function",begin:"("+i+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[c],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,a]},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,o,a,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,o,a,s]}]},s,t,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"",keywords:h,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:h},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:o,keywords:h}}};var uy=function(e){const t={keyword:["abstract","as","base","break","case","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},s=e.inherit(i,{illegal:/\n/}),o={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(o,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]},u=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});o.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],a.contains=[u,l,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const h={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},f=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",p={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},h,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"meta-string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+f+"\\s+)+"+e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,d],relevance:0},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[h,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},p]}};const hy=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],dy=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],fy=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],py=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],gy=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse();function my(e){return function(...e){return e.map((e=>function(e){return e?"string"==typeof e?e:e.source:null}(e))).join("")}("(?=",e,")")}var by=function(e){const t=(e=>({IMPORTANT:{className:"meta",begin:"!important"},HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"},ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]}}))(e),n=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[e.C_BLOCK_COMMENT_MODE,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},e.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+fy.join("|")+")"},{begin:"::("+py.join("|")+")"}]},{className:"attribute",begin:"\\b("+gy.join("|")+")\\b"},{begin:":",end:"[;}]",contains:[t.HEXCOLOR,t.IMPORTANT,e.CSS_NUMBER_MODE,...n,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},{className:"built_in",begin:/[\w-]+(?=\()/}]},{begin:my(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:dy.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...n,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+hy.join("|")+")\\b"}]}};var vy=function(e){const t={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",literal:"true false iota nil",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{name:"Go",aliases:["golang"],keywords:t,illegal:")?",r="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",i={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]};const s=_y;return{name:"Java",aliases:["jsp"],keywords:r,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"class",beginKeywords:"class interface enum",end:/[{;=]/,excludeEnd:!0,relevance:1,keywords:"class interface enum",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"new throw return else",relevance:0},{className:"class",begin:"record\\s+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,excludeEnd:!0,end:/[{;=]/,keywords:r,contains:[{beginKeywords:"record"},{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"function",begin:"("+n+"\\s+)+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:r,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,s,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},s,i]}};var Ny=function(e){const t={literal:"true false null"},n=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],r=[e.QUOTE_STRING_MODE,e.C_NUMBER_MODE],i={end:",",endsWithParent:!0,excludeEnd:!0,contains:r,keywords:t},s={begin:/\{/,end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE],illegal:"\\n"},e.inherit(i,{begin:/:/})].concat(n),illegal:"\\S"},o={begin:"\\[",end:"\\]",contains:[e.inherit(i)],illegal:"\\S"};return r.push(s,o),n.forEach((function(e){r.push(e)})),{name:"JSON",contains:r,keywords:t,illegal:"\\S"}};var ky=function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:"@interface @class @protocol @implementation"};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{$pattern:t,keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.split(" ").join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}};var Ay=function(e){const t={className:"variable",begin:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*(?![A-Za-z0-9])(?![$])"},n={className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{begin:/\?>/}]},r={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},i=e.inherit(e.APOS_STRING_MODE,{illegal:null}),s=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(r)}),o=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(r)}),a={className:"string",contains:[e.BACKSLASH_ESCAPE,n],variants:[e.inherit(i,{begin:"b'",end:"'"}),e.inherit(s,{begin:'b"',end:'"'}),s,i,o]},l={className:"number",variants:[{begin:"\\b0b[01]+(?:_[01]+)*\\b"},{begin:"\\b0o[0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:e[+-]?\\d+)?"}],relevance:0},c={keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list match|0 mixed new object or private protected public real return string switch throw trait try unset use var void while xor yield",literal:"false null true",built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException UnhandledMatchError ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Stringable Throwable Traversable WeakReference WeakMap Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass"};return{aliases:["php3","php4","php5","php6","php7","php8"],case_insensitive:!0,keywords:c,contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$",{contains:[n]}),e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0,keywords:"__halt_compiler"}),n,{className:"keyword",begin:/\$this\b/},t,{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{className:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",t,e.C_BLOCK_COMMENT_MODE,a,l]}]},{className:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",relevance:0,end:";",contains:[e.UNDERSCORE_TITLE_MODE]},a,l]}};function Sy(e){return function(...e){return e.map((e=>function(e){return e?"string"==typeof e?e:e.source:null}(e))).join("")}("(?=",e,")")}var qy=function(e){const t={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},n={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/,end:/\}/,keywords:t,illegal:/#/},i={begin:/\{\{/,relevance:0},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,n],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,n],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,n,i,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,n,i,r]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,i,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},o="[0-9](_?[0-9])*",a=`(\\b(${o}))?\\.(${o})|\\b(${o})\\.`,l={className:"number",relevance:0,variants:[{begin:`(\\b(${o})|(${a}))[eE][+-]?(${o})[jJ]?\\b`},{begin:`(${a})[jJ]?`},{begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${o})[jJ]\\b`}]},c={className:"comment",begin:Sy(/# type:/),end:/$/,keywords:t,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},u={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,contains:["self",n,l,s,e.HASH_COMMENT_MODE]}]};return r.contains=[s,l,n],{name:"Python",aliases:["py","gyp","ipython"],keywords:t,illegal:/(<\/|->|\?)|=>/,contains:[n,l,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},s,c,e.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[e.UNDERSCORE_TITLE_MODE,u,{begin:/->/,endsWithParent:!0,keywords:t}]},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[l,u,s]}]}};function Oy(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}var Cy=function(e){const t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__",built_in:"proc lambda",literal:"true false nil"},r={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},s=[e.COMMENT("#","$",{contains:[r]}),e.COMMENT("^=begin","^=end",{contains:[r],relevance:10}),e.COMMENT("^__END__","\\n$")],o={className:"subst",begin:/#\{/,end:/\}/,keywords:n},a={className:"string",contains:[e.BACKSLASH_ESCAPE,o],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:/<<[-~]?'?(\w+)\n(?:[^\n]*\n)*?\s*\1\b/,returnBegin:!0,contains:[{begin:/<<[-~]?'?/},e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,o]})]}]},l="[0-9](_?[0-9])*",c={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${l}))?([eE][+-]?(${l})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},u={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:n},h=[a,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE,relevance:0}]}].concat(s)},{className:"function",begin:Oy(/def\s+/,(d=t+"\\s*(\\(|;|$)",Oy("(?=",d,")"))),relevance:0,keywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:t}),u].concat(s)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[a,{begin:t}],relevance:0},c,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:n},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,o],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(i,s),relevance:0}].concat(i,s);var d;o.contains=h,u.contains=h;const f=[{begin:/^\s*=>/,starts:{end:"$",contains:h}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",contains:h}}];return s.unshift(i),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:n,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(f).concat(s).concat(h)}};function Ty(e){return e?"string"==typeof e?e:e.source:null}function Ly(...e){return e.map((e=>Ty(e))).join("")}function My(...e){return"("+e.map((e=>Ty(e))).join("|")+")"}var Ry=function(e){const t=e.COMMENT("--","$"),n=["true","false","unknown"],r=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],o=i,a=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update ","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!i.includes(e))),l={begin:Ly(/\b/,My(...o),/\s*\(/),keywords:{built_in:o}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const r=n;return t=t||[],e.map((e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e))}(a,{when:e=>e.length<3}),literal:n,type:r,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:My(...s),keywords:{$pattern:/[\w\.]+/,keyword:a.concat(s),literal:n,type:r}},{className:"type",begin:My("double precision","large object","with timezone","without timezone")},l,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}};function Iy(e){return e?"string"==typeof e?e:e.source:null}function jy(e){return By("(?=",e,")")}function By(...e){return e.map((e=>Iy(e))).join("")}function Dy(...e){return"("+e.map((e=>Iy(e))).join("|")+")"}var zy=function(e){const t=By(/[A-Z_]/,By("(",/[A-Z0-9_.-]*:/,")?"),/[A-Z0-9_.-]*/),n={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"meta-keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=e.inherit(r,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"meta-string"}),o=e.inherit(e.QUOTE_STRING_MODE,{className:"meta-string"}),a={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[r,o,s,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[r,i,o,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},n,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[a],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[a],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:By(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:a}]},{className:"tag",begin:By(/<\//,jy(By(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}};var Uy=function(e){const t={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"},{begin:/\$\{/,end:/\}/}]},n={className:"string",variants:[{begin:'"""',end:'"""'},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:'[a-z]+"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t]},{className:"string",begin:'[a-z]+"""',end:'"""',contains:[t],relevance:10}]},r={className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},i={className:"title",begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,relevance:0},s={className:"class",beginKeywords:"class object trait type",end:/[:={\[\n;]/,excludeEnd:!0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{beginKeywords:"extends with",relevance:10},{begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[r]},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[r]},i]},o={className:"function",beginKeywords:"def",end:/[:={\[(\n;]/,excludeEnd:!0,contains:[i]};return{name:"Scala",keywords:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit"},contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"symbol",begin:"'\\w[\\w\\d_]*(?!')"},r,o,s,e.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"}]}};var $y=function(e){var t="('|\\.')+",n={relevance:0,contains:[{begin:t}]};return{name:"Matlab",keywords:{keyword:"arguments break case catch classdef continue else elseif end enumeration events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i|0 inf nan isnan isinf isfinite j|0 why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson max min nanmax nanmin mean nanmean type table readtable writetable sortrows sort figure plot plot3 scatter scatter3 cellfun legend intersect ismember procrustes hold num2cell "},illegal:'(//|"|#|/\\*|\\s+/\\w+)',contains:[{className:"function",beginKeywords:"function",end:"$",contains:[e.UNDERSCORE_TITLE_MODE,{className:"params",variants:[{begin:"\\(",end:"\\)"},{begin:"\\[",end:"\\]"}]}]},{className:"built_in",begin:/true|false/,relevance:0,starts:n},{begin:"[a-zA-Z][a-zA-Z_0-9]*"+t,relevance:0},{className:"number",begin:e.C_NUMBER_RE,relevance:0,starts:n},{className:"string",begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE,{begin:"''"}]},{begin:/\]|\}|\)/,relevance:0,starts:n},{className:"string",begin:'"',end:'"',contains:[e.BACKSLASH_ESCAPE,{begin:'""'}],starts:n},e.COMMENT("^\\s*%\\{\\s*$","^\\s*%\\}\\s*$"),e.COMMENT("%","$")]}};function Py(e){return e?"string"==typeof e?e:e.source:null}function Hy(e){return Fy("(?=",e,")")}function Fy(...e){return e.map((e=>Py(e))).join("")}function Wy(...e){return"("+e.map((e=>Py(e))).join("|")+")"}const Ky=e=>Fy(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Vy=["Protocol","Type"].map(Ky),Gy=["init","self"].map(Ky),Zy=["Any","Self"],Qy=["associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Xy=["false","nil","true"],Yy=["assignment","associativity","higherThan","left","lowerThan","none","right"],Jy=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],ex=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],tx=Wy(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),nx=Wy(tx,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),rx=Fy(tx,nx,"*"),ix=Wy(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),sx=Wy(ix,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ox=Fy(ix,sx,"*"),ax=Fy(/[A-Z]/,sx,"*"),lx=["autoclosure",Fy(/convention\(/,Wy("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Fy(/objc\(/,ox,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","testable","UIApplicationMain","unknown","usableFromInline"],cx=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];var ux=function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={className:"keyword",begin:Fy(/\./,Hy(Wy(...Vy,...Gy))),end:Wy(...Vy,...Gy),excludeBegin:!0},s={match:Fy(/\./,Wy(...Qy)),relevance:0},o=Qy.filter((e=>"string"==typeof e)).concat(["_|0"]),a={variants:[{className:"keyword",match:Wy(...Qy.filter((e=>"string"!=typeof e)).concat(Zy).map(Ky),...Gy)}]},l={$pattern:Wy(/\b\w+/,/#\w+/),keyword:o.concat(Jy),literal:Xy},c=[i,s,a],u=[{match:Fy(/\./,Wy(...ex)),relevance:0},{className:"built_in",match:Fy(/\b/,Wy(...ex),/(?=\()/)}],h={match:/->/,relevance:0},d=[h,{className:"operator",relevance:0,variants:[{match:rx},{match:`\\.(\\.|${nx})+`}]}],f="([0-9]_*)+",p="([0-9a-fA-F]_*)+",g={className:"number",relevance:0,variants:[{match:`\\b(${f})(\\.(${f}))?([eE][+-]?(${f}))?\\b`},{match:`\\b0x(${p})(\\.(${p}))?([pP][+-]?(${f}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},m=(e="")=>({className:"subst",variants:[{match:Fy(/\\/,e,/[0\\tnr"']/)},{match:Fy(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:Fy(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e="")=>({className:"subst",label:"interpol",begin:Fy(/\\/,e,/\(/),end:/\)/}),y=(e="")=>({begin:Fy(e,/"""/),end:Fy(/"""/,e),contains:[m(e),b(e),v(e)]}),x=(e="")=>({begin:Fy(e,/"/),end:Fy(/"/,e),contains:[m(e),v(e)]}),w={className:"string",variants:[y(),y("#"),y("##"),y("###"),x(),x("#"),x("##"),x("###")]},_={match:Fy(/`/,ox,/`/)},E=[_,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${sx}+`}],N=[{match:/(@|#)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:cx,contains:[...d,g,w]}]}},{className:"keyword",match:Fy(/@/,Wy(...lx))},{className:"meta",match:Fy(/@/,ox)}],k={match:Hy(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Fy(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,sx,"+")},{className:"type",match:ax,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Fy(/\s+&\s+/,Hy(ax)),relevance:0}]},A={begin://,keywords:l,contains:[...r,...c,...N,h,k]};k.contains.push(A);const S={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:Fy(ox,/\s*:/),keywords:"_|0",relevance:0},...r,...c,...u,...d,g,w,...E,...N,k]},q={beginKeywords:"func",contains:[{className:"title",match:Wy(_.match,ox,rx),endsParent:!0,relevance:0},t]},O={begin://,contains:[...r,k]},C={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:Wy(Hy(Fy(ox,/\s*:/)),Hy(Fy(ox,/\s+/,ox,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ox}]},...r,...c,...d,g,w,...N,k,S],endsParent:!0,illegal:/["']/},T={className:"function",match:Hy(/\bfunc\b/),contains:[q,O,C,t],illegal:[/\[/,/%/]},L={className:"function",match:/\b(subscript|init[?!]?)\s*(?=[<(])/,keywords:{keyword:"subscript init init? init!",$pattern:/\w+[?!]?/},contains:[O,C,t],illegal:/\[|%/},M={beginKeywords:"operator",end:e.MATCH_NOTHING_RE,contains:[{className:"title",match:rx,endsParent:!0,relevance:0}]},R={beginKeywords:"precedencegroup",end:e.MATCH_NOTHING_RE,contains:[{className:"title",match:ax,relevance:0},{begin:/{/,end:/}/,relevance:0,endsParent:!0,keywords:[...Yy,...Xy],contains:[k]}]};for(const e of w.variants){const t=e.contains.find((e=>"interpol"===e.label));t.keywords=l;const n=[...c,...u,...d,g,w,...E];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,T,L,{className:"class",beginKeywords:"struct protocol class extension enum",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},M,R,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...c,...u,...d,g,w,...E,...N,k,S]}};var hx=function(e){const t={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},n={className:"subst",variants:[{begin:/\$\{/,end:/\}/}],keywords:"true false null this is new super"},r={className:"string",variants:[{begin:"r'''",end:"'''"},{begin:'r"""',end:'"""'},{begin:"r'",end:"'",illegal:"\\n"},{begin:'r"',end:'"',illegal:"\\n"},{begin:"'''",end:"'''",contains:[e.BACKSLASH_ESCAPE,t,n]},{begin:'"""',end:'"""',contains:[e.BACKSLASH_ESCAPE,t,n]},{begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,n]},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,n]}]};n.contains=[e.C_NUMBER_MODE,r];const i=["Comparable","DateTime","Duration","Function","Iterable","Iterator","List","Map","Match","Object","Pattern","RegExp","Set","Stopwatch","String","StringBuffer","StringSink","Symbol","Type","Uri","bool","double","int","num","Element","ElementList"],s=i.map((e=>`${e}?`));return{name:"Dart",keywords:{keyword:"abstract as assert async await break case catch class const continue covariant default deferred do dynamic else enum export extends extension external factory false final finally for Function get hide if implements import in inferface is late library mixin new null on operator part required rethrow return set show static super switch sync this throw true try typedef var void while with yield",built_in:i.concat(s).concat(["Never","Null","dynamic","print","document","querySelector","querySelectorAll","window"]),$pattern:/[A-Za-z][A-Za-z0-9_]*\??/},contains:[r,e.COMMENT(/\/\*\*(?!\/)/,/\*\//,{subLanguage:"markdown",relevance:0}),e.COMMENT(/\/{3,} ?/,/$/,{contains:[{subLanguage:"markdown",begin:".",end:"$",relevance:0}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},e.C_NUMBER_MODE,{className:"meta",begin:"@[A-Za-z]+"},{begin:"=>"}]}};function dx(e,t){if("object"==typeof t)for(let n in t)e.style[n]=t[n]}function fx(e,t){let n=t.getBoundingClientRect();return{x:e.x-n.x-t.scrollLeft,y:e.y-n.y-t.scrollTop,x1:e.x-n.x-t.scrollLeft+e.width,y1:e.y-n.y-t.scrollTop+e.height,width:e.width,height:e.height}}function px(e,t){return e&&Object.keys(e).reduce(((n,r)=>t.includes(r)?n:Object.assign({},n,{[r]:e[r]})),{})}function gx(e){let t;if(t=e.path||e.composedPath&&e.composedPath(),null==t&&e.target){t=[];let n=e.target;for(t.push(n);n&&n.parentNode;)n=n.parentNode,t.push(n)}return t}class mx{constructor(e,t,n){if(!e)return null;this.table=e,this.quill=t,this.options=n,this.domNode=null,this.initColTool()}initColTool(){const e=this.quill.root.parentNode;this.table.getBoundingClientRect();const t=e.getBoundingClientRect(),n=this.table.parentNode.getBoundingClientRect();this.domNode=document.createElement("div"),this.domNode.classList.add("qlbt-col-tool"),this.updateToolCells(),e.appendChild(this.domNode),dx(this.domNode,{width:`${n.width}px`,height:"10px",left:`${n.left-t.left+e.scrollLeft}px`,top:n.top-t.top+e.scrollTop-10-5+"px"})}createToolCell(){const e=document.createElement("div");e.classList.add("qlbt-col-tool-cell");const t=document.createElement("div");return t.classList.add("qlbt-col-tool-cell-holder"),dx(e,{height:"10px"}),e.appendChild(t),e}updateToolCells(){const e=$p.find(this.table),t=e.children.tail.children.head.children,n=e.colGroup().children,r=function(e){return e.reduce(((e,t)=>{const n=t.formats().colspan;return e+=parseInt(n,10)}),0)}(t);let i=Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell"));for(let e=0;e=r?i[e].remove():(o=i[e],dx(o,{"min-width":`${s}px`})):(o=this.createToolCell(),this.domNode.appendChild(o),this.addColCellHolderHandler(o),dx(o,{"min-width":`${s}px`}))}}destroy(){return this.domNode.remove(),null}addColCellHolderHandler(e){const t=$p.find(this.table),n=e.querySelector(".qlbt-col-tool-cell-holder");let r=!1,i=0,s=0,o=0,a=0,l={},c={},u=null;const h=e=>{e.preventDefault(),r&&(s=e.clientX,o=a+s-i>=50?s-i:50-a,dx(u,{left:`${c.left+c.width-1+o}px`}))},d=f=>{f.preventDefault();const p=Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell")).indexOf(e),g=t.colGroup().children.at(p);r&&(g.format("width",a+o),dx(e,{"min-width":`${a+o}px`}),i=0,s=0,o=0,a=0,r=!1,n.classList.remove("dragging")),document.removeEventListener("mousemove",h,!1),document.removeEventListener("mouseup",d,!1),l={},c={},u.remove(),u=null,t.updateTableWidth();const m=this.quill.getModule("better-table").tableSelection;m&&m.clearSelection()};n.addEventListener("mousedown",(t=>{document.addEventListener("mousemove",h,!1),document.addEventListener("mouseup",d,!1),l=this.table.getBoundingClientRect(),c=e.getBoundingClientRect(),u=document.createElement("div"),dx(u,{position:"fixed",top:`${c.top}px`,left:c.left+c.width-1+"px",zIndex:"100",height:`${l.height+10+4}px`,width:"1px",backgroundColor:"#35A7ED"}),document.body.appendChild(u),r=!0,i=t.clientX,a=c.width,n.classList.add("dragging")}),!1)}colToolCells(){return Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell"))}}const bx=$p.import("blots/block");class vx extends bx{static create(e){"string"==typeof e&&(e={value:e});const t=super.create(e.value);return Nx.forEach((n=>{e[n]&&t.setAttribute(`data-${n}`,e[n])})),kx.forEach((n=>{e[n]&&t.setAttribute(`data-${n}`,e[n])})),t}static formats(e){const t={};return t.value=this.tagName.indexOf(e.tagName)+1,kx.concat(Nx).reduce(((t,n)=>(e.hasAttribute(`data-${n}`)&&(t[n]=e.getAttribute(`data-${n}`)||void 0),t)),t)}format(e,t){const{row:n,cell:r,rowspan:i,colspan:s}=vx.formats(this.domNode);e===vx.blotName?t?super.format(e,{value:t,row:n,cell:r,rowspan:i,colspan:s}):n?this.replaceWith(Sx.blotName,{row:n,cell:r,rowspan:i,colspan:s}):super.format(e,t):super.format(e,t)}optimize(e){const{row:t,rowspan:n,colspan:r}=vx.formats(this.domNode);if(!t||this.parent instanceof qx||this.wrap(qx.blotName,{row:t,colspan:r,rowspan:n}),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove();this.cache={}}}vx.blotName="header",vx.tagName=["H1","H2","H3","H4","H5","H6"];const yx=$p.import("blots/break"),xx=$p.import("blots/block"),wx=$p.import("blots/container"),_x=["width"],Ex={width:120},Nx=["row","cell"],kx=["rowspan","colspan"],Ax={rowspan:1,colspan:1};class Sx extends xx{static create(e){const t=super.create(e);return Nx.forEach((n=>{let r="row"===n?Ix:jx;t.setAttribute(`data-${n}`,e[n]||r())})),kx.forEach((n=>{t.setAttribute(`data-${n}`,e[n]||Ax[n])})),e["cell-bg"]&&t.setAttribute("data-cell-bg",e["cell-bg"]),t}static formats(e){return kx.concat(Nx).concat(["cell-bg"]).reduce(((t,n)=>(e.hasAttribute(`data-${n}`)&&(t[n]=e.getAttribute(`data-${n}`)||void 0),t)),{})}format(e,t){if(kx.concat(Nx).indexOf(e)>-1)t?this.domNode.setAttribute(`data-${e}`,t):this.domNode.removeAttribute(`data-${e}`);else if("cell-bg"===e)t?this.domNode.setAttribute("data-cell-bg",t):this.domNode.removeAttribute("data-cell-bg");else if("header"===e){if(!t)return;const{row:n,cell:r,rowspan:i,colspan:s}=Sx.formats(this.domNode);super.format(e,{value:t,row:n,cell:r,rowspan:i,colspan:s})}else super.format(e,t)}optimize(e){const t=this.domNode.getAttribute("data-row"),n=this.domNode.getAttribute("data-rowspan"),r=this.domNode.getAttribute("data-colspan"),i=this.domNode.getAttribute("data-cell-bg");!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName,{row:t,colspan:r,rowspan:n,"cell-bg":i}),super.optimize(e)}tableCell(){return this.parent}}Sx.blotName="table-cell-line",Sx.className="qlbt-cell-line",Sx.tagName="P";class qx extends wx{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head&&this.children.head.formats&&this.children.tail.formats&&this.next.children.head.formats&&this.next.children.tail.formats){const e=this.children.head.formats()[this.children.head.statics.blotName],t=this.children.tail.formats()[this.children.tail.statics.blotName],n=this.next.children.head.formats()[this.next.children.head.statics.blotName],r=this.next.children.tail.formats()[this.next.children.tail.statics.blotName];if(e&&t&&n&&r)return e.cell===t.cell&&e.cell===n.cell&&e.cell===r.cell}return!1}static create(e){const t=super.create(e);return t.setAttribute("data-row",e.row),kx.forEach((n=>{e[n]&&t.setAttribute(n,e[n])})),e["cell-bg"]&&(t.setAttribute("data-cell-bg",e["cell-bg"]),t.style.backgroundColor=e["cell-bg"]),t}static formats(e){const t={};return e.hasAttribute("data-row")&&(t.row=e.getAttribute("data-row")),e.hasAttribute("data-cell-bg")&&(t["cell-bg"]=e.getAttribute("data-cell-bg")),kx.reduce(((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t)),t)}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}formats(){const e={};return this.domNode.hasAttribute("data-row")&&(e.row=this.domNode.getAttribute("data-row")),this.domNode.hasAttribute("data-cell-bg")&&(e["cell-bg"]=this.domNode.getAttribute("data-cell-bg")),kx.reduce(((e,t)=>(this.domNode.hasAttribute(t)&&(e[t]=this.domNode.getAttribute(t)),e)),e)}toggleAttribute(e,t){t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e)}formatChildren(e,t){this.children.forEach((n=>{n.format(e,t)}))}format(e,t){kx.indexOf(e)>-1?(this.toggleAttribute(e,t),this.formatChildren(e,t)):["row"].indexOf(e)>-1?(this.toggleAttribute(`data-${e}`,t),this.formatChildren(e,t)):"cell-bg"===e?(this.toggleAttribute("data-cell-bg",t),this.formatChildren(e,t),this.domNode.style.backgroundColor=t||"initial"):super.format(e,t)}optimize(e){const t=this.domNode.getAttribute("data-row");!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName,{row:t}),super.optimize(e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}qx.blotName="table",qx.tagName="TD";class Ox extends wx{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.row===t.row&&e.row===n.row&&e.row===r.row}return!1}static create(e){const t=super.create(e);return t.setAttribute("data-row",e.row),t}formats(){return["row"].reduce(((e,t)=>(this.domNode.hasAttribute(`data-${t}`)&&(e[t]=this.domNode.getAttribute(`data-${t}`)),e)),{})}optimize(e){!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}Ox.blotName="table-row",Ox.tagName="TR";class Cx extends wx{}Cx.blotName="table-body",Cx.tagName="TBODY";class Tx extends xx{static create(e){let t=super.create(e);return _x.forEach((n=>{t.setAttribute(`${n}`,e[n]||Ex[n])})),t}static formats(e){return _x.reduce(((t,n)=>(e.hasAttribute(`${n}`)&&(t[n]=e.getAttribute(`${n}`)||void 0),t)),{})}format(e,t){_x.indexOf(e)>-1?this.domNode.setAttribute(`${e}`,t||Ex[e]):super.format(e,t)}html(){return this.domNode.outerHTML}}Tx.blotName="table-col",Tx.tagName="col";class Lx extends wx{}Lx.blotName="table-col-group",Lx.tagName="colgroup";class Mx extends wx{static create(){return super.create()}constructor(e,t){super(e,t),this.updateTableWidth()}updateTableWidth(){setTimeout((()=>{const e=this.colGroup();if(!e)return;const t=e.children.reduce(((e,t)=>e+=parseInt(t.formats()[Tx.blotName].width,10)),0);this.domNode.style.width=`${t}px`}),0)}cells(e){return this.rows().map((t=>t.children.at(e)))}colGroup(){return this.children.head}deleteColumns(e,t=[],n){const[r]=this.descendants(Cx);if(null==r||null==r.children.head)return;const i=this.descendants(qx),s=[],o=[];if(i.forEach((t=>{const r=fx(t.domNode.getBoundingClientRect(),n);r.x+5>e.x&&r.x1-5e.x1-5&&o.push(t)})),s.length===i.length)return this.tableDestroy(),!0;t.forEach((e=>{this.colGroup().children.at(t[0]).remove()})),s.forEach((e=>{e.remove()})),o.forEach((e=>{const n=parseInt(e.formats().colspan,10);parseInt(e.formats().width,10),e.format("colspan",n-t.length)})),this.updateTableWidth()}deleteRow(e,t){const[n]=this.descendants(Cx);if(null==n||null==n.children.head)return;const r=this.descendants(qx),i=this.descendants(Ox),s=[],o=[],a=[],l=i.filter((n=>{const r=fx(n.domNode.getBoundingClientRect(),t);return r.y>e.y-5&&r.y1{const r=fx(n.domNode.getBoundingClientRect(),t);r.y>e.y-5&&r.y1e.y1-5&&(o.push(n),Math.abs(r.y-e.y)<5&&a.push(n))})),s.length===r.length)return void this.tableDestroy();const c=this.rows().reduce(((n,r)=>{let i=fx(r.domNode.getBoundingClientRect(),t);return i.y>e.y-5&&i.y1{const n=fx(e.domNode.getBoundingClientRect(),t),r=e.parent.next,i=r.children.reduce(((e,r)=>{const i=fx(r.domNode.getBoundingClientRect(),t);return Math.abs(n.x1-i.x)<5&&(e=r),e}),null);r.insertBefore(e,i),e.format("row",r.formats().row)})),s.forEach((e=>{e.remove()})),o.forEach((e=>{const t=parseInt(e.formats().rowspan,10);e.format("rowspan",t-c)})),l.forEach((e=>e.remove()))}tableDestroy(){const e=$p.find(this.scroll.domNode.parentNode),t=e.getModule("better-table");this.remove(),t.hideTableTools(),e.update($p.sources.USER)}insertCell(e,t){const n=jx(),r=e.formats().row,i=this.scroll.create(qx.blotName,Object.assign({},Ax,{row:r})),s=this.scroll.create(Sx.blotName,{row:r,cell:n});i.appendChild(s),t?e.insertBefore(i,t):e.appendChild(i)}insertColumn(e,t,n=!0,r){const[i]=this.descendants(Cx),[s]=this.descendants(Lx),o=this.descendants(Tx);let a=[],l=[],c=[];if(null==i||null==i.children.head)return;this.descendants(qx).forEach((t=>{const i=fx(t.domNode.getBoundingClientRect(),r);n?Math.abs(i.x1-e.x1)<5?a.push(t):e.x1-i.x>5&&e.x1-i.x1<-5&&l.push(t):Math.abs(i.x-e.x)<5?a.push(t):e.x-i.x>5&&e.x-i.x1<-5&&l.push(t)})),a.forEach((e=>{const t=n?e.next:e,r=jx(),i=e.parent,s=i.formats().row,o=e.formats(),a=this.scroll.create(qx.blotName,Object.assign({},Ax,{row:s,rowspan:o.rowspan})),l=this.scroll.create(Sx.blotName,{row:s,cell:r,rowspan:o.rowspan});a.appendChild(l),t?i.insertBefore(a,t):i.appendChild(a),c.push(a)}));const u=this.scroll.create(Tx.blotName,!0);let h=n?o[t].next:o[t];return h?s.insertBefore(u,h):s.appendChild(u),l.forEach((e=>{const t=e.formats().colspan;e.format("colspan",parseInt(t,10)+1),c.push(e)})),c.sort(((e,t)=>e.domNode.getBoundingClientRect().y-t.domNode.getBoundingClientRect().y)),this.updateTableWidth(),c}insertRow(e,t,n){const[r]=this.descendants(Cx);if(null==r||null==r.children.head)return;const i=this.descendants(qx),s=Ix(),o=this.scroll.create(Ox.blotName,{row:s});let a=[],l=[],c=[];i.forEach((r=>{const i=fx(r.domNode.getBoundingClientRect(),n);t?Math.abs(i.y1-e.y1)<5?a.push(r):e.y1-i.y>5&&e.y1-i.y1<-5&&l.push(r):Math.abs(i.y-e.y)<5?a.push(r):e.y-i.y>5&&e.y-i.y1<-5&&l.push(r)}));const u=(e,t)=>e.domNode.getBoundingClientRect().x-t.domNode.getBoundingClientRect().x;a.sort(u),a.forEach((e=>{const t=jx(),n=e.formats(),r=this.scroll.create(qx.blotName,Object.assign({},Ax,{row:s,colspan:n.colspan})),i=this.scroll.create(Sx.blotName,{row:s,cell:t,colspan:n.colspan}),a=this.scroll.create(yx.blotName);i.appendChild(a),r.appendChild(i),o.appendChild(r),c.push(r)})),l.forEach((e=>{const t=parseInt(e.formats().rowspan,10);e.format("rowspan",t+1),c.push(e)}));const h=this.rows().find((r=>{let i=fx(r.domNode.getBoundingClientRect(),n);return t?Math.abs(i.y-e.y-e.height)<5:Math.abs(i.y-e.y)<5}));return r.insertBefore(o,h),c.sort(u),c}mergeCells(e,t,n,r,i){const s=t.reduce(((e,t,i)=>(0!==i?(e&&t.moveChildren(e),t.remove()):(t.format("colspan",r),t.format("rowspan",n),e=t),e)),null);let o=s.domNode.getAttribute("data-row"),a=s.children.head.domNode.getAttribute("data-cell");return s.children.forEach((e=>{e.format("cell",a),e.format("row",o),e.format("colspan",r),e.format("rowspan",n)})),s}unmergeCells(e,t){let n={},r=1,i=1;e.forEach((e=>{if(n=e.formats(),r=n.rowspan,i=n.colspan,i>1){let t=e.next,n=e.row();e.format("colspan",1);for(let e=i;e>1;e--)this.insertCell(n,t)}if(r>1){let n=r,s=e.row().next;for(;n>1;){let r=s.children.reduce(((n,r)=>{let i=fx(e.domNode.getBoundingClientRect(),t),s=fx(r.domNode.getBoundingClientRect(),t);return Math.abs(i.x1-s.x)<5&&(n=r),n}),null);for(let e=i;e>0;e--)this.insertCell(s,r);n-=1,s=s.next}e.format("rowspan",1)}}))}rows(){const e=this.children.tail;return null==e?[]:e.children.map((e=>e))}}Mx.blotName="table-container",Mx.className="quill-better-table",Mx.tagName="TABLE";class Rx extends wx{constructor(e,t){super(e,t);const n=$p.find(e.domNode.parentNode);t.addEventListener("scroll",(e=>{const t=n.getModule("better-table");t.columnTool&&(t.columnTool.domNode.scrollLeft=e.target.scrollLeft),t.tableSelection&&t.tableSelection.selectedTds.length>0&&t.tableSelection.repositionHelpLines()}),!1)}table(){return this.children.head}}function Ix(){return`row-${Math.random().toString(36).slice(2,6)}`}function jx(){return`cell-${Math.random().toString(36).slice(2,6)}`}Rx.blotName="table-view",Rx.className="quill-better-table-wrapper",Rx.tagName="DIV",Rx.allowedChildren=[Mx],Mx.requiredContainer=Rx,Mx.allowedChildren=[Cx,Lx],Cx.requiredContainer=Mx,Cx.allowedChildren=[Ox],Ox.requiredContainer=Cx,Ox.allowedChildren=[qx],qx.requiredContainer=Ox,qx.allowedChildren=[Sx,vx],Sx.requiredContainer=qx,Lx.allowedChildren=[Tx],Lx.requiredContainer=Mx,Tx.requiredContainer=Lx;const Bx=["left","right","top","bottom"];class Dx{constructor(e,t,n){if(!e)return null;this.table=e,this.quill=t,this.options=n,this.boundary={},this.selectedTds=[],this.dragging=!1,this.selectingHandler=this.mouseDownHandler.bind(this),this.clearSelectionHandler=this.clearSelection.bind(this),this.helpLinesInitial(),this.quill.root.addEventListener("mousedown",this.selectingHandler,!1),this.quill.on("text-change",this.clearSelectionHandler)}helpLinesInitial(){let e=this.quill.root.parentNode;Bx.forEach((t=>{this[t]=document.createElement("div"),this[t].classList.add("qlbt-selection-line"),this[t].classList.add("qlbt-selection-line-"+t),dx(this[t],{position:"absolute",display:"none","background-color":"#6918b4"}),e.appendChild(this[t])}))}mouseDownHandler(e){if(0!==e.button||!e.target.closest(".quill-better-table"))return;this.quill.root.addEventListener("mousemove",i,!1),this.quill.root.addEventListener("mouseup",(function e(n){t.quill.root.removeEventListener("mousemove",i,!1),t.quill.root.removeEventListener("mouseup",e,!1),t.dragging=!1}),!1);const t=this,n=e.target.closest("td[data-row]"),r=fx(n.getBoundingClientRect(),this.quill.root.parentNode);function i(e){if(0!==e.button||!e.target.closest(".quill-better-table"))return;const i=e.target.closest("td[data-row]"),s=fx(i.getBoundingClientRect(),t.quill.root.parentNode);t.boundary=zx(r,s),t.correctBoundary(),t.selectedTds=t.computeSelectedTds(),t.repositionHelpLines(),n!==i&&t.quill.blur()}this.dragging=!0,this.boundary=zx(r,r),this.correctBoundary(),this.selectedTds=this.computeSelectedTds(),this.repositionHelpLines()}correctBoundary(){$p.find(this.table).descendants(qx).forEach((e=>{let{x:t,y:n,width:r,height:i}=fx(e.domNode.getBoundingClientRect(),this.quill.root.parentNode);(t+2>=this.boundary.x&&t+2<=this.boundary.x1||t-2+r>=this.boundary.x&&t-2+r<=this.boundary.x1)&&(n+2>=this.boundary.y&&n+2<=this.boundary.y1||n-2+i>=this.boundary.y&&n-2+i<=this.boundary.y1)&&(this.boundary=zx(this.boundary,{x:t,y:n,width:r,height:i}))}))}computeSelectedTds(){return $p.find(this.table).descendants(qx).reduce(((e,t)=>{let{x:n,y:r,width:i,height:s}=fx(t.domNode.getBoundingClientRect(),this.quill.root.parentNode);return n+2>=this.boundary.x&&n-2+i<=this.boundary.x1&&r+2>=this.boundary.y&&r-2+s<=this.boundary.y1&&e.push(t),e}),[])}repositionHelpLines(){const e=this.table.parentNode.scrollLeft;dx(this.left,{display:"block",left:this.boundary.x-e-1+"px",top:`${this.boundary.y}px`,height:`${this.boundary.height+1}px`,width:"1px"}),dx(this.right,{display:"block",left:this.boundary.x1-e+"px",top:`${this.boundary.y}px`,height:`${this.boundary.height+1}px`,width:"1px"}),dx(this.top,{display:"block",left:this.boundary.x-1-e+"px",top:`${this.boundary.y}px`,width:`${this.boundary.width+1}px`,height:"1px"}),dx(this.bottom,{display:"block",left:this.boundary.x-1-e+"px",top:`${this.boundary.y1+1}px`,width:`${this.boundary.width+1}px`,height:"1px"})}refreshHelpLinesPosition(){const e=fx(this.selectedTds[0].domNode.getBoundingClientRect(),this.quill.root.parentNode),t=fx(this.selectedTds[this.selectedTds.length-1].domNode.getBoundingClientRect(),this.quill.root.parentNode);this.boundary=zx(e,t),this.repositionHelpLines()}destroy(){return Bx.forEach((e=>{this[e].remove(),this[e]=null})),this.quill.root.removeEventListener("mousedown",this.selectingHandler,!1),this.quill.off("text-change",this.clearSelectionHandler),null}setSelection(e,t){this.boundary=zx(fx(e,this.quill.root.parentNode),fx(t,this.quill.root.parentNode)),this.correctBoundary(),this.selectedTds=this.computeSelectedTds(),this.repositionHelpLines()}clearSelection(){this.boundary={},this.selectedTds=[],Bx.forEach((e=>{this[e]&&dx(this[e],{display:"none"})}))}}function zx(e,t){let n=Math.min(e.x,t.x,e.x+e.width-1,t.x+t.width-1),r=Math.max(e.x,t.x,e.x+e.width-1,t.x+t.width-1),i=Math.min(e.y,t.y,e.y+e.height-1,t.y+t.height-1),s=Math.max(e.y,t.y,e.y+e.height-1,t.y+t.height-1);return{x:n,x1:r,y:i,y1:s,width:r-n,height:s-i}}const Ux=["white","red","yellow","blue"],$x={insertColumnRight:{text:"Insert Column Right",iconSrc:'',handler(){const e=$p.find(this.table);let t=Hx(this.columnToolCells,this.boundary,((e,t)=>Math.abs(e.x+e.width-t.x1)<=5),this.quill.root.parentNode);const n=e.insertColumn(this.boundary,t,!0,this.quill.root.parentNode);this.tableColumnTool.updateToolCells(),this.quill.update($p.sources.USER),this.quill.setSelection(this.quill.getIndex(n[0]),0,$p.sources.SILENT),this.tableSelection.setSelection(n[0].domNode.getBoundingClientRect(),n[0].domNode.getBoundingClientRect())}},insertColumnLeft:{text:"Insert Column Left",iconSrc:'',handler(){const e=$p.find(this.table);let t=Hx(this.columnToolCells,this.boundary,((e,t)=>Math.abs(e.x-t.x)<=5),this.quill.root.parentNode);const n=e.insertColumn(this.boundary,t,!1,this.quill.root.parentNode);this.tableColumnTool.updateToolCells(),this.quill.update($p.sources.USER),this.quill.setSelection(this.quill.getIndex(n[0]),0,$p.sources.SILENT),this.tableSelection.setSelection(n[0].domNode.getBoundingClientRect(),n[0].domNode.getBoundingClientRect())}},insertRowUp:{text:"Insert Row Above",iconSrc:'',handler(){const e=$p.find(this.table).insertRow(this.boundary,!1,this.quill.root.parentNode);this.quill.update($p.sources.USER),this.quill.setSelection(this.quill.getIndex(e[0]),0,$p.sources.SILENT),this.tableSelection.setSelection(e[0].domNode.getBoundingClientRect(),e[0].domNode.getBoundingClientRect())}},insertRowDown:{text:"Insert Row Below",iconSrc:'',handler(){const e=$p.find(this.table).insertRow(this.boundary,!0,this.quill.root.parentNode);this.quill.update($p.sources.USER),this.quill.setSelection(this.quill.getIndex(e[0]),0,$p.sources.SILENT),this.tableSelection.setSelection(e[0].domNode.getBoundingClientRect(),e[0].domNode.getBoundingClientRect())}},mergeCells:{text:"Merge Selected Cells",iconSrc:'',handler(){const e=$p.find(this.table),t=e.rows().reduce(((e,t)=>{let n=fx(t.domNode.getBoundingClientRect(),this.quill.root.parentNode);return n.y>this.boundary.y-5&&n.y+n.height{let n=fx(t.getBoundingClientRect(),this.quill.root.parentNode);return n.x>this.boundary.x-5&&n.x+n.width