diff --git a/ui-kit/demo/assets/1c-B7I0nUCD.js b/ui-kit/demo/assets/1c-B7I0nUCD.js deleted file mode 100644 index 8bb39225..00000000 --- a/ui-kit/demo/assets/1c-B7I0nUCD.js +++ /dev/null @@ -1 +0,0 @@ -import{g as f}from"./index-DKsnjJVp.js";import{r as s}from"./default-highlight-CrA-MuiQ.js";function i(t,n){for(var o=0;oe[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=s();const p=f(a),l=i({__proto__:null,default:p},[a]);export{l as _}; diff --git a/ui-kit/demo/assets/1c-DtYsuQye.js b/ui-kit/demo/assets/1c-DtYsuQye.js new file mode 100644 index 00000000..1175d96b --- /dev/null +++ b/ui-kit/demo/assets/1c-DtYsuQye.js @@ -0,0 +1 @@ +import{g as f}from"./index-Dv3qFdjW.js";import{r as s}from"./default-highlight-DvtBkdhg.js";function i(t,n){for(var o=0;oe[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a=s();const p=f(a),l=i({__proto__:null,default:p},[a]);export{l as _}; diff --git a/ui-kit/demo/assets/Page0101d3ccbe624f63b8f92c0c42ba982b-B7synOHq.js b/ui-kit/demo/assets/Page0101d3ccbe624f63b8f92c0c42ba982b-B7synOHq.js deleted file mode 100644 index 81c95a87..00000000 --- a/ui-kit/demo/assets/Page0101d3ccbe624f63b8f92c0c42ba982b-B7synOHq.js +++ /dev/null @@ -1,165 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cz0v0Rp9.js","assets/default-highlight-CrA-MuiQ.js","assets/index-DKsnjJVp.js"])))=>i.map(i=>d[i]); -import{j as e,r as o,_ as s,D as n}from"./index-DKsnjJVp.js";import{D as a}from"./dForm-RzxzTjHO.js";import{T as l}from"./treeSelectField-GZfiUGts.js";import{P as c,C as m,d as p,c as u}from"./darcula-CbhncTMN.js";import"./modal-s_O7aRct.js";import"./index-CSyocx7G.js";import"./dFormModal-BxobeehR.js";import"./modal-sKRn3jmz.js";import"./defaultButtonsProps-Bo_d-5AQ.js";import"./useShowArrow-42klRCfV.js";import"./useIcons-CWHa1yEa.js";import"./SearchOutlined-K0l7o9jX.js";import"./useApiIsNodeSelected-DVBYhN5o.js";const h=[{id:"01",title:"Департамент аналитики данных"},{id:"02",title:"Департамент инженерных работ"},{id:"03",title:"Департамент проектных работ"}],f=[{id:"01-01",title:"Управление аналитики продаж",children:[{id:"01-01-01",title:"Отдел прода север"},{id:"01-01-02",title:"Отдел прода юг"},{id:"01-01-03",title:"Отдел прода запад"}]},{id:"01-02",title:"Управление аналитики закупок",children:[{id:"01-02-01",title:"Отдел закупок север"},{id:"01-02-02",title:"Отдел закупок юг"},{id:"01-02-03",title:"Отдел закупок запад"}]},{id:"01-03",title:"Управление аналитики производства",children:[{id:"01-03-01",title:"Отдел производства север"},{id:"01-03-02",title:"Отдел производства юг"},{id:"01-03-03",title:"Отдел производства запад"}]}],v=[{id:"02-01",title:"Управление строительства",children:[{id:"02-01-01",title:"Отдел строительства север"},{id:"02-01-02",title:"Отдел строительства юг"},{id:"02-01-03",title:"Отдел строительства запад"}]},{id:"02-02",title:"Управление демонтажа",children:[{id:"02-02-01",title:"Отдел демонтажа север"},{id:"02-02-02",title:"Отдел демонтажа юг"},{id:"02-02-03",title:"Отдел демонтажа запад"}]},{id:"02-03",title:"Управление реконструкции",children:[{id:"02-03-01",title:"Отдел реконструкции север"},{id:"02-03-02",title:"Отдел реконструкции юг"},{id:"02-03-03",title:"Отдел реконструкции запад"}]}],F=[{id:"03-01",title:"Управление проектирования",children:[{id:"03-01-01",title:"Отдел проектирования север"},{id:"03-01-02",title:"Отдел проектирования юг"},{id:"03-01-03",title:"Отдел проектирования запад"}]},{id:"03-02",title:"Управление согласования",children:[{id:"03-02-01",title:"Отдел согласования север"},{id:"03-02-02",title:"Отдел согласования юг"},{id:"03-02-03",title:"Отдел согласования запад"}]},{id:"03-03",title:"Управление анализа проектов",children:[{id:"03-03-01",title:"Отдел анализа север"},{id:"03-03-02",title:"Отдел анализа юг"},{id:"03-03-03",title:"Отдел анализа запад"}]}],r={},D={formId:"Test form",apiRef:r,confirmChanges:!0,fieldsProps:{department:{component:l,label:"Департамент",fetchMode:"onUse",onDataFetch:()=>new Promise((t,i)=>{setTimeout(()=>{Math.random()<0?i({message:"Ошибка загрузки данных",code:400}):t({data:h})},2e3)}),onValueChanged:(t,i,d)=>{d.getModel().getField("division").setValue(null)}},division:{component:l,label:"Управления",fetchMode:"onUse",dependsOn:["department"],noCacheFetchedData:!0,onDataFetch:()=>new Promise(t=>{setTimeout(()=>{const i=r.model.getField("department").getValue();let d;i?i==="01"?d=f:i==="02"?d=v:i==="03"?d=F:d=[]:d=[],t({data:d})},2e3)})}},buttons:null},S=()=>e.jsxs(e.Fragment,{children:[e.jsx("h1",{children:"Пример отображения зависимых асинхронных TreeSelect"}),e.jsx("p",{children:"Пока не выбран департамент, поле Управление скрыто. При изменении департамента изменяются параметры запроса списка управлений."}),e.jsx("div",{style:{maxWidth:500},children:e.jsx(a,{...D})})]}),g=o.lazy(()=>s(()=>import("./index-Cz0v0Rp9.js").then(t=>t.ds),__vite__mapDeps([0,1,2])).then(t=>({default:t.Prism}))),R=t=>e.jsxs(c,{children:[e.jsx("div",{children:e.jsx(S,{})}),e.jsx(n,{}),e.jsx("div",{children:e.jsx(m,{items:[{key:1,label:"Show source",children:e.jsx(o.Suspense,{fallback:e.jsx("div",{children:"Loading source..."}),children:e.jsx(g,{language:"tsx",style:t.darkMode?p:u,showLineNumbers:!0,children:` -import React from 'react'; -import {DForm, IDFormProps} from @krinopotam/ui-kit/dForm'; -import {IDFormModalApi} from @krinopotam/ui-kit/dFormModal'; -import {ITreeSelectFieldProps, TreeSelectField} from @krinopotam/ui-kit/dForm/fields/treeSelect/treeSelectField'; -const departments = [ - { - id: '01', - title: 'Департамент аналитики данных', - }, - { - id: '02', - title: 'Департамент инженерных работ', - }, - { - id: '03', - title: 'Департамент проектных работ', - }, -]; -const divisions1 = [ - { - id: '01-01', - title: 'Управление аналитики продаж', - children: [ - {id: '01-01-01', title: 'Отдел прода север'}, - {id: '01-01-02', title: 'Отдел прода юг'}, - {id: '01-01-03', title: 'Отдел прода запад'}, - ], - }, - { - id: '01-02', - title: 'Управление аналитики закупок', - children: [ - {id: '01-02-01', title: 'Отдел закупок север'}, - {id: '01-02-02', title: 'Отдел закупок юг'}, - {id: '01-02-03', title: 'Отдел закупок запад'}, - ], - }, - { - id: '01-03', - title: 'Управление аналитики производства', - children: [ - {id: '01-03-01', title: 'Отдел производства север'}, - {id: '01-03-02', title: 'Отдел производства юг'}, - {id: '01-03-03', title: 'Отдел производства запад'}, - ], - }, -]; -const divisions2 = [ - { - id: '02-01', - title: 'Управление строительства', - children: [ - {id: '02-01-01', title: 'Отдел строительства север'}, - {id: '02-01-02', title: 'Отдел строительства юг'}, - {id: '02-01-03', title: 'Отдел строительства запад'}, - ], - }, - { - id: '02-02', - title: 'Управление демонтажа', - children: [ - {id: '02-02-01', title: 'Отдел демонтажа север'}, - {id: '02-02-02', title: 'Отдел демонтажа юг'}, - {id: '02-02-03', title: 'Отдел демонтажа запад'}, - ], - }, - { - id: '02-03', - title: 'Управление реконструкции', - children: [ - {id: '02-03-01', title: 'Отдел реконструкции север'}, - {id: '02-03-02', title: 'Отдел реконструкции юг'}, - {id: '02-03-03', title: 'Отдел реконструкции запад'}, - ], - }, -]; -const divisions3 = [ - { - id: '03-01', - title: 'Управление проектирования', - children: [ - {id: '03-01-01', title: 'Отдел проектирования север'}, - {id: '03-01-02', title: 'Отдел проектирования юг'}, - {id: '03-01-03', title: 'Отдел проектирования запад'}, - ], - }, - { - id: '03-02', - title: 'Управление согласования', - children: [ - {id: '03-02-01', title: 'Отдел согласования север'}, - {id: '03-02-02', title: 'Отдел согласования юг'}, - {id: '03-02-03', title: 'Отдел согласования запад'}, - ], - }, - { - id: '03-03', - title: 'Управление анализа проектов', - children: [ - {id: '03-03-01', title: 'Отдел анализа север'}, - {id: '03-03-02', title: 'Отдел анализа юг'}, - {id: '03-03-03', title: 'Отдел анализа запад'}, - ], - }, -]; -const formApi = {} as IDFormModalApi; -const formProps: IDFormProps = { - formId: 'Test form', - apiRef: formApi, - confirmChanges: true, - fieldsProps: { - department: { - component: TreeSelectField, - label: 'Департамент', - fetchMode: 'onUse', - onDataFetch: () => { - return new Promise((resolve, reject) => { - setTimeout(() => { - if (Math.random() < 0.0) reject({message: 'Ошибка загрузки данных', code: 400}); - else resolve({data: departments}); - }, 2000); - }); - }, - onValueChanged: (value, prevValue, field) => { - const division = field.getModel().getField('division'); - division.setValue(null); - }, - } as ITreeSelectFieldProps, - division: { - component: TreeSelectField, - label: 'Управления', - fetchMode: 'onUse', - dependsOn: ['department'], - noCacheFetchedData: true, - onDataFetch: () => { - return new Promise(resolve => { - setTimeout(() => { - const departmentValue = formApi.model.getField('department').getValue(); //we can get the current department value and use it for server request - /** the server request imitation */ - let newDataSet: ITreeSelectFieldProps['dataSet']; - if (!departmentValue) newDataSet = []; - else if (departmentValue === '01') newDataSet = divisions1; - else if (departmentValue === '02') newDataSet = divisions2; - else if (departmentValue === '03') newDataSet = divisions3; - else newDataSet = []; - resolve({data: newDataSet}); - }, 2000); - }); - }, - } satisfies ITreeSelectFieldProps, - }, - buttons: null, -}; -export const TreeSelectDependedAsync = (): React.JSX.Element => { - return ( - <> -
- -
- - ); -}; -`})})}]})})]});export{R as Page0101d3ccbe624f63b8f92c0c42ba982b,R as default}; diff --git a/ui-kit/demo/assets/Pagec17a85452fc444889446740545d8e3af-D-h-yQ65.css b/ui-kit/demo/assets/Page026bc3d012da47a7b307029e6a989827-D-h-yQ65.css similarity index 100% rename from ui-kit/demo/assets/Pagec17a85452fc444889446740545d8e3af-D-h-yQ65.css rename to ui-kit/demo/assets/Page026bc3d012da47a7b307029e6a989827-D-h-yQ65.css diff --git a/ui-kit/demo/assets/Page026bc3d012da47a7b307029e6a989827-DYkyy1-Z.js b/ui-kit/demo/assets/Page026bc3d012da47a7b307029e6a989827-DYkyy1-Z.js new file mode 100644 index 00000000..c70a93c0 --- /dev/null +++ b/ui-kit/demo/assets/Page026bc3d012da47a7b307029e6a989827-DYkyy1-Z.js @@ -0,0 +1,168 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Co9PZaPl.js","assets/default-highlight-DvtBkdhg.js","assets/index-Dv3qFdjW.js"])))=>i.map(i=>d[i]); +import{j as lt,t as Ge,c as ht,r as yt,b as Ve,g as We,R as ke,D as Se,S as Ze,a as Ye,_ as Qe}from"./index-Dv3qFdjW.js";import{B as xe,D as Xe,I as Je}from"./dForm-QxcKLYQQ.js";import{I as tn}from"./inputField-C4gwpQCw.js";import{T as en}from"./tabsField-Drx04j7B.js";import{T as nn}from"./tabulatorGridField-B2bifJ-i.js";import{T as rn,a as on,b as an}from"./tabulatorData-LW4kGiGF.js";import{D as ln}from"./dateTimeField-oeBpSYZ_.js";import{S as un}from"./switchField-CFjxAchm.js";import{T as sn}from"./textAreaField-BqiYx3mF.js";import{f as fn}from"./tabulatorGrid-COGwSkTc.js";import{S as cn}from"./selectField-DZ0FHcKr.js";import{P as hn,C as dn,d as vn,c as pn}from"./darcula-MphVyLu8.js";import"./modal-Bp_ASPGm.js";import"./index-8gx4Y1o-.js";import"./index-qOGxHuln.js";import"./SearchOutlined-DCaoIkCx.js";import"./index-HhPNPXlg.js";import"./dFormModal-BUbiUSeF.js";import"./modal-DoluWT5v.js";import"./useIcons-CEssDIMU.js";import"./defaultButtonsProps-DchoBAIh.js";import"./index-CWJIcpxl.js";import"./useShowArrow-CHTHTBiw.js";const{useToken:yn}=Ge,gn=fn` + .quill { + + background-color: transparent; + + .ql-toolbar { + background-color: ${p=>p.colorFillQuaternary}; + color: ${p=>p.colorText}; + border-top-right-radius: ${p=>p.borderRadius}px; + border-top-left-radius: ${p=>p.borderRadius}px; + border-bottom: 0; + border-color: ${p=>p.colorBorder}; + + font-size: ${p=>p.fontSize}px; + } + + .ql-toolbar.ql-snow + .ql-container.ql-snow { + background-color: ${p=>p.colorBgContainer}; + color: ${p=>p.colorText}; + font-size: ${p=>p.fontSize}px; + border: 1px solid ${p=>p.colorBorder}; + border-bottom-right-radius: ${p=>p.borderRadius}px; + border-bottom-left-radius: ${p=>p.borderRadius}px; + + .ql-editor { + line-height: ${p=>p.lineHeight}; + padding: 4px ${p=>p.controlPaddingHorizontal}px; + } + + &:hover { + border-color: ${p=>p.colorPrimaryHover}; + } + + &:focus-within { + border-color: ${p=>p.colorPrimary}; + box-shadow: 0 0 0 2px ${p=>p.controlOutline}; + border-inline-end-width: 1px; + outline: 0; + } + + /** placeholder */ + > .ql-editor.ql-blank::before { + font-style: normal; + font-size: ${p=>p.fontSize}px; + color: ${p=>p.colorTextPlaceholder}; + left: ${p=>p.controlPaddingHorizontal}px; + right: ${p=>p.controlPaddingHorizontal}px; + } + } + + } +`,mn=()=>{const{token:p}=yn();return lt.jsx(gn,{...p})};function bn(){this.__data__=[],this.size=0}var _n=bn;function On(p,N){return p===N||p!==p&&N!==N}var Ne=On,En=Ne;function An(p,N){for(var O=p.length;O--;)if(En(p[O][0],N))return O;return-1}var Rt=An,Tn=Rt,wn=Array.prototype,kn=wn.splice;function Sn(p){var N=this.__data__,O=Tn(N,p);if(O<0)return!1;var s=N.length-1;return O==s?N.pop():kn.call(N,O,1),--this.size,!0}var xn=Sn,Nn=Rt;function Pn(p){var N=this.__data__,O=Nn(N,p);return O<0?void 0:N[O][1]}var Ln=Pn,qn=Rt;function Rn(p){return qn(this.__data__,p)>-1}var jn=Rn,In=Rt;function Dn(p,N){var O=this.__data__,s=In(O,p);return s<0?(++this.size,O.push([p,N])):O[s][1]=N,this}var Mn=Dn,Cn=_n,Bn=xn,Fn=Ln,$n=jn,Un=Mn;function _t(p){var N=-1,O=p==null?0:p.length;for(this.clear();++Nb))return!1;var y=k.get(p),c=k.get(N);if(y&&c)return y==N&&c==p;var o=-1,t=!0,e=O&No?new wo:void 0;for(k.set(p,N),k.set(N,p);++o-1&&p%1==0&&p-1&&p%1==0&&p<=Ba}var Be=Fa,$a=It,Ua=Be,Ha=Ct,za="[object Arguments]",Ka="[object Array]",Ga="[object Boolean]",Va="[object Date]",Wa="[object Error]",Za="[object Function]",Ya="[object Map]",Qa="[object Number]",Xa="[object Object]",Ja="[object RegExp]",tl="[object Set]",el="[object String]",nl="[object WeakMap]",rl="[object ArrayBuffer]",il="[object DataView]",ol="[object Float32Array]",al="[object Float64Array]",ll="[object Int8Array]",ul="[object Int16Array]",sl="[object Int32Array]",fl="[object Uint8Array]",cl="[object Uint8ClampedArray]",hl="[object Uint16Array]",dl="[object Uint32Array]",at={};at[ol]=at[al]=at[ll]=at[ul]=at[sl]=at[fl]=at[cl]=at[hl]=at[dl]=!0;at[za]=at[Ka]=at[rl]=at[Ga]=at[il]=at[Va]=at[Wa]=at[Za]=at[Ya]=at[Qa]=at[Xa]=at[Ja]=at[tl]=at[el]=at[nl]=!1;function vl(p){return Ha(p)&&Ua(p.length)&&!!at[$a(p)]}var pl=vl;function yl(p){return function(N){return p(N)}}var gl=yl,Lt={exports:{}};Lt.exports;(function(p,N){var O=Pe,s=N&&!N.nodeType&&N,d=s&&!0&&p&&!p.nodeType&&p,k=d&&d.exports===s,T=k&&O.process,b=function(){try{var v=d&&d.require&&d.require("util").types;return v||T&&T.binding&&T.binding("util")}catch{}}();p.exports=b})(Lt,Lt.exports);var ml=Lt.exports,bl=pl,_l=gl,ue=ml,se=ue&&ue.isTypedArray,Ol=se?_l(se):bl,Fe=Ol,El=Oa,Al=qa,Tl=Yt,wl=Ce,kl=Ca,Sl=Fe,xl=Object.prototype,Nl=xl.hasOwnProperty;function Pl(p,N){var O=Tl(p),s=!O&&Al(p),d=!O&&!s&&wl(p),k=!O&&!s&&!d&&Sl(p),T=O||s||d||k,b=T?El(p.length,String):[],v=b.length;for(var y in p)(N||Nl.call(p,y))&&!(T&&(y=="length"||d&&(y=="offset"||y=="parent")||k&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||kl(y,v)))&&b.push(y);return b}var Ll=Pl,ql=Object.prototype;function Rl(p){var N=p&&p.constructor,O=typeof N=="function"&&N.prototype||ql;return p===O}var jl=Rl;function Il(p,N){return function(O){return p(N(O))}}var Dl=Il,Ml=Dl,Cl=Ml(Object.keys,Object),Bl=Cl,Fl=jl,$l=Bl,Ul=Object.prototype,Hl=Ul.hasOwnProperty;function zl(p){if(!Fl(p))return $l(p);var N=[];for(var O in Object(p))Hl.call(p,O)&&O!="constructor"&&N.push(O);return N}var Kl=zl,Gl=Re,Vl=Be;function Wl(p){return p!=null&&Vl(p.length)&&!Gl(p)}var Zl=Wl,Yl=Ll,Ql=Kl,Xl=Zl;function Jl(p){return Xl(p)?Yl(p):Ql(p)}var tu=Jl,eu=sa,nu=ba,ru=tu;function iu(p){return eu(p,ru,nu)}var ou=iu,fe=ou,au=1,lu=Object.prototype,uu=lu.hasOwnProperty;function su(p,N,O,s,d,k){var T=O&au,b=fe(p),v=b.length,y=fe(N),c=y.length;if(v!=c&&!T)return!1;for(var o=v;o--;){var t=b[o];if(!(T?t in N:uu.call(N,t)))return!1}var e=k.get(p),u=k.get(N);if(e&&u)return e==N&&u==p;var a=!0;k.set(p,N),k.set(N,p);for(var l=T;++o1)return l.map(function(n){return a(n)});var i=l[0];if(typeof i.blotName!="string"&&typeof i.attrName!="string")throw new T("Invalid definition");if(i.blotName==="abstract")throw new T("Cannot register abstract class");if(c[i.blotName||i.attrName]=i,typeof i.keyName=="string")b[i.keyName]=i;else if(i.className!=null&&(v[i.className]=i),i.tagName!=null){Array.isArray(i.tagName)?i.tagName=i.tagName.map(function(n){return n.toUpperCase()}):i.tagName=i.tagName.toUpperCase();var f=Array.isArray(i.tagName)?i.tagName:[i.tagName];f.forEach(function(n){(y[n]==null||i.className==null)&&(y[n]=i)})}return i}s.register=a},function(O,s,d){var k=d(51),T=d(11),b=d(3),v=d(20),y="\0",c=function(o){Array.isArray(o)?this.ops=o:o!=null&&Array.isArray(o.ops)?this.ops=o.ops:this.ops=[]};c.prototype.insert=function(o,t){var e={};return o.length===0?this:(e.insert=o,t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(e.attributes=t),this.push(e))},c.prototype.delete=function(o){return o<=0?this:this.push({delete:o})},c.prototype.retain=function(o,t){if(o<=0)return this;var e={retain:o};return t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(e.attributes=t),this.push(e)},c.prototype.push=function(o){var t=this.ops.length,e=this.ops[t-1];if(o=b(!0,{},o),typeof e=="object"){if(typeof o.delete=="number"&&typeof e.delete=="number")return this.ops[t-1]={delete:e.delete+o.delete},this;if(typeof e.delete=="number"&&o.insert!=null&&(t-=1,e=this.ops[t-1],typeof e!="object"))return this.ops.unshift(o),this;if(T(o.attributes,e.attributes)){if(typeof o.insert=="string"&&typeof e.insert=="string")return this.ops[t-1]={insert:e.insert+o.insert},typeof o.attributes=="object"&&(this.ops[t-1].attributes=o.attributes),this;if(typeof o.retain=="number"&&typeof e.retain=="number")return this.ops[t-1]={retain:e.retain+o.retain},typeof o.attributes=="object"&&(this.ops[t-1].attributes=o.attributes),this}}return t===this.ops.length?this.ops.push(o):this.ops.splice(t,0,o),this},c.prototype.chop=function(){var o=this.ops[this.ops.length-1];return o&&o.retain&&!o.attributes&&this.ops.pop(),this},c.prototype.filter=function(o){return this.ops.filter(o)},c.prototype.forEach=function(o){this.ops.forEach(o)},c.prototype.map=function(o){return this.ops.map(o)},c.prototype.partition=function(o){var t=[],e=[];return this.forEach(function(u){var a=o(u)?t:e;a.push(u)}),[t,e]},c.prototype.reduce=function(o,t){return this.ops.reduce(o,t)},c.prototype.changeLength=function(){return this.reduce(function(o,t){return t.insert?o+v.length(t):t.delete?o-t.delete:o},0)},c.prototype.length=function(){return this.reduce(function(o,t){return o+v.length(t)},0)},c.prototype.slice=function(o,t){o=o||0,typeof t!="number"&&(t=1/0);for(var e=[],u=v.iterator(this.ops),a=0;a0&&e.next(a.retain-l)}for(var r=new c(u);t.hasNext()||e.hasNext();)if(e.peekType()==="insert")r.push(e.next());else if(t.peekType()==="delete")r.push(t.next());else{var i=Math.min(t.peekLength(),e.peekLength()),f=t.next(i),n=e.next(i);if(typeof n.retain=="number"){var h={};typeof f.retain=="number"?h.retain=i:h.insert=f.insert;var x=v.attributes.compose(f.attributes,n.attributes,typeof f.retain=="number");if(x&&(h.attributes=x),r.push(h),!e.hasNext()&&T(r.ops[r.ops.length-1],h)){var E=new c(t.rest());return r.concat(E).chop()}}else typeof n.delete=="number"&&typeof f.retain=="number"&&r.push(n)}return r.chop()},c.prototype.concat=function(o){var t=new c(this.ops.slice());return o.ops.length>0&&(t.push(o.ops[0]),t.ops=t.ops.concat(o.ops.slice(1))),t},c.prototype.diff=function(o,t){if(this.ops===o.ops)return new c;var e=[this,o].map(function(i){return i.map(function(f){if(f.insert!=null)return typeof f.insert=="string"?f.insert:y;var n=i===o?"on":"with";throw new Error("diff() called "+n+" non-document")}).join("")}),u=new c,a=k(e[0],e[1],t),l=v.iterator(this.ops),r=v.iterator(o.ops);return a.forEach(function(i){for(var f=i[1].length;f>0;){var n=0;switch(i[0]){case k.INSERT:n=Math.min(r.peekLength(),f),u.push(r.next(n));break;case k.DELETE:n=Math.min(f,l.peekLength()),l.next(n),u.delete(n);break;case k.EQUAL:n=Math.min(l.peekLength(),r.peekLength(),f);var h=l.next(n),x=r.next(n);T(h.insert,x.insert)?u.retain(n,v.attributes.diff(h.attributes,x.attributes)):u.push(x).delete(n);break}f-=n}}),u.chop()},c.prototype.eachLine=function(o,t){t=t||` +`;for(var e=v.iterator(this.ops),u=new c,a=0;e.hasNext();){if(e.peekType()!=="insert")return;var l=e.peek(),r=v.length(l)-e.peekLength(),i=typeof l.insert=="string"?l.insert.indexOf(t,r)-r:-1;if(i<0)u.push(e.next());else if(i>0)u.push(e.next(i));else{if(o(u,e.next(1).attributes||{},a)===!1)return;a+=1,u=new c}}u.length()>0&&o(u,{},a)},c.prototype.transform=function(o,t){if(t=!!t,typeof o=="number")return this.transformPosition(o,t);for(var e=v.iterator(this.ops),u=v.iterator(o.ops),a=new c;e.hasNext()||u.hasNext();)if(e.peekType()==="insert"&&(t||u.peekType()!=="insert"))a.retain(v.length(e.next()));else if(u.peekType()==="insert")a.push(u.next());else{var l=Math.min(e.peekLength(),u.peekLength()),r=e.next(l),i=u.next(l);if(r.delete)continue;i.delete?a.push(i):a.retain(l,v.attributes.transform(r.attributes,i.attributes,t))}return a.chop()},c.prototype.transformPosition=function(o,t){t=!!t;for(var e=v.iterator(this.ops),u=0;e.hasNext()&&u<=o;){var a=e.peekLength(),l=e.peekType();if(e.next(),l==="delete"){o-=Math.min(a,o-u);continue}else l==="insert"&&(u"u"||d.call(e,l)},c=function(e,u){T&&u.name==="__proto__"?T(e,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):e[u.name]=u.newValue},o=function(e,u){if(u==="__proto__")if(d.call(e,u)){if(b)return b(e,u).value}else return;return e[u]};O.exports=function t(){var e,u,a,l,r,i,f=arguments[0],n=1,h=arguments.length,x=!1;for(typeof f=="boolean"&&(x=f,f=arguments[1]||{},n=2),(f==null||typeof f!="object"&&typeof f!="function")&&(f={});n0&&(L1&&arguments[1]!==void 0?arguments[1]:!1;if(I&&(L===0||L>=this.length()-E)){var F=this.clone();return L===0?(this.parent.insertBefore(F,this),this):(this.parent.insertBefore(F,this.next),F)}else{var $=T(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"split",this).call(this,L,I);return this.cache={},$}}}]),m}(t.default.Block);P.blotName="block",P.tagName="P",P.defaultChild="break",P.allowedChildren=[l.default,t.default.Embed,i.default];function _(g){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return g==null||(typeof g.formats=="function"&&(m=(0,v.default)(m,g.formats())),g.parent==null||g.parent.blotName=="scroll"||g.parent.statics.scope!==g.statics.scope)?m:_(g.parent,m)}s.bubbleFormats=_,s.BlockEmbed=A,s.default=P},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0}),s.default=s.overload=s.expandConfig=void 0;var k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},T=function(){function C(D,w){var R=[],j=!0,U=!1,B=void 0;try{for(var q=D[Symbol.iterator](),M;!(j=(M=q.next()).done)&&(R.push(M.value),!(w&&R.length===w));j=!0);}catch(H){U=!0,B=H}finally{try{!j&&q.return&&q.return()}finally{if(U)throw B}}return R}return function(D,w){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return C(D,w);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(){function C(D,w){for(var R=0;R2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof w!="string"){var B=w.attrName||w.blotName;typeof B=="string"?this.register("formats/"+B,w,R):Object.keys(w).forEach(function(q){j.register(q,w[q],R)})}else this.imports[w]!=null&&!U&&S.warn("Overwriting "+w+" with",R),this.imports[w]=R,(w.startsWith("blots/")||w.startsWith("formats/"))&&R.blotName!=="abstract"?r.default.register(R):w.startsWith("modules")&&typeof R.register=="function"&&R.register()}}]);function C(D){var w=this,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m(this,C),this.options=I(D,R),this.container=this.options.container,this.container==null)return S.error("Invalid Quill container",D);this.options.debug&&C.debug(this.options.debug);var j=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new e.default,this.scroll=r.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new o.default(this.scroll),this.selection=new f.default(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.theme.init(),this.emitter.on(e.default.events.EDITOR_CHANGE,function(B){B===e.default.events.TEXT_CHANGE&&w.root.classList.toggle("ql-blank",w.editor.isBlank())}),this.emitter.on(e.default.events.SCROLL_UPDATE,function(B,q){var M=w.selection.lastRange,H=M&&M.length===0?M.index:void 0;F.call(w,function(){return w.editor.update(null,q,H)},B)});var U=this.clipboard.convert(`
`+j+"


");this.setContents(U),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return b(C,[{key:"addContainer",value:function(w){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof w=="string"){var j=w;w=document.createElement("div"),w.classList.add(j)}return this.container.insertBefore(w,R),w}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(w,R,j){var U=this,B=$(w,R,j),q=T(B,4);return w=q[0],R=q[1],j=q[3],F.call(this,function(){return U.editor.deleteText(w,R)},j,w,-1*R)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(w),this.container.classList.toggle("ql-disabled",!w)}},{key:"focus",value:function(){var w=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=w,this.scrollIntoView()}},{key:"format",value:function(w,R){var j=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.default.sources.API;return F.call(this,function(){var B=j.getSelection(!0),q=new y.default;if(B==null)return q;if(r.default.query(w,r.default.Scope.BLOCK))q=j.editor.formatLine(B.index,B.length,g({},w,R));else{if(B.length===0)return j.selection.format(w,R),q;q=j.editor.formatText(B.index,B.length,g({},w,R))}return j.setSelection(B,e.default.sources.SILENT),q},U)}},{key:"formatLine",value:function(w,R,j,U,B){var q=this,M=void 0,H=$(w,R,j,U,B),z=T(H,4);return w=z[0],R=z[1],M=z[2],B=z[3],F.call(this,function(){return q.editor.formatLine(w,R,M)},B,w,0)}},{key:"formatText",value:function(w,R,j,U,B){var q=this,M=void 0,H=$(w,R,j,U,B),z=T(H,4);return w=z[0],R=z[1],M=z[2],B=z[3],F.call(this,function(){return q.editor.formatText(w,R,M)},B,w,0)}},{key:"getBounds",value:function(w){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,j=void 0;typeof w=="number"?j=this.selection.getBounds(w,R):j=this.selection.getBounds(w.index,w.length);var U=this.container.getBoundingClientRect();return{bottom:j.bottom-U.top,height:j.height,left:j.left-U.left,right:j.right-U.left,top:j.top-U.top,width:j.width}}},{key:"getContents",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-w,j=$(w,R),U=T(j,2);return w=U[0],R=U[1],this.editor.getContents(w,R)}},{key:"getFormat",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof w=="number"?this.editor.getFormat(w,R):this.editor.getFormat(w.index,w.length)}},{key:"getIndex",value:function(w){return w.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(w){return this.scroll.leaf(w)}},{key:"getLine",value:function(w){return this.scroll.line(w)}},{key:"getLines",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof w!="number"?this.scroll.lines(w.index,w.length):this.scroll.lines(w,R)}},{key:"getModule",value:function(w){return this.theme.modules[w]}},{key:"getSelection",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return w&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-w,j=$(w,R),U=T(j,2);return w=U[0],R=U[1],this.editor.getText(w,R)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(w,R,j){var U=this,B=arguments.length>3&&arguments[3]!==void 0?arguments[3]:C.sources.API;return F.call(this,function(){return U.editor.insertEmbed(w,R,j)},B,w)}},{key:"insertText",value:function(w,R,j,U,B){var q=this,M=void 0,H=$(w,0,j,U,B),z=T(H,4);return w=z[0],M=z[2],B=z[3],F.call(this,function(){return q.editor.insertText(w,R,M)},B,w,R.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(w,R,j){this.clipboard.dangerouslyPasteHTML(w,R,j)}},{key:"removeFormat",value:function(w,R,j){var U=this,B=$(w,R,j),q=T(B,4);return w=q[0],R=q[1],j=q[3],F.call(this,function(){return U.editor.removeFormat(w,R)},j,w)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(w){var R=this,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API;return F.call(this,function(){w=new y.default(w);var U=R.getLength(),B=R.editor.deleteText(0,U),q=R.editor.applyDelta(w),M=q.ops[q.ops.length-1];M!=null&&typeof M.insert=="string"&&M.insert[M.insert.length-1]===` +`&&(R.editor.deleteText(R.getLength()-1,1),q.delete(1));var H=B.compose(q);return H},j)}},{key:"setSelection",value:function(w,R,j){if(w==null)this.selection.setRange(null,R||C.sources.API);else{var U=$(w,R,j),B=T(U,4);w=B[0],R=B[1],j=B[3],this.selection.setRange(new i.Range(w,R),j),j!==e.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(w){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API,j=new y.default().insert(w);return this.setContents(j,R)}},{key:"update",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.default.sources.USER,R=this.scroll.update(w);return this.selection.update(w),R}},{key:"updateContents",value:function(w){var R=this,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API;return F.call(this,function(){return w=new y.default(w),R.editor.applyDelta(w,j)},j,!0)}}]),C}();L.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},L.events=e.default.events,L.sources=e.default.sources,L.version="1.3.7",L.imports={delta:y.default,parchment:r.default,"core/module":a.default,"core/theme":P.default};function I(C,D){if(D=(0,h.default)(!0,{container:C,modules:{clipboard:!0,keyboard:!0,history:!0}},D),!D.theme||D.theme===L.DEFAULTS.theme)D.theme=P.default;else if(D.theme=L.import("themes/"+D.theme),D.theme==null)throw new Error("Invalid theme "+D.theme+". Did you register it?");var w=(0,h.default)(!0,{},D.theme.DEFAULTS);[w,D].forEach(function(U){U.modules=U.modules||{},Object.keys(U.modules).forEach(function(B){U.modules[B]===!0&&(U.modules[B]={})})});var R=Object.keys(w.modules).concat(Object.keys(D.modules)),j=R.reduce(function(U,B){var q=L.import("modules/"+B);return q==null?S.error("Cannot load "+B+" module. Are you sure you registered it?"):U[B]=q.DEFAULTS||{},U},{});return D.modules!=null&&D.modules.toolbar&&D.modules.toolbar.constructor!==Object&&(D.modules.toolbar={container:D.modules.toolbar}),D=(0,h.default)(!0,{},L.DEFAULTS,{modules:j},w,D),["bounds","container","scrollingContainer"].forEach(function(U){typeof D[U]=="string"&&(D[U]=document.querySelector(D[U]))}),D.modules=Object.keys(D.modules).reduce(function(U,B){return D.modules[B]&&(U[B]=D.modules[B]),U},{}),D}function F(C,D,w,R){if(this.options.strict&&!this.isEnabled()&&D===e.default.sources.USER)return new y.default;var j=w==null?null:this.getSelection(),U=this.editor.delta,B=C();if(j!=null&&(w===!0&&(w=j.index),R==null?j=W(j,B,D):R!==0&&(j=W(j,w,R,D)),this.setSelection(j,e.default.sources.SILENT)),B.length()>0){var q,M=[e.default.events.TEXT_CHANGE,B,U,D];if((q=this.emitter).emit.apply(q,[e.default.events.EDITOR_CHANGE].concat(M)),D!==e.default.sources.SILENT){var H;(H=this.emitter).emit.apply(H,M)}}return B}function $(C,D,w,R,j){var U={};return typeof C.index=="number"&&typeof C.length=="number"?typeof D!="number"?(j=R,R=w,w=D,D=C.length,C=C.index):(D=C.length,C=C.index):typeof D!="number"&&(j=R,R=w,w=D,D=0),(typeof w>"u"?"undefined":k(w))==="object"?(U=w,j=R):typeof w=="string"&&(R!=null?U[w]=R:j=w),j=j||e.default.sources.API,[C,D,U,j]}function W(C,D,w,R){if(C==null)return null;var j=void 0,U=void 0;if(D instanceof y.default){var B=[C.index,C.index+C.length].map(function(z){return D.transformPosition(z,R!==e.default.sources.USER)}),q=T(B,2);j=q[0],U=q[1]}else{var M=[C.index,C.index+C.length].map(function(z){return z=0?z+w:Math.max(D,z+w)}),H=T(M,2);j=H[0],U=H[1]}return new i.Range(j,U-j)}s.expandConfig=I,s.overload=$,s.default=L},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=function(){function l(r,i){for(var f=0;f0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(f,n){var h=r.order.indexOf(f),x=r.order.indexOf(n);return h>=0||x>=0?h-x:f===n?0:f1?x-1:0),A=1;A1&&arguments[1]!==void 0?arguments[1]:{};k(this,b),this.quill=v,this.options=y};T.DEFAULTS={},s.default=T},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=["error","warn","log","info"],T="warn";function b(y){if(k.indexOf(y)<=k.indexOf(T)){for(var c,o=arguments.length,t=Array(o>1?o-1:0),e=1;e0&&typeof t[0]!="number")}function o(t,e,u){var a,l;if(y(t)||y(e)||t.prototype!==e.prototype)return!1;if(b(t))return b(e)?(t=k.call(t),e=k.call(e),v(t,e,u)):!1;if(c(t)){if(!c(e)||t.length!==e.length)return!1;for(a=0;a=0;a--)if(r[a]!=i[a])return!1;for(a=r.length-1;a>=0;a--)if(l=r[a],!v(t[l],e[l],u))return!1;return typeof t==typeof e}},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=d(1),T=function(){function b(v,y,c){c===void 0&&(c={}),this.attrName=v,this.keyName=y;var o=k.Scope.TYPE&k.Scope.ATTRIBUTE;c.scope!=null?this.scope=c.scope&k.Scope.LEVEL|o:this.scope=k.Scope.ATTRIBUTE,c.whitelist!=null&&(this.whitelist=c.whitelist)}return b.keys=function(v){return[].map.call(v.attributes,function(y){return y.name})},b.prototype.add=function(v,y){return this.canAdd(v,y)?(v.setAttribute(this.keyName,y),!0):!1},b.prototype.canAdd=function(v,y){var c=k.query(v,k.Scope.BLOT&(this.scope|k.Scope.TYPE));return c==null?!1:this.whitelist==null?!0:typeof y=="string"?this.whitelist.indexOf(y.replace(/["']/g,""))>-1:this.whitelist.indexOf(y)>-1},b.prototype.remove=function(v){v.removeAttribute(this.keyName)},b.prototype.value=function(v){var y=v.getAttribute(this.keyName);return this.canAdd(v,y)&&y?y:""},b}();s.default=T},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0}),s.default=s.Code=void 0;var k=function(){function A(P,_){var g=[],m=!0,S=!1,L=void 0;try{for(var I=P[Symbol.iterator](),F;!(m=(F=I.next()).done)&&(g.push(F.value),!(_&&g.length===_));m=!0);}catch($){S=!0,L=$}finally{try{!m&&I.return&&I.return()}finally{if(S)throw L}}return g}return function(P,_){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return A(P,_);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),T=function(){function A(P,_){for(var g=0;g<_.length;g++){var m=_[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}return function(P,_,g){return _&&A(P.prototype,_),g&&A(P,g),P}}(),b=function A(P,_,g){P===null&&(P=Function.prototype);var m=Object.getOwnPropertyDescriptor(P,_);if(m===void 0){var S=Object.getPrototypeOf(P);return S===null?void 0:A(S,_,g)}else{if("value"in m)return m.value;var L=m.get;return L===void 0?void 0:L.call(g)}},v=d(2),y=i(v),c=d(0),o=i(c),t=d(4),e=i(t),u=d(6),a=i(u),l=d(7),r=i(l);function i(A){return A&&A.__esModule?A:{default:A}}function f(A,P){if(!(A instanceof P))throw new TypeError("Cannot call a class as a function")}function n(A,P){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:A}function h(A,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);A.prototype=Object.create(P&&P.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(A,P):A.__proto__=P)}var x=function(A){h(P,A);function P(){return f(this,P),n(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return P}(a.default);x.blotName="code",x.tagName="CODE";var E=function(A){h(P,A);function P(){return f(this,P),n(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return T(P,[{key:"delta",value:function(){var g=this,m=this.domNode.textContent;return m.endsWith(` +`)&&(m=m.slice(0,-1)),m.split(` +`).reduce(function(S,L){return S.insert(L).insert(` +`,g.formats())},new y.default)}},{key:"format",value:function(g,m){if(!(g===this.statics.blotName&&m)){var S=this.descendant(r.default,this.length()-1),L=k(S,1),I=L[0];I!=null&&I.deleteAt(I.length()-1,1),b(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,g,m)}}},{key:"formatAt",value:function(g,m,S,L){if(m!==0&&!(o.default.query(S,o.default.Scope.BLOCK)==null||S===this.statics.blotName&&L===this.statics.formats(this.domNode))){var I=this.newlineIndex(g);if(!(I<0||I>=g+m)){var F=this.newlineIndex(g,!0)+1,$=I-F+1,W=this.isolate(F,$),C=W.next;W.format(S,L),C instanceof P&&C.formatAt(0,g-F+m-$,S,L)}}}},{key:"insertAt",value:function(g,m,S){if(S==null){var L=this.descendant(r.default,g),I=k(L,2),F=I[0],$=I[1];F.insertAt($,m)}}},{key:"length",value:function(){var g=this.domNode.textContent.length;return this.domNode.textContent.endsWith(` +`)?g:g+1}},{key:"newlineIndex",value:function(g){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(m)return this.domNode.textContent.slice(0,g).lastIndexOf(` +`);var S=this.domNode.textContent.slice(g).indexOf(` +`);return S>-1?g+S:-1}},{key:"optimize",value:function(g){this.domNode.textContent.endsWith(` +`)||this.appendChild(o.default.create("text",` +`)),b(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,g);var m=this.next;m!=null&&m.prev===this&&m.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===m.statics.formats(m.domNode)&&(m.optimize(g),m.moveChildren(this),m.remove())}},{key:"replace",value:function(g){b(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,g),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(m){var S=o.default.find(m);S==null?m.parentNode.removeChild(m):S instanceof o.default.Embed?S.remove():S.unwrap()})}}],[{key:"create",value:function(g){var m=b(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,g);return m.setAttribute("spellcheck",!1),m}},{key:"formats",value:function(){return!0}}]),P}(e.default);E.blotName="code-block",E.tagName="PRE",E.TAB=" ",s.Code=x,s.default=E},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},T=function(){function C(D,w){var R=[],j=!0,U=!1,B=void 0;try{for(var q=D[Symbol.iterator](),M;!(j=(M=q.next()).done)&&(R.push(M.value),!(w&&R.length===w));j=!0);}catch(H){U=!0,B=H}finally{try{!j&&q.return&&q.return()}finally{if(U)throw B}}return R}return function(D,w){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return C(D,w);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(){function C(D,w){for(var R=0;R=U&&!z.endsWith(` +`)&&(j=!0),R.scroll.insertAt(B,z);var V=R.scroll.line(B),X=T(V,2),J=X[0],tt=X[1],it=(0,g.default)({},(0,i.bubbleFormats)(J));if(J instanceof f.default){var ot=J.descendant(e.default.Leaf,tt),ct=T(ot,1),ft=ct[0];it=(0,g.default)(it,(0,i.bubbleFormats)(ft))}H=o.default.attributes.diff(it,H)||{}}else if(k(q.insert)==="object"){var K=Object.keys(q.insert)[0];if(K==null)return B;R.scroll.insertAt(B,K,q.insert[K])}U+=M}return Object.keys(H).forEach(function(G){R.scroll.formatAt(B,M,G,H[G])}),B+M},0),w.reduce(function(B,q){return typeof q.delete=="number"?(R.scroll.deleteAt(B,q.delete),B):B+(q.retain||q.insert.length||1)},0),this.scroll.batchEnd(),this.update(w)}},{key:"deleteText",value:function(w,R){return this.scroll.deleteAt(w,R),this.update(new y.default().retain(w).delete(R))}},{key:"formatLine",value:function(w,R){var j=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(U).forEach(function(B){if(!(j.scroll.whitelist!=null&&!j.scroll.whitelist[B])){var q=j.scroll.lines(w,Math.max(R,1)),M=R;q.forEach(function(H){var z=H.length();if(!(H instanceof a.default))H.format(B,U[B]);else{var V=w-H.offset(j.scroll),X=H.newlineIndex(V+M)-V+1;H.formatAt(V,X,B,U[B])}M-=z})}}),this.scroll.optimize(),this.update(new y.default().retain(w).retain(R,(0,E.default)(U)))}},{key:"formatText",value:function(w,R){var j=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(U).forEach(function(B){j.scroll.formatAt(w,R,B,U[B])}),this.update(new y.default().retain(w).retain(R,(0,E.default)(U)))}},{key:"getContents",value:function(w,R){return this.delta.slice(w,w+R)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(w,R){return w.concat(R.delta())},new y.default)}},{key:"getFormat",value:function(w){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,j=[],U=[];R===0?this.scroll.path(w).forEach(function(q){var M=T(q,1),H=M[0];H instanceof f.default?j.push(H):H instanceof e.default.Leaf&&U.push(H)}):(j=this.scroll.lines(w,R),U=this.scroll.descendants(e.default.Leaf,w,R));var B=[j,U].map(function(q){if(q.length===0)return{};for(var M=(0,i.bubbleFormats)(q.shift());Object.keys(M).length>0;){var H=q.shift();if(H==null)return M;M=$((0,i.bubbleFormats)(H),M)}return M});return g.default.apply(g.default,B)}},{key:"getText",value:function(w,R){return this.getContents(w,R).filter(function(j){return typeof j.insert=="string"}).map(function(j){return j.insert}).join("")}},{key:"insertEmbed",value:function(w,R,j){return this.scroll.insertAt(w,R,j),this.update(new y.default().retain(w).insert(S({},R,j)))}},{key:"insertText",value:function(w,R){var j=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return R=R.replace(/\r\n/g,` +`).replace(/\r/g,` +`),this.scroll.insertAt(w,R),Object.keys(U).forEach(function(B){j.scroll.formatAt(w,R.length,B,U[B])}),this.update(new y.default().retain(w).insert(R,(0,E.default)(U)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var w=this.scroll.children.head;return w.statics.blotName!==f.default.blotName||w.children.length>1?!1:w.children.head instanceof h.default}},{key:"removeFormat",value:function(w,R){var j=this.getText(w,R),U=this.scroll.line(w+R),B=T(U,2),q=B[0],M=B[1],H=0,z=new y.default;q!=null&&(q instanceof a.default?H=q.newlineIndex(M)-M+1:H=q.length()-M,z=q.delta().slice(M,M+H-1).insert(` +`));var V=this.getContents(w,R+H),X=V.diff(new y.default().insert(j).concat(z)),J=new y.default().retain(w).concat(X);return this.applyDelta(J)}},{key:"update",value:function(w){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,U=this.delta;if(R.length===1&&R[0].type==="characterData"&&R[0].target.data.match(I)&&e.default.find(R[0].target)){var B=e.default.find(R[0].target),q=(0,i.bubbleFormats)(B),M=B.offset(this.scroll),H=R[0].oldValue.replace(r.default.CONTENTS,""),z=new y.default().insert(H),V=new y.default().insert(B.value()),X=new y.default().retain(M).concat(z.diff(V,j));w=X.reduce(function(J,tt){return tt.insert?J.insert(tt.insert,q):J.push(tt)},new y.default),this.delta=U.compose(w)}else this.delta=this.getDelta(),(!w||!(0,P.default)(U.compose(w),this.delta))&&(w=U.diff(this.delta,j));return w}}]),C}();function $(C,D){return Object.keys(D).reduce(function(w,R){return C[R]==null||(D[R]===C[R]?w[R]=D[R]:Array.isArray(D[R])?D[R].indexOf(C[R])<0&&(w[R]=D[R].concat([C[R]])):w[R]=[D[R],C[R]]),w},{})}function W(C){return C.reduce(function(D,w){if(w.insert===1){var R=(0,E.default)(w.attributes);return delete R.image,D.insert({image:w.attributes.image},R)}if(w.attributes!=null&&(w.attributes.list===!0||w.attributes.bullet===!0)&&(w=(0,E.default)(w),w.attributes.list?w.attributes.list="ordered":(w.attributes.list="bullet",delete w.attributes.bullet)),typeof w.insert=="string"){var j=w.insert.replace(/\r\n/g,` +`).replace(/\r/g,` +`);return D.insert(j,w.attributes)}return D.push(w)},new y.default)}s.default=F},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0}),s.default=s.Range=void 0;var k=function(){function A(P,_){var g=[],m=!0,S=!1,L=void 0;try{for(var I=P[Symbol.iterator](),F;!(m=(F=I.next()).done)&&(g.push(F.value),!(_&&g.length===_));m=!0);}catch($){S=!0,L=$}finally{try{!m&&I.return&&I.return()}finally{if(S)throw L}}return g}return function(P,_){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return A(P,_);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),T=function(){function A(P,_){for(var g=0;g<_.length;g++){var m=_[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}return function(P,_,g){return _&&A(P.prototype,_),g&&A(P,g),P}}(),b=d(0),v=r(b),y=d(21),c=r(y),o=d(11),t=r(o),e=d(8),u=r(e),a=d(10),l=r(a);function r(A){return A&&A.__esModule?A:{default:A}}function i(A){if(Array.isArray(A)){for(var P=0,_=Array(A.length);P1&&arguments[1]!==void 0?arguments[1]:0;f(this,A),this.index=P,this.length=_},x=function(){function A(P,_){var g=this;f(this,A),this.emitter=_,this.scroll=P,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=v.default.create("cursor",this),this.lastRange=this.savedRange=new h(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){g.mouseDown||setTimeout(g.update.bind(g,u.default.sources.USER),1)}),this.emitter.on(u.default.events.EDITOR_CHANGE,function(m,S){m===u.default.events.TEXT_CHANGE&&S.length()>0&&g.update(u.default.sources.SILENT)}),this.emitter.on(u.default.events.SCROLL_BEFORE_UPDATE,function(){if(g.hasFocus()){var m=g.getNativeRange();m!=null&&m.start.node!==g.cursor.textNode&&g.emitter.once(u.default.events.SCROLL_UPDATE,function(){try{g.setNativeRange(m.start.node,m.start.offset,m.end.node,m.end.offset)}catch{}})}}),this.emitter.on(u.default.events.SCROLL_OPTIMIZE,function(m,S){if(S.range){var L=S.range,I=L.startNode,F=L.startOffset,$=L.endNode,W=L.endOffset;g.setNativeRange(I,F,$,W)}}),this.update(u.default.sources.SILENT)}return T(A,[{key:"handleComposition",value:function(){var _=this;this.root.addEventListener("compositionstart",function(){_.composing=!0}),this.root.addEventListener("compositionend",function(){if(_.composing=!1,_.cursor.parent){var g=_.cursor.restore();if(!g)return;setTimeout(function(){_.setNativeRange(g.startNode,g.startOffset,g.endNode,g.endOffset)},1)}})}},{key:"handleDragging",value:function(){var _=this;this.emitter.listenDOM("mousedown",document.body,function(){_.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){_.mouseDown=!1,_.update(u.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(_,g){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[_])){this.scroll.update();var m=this.getNativeRange();if(!(m==null||!m.native.collapsed||v.default.query(_,v.default.Scope.BLOCK))){if(m.start.node!==this.cursor.textNode){var S=v.default.find(m.start.node,!1);if(S==null)return;if(S instanceof v.default.Leaf){var L=S.split(m.start.offset);S.parent.insertBefore(this.cursor,L)}else S.insertBefore(this.cursor,m.start.node);this.cursor.attach()}this.cursor.format(_,g),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(_){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,m=this.scroll.length();_=Math.min(_,m-1),g=Math.min(_+g,m-1)-_;var S=void 0,L=this.scroll.leaf(_),I=k(L,2),F=I[0],$=I[1];if(F==null)return null;var W=F.position($,!0),C=k(W,2);S=C[0],$=C[1];var D=document.createRange();if(g>0){D.setStart(S,$);var w=this.scroll.leaf(_+g),R=k(w,2);if(F=R[0],$=R[1],F==null)return null;var j=F.position($,!0),U=k(j,2);return S=U[0],$=U[1],D.setEnd(S,$),D.getBoundingClientRect()}else{var B="left",q=void 0;return S instanceof Text?($0&&(B="right")),{bottom:q.top+q.height,height:q.height,left:q[B],right:q[B],top:q.top,width:0}}}},{key:"getNativeRange",value:function(){var _=document.getSelection();if(_==null||_.rangeCount<=0)return null;var g=_.getRangeAt(0);if(g==null)return null;var m=this.normalizeNative(g);return n.info("getNativeRange",m),m}},{key:"getRange",value:function(){var _=this.getNativeRange();if(_==null)return[null,null];var g=this.normalizedToRange(_);return[g,_]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(_){var g=this,m=[[_.start.node,_.start.offset]];_.native.collapsed||m.push([_.end.node,_.end.offset]);var S=m.map(function(F){var $=k(F,2),W=$[0],C=$[1],D=v.default.find(W,!0),w=D.offset(g.scroll);return C===0?w:D instanceof v.default.Container?w+D.length():w+D.index(W,C)}),L=Math.min(Math.max.apply(Math,i(S)),this.scroll.length()-1),I=Math.min.apply(Math,[L].concat(i(S)));return new h(I,L-I)}},{key:"normalizeNative",value:function(_){if(!E(this.root,_.startContainer)||!_.collapsed&&!E(this.root,_.endContainer))return null;var g={start:{node:_.startContainer,offset:_.startOffset},end:{node:_.endContainer,offset:_.endOffset},native:_};return[g.start,g.end].forEach(function(m){for(var S=m.node,L=m.offset;!(S instanceof Text)&&S.childNodes.length>0;)if(S.childNodes.length>L)S=S.childNodes[L],L=0;else if(S.childNodes.length===L)S=S.lastChild,L=S instanceof Text?S.data.length:S.childNodes.length+1;else break;m.node=S,m.offset=L}),g}},{key:"rangeToNative",value:function(_){var g=this,m=_.collapsed?[_.index]:[_.index,_.index+_.length],S=[],L=this.scroll.length();return m.forEach(function(I,F){I=Math.min(L-1,I);var $=void 0,W=g.scroll.leaf(I),C=k(W,2),D=C[0],w=C[1],R=D.position(w,F!==0),j=k(R,2);$=j[0],w=j[1],S.push($,w)}),S.length<2&&(S=S.concat(S)),S}},{key:"scrollIntoView",value:function(_){var g=this.lastRange;if(g!=null){var m=this.getBounds(g.index,g.length);if(m!=null){var S=this.scroll.length()-1,L=this.scroll.line(Math.min(g.index,S)),I=k(L,1),F=I[0],$=F;if(g.length>0){var W=this.scroll.line(Math.min(g.index+g.length,S)),C=k(W,1);$=C[0]}if(!(F==null||$==null)){var D=_.getBoundingClientRect();m.topD.bottom&&(_.scrollTop+=m.bottom-D.bottom)}}}}},{key:"setNativeRange",value:function(_,g){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_,S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:g,L=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(n.info("setNativeRange",_,g,m,S),!(_!=null&&(this.root.parentNode==null||_.parentNode==null||m.parentNode==null))){var I=document.getSelection();if(I!=null)if(_!=null){this.hasFocus()||this.root.focus();var F=(this.getNativeRange()||{}).native;if(F==null||L||_!==F.startContainer||g!==F.startOffset||m!==F.endContainer||S!==F.endOffset){_.tagName=="BR"&&(g=[].indexOf.call(_.parentNode.childNodes,_),_=_.parentNode),m.tagName=="BR"&&(S=[].indexOf.call(m.parentNode.childNodes,m),m=m.parentNode);var $=document.createRange();$.setStart(_,g),$.setEnd(m,S),I.removeAllRanges(),I.addRange($)}}else I.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(_){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u.default.sources.API;if(typeof g=="string"&&(m=g,g=!1),n.info("setRange",_),_!=null){var S=this.rangeToNative(_);this.setNativeRange.apply(this,i(S).concat([g]))}else this.setNativeRange(null);this.update(m)}},{key:"update",value:function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:u.default.sources.USER,g=this.lastRange,m=this.getRange(),S=k(m,2),L=S[0],I=S[1];if(this.lastRange=L,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,t.default)(g,this.lastRange)){var F;!this.composing&&I!=null&&I.native.collapsed&&I.start.node!==this.cursor.textNode&&this.cursor.restore();var $=[u.default.events.SELECTION_CHANGE,(0,c.default)(this.lastRange),(0,c.default)(g),_];if((F=this.emitter).emit.apply(F,[u.default.events.EDITOR_CHANGE].concat($)),_!==u.default.sources.SILENT){var W;(W=this.emitter).emit.apply(W,$)}}}}]),A}();function E(A,P){try{P.parentNode}catch{return!1}return P instanceof Text&&(P=P.parentNode),A.contains(P)}s.Range=h,s.default=x},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=function(){function u(a,l){for(var r=0;r0&&(e+=1),[this.parent.domNode,e]},c.prototype.value=function(){var o;return o={},o[this.statics.blotName]=this.statics.value(this.domNode)||!0,o},c.scope=b.Scope.INLINE_BLOT,c}(T.default);s.default=v},function(O,s,d){var k=d(11),T=d(3),b={attributes:{compose:function(y,c,o){typeof y!="object"&&(y={}),typeof c!="object"&&(c={});var t=T(!0,{},c);o||(t=Object.keys(t).reduce(function(u,a){return t[a]!=null&&(u[a]=t[a]),u},{}));for(var e in y)y[e]!==void 0&&c[e]===void 0&&(t[e]=y[e]);return Object.keys(t).length>0?t:void 0},diff:function(y,c){typeof y!="object"&&(y={}),typeof c!="object"&&(c={});var o=Object.keys(y).concat(Object.keys(c)).reduce(function(t,e){return k(y[e],c[e])||(t[e]=c[e]===void 0?null:c[e]),t},{});return Object.keys(o).length>0?o:void 0},transform:function(y,c,o){if(typeof y!="object")return c;if(typeof c=="object"){if(!o)return c;var t=Object.keys(c).reduce(function(e,u){return y[u]===void 0&&(e[u]=c[u]),e},{});return Object.keys(t).length>0?t:void 0}}},iterator:function(y){return new v(y)},length:function(y){return typeof y.delete=="number"?y.delete:typeof y.retain=="number"?y.retain:typeof y.insert=="string"?y.insert.length:1}};function v(y){this.ops=y,this.index=0,this.offset=0}v.prototype.hasNext=function(){return this.peekLength()<1/0},v.prototype.next=function(y){y||(y=1/0);var c=this.ops[this.index];if(c){var o=this.offset,t=b.length(c);if(y>=t-o?(y=t-o,this.index+=1,this.offset=0):this.offset+=y,typeof c.delete=="number")return{delete:y};var e={};return c.attributes&&(e.attributes=c.attributes),typeof c.retain=="number"?e.retain=y:typeof c.insert=="string"?e.insert=c.insert.substr(o,y):e.insert=c.insert,e}else return{retain:1/0}},v.prototype.peek=function(){return this.ops[this.index]},v.prototype.peekLength=function(){return this.ops[this.index]?b.length(this.ops[this.index])-this.offset:1/0},v.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},v.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var y=this.offset,c=this.index,o=this.next(),t=this.ops.slice(this.index);return this.offset=y,this.index=c,[o].concat(t)}else return[]},O.exports=b},function(O,s){var d=function(){function k(a,l){return l!=null&&a instanceof l}var T;try{T=Map}catch{T=function(){}}var b;try{b=Set}catch{b=function(){}}var v;try{v=Promise}catch{v=function(){}}function y(a,l,r,i,f){typeof l=="object"&&(r=l.depth,i=l.prototype,f=l.includeNonEnumerable,l=l.circular);var n=[],h=[],x=typeof Buffer<"u";typeof l>"u"&&(l=!0),typeof r>"u"&&(r=1/0);function E(A,P){if(A===null)return null;if(P===0)return A;var _,g;if(typeof A!="object")return A;if(k(A,T))_=new T;else if(k(A,b))_=new b;else if(k(A,v))_=new v(function(D,w){A.then(function(R){D(E(R,P-1))},function(R){w(E(R,P-1))})});else if(y.__isArray(A))_=[];else if(y.__isRegExp(A))_=new RegExp(A.source,u(A)),A.lastIndex&&(_.lastIndex=A.lastIndex);else if(y.__isDate(A))_=new Date(A.getTime());else{if(x&&Buffer.isBuffer(A))return Buffer.allocUnsafe?_=Buffer.allocUnsafe(A.length):_=new Buffer(A.length),A.copy(_),_;k(A,Error)?_=Object.create(A):typeof i>"u"?(g=Object.getPrototypeOf(A),_=Object.create(g)):(_=Object.create(i),g=i)}if(l){var m=n.indexOf(A);if(m!=-1)return h[m];n.push(A),h.push(_)}k(A,T)&&A.forEach(function(D,w){var R=E(w,P-1),j=E(D,P-1);_.set(R,j)}),k(A,b)&&A.forEach(function(D){var w=E(D,P-1);_.add(w)});for(var S in A){var L;g&&(L=Object.getOwnPropertyDescriptor(g,S)),!(L&&L.set==null)&&(_[S]=E(A[S],P-1))}if(Object.getOwnPropertySymbols)for(var I=Object.getOwnPropertySymbols(A),S=0;S0){if($ instanceof t.BlockEmbed||w instanceof t.BlockEmbed){this.optimize();return}if($ instanceof r.default){var R=$.newlineIndex($.length(),!0);if(R>-1&&($=$.split(R+1),$===w)){this.optimize();return}}else if(w instanceof r.default){var j=w.newlineIndex(0);j>-1&&w.split(j+1)}var U=w.children.head instanceof a.default?null:w.children.head;$.moveChildren(w,U),$.remove()}this.optimize()}},{key:"enable",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",S)}},{key:"formatAt",value:function(S,L,I,F){this.whitelist!=null&&!this.whitelist[I]||(b(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"formatAt",this).call(this,S,L,I,F),this.optimize())}},{key:"insertAt",value:function(S,L,I){if(!(I!=null&&this.whitelist!=null&&!this.whitelist[L])){if(S>=this.length())if(I==null||y.default.query(L,y.default.Scope.BLOCK)==null){var F=y.default.create(this.statics.defaultChild);this.appendChild(F),I==null&&L.endsWith(` +`)&&(L=L.slice(0,-1)),F.insertAt(0,L,I)}else{var $=y.default.create(L,I);this.appendChild($)}else b(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"insertAt",this).call(this,S,L,I);this.optimize()}}},{key:"insertBefore",value:function(S,L){if(S.statics.scope===y.default.Scope.INLINE_BLOT){var I=y.default.create(this.statics.defaultChild);I.appendChild(S),S=I}b(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"insertBefore",this).call(this,S,L)}},{key:"leaf",value:function(S){return this.path(S).pop()||[null,-1]}},{key:"line",value:function(S){return S===this.length()?this.line(S-1):this.descendant(A,S)}},{key:"lines",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,I=function F($,W,C){var D=[],w=C;return $.children.forEachAt(W,C,function(R,j,U){A(R)?D.push(R):R instanceof y.default.Container&&(D=D.concat(F(R,j,w))),w-=U}),D};return I(this,S,L)}},{key:"optimize",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(b(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"optimize",this).call(this,S,L),S.length>0&&this.emitter.emit(o.default.events.SCROLL_OPTIMIZE,S,L))}},{key:"path",value:function(S){return b(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"path",this).call(this,S).slice(1)}},{key:"update",value:function(S){if(this.batch!==!0){var L=o.default.sources.USER;typeof S=="string"&&(L=S),Array.isArray(S)||(S=this.observer.takeRecords()),S.length>0&&this.emitter.emit(o.default.events.SCROLL_BEFORE_UPDATE,L,S),b(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"update",this).call(this,S.concat([])),S.length>0&&this.emitter.emit(o.default.events.SCROLL_UPDATE,L,S)}}}]),g}(y.default.Scroll);P.blotName="scroll",P.className="ql-editor",P.tagName="DIV",P.defaultChild="block",P.allowedChildren=[e.default,t.BlockEmbed,f.default],s.default=P},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0}),s.SHORTKEY=s.default=void 0;var k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},T=function(){function q(M,H){var z=[],V=!0,X=!1,J=void 0;try{for(var tt=M[Symbol.iterator](),it;!(V=(it=tt.next()).done)&&(z.push(it.value),!(H&&z.length===H));V=!0);}catch(ot){X=!0,J=ot}finally{try{!V&&tt.return&&tt.return()}finally{if(X)throw J}}return z}return function(M,H){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return q(M,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(){function q(M,H){for(var z=0;z1&&arguments[1]!==void 0?arguments[1]:{},X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},J=B(z);if(J==null||J.key==null)return I.warn("Attempted to add invalid keyboard binding",J);typeof V=="function"&&(V={handler:V}),typeof X=="function"&&(X={handler:X}),J=(0,e.default)(J,V,X),this.bindings[J.key]=this.bindings[J.key]||[],this.bindings[J.key].push(J)}},{key:"listen",value:function(){var z=this;this.quill.root.addEventListener("keydown",function(V){if(!V.defaultPrevented){var X=V.which||V.keyCode,J=(z.bindings[X]||[]).filter(function(st){return M.match(V,st)});if(J.length!==0){var tt=z.quill.getSelection();if(!(tt==null||!z.quill.hasFocus())){var it=z.quill.getLine(tt.index),ot=T(it,2),ct=ot[0],ft=ot[1],K=z.quill.getLeaf(tt.index),G=T(K,2),Y=G[0],Q=G[1],Z=tt.length===0?[Y,Q]:z.quill.getLeaf(tt.index+tt.length),et=T(Z,2),nt=et[0],rt=et[1],dt=Y instanceof f.default.Text?Y.value().slice(0,Q):"",pt=nt instanceof f.default.Text?nt.value().slice(rt):"",ut={collapsed:tt.length===0,empty:tt.length===0&&ct.length()<=1,format:z.quill.getFormat(tt),offset:ft,prefix:dt,suffix:pt},Ke=J.some(function(st){if(st.collapsed!=null&&st.collapsed!==ut.collapsed||st.empty!=null&&st.empty!==ut.empty||st.offset!=null&&st.offset!==ut.offset)return!1;if(Array.isArray(st.format)){if(st.format.every(function(mt){return ut.format[mt]==null}))return!1}else if(k(st.format)==="object"&&!Object.keys(st.format).every(function(mt){return st.format[mt]===!0?ut.format[mt]!=null:st.format[mt]===!1?ut.format[mt]==null:(0,o.default)(st.format[mt],ut.format[mt])}))return!1;return st.prefix!=null&&!st.prefix.test(ut.prefix)||st.suffix!=null&&!st.suffix.test(ut.suffix)?!1:st.handler.call(z,tt,ut)!==!0});Ke&&V.preventDefault()}}}})}}]),M}(P.default);$.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},$.DEFAULTS={bindings:{bold:U("bold"),italic:U("italic"),underline:U("underline"),indent:{key:$.keys.TAB,format:["blockquote","indent","list"],handler:function(M,H){if(H.collapsed&&H.offset!==0)return!0;this.quill.format("indent","+1",h.default.sources.USER)}},outdent:{key:$.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(M,H){if(H.collapsed&&H.offset!==0)return!0;this.quill.format("indent","-1",h.default.sources.USER)}},"outdent backspace":{key:$.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(M,H){H.format.indent!=null?this.quill.format("indent","-1",h.default.sources.USER):H.format.list!=null&&this.quill.format("list",!1,h.default.sources.USER)}},"indent code-block":j(!0),"outdent code-block":j(!1),"remove tab":{key:$.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(M){this.quill.deleteText(M.index-1,1,h.default.sources.USER)}},tab:{key:$.keys.TAB,handler:function(M){this.quill.history.cutoff();var H=new a.default().retain(M.index).delete(M.length).insert(" ");this.quill.updateContents(H,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(M.index+1,h.default.sources.SILENT)}},"list empty enter":{key:$.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(M,H){this.quill.format("list",!1,h.default.sources.USER),H.format.indent&&this.quill.format("indent",!1,h.default.sources.USER)}},"checklist enter":{key:$.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(M){var H=this.quill.getLine(M.index),z=T(H,2),V=z[0],X=z[1],J=(0,e.default)({},V.formats(),{list:"checked"}),tt=new a.default().retain(M.index).insert(` +`,J).retain(V.length()-X-1).retain(1,{list:"unchecked"});this.quill.updateContents(tt,h.default.sources.USER),this.quill.setSelection(M.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:$.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(M,H){var z=this.quill.getLine(M.index),V=T(z,2),X=V[0],J=V[1],tt=new a.default().retain(M.index).insert(` +`,H.format).retain(X.length()-J-1).retain(1,{header:null});this.quill.updateContents(tt,h.default.sources.USER),this.quill.setSelection(M.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(M,H){var z=H.prefix.length,V=this.quill.getLine(M.index),X=T(V,2),J=X[0],tt=X[1];if(tt>z)return!0;var it=void 0;switch(H.prefix.trim()){case"[]":case"[ ]":it="unchecked";break;case"[x]":it="checked";break;case"-":case"*":it="bullet";break;default:it="ordered"}this.quill.insertText(M.index," ",h.default.sources.USER),this.quill.history.cutoff();var ot=new a.default().retain(M.index-tt).delete(z+1).retain(J.length()-2-tt).retain(1,{list:it});this.quill.updateContents(ot,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(M.index-z,h.default.sources.SILENT)}},"code exit":{key:$.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(M){var H=this.quill.getLine(M.index),z=T(H,2),V=z[0],X=z[1],J=new a.default().retain(M.index+V.length()-X-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(J,h.default.sources.USER)}},"embed left":W($.keys.LEFT,!1),"embed left shift":W($.keys.LEFT,!0),"embed right":W($.keys.RIGHT,!1),"embed right shift":W($.keys.RIGHT,!0)}};function W(q,M){var H,z=q===$.keys.LEFT?"prefix":"suffix";return H={key:q,shiftKey:M,altKey:null},g(H,z,/^$/),g(H,"handler",function(X){var J=X.index;q===$.keys.RIGHT&&(J+=X.length+1);var tt=this.quill.getLeaf(J),it=T(tt,1),ot=it[0];return ot instanceof f.default.Embed?(q===$.keys.LEFT?M?this.quill.setSelection(X.index-1,X.length+1,h.default.sources.USER):this.quill.setSelection(X.index-1,h.default.sources.USER):M?this.quill.setSelection(X.index,X.length+1,h.default.sources.USER):this.quill.setSelection(X.index+X.length+1,h.default.sources.USER),!1):!0}),H}function C(q,M){if(!(q.index===0||this.quill.getLength()<=1)){var H=this.quill.getLine(q.index),z=T(H,1),V=z[0],X={};if(M.offset===0){var J=this.quill.getLine(q.index-1),tt=T(J,1),it=tt[0];if(it!=null&&it.length()>1){var ot=V.formats(),ct=this.quill.getFormat(q.index-1,1);X=r.default.attributes.diff(ot,ct)||{}}}var ft=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(M.prefix)?2:1;this.quill.deleteText(q.index-ft,ft,h.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine(q.index-ft,ft,X,h.default.sources.USER),this.quill.focus()}}function D(q,M){var H=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(M.suffix)?2:1;if(!(q.index>=this.quill.getLength()-H)){var z={},V=0,X=this.quill.getLine(q.index),J=T(X,1),tt=J[0];if(M.offset>=tt.length()-1){var it=this.quill.getLine(q.index+1),ot=T(it,1),ct=ot[0];if(ct){var ft=tt.formats(),K=this.quill.getFormat(q.index,1);z=r.default.attributes.diff(ft,K)||{},V=ct.length()}}this.quill.deleteText(q.index,H,h.default.sources.USER),Object.keys(z).length>0&&this.quill.formatLine(q.index+V-1,H,z,h.default.sources.USER)}}function w(q){var M=this.quill.getLines(q),H={};if(M.length>1){var z=M[0].formats(),V=M[M.length-1].formats();H=r.default.attributes.diff(V,z)||{}}this.quill.deleteText(q,h.default.sources.USER),Object.keys(H).length>0&&this.quill.formatLine(q.index,1,H,h.default.sources.USER),this.quill.setSelection(q.index,h.default.sources.SILENT),this.quill.focus()}function R(q,M){var H=this;q.length>0&&this.quill.scroll.deleteAt(q.index,q.length);var z=Object.keys(M.format).reduce(function(V,X){return f.default.query(X,f.default.Scope.BLOCK)&&!Array.isArray(M.format[X])&&(V[X]=M.format[X]),V},{});this.quill.insertText(q.index,` +`,z,h.default.sources.USER),this.quill.setSelection(q.index+1,h.default.sources.SILENT),this.quill.focus(),Object.keys(M.format).forEach(function(V){z[V]==null&&(Array.isArray(M.format[V])||V!=="link"&&H.quill.format(V,M.format[V],h.default.sources.USER))})}function j(q){return{key:$.keys.TAB,shiftKey:!q,format:{"code-block":!0},handler:function(H){var z=f.default.query("code-block"),V=H.index,X=H.length,J=this.quill.scroll.descendant(z,V),tt=T(J,2),it=tt[0],ot=tt[1];if(it!=null){var ct=this.quill.getIndex(it),ft=it.newlineIndex(ot,!0)+1,K=it.newlineIndex(ct+ot+X),G=it.domNode.textContent.slice(ft,K).split(` +`);ot=0,G.forEach(function(Y,Q){q?(it.insertAt(ft+ot,z.TAB),ot+=z.TAB.length,Q===0?V+=z.TAB.length:X+=z.TAB.length):Y.startsWith(z.TAB)&&(it.deleteAt(ft+ot,z.TAB.length),ot-=z.TAB.length,Q===0?V-=z.TAB.length:X-=z.TAB.length),ot+=Y.length+1}),this.quill.update(h.default.sources.USER),this.quill.setSelection(V,X,h.default.sources.SILENT)}}}}function U(q){return{key:q[0].toUpperCase(),shortKey:!0,handler:function(H,z){this.quill.format(q,!z.format[q],h.default.sources.USER)}}}function B(q){if(typeof q=="string"||typeof q=="number")return B({key:q});if((typeof q>"u"?"undefined":k(q))==="object"&&(q=(0,y.default)(q,!1)),typeof q.key=="string")if($.keys[q.key.toUpperCase()]!=null)q.key=$.keys[q.key.toUpperCase()];else if(q.key.length===1)q.key=q.key.toUpperCase().charCodeAt(0);else return null;return q.shortKey&&(q[F]=q.shortKey,delete q.shortKey),q}s.default=$,s.SHORTKEY=F},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=function(){function r(i,f){var n=[],h=!0,x=!1,E=void 0;try{for(var A=i[Symbol.iterator](),P;!(h=(P=A.next()).done)&&(n.push(P.value),!(f&&n.length===f));h=!0);}catch(_){x=!0,E=_}finally{try{!h&&A.return&&A.return()}finally{if(x)throw E}}return n}return function(i,f){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return r(i,f);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),T=function r(i,f,n){i===null&&(i=Function.prototype);var h=Object.getOwnPropertyDescriptor(i,f);if(h===void 0){var x=Object.getPrototypeOf(i);return x===null?void 0:r(x,f,n)}else{if("value"in h)return h.value;var E=h.get;return E===void 0?void 0:E.call(n)}},b=function(){function r(i,f){for(var n=0;n-1}s.default=e,s.sanitize=u},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},T=function(){function l(r,i){for(var f=0;f1&&arguments[1]!==void 0?arguments[1]:!1,n=this.container.querySelector(".ql-selected");if(i!==n&&(n!=null&&n.classList.remove("ql-selected"),i!=null&&(i.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(i.parentNode.children,i),i.hasAttribute("data-value")?this.label.setAttribute("data-value",i.getAttribute("data-value")):this.label.removeAttribute("data-value"),i.hasAttribute("data-label")?this.label.setAttribute("data-label",i.getAttribute("data-label")):this.label.removeAttribute("data-label"),f))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":k(Event))==="object"){var h=document.createEvent("Event");h.initEvent("change",!0,!0),this.select.dispatchEvent(h)}this.close()}}},{key:"update",value:function(){var i=void 0;if(this.select.selectedIndex>-1){var f=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];i=this.select.options[this.select.selectedIndex],this.selectItem(f)}else this.selectItem(null);var n=i!=null&&i!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),l}();s.default=a},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=d(0),T=I(k),b=d(5),v=I(b),y=d(4),c=I(y),o=d(16),t=I(o),e=d(25),u=I(e),a=d(24),l=I(a),r=d(35),i=I(r),f=d(6),n=I(f),h=d(22),x=I(h),E=d(7),A=I(E),P=d(55),_=I(P),g=d(42),m=I(g),S=d(23),L=I(S);function I(F){return F&&F.__esModule?F:{default:F}}v.default.register({"blots/block":c.default,"blots/block/embed":y.BlockEmbed,"blots/break":t.default,"blots/container":u.default,"blots/cursor":l.default,"blots/embed":i.default,"blots/inline":n.default,"blots/scroll":x.default,"blots/text":A.default,"modules/clipboard":_.default,"modules/history":m.default,"modules/keyboard":L.default}),T.default.register(c.default,t.default,l.default,n.default,x.default,A.default),s.default=v.default},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=d(1),T=function(){function b(v){this.domNode=v,this.domNode[k.DATA_KEY]={blot:this}}return Object.defineProperty(b.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),b.create=function(v){if(this.tagName==null)throw new k.ParchmentError("Blot definition missing tagName");var y;return Array.isArray(this.tagName)?(typeof v=="string"&&(v=v.toUpperCase(),parseInt(v).toString()===v&&(v=parseInt(v))),typeof v=="number"?y=document.createElement(this.tagName[v-1]):this.tagName.indexOf(v)>-1?y=document.createElement(v):y=document.createElement(this.tagName[0])):y=document.createElement(this.tagName),this.className&&y.classList.add(this.className),y},b.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},b.prototype.clone=function(){var v=this.domNode.cloneNode(!1);return k.create(v)},b.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[k.DATA_KEY]},b.prototype.deleteAt=function(v,y){var c=this.isolate(v,y);c.remove()},b.prototype.formatAt=function(v,y,c,o){var t=this.isolate(v,y);if(k.query(c,k.Scope.BLOT)!=null&&o)t.wrap(c,o);else if(k.query(c,k.Scope.ATTRIBUTE)!=null){var e=k.create(this.statics.scope);t.wrap(e),e.format(c,o)}},b.prototype.insertAt=function(v,y,c){var o=c==null?k.create("text",y):k.create(y,c),t=this.split(v);this.parent.insertBefore(o,t)},b.prototype.insertInto=function(v,y){y===void 0&&(y=null),this.parent!=null&&this.parent.children.remove(this);var c=null;v.children.insertBefore(this,y),y!=null&&(c=y.domNode),(this.domNode.parentNode!=v.domNode||this.domNode.nextSibling!=c)&&v.domNode.insertBefore(this.domNode,c),this.parent=v,this.attach()},b.prototype.isolate=function(v,y){var c=this.split(v);return c.split(y),c},b.prototype.length=function(){return 1},b.prototype.offset=function(v){return v===void 0&&(v=this.parent),this.parent==null||this==v?0:this.parent.children.offset(this)+this.parent.offset(v)},b.prototype.optimize=function(v){this.domNode[k.DATA_KEY]!=null&&delete this.domNode[k.DATA_KEY].mutations},b.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},b.prototype.replace=function(v){v.parent!=null&&(v.parent.insertBefore(this,v.next),v.remove())},b.prototype.replaceWith=function(v,y){var c=typeof v=="string"?k.create(v,y):v;return c.replace(this),c},b.prototype.split=function(v,y){return v===0?this:this.next},b.prototype.update=function(v,y){},b.prototype.wrap=function(v,y){var c=typeof v=="string"?k.create(v,y):v;return this.parent!=null&&this.parent.insertBefore(c,this.next),c.appendChild(this),c},b.blotName="abstract",b}();s.default=T},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=d(12),T=d(32),b=d(33),v=d(1),y=function(){function c(o){this.attributes={},this.domNode=o,this.build()}return c.prototype.attribute=function(o,t){t?o.add(this.domNode,t)&&(o.value(this.domNode)!=null?this.attributes[o.attrName]=o:delete this.attributes[o.attrName]):(o.remove(this.domNode),delete this.attributes[o.attrName])},c.prototype.build=function(){var o=this;this.attributes={};var t=k.default.keys(this.domNode),e=T.default.keys(this.domNode),u=b.default.keys(this.domNode);t.concat(e).concat(u).forEach(function(a){var l=v.query(a,v.Scope.ATTRIBUTE);l instanceof k.default&&(o.attributes[l.attrName]=l)})},c.prototype.copy=function(o){var t=this;Object.keys(this.attributes).forEach(function(e){var u=t.attributes[e].value(t.domNode);o.format(e,u)})},c.prototype.move=function(o){var t=this;this.copy(o),Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)}),this.attributes={}},c.prototype.values=function(){var o=this;return Object.keys(this.attributes).reduce(function(t,e){return t[e]=o.attributes[e].value(o.domNode),t},{})},c}();s.default=y},function(O,s,d){var k=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var t in o)o.hasOwnProperty(t)&&(c[t]=o[t])};return function(c,o){y(c,o);function t(){this.constructor=c}c.prototype=o===null?Object.create(o):(t.prototype=o.prototype,new t)}}();Object.defineProperty(s,"__esModule",{value:!0});var T=d(12);function b(y,c){var o=y.getAttribute("class")||"";return o.split(/\s+/).filter(function(t){return t.indexOf(c+"-")===0})}var v=function(y){k(c,y);function c(){return y!==null&&y.apply(this,arguments)||this}return c.keys=function(o){return(o.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},c.prototype.add=function(o,t){return this.canAdd(o,t)?(this.remove(o),o.classList.add(this.keyName+"-"+t),!0):!1},c.prototype.remove=function(o){var t=b(o,this.keyName);t.forEach(function(e){o.classList.remove(e)}),o.classList.length===0&&o.removeAttribute("class")},c.prototype.value=function(o){var t=b(o,this.keyName)[0]||"",e=t.slice(this.keyName.length+1);return this.canAdd(o,e)?e:""},c}(T.default);s.default=v},function(O,s,d){var k=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var t in o)o.hasOwnProperty(t)&&(c[t]=o[t])};return function(c,o){y(c,o);function t(){this.constructor=c}c.prototype=o===null?Object.create(o):(t.prototype=o.prototype,new t)}}();Object.defineProperty(s,"__esModule",{value:!0});var T=d(12);function b(y){var c=y.split("-"),o=c.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return c[0]+o}var v=function(y){k(c,y);function c(){return y!==null&&y.apply(this,arguments)||this}return c.keys=function(o){return(o.getAttribute("style")||"").split(";").map(function(t){var e=t.split(":");return e[0].trim()})},c.prototype.add=function(o,t){return this.canAdd(o,t)?(o.style[b(this.keyName)]=t,!0):!1},c.prototype.remove=function(o){o.style[b(this.keyName)]="",o.getAttribute("style")||o.removeAttribute("style")},c.prototype.value=function(o){var t=o.style[b(this.keyName)];return this.canAdd(o,t)?t:""},c}(T.default);s.default=v},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=function(){function v(y,c){for(var o=0;oP&&this.stack.undo.length>0){var _=this.stack.undo.pop();A=A.compose(_.undo),x=_.redo.compose(x)}else this.lastRecorded=P;this.stack.undo.push({redo:x,undo:A}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(x){this.stack.undo.forEach(function(E){E.undo=x.transform(E.undo,!0),E.redo=x.transform(E.redo,!0)}),this.stack.redo.forEach(function(E){E.undo=x.transform(E.undo,!0),E.redo=x.transform(E.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),n}(o.default);l.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function r(f){var n=f.ops[f.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(` +`):n.attributes!=null?Object.keys(n.attributes).some(function(h){return b.default.query(h,b.default.Scope.BLOCK)!=null}):!1}function i(f){var n=f.reduce(function(x,E){return x+=E.delete||0,x},0),h=f.length()-n;return r(f)&&(h-=1),h}s.default=l,s.getLastChangeIndex=i},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0}),s.default=s.BaseTooltip=void 0;var k=function(){function R(j,U){for(var B=0;B0&&arguments[0]!==void 0?arguments[0]:"link",q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),q!=null?this.textbox.value=q:B!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+B)||""),this.root.setAttribute("data-mode",B)}},{key:"restoreFocus",value:function(){var B=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=B}},{key:"save",value:function(){var B=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var q=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",B,t.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",B,t.default.sources.USER)),this.quill.root.scrollTop=q;break}case"video":B=D(B);case"formula":{if(!B)break;var M=this.quill.getSelection(!0);if(M!=null){var H=M.index+M.length;this.quill.insertEmbed(H,this.root.getAttribute("data-mode"),B,t.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(H+1," ",t.default.sources.USER),this.quill.setSelection(H+2,t.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),j}(A.default);function D(R){var j=R.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||R.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return j?(j[1]||"https")+"://www.youtube.com/embed/"+j[2]+"?showinfo=0":(j=R.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(j[1]||"https")+"://player.vimeo.com/video/"+j[2]+"/":R}function w(R,j){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;j.forEach(function(B){var q=document.createElement("option");B===U?q.setAttribute("selected","selected"):q.setAttribute("value",B),R.appendChild(q)})}s.BaseTooltip=C,s.default=W},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=function(){function T(){this.head=this.tail=null,this.length=0}return T.prototype.append=function(){for(var b=[],v=0;v1&&this.append.apply(this,b.slice(1))},T.prototype.contains=function(b){for(var v,y=this.iterator();v=y();)if(v===b)return!0;return!1},T.prototype.insertBefore=function(b,v){b&&(b.next=v,v!=null?(b.prev=v.prev,v.prev!=null&&(v.prev.next=b),v.prev=b,v===this.head&&(this.head=b)):this.tail!=null?(this.tail.next=b,b.prev=this.tail,this.tail=b):(b.prev=null,this.head=this.tail=b),this.length+=1)},T.prototype.offset=function(b){for(var v=0,y=this.head;y!=null;){if(y===b)return v;v+=y.length(),y=y.next}return-1},T.prototype.remove=function(b){this.contains(b)&&(b.prev!=null&&(b.prev.next=b.next),b.next!=null&&(b.next.prev=b.prev),b===this.head&&(this.head=b.next),b===this.tail&&(this.tail=b.prev),this.length-=1)},T.prototype.iterator=function(b){return b===void 0&&(b=this.head),function(){var v=b;return b!=null&&(b=b.next),v}},T.prototype.find=function(b,v){v===void 0&&(v=!1);for(var y,c=this.iterator();y=c();){var o=y.length();if(bu?y(e,b-u,Math.min(v,u+l-b)):y(e,0,Math.min(l,b+v-u)),u+=l}},T.prototype.map=function(b){return this.reduce(function(v,y){return v.push(b(y)),v},[])},T.prototype.reduce=function(b,v){for(var y,c=this.iterator();y=c();)v=b(v,y);return v},T}();s.default=k},function(O,s,d){var k=this&&this.__extends||function(){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var u in e)e.hasOwnProperty(u)&&(t[u]=e[u])};return function(t,e){o(t,e);function u(){this.constructor=t}t.prototype=e===null?Object.create(e):(u.prototype=e.prototype,new u)}}();Object.defineProperty(s,"__esModule",{value:!0});var T=d(17),b=d(1),v={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},y=100,c=function(o){k(t,o);function t(e){var u=o.call(this,e)||this;return u.scroll=u,u.observer=new MutationObserver(function(a){u.update(a)}),u.observer.observe(u.domNode,v),u.attach(),u}return t.prototype.detach=function(){o.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(e,u){this.update(),e===0&&u===this.length()?this.children.forEach(function(a){a.remove()}):o.prototype.deleteAt.call(this,e,u)},t.prototype.formatAt=function(e,u,a,l){this.update(),o.prototype.formatAt.call(this,e,u,a,l)},t.prototype.insertAt=function(e,u,a){this.update(),o.prototype.insertAt.call(this,e,u,a)},t.prototype.optimize=function(e,u){var a=this;e===void 0&&(e=[]),u===void 0&&(u={}),o.prototype.optimize.call(this,u);for(var l=[].slice.call(this.observer.takeRecords());l.length>0;)e.push(l.pop());for(var r=function(h,x){x===void 0&&(x=!0),!(h==null||h===a)&&h.domNode.parentNode!=null&&(h.domNode[b.DATA_KEY].mutations==null&&(h.domNode[b.DATA_KEY].mutations=[]),x&&r(h.parent))},i=function(h){h.domNode[b.DATA_KEY]==null||h.domNode[b.DATA_KEY].mutations==null||(h instanceof T.default&&h.children.forEach(i),h.optimize(u))},f=e,n=0;f.length>0;n+=1){if(n>=y)throw new Error("[Parchment] Maximum optimize iterations reached");for(f.forEach(function(h){var x=b.find(h.target,!0);x!=null&&(x.domNode===h.target&&(h.type==="childList"?(r(b.find(h.previousSibling,!1)),[].forEach.call(h.addedNodes,function(E){var A=b.find(E,!1);r(A,!1),A instanceof T.default&&A.children.forEach(function(P){r(P,!1)})})):h.type==="attributes"&&r(x.prev)),r(x))}),this.children.forEach(i),f=[].slice.call(this.observer.takeRecords()),l=f.slice();l.length>0;)e.push(l.pop())}},t.prototype.update=function(e,u){var a=this;u===void 0&&(u={}),e=e||this.observer.takeRecords(),e.map(function(l){var r=b.find(l.target,!0);return r==null?null:r.domNode[b.DATA_KEY].mutations==null?(r.domNode[b.DATA_KEY].mutations=[l],r):(r.domNode[b.DATA_KEY].mutations.push(l),null)}).forEach(function(l){l==null||l===a||l.domNode[b.DATA_KEY]==null||l.update(l.domNode[b.DATA_KEY].mutations||[],u)}),this.domNode[b.DATA_KEY].mutations!=null&&o.prototype.update.call(this,this.domNode[b.DATA_KEY].mutations,u),this.optimize(e,u)},t.blotName="scroll",t.defaultChild="block",t.scope=b.Scope.BLOCK_BLOT,t.tagName="DIV",t}(T.default);s.default=c},function(O,s,d){var k=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])};return function(o,t){c(o,t);function e(){this.constructor=o}o.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();Object.defineProperty(s,"__esModule",{value:!0});var T=d(18),b=d(1);function v(c,o){if(Object.keys(c).length!==Object.keys(o).length)return!1;for(var t in c)if(c[t]!==o[t])return!1;return!0}var y=function(c){k(o,c);function o(){return c!==null&&c.apply(this,arguments)||this}return o.formats=function(t){if(t.tagName!==o.tagName)return c.formats.call(this,t)},o.prototype.format=function(t,e){var u=this;t===this.statics.blotName&&!e?(this.children.forEach(function(a){a instanceof T.default||(a=a.wrap(o.blotName,!0)),u.attributes.copy(a)}),this.unwrap()):c.prototype.format.call(this,t,e)},o.prototype.formatAt=function(t,e,u,a){if(this.formats()[u]!=null||b.query(u,b.Scope.ATTRIBUTE)){var l=this.isolate(t,e);l.format(u,a)}else c.prototype.formatAt.call(this,t,e,u,a)},o.prototype.optimize=function(t){c.prototype.optimize.call(this,t);var e=this.formats();if(Object.keys(e).length===0)return this.unwrap();var u=this.next;u instanceof o&&u.prev===this&&v(e,u.formats())&&(u.moveChildren(this),u.remove())},o.blotName="inline",o.scope=b.Scope.INLINE_BLOT,o.tagName="SPAN",o}(T.default);s.default=y},function(O,s,d){var k=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var t in o)o.hasOwnProperty(t)&&(c[t]=o[t])};return function(c,o){y(c,o);function t(){this.constructor=c}c.prototype=o===null?Object.create(o):(t.prototype=o.prototype,new t)}}();Object.defineProperty(s,"__esModule",{value:!0});var T=d(18),b=d(1),v=function(y){k(c,y);function c(){return y!==null&&y.apply(this,arguments)||this}return c.formats=function(o){var t=b.query(c.blotName).tagName;if(o.tagName!==t)return y.formats.call(this,o)},c.prototype.format=function(o,t){b.query(o,b.Scope.BLOCK)!=null&&(o===this.statics.blotName&&!t?this.replaceWith(c.blotName):y.prototype.format.call(this,o,t))},c.prototype.formatAt=function(o,t,e,u){b.query(e,b.Scope.BLOCK)!=null?this.format(e,u):y.prototype.formatAt.call(this,o,t,e,u)},c.prototype.insertAt=function(o,t,e){if(e==null||b.query(t,b.Scope.INLINE)!=null)y.prototype.insertAt.call(this,o,t,e);else{var u=this.split(o),a=b.create(t,e);u.parent.insertBefore(a,u)}},c.prototype.update=function(o,t){navigator.userAgent.match(/Trident/)?this.build():y.prototype.update.call(this,o,t)},c.blotName="block",c.scope=b.Scope.BLOCK_BLOT,c.tagName="P",c}(T.default);s.default=v},function(O,s,d){var k=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,c){y.__proto__=c}||function(y,c){for(var o in c)c.hasOwnProperty(o)&&(y[o]=c[o])};return function(y,c){v(y,c);function o(){this.constructor=y}y.prototype=c===null?Object.create(c):(o.prototype=c.prototype,new o)}}();Object.defineProperty(s,"__esModule",{value:!0});var T=d(19),b=function(v){k(y,v);function y(){return v!==null&&v.apply(this,arguments)||this}return y.formats=function(c){},y.prototype.format=function(c,o){v.prototype.formatAt.call(this,0,this.length(),c,o)},y.prototype.formatAt=function(c,o,t,e){c===0&&o===this.length()?this.format(t,e):v.prototype.formatAt.call(this,c,o,t,e)},y.prototype.formats=function(){return this.statics.formats(this.domNode)},y}(T.default);s.default=b},function(O,s,d){var k=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var t in o)o.hasOwnProperty(t)&&(c[t]=o[t])};return function(c,o){y(c,o);function t(){this.constructor=c}c.prototype=o===null?Object.create(o):(t.prototype=o.prototype,new t)}}();Object.defineProperty(s,"__esModule",{value:!0});var T=d(19),b=d(1),v=function(y){k(c,y);function c(o){var t=y.call(this,o)||this;return t.text=t.statics.value(t.domNode),t}return c.create=function(o){return document.createTextNode(o)},c.value=function(o){var t=o.data;return t.normalize&&(t=t.normalize()),t},c.prototype.deleteAt=function(o,t){this.domNode.data=this.text=this.text.slice(0,o)+this.text.slice(o+t)},c.prototype.index=function(o,t){return this.domNode===o?t:-1},c.prototype.insertAt=function(o,t,e){e==null?(this.text=this.text.slice(0,o)+t+this.text.slice(o),this.domNode.data=this.text):y.prototype.insertAt.call(this,o,t,e)},c.prototype.length=function(){return this.text.length},c.prototype.optimize=function(o){y.prototype.optimize.call(this,o),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof c&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},c.prototype.position=function(o,t){return[this.domNode,o]},c.prototype.split=function(o,t){if(t===void 0&&(t=!1),!t){if(o===0)return this;if(o===this.length())return this.next}var e=b.create(this.domNode.splitText(o));return this.parent.insertBefore(e,this.next),this.text=this.statics.value(this.domNode),e},c.prototype.update=function(o,t){var e=this;o.some(function(u){return u.type==="characterData"&&u.target===e.domNode})&&(this.text=this.statics.value(this.domNode))},c.prototype.value=function(){return this.text},c.blotName="text",c.scope=b.Scope.INLINE_BLOT,c}(T.default);s.default=v},function(O,s,d){var k=document.createElement("div");if(k.classList.toggle("test-class",!1),k.classList.contains("test-class")){var T=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(b,v){return arguments.length>1&&!this.contains(b)==!v?v:T.call(this,b)}}String.prototype.startsWith||(String.prototype.startsWith=function(b,v){return v=v||0,this.substr(v,b.length)===b}),String.prototype.endsWith||(String.prototype.endsWith=function(b,v){var y=this.toString();(typeof v!="number"||!isFinite(v)||Math.floor(v)!==v||v>y.length)&&(v=y.length),v-=b.length;var c=y.indexOf(b,v);return c!==-1&&c===v}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(v){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof v!="function")throw new TypeError("predicate must be a function");for(var y=Object(this),c=y.length>>>0,o=arguments[1],t,e=0;eh.length?n:h,A=n.length>h.length?h:n,P=E.indexOf(A);if(P!=-1)return x=[[k,E.substring(0,P)],[T,A],[k,E.substring(P+A.length)]],n.length>h.length&&(x[0][0]=x[2][0]=d),x;if(A.length==1)return[[d,n],[k,h]];var _=e(n,h);if(_){var g=_[0],m=_[1],S=_[2],L=_[3],I=_[4],F=b(g,S),$=b(m,L);return F.concat([[T,I]],$)}return y(n,h)}function y(n,h){for(var x=n.length,E=h.length,A=Math.ceil((x+E)/2),P=A,_=2*A,g=new Array(_),m=new Array(_),S=0;S<_;S++)g[S]=-1,m[S]=-1;g[P+1]=0,m[P+1]=0;for(var L=x-E,I=L%2!=0,F=0,$=0,W=0,C=0,D=0;Dx)$+=2;else if(U>E)F+=2;else if(I){var B=P+L-w;if(B>=0&&B<_&&m[B]!=-1){var q=x-m[B];if(j>=q)return c(n,h,j,U)}}}for(var M=-D+W;M<=D-C;M+=2){var B=P+M,q;M==-D||M!=D&&m[B-1]x)C+=2;else if(H>E)W+=2;else if(!I){var R=P+L-M;if(R>=0&&R<_&&g[R]!=-1){var j=g[R],U=P+j-R;if(q=x-q,j>=q)return c(n,h,j,U)}}}}return[[d,n],[k,h]]}function c(n,h,x,E){var A=n.substring(0,x),P=h.substring(0,E),_=n.substring(x),g=h.substring(E),m=b(A,P),S=b(_,g);return m.concat(S)}function o(n,h){if(!n||!h||n.charAt(0)!=h.charAt(0))return 0;for(var x=0,E=Math.min(n.length,h.length),A=E,P=0;xh.length?n:h,E=n.length>h.length?h:n;if(x.length<4||E.length*2=$.length?[j,U,B,q,R]:null}var P=A(x,E,Math.ceil(x.length/4)),_=A(x,E,Math.ceil(x.length/2)),g;if(!P&&!_)return null;_?P?g=P[4].length>_[4].length?P:_:g=_:g=P;var m,S,L,I;n.length>h.length?(m=g[0],S=g[1],L=g[2],I=g[3]):(L=g[0],I=g[1],m=g[2],S=g[3]);var F=g[4];return[m,S,L,I,F]}function u(n){n.push([T,""]);for(var h=0,x=0,E=0,A="",P="",_;h1?(x!==0&&E!==0&&(_=o(P,A),_!==0&&(h-x-E>0&&n[h-x-E-1][0]==T?n[h-x-E-1][1]+=P.substring(0,_):(n.splice(0,0,[T,P.substring(0,_)]),h++),P=P.substring(_),A=A.substring(_)),_=t(P,A),_!==0&&(n[h][1]=P.substring(P.length-_)+n[h][1],P=P.substring(0,P.length-_),A=A.substring(0,A.length-_))),x===0?n.splice(h-E,x+E,[k,P]):E===0?n.splice(h-x,x+E,[d,A]):n.splice(h-x-E,x+E,[d,A],[k,P]),h=h-x-E+(x?1:0)+(E?1:0)+1):h!==0&&n[h-1][0]==T?(n[h-1][1]+=n[h][1],n.splice(h,1)):h++,E=0,x=0,A="",P="";break}n[n.length-1][1]===""&&n.pop();var g=!1;for(h=1;h0&&E.splice(A+2,0,[_[0],g]),f(E,A,3)}else return n}function i(n){for(var h=!1,x=function(_){return _.charCodeAt(0)>=56320&&_.charCodeAt(0)<=57343},E=function(_){return _.charCodeAt(_.length-1)>=55296&&_.charCodeAt(_.length-1)<=56319},A=2;A0&&P.push(n[A]);return P}function f(n,h,x){for(var E=h+x-1;E>=0&&E>=h-1;E--)if(E+1\r?\n +\<"),this.convert();var Z=this.quill.getFormat(this.quill.selection.savedRange.index);if(Z[E.default.blotName]){var et=this.container.innerText;return this.container.innerHTML="",new o.default().insert(et,S({},E.default.blotName,Z[E.default.blotName]))}var nt=this.prepareMatching(),rt=T(nt,2),dt=rt[0],pt=rt[1],ut=M(this.container,dt,pt);return B(ut,` +`)&&ut.ops[ut.ops.length-1].attributes==null&&(ut=ut.compose(new o.default().retain(ut.length()-1).delete(1))),$.log("convert",this.container.innerHTML,ut),this.container.innerHTML="",ut}},{key:"dangerouslyPasteHTML",value:function(Q,Z){var et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:a.default.sources.API;if(typeof Q=="string")this.quill.setContents(this.convert(Q),Z),this.quill.setSelection(0,a.default.sources.SILENT);else{var nt=this.convert(Z);this.quill.updateContents(new o.default().retain(Q).concat(nt),et),this.quill.setSelection(Q+nt.length(),a.default.sources.SILENT)}}},{key:"onPaste",value:function(Q){var Z=this;if(!(Q.defaultPrevented||!this.quill.isEnabled())){var et=this.quill.getSelection(),nt=new o.default().retain(et.index),rt=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(a.default.sources.SILENT),setTimeout(function(){nt=nt.concat(Z.convert()).delete(et.length),Z.quill.updateContents(nt,a.default.sources.USER),Z.quill.setSelection(nt.length()-et.length,a.default.sources.SILENT),Z.quill.scrollingContainer.scrollTop=rt,Z.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Q=this,Z=[],et=[];return this.matchers.forEach(function(nt){var rt=T(nt,2),dt=rt[0],pt=rt[1];switch(dt){case Node.TEXT_NODE:et.push(pt);break;case Node.ELEMENT_NODE:Z.push(pt);break;default:[].forEach.call(Q.container.querySelectorAll(dt),function(ut){ut[W]=ut[W]||[],ut[W].push(pt)});break}}),[Z,et]}}]),G}(f.default);R.DEFAULTS={matchers:[],matchVisual:!0};function j(K,G,Y){return(typeof G>"u"?"undefined":k(G))==="object"?Object.keys(G).reduce(function(Q,Z){return j(Q,Z,G[Z])},K):K.reduce(function(Q,Z){return Z.attributes&&Z.attributes[G]?Q.push(Z):Q.insert(Z.insert,(0,y.default)({},S({},G,Y),Z.attributes))},new o.default)}function U(K){if(K.nodeType!==Node.ELEMENT_NODE)return{};var G="__ql-computed-style";return K[G]||(K[G]=window.getComputedStyle(K))}function B(K,G){for(var Y="",Q=K.ops.length-1;Q>=0&&Y.length-1}function M(K,G,Y){return K.nodeType===K.TEXT_NODE?Y.reduce(function(Q,Z){return Z(K,Q)},new o.default):K.nodeType===K.ELEMENT_NODE?[].reduce.call(K.childNodes||[],function(Q,Z){var et=M(Z,G,Y);return Z.nodeType===K.ELEMENT_NODE&&(et=G.reduce(function(nt,rt){return rt(Z,nt)},et),et=(Z[W]||[]).reduce(function(nt,rt){return rt(Z,nt)},et)),Q.concat(et)},new o.default):new o.default}function H(K,G,Y){return j(Y,K,!0)}function z(K,G){var Y=e.default.Attributor.Attribute.keys(K),Q=e.default.Attributor.Class.keys(K),Z=e.default.Attributor.Style.keys(K),et={};return Y.concat(Q).concat(Z).forEach(function(nt){var rt=e.default.query(nt,e.default.Scope.ATTRIBUTE);rt!=null&&(et[rt.attrName]=rt.value(K),et[rt.attrName])||(rt=D[nt],rt!=null&&(rt.attrName===nt||rt.keyName===nt)&&(et[rt.attrName]=rt.value(K)||void 0),rt=w[nt],rt!=null&&(rt.attrName===nt||rt.keyName===nt)&&(rt=w[nt],et[rt.attrName]=rt.value(K)||void 0))}),Object.keys(et).length>0&&(G=j(G,et)),G}function V(K,G){var Y=e.default.query(K);if(Y==null)return G;if(Y.prototype instanceof e.default.Embed){var Q={},Z=Y.value(K);Z!=null&&(Q[Y.blotName]=Z,G=new o.default().insert(Q,Y.formats(K)))}else typeof Y.formats=="function"&&(G=j(G,Y.blotName,Y.formats(K)));return G}function X(K,G){return B(G,` +`)||G.insert(` +`),G}function J(){return new o.default}function tt(K,G){var Y=e.default.query(K);if(Y==null||Y.blotName!=="list-item"||!B(G,` +`))return G;for(var Q=-1,Z=K.parentNode;!Z.classList.contains("ql-clipboard");)(e.default.query(Z)||{}).blotName==="list"&&(Q+=1),Z=Z.parentNode;return Q<=0?G:G.compose(new o.default().retain(G.length()-1).retain(1,{indent:Q}))}function it(K,G){return B(G,` +`)||(q(K)||G.length()>0&&K.nextSibling&&q(K.nextSibling))&&G.insert(` +`),G}function ot(K,G){if(q(K)&&K.nextElementSibling!=null&&!B(G,` + +`)){var Y=K.offsetHeight+parseFloat(U(K).marginTop)+parseFloat(U(K).marginBottom);K.nextElementSibling.offsetTop>K.offsetTop+Y*1.5&&G.insert(` +`)}return G}function ct(K,G){var Y={},Q=K.style||{};return Q.fontStyle&&U(K).fontStyle==="italic"&&(Y.italic=!0),Q.fontWeight&&(U(K).fontWeight.startsWith("bold")||parseInt(U(K).fontWeight)>=700)&&(Y.bold=!0),Object.keys(Y).length>0&&(G=j(G,Y)),parseFloat(Q.textIndent||0)>0&&(G=new o.default().insert(" ").concat(G)),G}function ft(K,G){var Y=K.data;if(K.parentNode.tagName==="O:P")return G.insert(Y.trim());if(Y.trim().length===0&&K.parentNode.classList.contains("ql-clipboard"))return G;if(!U(K.parentNode).whiteSpace.startsWith("pre")){var Q=function(et,nt){return nt=nt.replace(/[^\u00a0]/g,""),nt.length<1&&et?" ":nt};Y=Y.replace(/\r\n/g," ").replace(/\n/g," "),Y=Y.replace(/\s\s+/g,Q.bind(Q,!0)),(K.previousSibling==null&&q(K.parentNode)||K.previousSibling!=null&&q(K.previousSibling))&&(Y=Y.replace(/^\s+/,Q.bind(Q,!1))),(K.nextSibling==null&&q(K.parentNode)||K.nextSibling!=null&&q(K.nextSibling))&&(Y=Y.replace(/\s+$/,Q.bind(Q,!1)))}return G.insert(Y)}s.default=R,s.matchAttributor=z,s.matchBlot=V,s.matchNewline=it,s.matchSpacing=ot,s.matchText=ft},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=function(){function u(a,l){for(var r=0;r '},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=function(){function u(a,l){for(var r=0;re.right&&(a=e.right-u.right,this.root.style.left=o+a+"px"),u.lefte.bottom){var l=u.bottom-u.top,r=c.bottom-c.top+l;this.root.style.top=t-r+"px",this.root.classList.add("ql-flip")}return a}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),v}();s.default=b},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=function(){function _(g,m){var S=[],L=!0,I=!1,F=void 0;try{for(var $=g[Symbol.iterator](),W;!(L=(W=$.next()).done)&&(S.push(W.value),!(m&&S.length===m));L=!0);}catch(C){I=!0,F=C}finally{try{!L&&$.return&&$.return()}finally{if(I)throw F}}return S}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return _(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),T=function _(g,m,S){g===null&&(g=Function.prototype);var L=Object.getOwnPropertyDescriptor(g,m);if(L===void 0){var I=Object.getPrototypeOf(g);return I===null?void 0:_(I,m,S)}else{if("value"in L)return L.value;var F=L.get;return F===void 0?void 0:F.call(S)}},b=function(){function _(g,m){for(var S=0;S','','',''].join(""),s.default=A},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=d(29),T=Z(k),b=d(36),v=d(38),y=d(64),c=d(65),o=Z(c),t=d(66),e=Z(t),u=d(67),a=Z(u),l=d(37),r=d(26),i=d(39),f=d(40),n=d(56),h=Z(n),x=d(68),E=Z(x),A=d(27),P=Z(A),_=d(69),g=Z(_),m=d(70),S=Z(m),L=d(71),I=Z(L),F=d(72),$=Z(F),W=d(73),C=Z(W),D=d(13),w=Z(D),R=d(74),j=Z(R),U=d(75),B=Z(U),q=d(57),M=Z(q),H=d(41),z=Z(H),V=d(28),X=Z(V),J=d(59),tt=Z(J),it=d(60),ot=Z(it),ct=d(61),ft=Z(ct),K=d(108),G=Z(K),Y=d(62),Q=Z(Y);function Z(et){return et&&et.__esModule?et:{default:et}}T.default.register({"attributors/attribute/direction":v.DirectionAttribute,"attributors/class/align":b.AlignClass,"attributors/class/background":l.BackgroundClass,"attributors/class/color":r.ColorClass,"attributors/class/direction":v.DirectionClass,"attributors/class/font":i.FontClass,"attributors/class/size":f.SizeClass,"attributors/style/align":b.AlignStyle,"attributors/style/background":l.BackgroundStyle,"attributors/style/color":r.ColorStyle,"attributors/style/direction":v.DirectionStyle,"attributors/style/font":i.FontStyle,"attributors/style/size":f.SizeStyle},!0),T.default.register({"formats/align":b.AlignClass,"formats/direction":v.DirectionClass,"formats/indent":y.IndentClass,"formats/background":l.BackgroundStyle,"formats/color":r.ColorStyle,"formats/font":i.FontClass,"formats/size":f.SizeClass,"formats/blockquote":o.default,"formats/code-block":w.default,"formats/header":e.default,"formats/list":a.default,"formats/bold":h.default,"formats/code":D.Code,"formats/italic":E.default,"formats/link":P.default,"formats/script":g.default,"formats/strike":S.default,"formats/underline":I.default,"formats/image":$.default,"formats/video":C.default,"formats/list/item":u.ListItem,"modules/formula":j.default,"modules/syntax":B.default,"modules/toolbar":M.default,"themes/bubble":G.default,"themes/snow":Q.default,"ui/icons":z.default,"ui/picker":X.default,"ui/icon-picker":ot.default,"ui/color-picker":tt.default,"ui/tooltip":ft.default},!0),s.default=T.default},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0}),s.IndentClass=void 0;var k=function(){function a(l,r){for(var i=0;i0&&this.children.tail.format(E,A)}},{key:"formats",value:function(){return u({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(E,A){if(E instanceof i)T(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"insertBefore",this).call(this,E,A);else{var P=A==null?this.length():A.offset(this),_=this.split(P);_.parent.insertBefore(E,_)}}},{key:"optimize",value:function(E){T(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"optimize",this).call(this,E);var A=this.next;A!=null&&A.prev===this&&A.statics.blotName===this.statics.blotName&&A.domNode.tagName===this.domNode.tagName&&A.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(A.moveChildren(this),A.remove())}},{key:"replace",value:function(E){if(E.statics.blotName!==this.statics.blotName){var A=v.default.create(this.statics.defaultChild);E.moveChildren(A),this.appendChild(A)}T(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"replace",this).call(this,E)}}]),h}(t.default);f.blotName="list",f.scope=v.default.Scope.BLOCK_BLOT,f.tagName=["OL","UL"],f.defaultChild="list-item",f.allowedChildren=[i],s.ListItem=i,s.default=f},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=d(56),T=b(k);function b(t){return t&&t.__esModule?t:{default:t}}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function c(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=function(t){c(e,t);function e(){return v(this,e),y(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return e}(T.default);o.blotName="italic",o.tagName=["EM","I"],s.default=o},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=function(){function u(a,l){for(var r=0;r-1?n?this.domNode.setAttribute(f,n):this.domNode.removeAttribute(f):T(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"format",this).call(this,f,n)}}],[{key:"create",value:function(f){var n=T(r.__proto__||Object.getPrototypeOf(r),"create",this).call(this,f);return typeof f=="string"&&n.setAttribute("src",this.sanitize(f)),n}},{key:"formats",value:function(f){return u.reduce(function(n,h){return f.hasAttribute(h)&&(n[h]=f.getAttribute(h)),n},{})}},{key:"match",value:function(f){return/\.(jpe?g|gif|png)$/.test(f)||/^data:image\/.+;base64/.test(f)}},{key:"sanitize",value:function(f){return(0,y.sanitize)(f,["http","https","data"])?f:"//:0"}},{key:"value",value:function(f){return f.getAttribute("src")}}]),r}(v.default.Embed);a.blotName="image",a.tagName="IMG",s.default=a},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0});var k=function(){function l(r,i){for(var f=0;f-1?n?this.domNode.setAttribute(f,n):this.domNode.removeAttribute(f):T(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"format",this).call(this,f,n)}}],[{key:"create",value:function(f){var n=T(r.__proto__||Object.getPrototypeOf(r),"create",this).call(this,f);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(f)),n}},{key:"formats",value:function(f){return u.reduce(function(n,h){return f.hasAttribute(h)&&(n[h]=f.getAttribute(h)),n},{})}},{key:"sanitize",value:function(f){return y.default.sanitize(f)}},{key:"value",value:function(f){return f.getAttribute("src")}}]),r}(b.BlockEmbed);a.blotName="video",a.className="ql-video",a.tagName="IFRAME",s.default=a},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0}),s.default=s.FormulaBlot=void 0;var k=function(){function f(n,h){for(var x=0;x0||this.cachedText==null)&&(this.domNode.innerHTML=P(_),this.domNode.normalize(),this.attach()),this.cachedText=_)}}]),E}(u.default);f.className="ql-syntax";var n=new v.default.Attributor.Class("token","hljs",{scope:v.default.Scope.INLINE}),h=function(x){i(E,x),k(E,null,[{key:"register",value:function(){c.default.register(n,!0),c.default.register(f,!0)}}]);function E(A,P){l(this,E);var _=r(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,A,P));if(typeof _.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var g=null;return _.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(g),g=setTimeout(function(){_.highlight(),g=null},_.options.interval)}),_.highlight(),_}return k(E,[{key:"highlight",value:function(){var P=this;if(!this.quill.selection.composing){this.quill.update(c.default.sources.USER);var _=this.quill.getSelection();this.quill.scroll.descendants(f).forEach(function(g){g.highlight(P.options.highlight)}),this.quill.update(c.default.sources.SILENT),_!=null&&this.quill.setSelection(_,c.default.sources.SILENT)}}}]),E}(t.default);h.DEFAULTS={highlight:function(){return window.hljs==null?null:function(x){var E=window.hljs.highlightAuto(x);return E.value}}(),interval:1e3},s.CodeBlock=f,s.CodeToken=n,s.default=h},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s){O.exports=' '},function(O,s,d){Object.defineProperty(s,"__esModule",{value:!0}),s.default=s.BubbleTooltip=void 0;var k=function E(A,P,_){A===null&&(A=Function.prototype);var g=Object.getOwnPropertyDescriptor(A,P);if(g===void 0){var m=Object.getPrototypeOf(A);return m===null?void 0:E(m,P,_)}else{if("value"in g)return g.value;var S=g.get;return S===void 0?void 0:S.call(_)}},T=function(){function E(A,P){for(var _=0;_0&&I===c.default.sources.USER){g.show(),g.root.style.left="0px",g.root.style.width="",g.root.style.width=g.root.offsetWidth+"px";var F=g.quill.getLines(S.index,S.length);if(F.length===1)g.position(g.quill.getBounds(S));else{var $=F[F.length-1],W=g.quill.getIndex($),C=Math.min($.length()-1,S.index+S.length-W),D=g.quill.getBounds(new e.Range(W,C));g.position(D)}}else document.activeElement!==g.textbox&&g.quill.hasFocus()&&g.hide()}),g}return T(A,[{key:"listen",value:function(){var _=this;k(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){_.root.classList.remove("ql-editing")}),this.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!_.root.classList.contains("ql-hidden")){var g=_.quill.getSelection();g!=null&&_.position(_.quill.getBounds(g))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(_){var g=k(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"position",this).call(this,_),m=this.root.querySelector(".ql-tooltip-arrow");if(m.style.marginLeft="",g===0)return g;m.style.marginLeft=-1*g-m.offsetWidth/2+"px"}}]),A}(o.BaseTooltip);x.TEMPLATE=['','
','','',"
"].join(""),s.BubbleTooltip=x,s.default=h},function(O,s,d){O.exports=d(63)}]).default})})(He);var Vu=He.exports,Wu=ht&&ht.__extends||function(){var p=function(N,O){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,d){s.__proto__=d}||function(s,d){for(var k in d)d.hasOwnProperty(k)&&(s[k]=d[k])},p(N,O)};return function(N,O){p(N,O);function s(){this.constructor=N}N.prototype=O===null?Object.create(O):(s.prototype=O.prototype,new s)}}(),qt=ht&&ht.__assign||function(){return qt=Object.assign||function(p){for(var N,O=1,s=arguments.length;O1)throw new Error("The Quill editing area can only be composed of a single React element.");if(vt.default.Children.count(O.children)){var d=vt.default.Children.only(O.children);if(((s=d)===null||s===void 0?void 0:s.type)==="textarea")throw new Error("Quill does not support editing on a