polotno 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/canvas/image-element.js +1 -1
- package/canvas/video-element.js +1 -1
- package/package.json +1 -1
- package/polotno.bundle.js +2 -2
package/polotno.bundle.js
CHANGED
|
@@ -39,7 +39,7 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
|
39
39
|
color: ${o.color};
|
|
40
40
|
opacity: 0.6;
|
|
41
41
|
}
|
|
42
|
-
`;iM.innerHTML="",iM.appendChild(document.createTextNode(n)),JSON.stringify(e)!==JSON.stringify(o)&&a(e)});let u=s(y).useRef(null);s(y).useEffect(()=>{let e=setTimeout(()=>{let e=u.current;if(!e)return;u.current?.focus();let t=i||e.value.length;e.selectionStart=e.selectionEnd=t,r&&(e?.select(),document.execCommand("selectAll",!1,null))});return()=>{clearTimeout(e)}},[]);let c=0,d=l.textArr.length*l.lineHeight()*l.fontSize();"middle"===t.verticalAlign&&(c=(t.a.height-d)/2),"bottom"===t.verticalAlign&&(c=t.a.height-d);let h=iS(t.text);return(0,g.jsx)(r4,{children:(0,g.jsx)("textarea",{className:"polotno-input",ref:u,dir:iF(h),style:{...iD,...o,paddingTop:c+"px"},value:h,onChange:e=>{t.set({text:e.target.value})},placeholder:t.placeholder,onBlur:n})})}),iB=e=>{let[t,n]=s(y).useState(!1),r=s(y).useRef(!1);return s(y).useEffect(()=>{var t=!0;return setTimeout(()=>{t&&(e._editModeEnabled&&(r.current=!0),n(!0),setTimeout(()=>{r.current=!1},50))},50),()=>{t=!1}},[]),{editorEnabled:t&&e._editModeEnabled,selectAll:r.current}},iU=(e,t)=>{let[n,r]=s(y).useReducer(e=>e+1,0),i=s(y).useRef(ib(t));return s(y).useLayoutEffect(()=>{if(i.current=ib(t),i.current)return;let n=!0;return(async()=>{i.current=!1,r();let o=il(`text ${t}`);await e.loadFont(t),s(N).Util.requestAnimFrame(o),n&&(i.current=!0,r())})(),()=>{n=!1}},[t]),[i.current]},iH=({fontLoaded:e,fontFamily:t,fontSize:n,lineHeight:r})=>s(y).useMemo(()=>{if("number"==typeof r)return r;let e=document.createElement("div");e.style.fontFamily=t,e.style.fontSize=n+"px",e.style.lineHeight=r,e.innerText="Test text",document.body.appendChild(e);let i=e.offsetHeight;return document.body.removeChild(e),i/n},[e,t,n,r]);function iV(e){let t=s(y).useRef(e),n=s(y).useRef(e);return s(y).useMemo(()=>{n.current=t.current,t.current=e},[e]),n.current}let iq=e=>s(y).useMemo(()=>{if(!ik(e.fill))return{fill:e.fill};let{stops:t,rotation:n}=iT(e.fill),r={x:e.a.width/2,y:e.a.height/2},i=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)),o=s(N).Util.degToRad(n)-Math.PI/2,a=[];return t.forEach(({offset:e,color:t})=>{a.push(e,t)}),{fillLinearGradientStartPointX:r.x-i*Math.cos(o),fillLinearGradientStartPointY:r.y-i*Math.sin(o),fillLinearGradientColorStops:a,fillLinearGradientEndPointX:r.x+i*Math.cos(o),fillLinearGradientEndPointY:r.y+i*Math.sin(o),fill:t[1].color,fillPriority:"linear-gradient"}},[e.fill]),iG=T(({element:e,store:t})=>{let n=s(y).useRef(null),r=s(y).useRef(null),{editorEnabled:i,selectAll:o}=iB(e),[a,l]=s(y).useState(!1),[u,c]=s(y).useState(!1),d=s(y).useRef(e.a.height),h=t.selectedElements.indexOf(e)>=0,{textVerticalResizeEnabled:f}=iE,p=iV(e.fontFamily),[m,v]=s(y).useState([]);s(y).useEffect(()=>{let e=n.current?.textArr??[];JSON.stringify(e)!==JSON.stringify(m)&&v(e)}),s(y).useEffect(()=>{if(e.a.width)return;let t=n.current;t.width(600),e.set({width:1.4*t.getTextWidth()})},[]),s(y).useLayoutEffect(()=>(0,b.autorun)(()=>{iA(n.current,e)}));let[w]=iU(t,e.fontFamily),x=iS(e.text),_=()=>{let e=n.current.clone({height:void 0}),t=Math.ceil(e.fontSize()*e.lineHeight()*e.textArr.length+1);return e.destroy(),t};s(y).useLayoutEffect(()=>{if(!w)return;let{textOverflow:r}=iE;if(!e.a.height){let n=_();t.history.ignore(()=>{e.set({height:n})},!1,!0);return}if("change-font-size"!==r||u||t.isPlaying){if("resize"===r){let r=_();f&&e.a.height<r&&t.history.ignore(()=>{e.set({height:r}),n.current.height(r)},!1,!0),f||e.a.height===r||t.history.ignore(()=>{e.set({height:r}),n.current.height(r)},!1,!0)}}else{let r=function(e,t){let n=e.fontSize(),r=e.height(),i=iS(t.text),o=t.a.fontSize;e.height(void 0);let a=Math.round(2*t.a.fontSize)-1;for(let n=1;n<a;n++){let n=t.a.height&&e.height()>t.a.height,r=i.split("\n").join(" ").split(/[\s-]+/),a=e.textArr.map(e=>e.text).join(";"),l=r.find(e=>!a.includes(e)||(a=a.replace(e,""),!1));if(!(n||l))break;o-=.5,e.fontSize(o)}return e.fontSize(n),e.height(r),o}(n.current,e);if(r!==e.a.fontSize){t.history.ignore(()=>{e.set({fontSize:r})},!1,!0);return}let i=_();e.a.height===i||f||t.history.ignore(()=>{e.set({height:i})},!1,!0)}}),s(y).useLayoutEffect(()=>{let t=n.current;t&&(t.width(t.width()+1e-8),t._setTextData(),iA(t,e))},[w]);let E=s(y).useRef(null),S=s(y).useRef(0),O=n=>{n.evt.preventDefault(),t.selectedShapes.find(t=>t===e)&&e.contentEditable&&(S.current=function(e){var t,n;let r=e.target,i=((t=r.getAbsoluteTransform().copy()).invert(),n=r.getStage().getPointerPosition(),t.point(n)),o=r.textArr,a=Math.floor(i.y/(r.fontSize()*r.lineHeight())),l=o.slice(0,a).reduce((e,t)=>e+t.text.length,a),s=o[a]??o[0],u=0;return"right"===r.align()?u=r.width()-s.width:"center"===r.align()&&(u=r.width()/2-s.width/2),l+Math.round((i.x-u)/s.width*s.text.length)}(n),e.toggleEditMode())},C=!x&&e.placeholder?.6:e.a.opacity;ii(n,C);let k=iH({fontLoaded:w,fontFamily:e.fontFamily,fontSize:e.a.fontSize,lineHeight:e.lineHeight}),P=e.selectable||"admin"===t.role,T=iq(e),A=s(y).useMemo(()=>e.backgroundEnabled?function({lines:e,lineHeight:t,width:n,align:r="left",padding:i=0,cornerRadius:o=0}){let a,l;e.forEach((e,t)=>{e.cx=n/2,"right"===r?e.cx=n-e.width/2:"left"===r&&(e.cx=e.width/2),"justify"!==r||e.lastInParagraph||(e.width=n),"justify"===r&&(e.cx=e.width/2)});let s=`M ${e[0]?.cx} ${-i}`;e.forEach((n,r)=>{let{cx:o}=n,a=e[r-1];a&&a.width>n.width?s+=` L ${o+n.width/2+i} ${r*t+i}`:s+=` L ${o+n.width/2+i} ${r*t-i}`;let l=e[r+1];l&&l.width>n.width?s+=` L ${o+n.width/2+i} ${(r+1)*t-i}`:s+=` L ${o+n.width/2+i} ${(r+1)*t+i}`});for(var u,c,d=e.length-1;d>=0;d--){let n=e[d],{cx:r}=n,o=e[d+1];o&&o.width>n.width?s+=` L ${r-n.width/2-i} ${(d+1)*t-i}`:s+=` L ${r-n.width/2-i} ${(d+1)*t+i}`;let a=e[d-1];a&&a.width>n.width?s+=` L ${r-n.width/2-i} ${d*t+i}`:s+=` L ${r-n.width/2-i} ${d*t-i}`}return(u=function(e){let t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g)].map(e=>({marker:e[0],index:e.index})).reduceRight((t,n)=>{let r=e.substring(n.index,t.length?t[t.length-1].index:e.length);return t.concat([{marker:n.marker,index:n.index,chunk:r.length>0?r.substr(1,r.length-1):r}])},[]).reverse().flatMap(e=>{let n=e.chunk.match(t),r=n?n.map(parseFloat):[];return function(e,t){let n=[];switch(e.toUpperCase()){case"M":for(let r=0;r<t.length;r+=2){let i;i=e===e.toUpperCase()?0===r?"M":"L":0===r?"m":"l",n.push({marker:i,values:{x:t[r],y:t[r+1]}})}break;case"L":for(let r=0;r<t.length;r+=2)n.push({marker:e,values:{x:t[r],y:t[r+1]}});break;case"H":for(let r=0;r<t.length;r++)n.push({marker:e,values:{x:t[r],y:0}});break;case"V":for(let r=0;r<t.length;r++)n.push({marker:e,values:{x:0,y:t[r]}});break;case"C":for(let r=0;r<t.length;r+=6)n.push({marker:e,values:{x1:t[r],y1:t[r+1],x2:t[r+2],y2:t[r+3],x:t[r+4],y:t[r+5]}});break;case"S":for(let r=0;r<t.length;r+=4)n.push({marker:e,values:{x2:t[r],y2:t[r+1],x:t[r+2],y:t[r+3]}});break;case"Q":for(let r=0;r<t.length;r+=4)n.push({marker:e,values:{x1:t[r],y1:t[r+1],x:t[r+2],y:t[r+3]}});break;case"T":for(let r=0;r<t.length;r+=2)n.push({marker:e,values:{x:t[r],y:t[r+1]}});break;case"A":for(let r=0;r<t.length;r+=7)n.push({marker:e,values:{radiusX:t[r],radiusY:t[r+1],rotation:t[r+2],largeArc:t[r+3],sweep:t[r+4],x:t[r+5],y:t[r+6]}});break;case"Z":n.push({marker:e,values:{x:0,y:0}})}return n}(e.marker,r)}).map(r8)}(s+=" Z"),a=[],l=[],c&&u.forEach(e=>(Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(c))),e)),u.forEach(e=>{"M"===e.marker&&a.push([]),a[a.length-1].push(e)}),a.forEach(e=>{e.map(r9),function e(t,n){let r=["x","y"].every(e=>0===Math.round(Math.abs(t[n].values[e]-t[0].values[e])));"L"===t[n].marker&&r&&(t[n].overlap=!0,e(t,n-1)),"Z"===t[n].marker&&e(t,n-1)}(e,e.length-1);let t="Z"==e[e.length-1].marker;e.filter(e=>!e.overlap).map((e,n,r)=>{let i,a,s;let u=function e(t,n,r){var i;let o=n-1,a=r[(o%(i=r.length)+i)%i];return"Z"!==a.marker?a:e(t,o,r)}(e,n,r),c=function e(t,n,r){var i;let o=n+1,a=r[(o%(i=r.length)+i)%i];return"Z"===a.marker?e(t,o,r):a}(e,n,r),d=r7(e.values,u.values),h=r7(e.values,c.values),f=h-d,p=180/Math.PI*f,g=Math.min(o,Math.abs(function(e,t,n){let r=ie(e.values,n.values);return Math.min(ie(t.values,e.values),r)}(e,u,c)/2*Math.tan(f/2))),m=(a=0,(s=180/Math.PI*f)<0&&s>=-180||s>180&&s<360?i=it(f/2,-g):(i=it(f/2,g),a=1,i===1/0&&(i=g)),{offset:i,sweepFlag:a}),v=m.offset,y=m.sweepFlag,b=(0==n||n==r.length-1)&&!t;switch(e.marker){case"M":case"L":let w=[e.values.x+Math.sin(d)*v,e.values.y+Math.cos(d)*v],x=[e.values.x+Math.sin(h)*v,e.values.y+Math.cos(h)*v];b?l.push({marker:e.marker,values:e.values}):l.push({marker:e.marker,values:{x:parseFloat(w[0].toFixed(3)),y:parseFloat(w[1].toFixed(3))}}),b||"L"!==c.marker&&"M"!==c.marker||l.push({marker:"A",radius:g,values:{radiusX:g,radiusY:g,rotation:p,largeArc:0,sweep:y,x:parseFloat(x[0].toFixed(3)),y:parseFloat(x[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":l.push({marker:e.marker,values:e.values})}})}),{path:function(e){let t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(e=>{let n="";if("Z"!==e.marker){let r=Object.keys(e.values);n=t.filter(e=>-1!==r.indexOf(e)).map(t=>e.values[t]).join()}return`${e.marker}${n}`}).join("").trim()}(l),commands:l}).path}({lines:JSON.parse(JSON.stringify(m)),cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*k*.5),lineHeight:k*e.a.fontSize,padding:e.backgroundPadding*(e.a.fontSize*k*.5),width:e.a.width,align:e.align}):"",[e.backgroundEnabled,e.backgroundCornerRadius,e.a.fontSize,k,e.backgroundPadding,e.a.width,e.align,m]),N=iL(),j=0;return"middle"===e.verticalAlign?j=(e.a.height-m.length*k*e.a.fontSize)/2:"bottom"===e.verticalAlign&&(j=e.a.height-m.length*k*e.a.fontSize),(0,g.jsxs)(s(y).Fragment,{children:[(0,g.jsx)(rZ,{ref:r,x:e.a.x,y:e.a.y,rotation:e.a.rotation,hideInExport:!e.showInExport||!x,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity,data:A,fill:e.backgroundColor,offsetY:-j}),(0,g.jsx)(rQ,{ref:n,id:e.id,name:"element",hideInExport:!e.showInExport||!x,editModeEnabled:e._editModeEnabled,x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,text:x||e.placeholder,...T,stroke:e.stroke,lineJoin:"round",strokeWidth:e.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:e.a.fontSize,fontFamily:`"${e.fontFamily}", "${p}"`,fontStyle:e.fontStyle+" "+e.fontWeight,textDecoration:e.textDecoration,align:e.align,verticalAlign:e.verticalAlign,draggable:N?e.draggable&&h:e.draggable,preventDefault:!N||h,opacity:C,visible:!e._editModeEnabled,ellipsis:"ellipsis"===iE.textOverflow,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,lineHeight:k,letterSpacing:e.letterSpacing*e.a.fontSize,listening:P,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},onClick:O,onTap:O,onTransformStart:()=>{c(!0),d.current=n.current.height()},onTransform:t=>{let n=t.target;r.current?.setAttrs({x:n.x(),y:n.y(),rotation:n.rotation(),scale:n.scale()});let i=n.getStage()?.findOne("Transformer").getActiveAnchor();if("middle-left"===i||"middle-right"===i){let t=n.scaleX(),r=n.width()*t,i=e.a.fontSize,o=r;r<i&&(o=i,E.current&&n.position(E.current)),n.width(o),n.scaleX(1),n.scaleY(1);let a=_();if("ellipsis"!==iE.textOverflow){let t=Math.max(a,d.current);n.height(t),e.set({height:n.height()})}e.set({x:n.x(),y:n.y(),width:n.width(),rotation:n.rotation()}),iA(n,e)}if("top-center"===i||"bottom-center"===i){let n="resize"===iE.textOverflow?_():k*e.a.fontSize;t.target.height(Math.max(n,t.target.height()*t.target.scaleY())),t.target.scaleY(1)}t.target.strokeWidth(e.strokeWidth/t.target.scaleX()),E.current=t.target.position()},onTransformEnd:t=>{let n=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),t.target.strokeWidth(e.strokeWidth),e.set({fontSize:Math.round(e.a.fontSize*n),width:Math.ceil(t.target.width()*n),x:t.target.x(),y:t.target.y(),rotation:t.target.rotation(),height:t.target.height()*n}),r.current?.setAttrs({scaleX:1,scaleY:1}),c(!1)}}),i&&(0,g.jsx)(rG,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,children:(0,g.jsx)(iz,{textNodeRef:n,element:e,selectAll:o,cursorPosition:S.current,onBlur:()=>{e.toggleEditMode(!1)}})}),!u&&(a||h)&&(0,g.jsx)(ij,{element:e})]})});var y=f("8NFma"),b=f("2SBKn"),y=f("8NFma");function iW(e){let t={fill:"",stroke:""};return e.getAttribute("fill")&&"none"!==e.getAttribute("fill")&&(t.fill=e.getAttribute("fill")),!t.fill&&e.style.fill&&"none"!==e.style.fill&&(t.fill=e.style.fill),e.getAttribute("stroke")&&(t.stroke=e.getAttribute("stroke")),!t.stroke&&e.style.stroke&&(t.stroke=e.style.stroke),t.stroke||t.fill||(t.fill="black"),t}let iK=["path","rect","circle"];function i$(e){for(var t=[],n=e.getElementsByTagName("*"),r=0,i=n.length;r<i;r++){let e=n[r];!function(e){for(;e.parentNode;){if("defs"===e.nodeName)return!0;e=e.parentNode}return!1}(e)&&(null!==e.getAttribute("fill")&&t.push(e),null!==e.getAttribute("stroke")?t.push(e):e.style&&e.style.fill?t.push(e):iK.indexOf(e.nodeName)>=0&&t.push(e))}return t}async function iY(e){let t=await fetch(e);return iQ(await t.text())}async function iX(e){let t=await fetch(e,{mode:"cors"});return await t.text()}function iQ(e){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(e)))}async function iZ(e){let t=await iX(e),n=new DOMParser().parseFromString(t,"image/svg+xml").documentElement.getAttribute("viewBox"),[r,i,o,a]=n?.split(" ")||[];return{width:parseFloat(o),height:parseFloat(a)}}function iJ(e){var t=new DOMParser().parseFromString(e,"image/svg+xml");let n=t.documentElement.getAttribute("viewBox"),[r,i,o,a]=n?.split(" ")||[],l=t.documentElement.getAttribute("width");l||t.documentElement.setAttribute("width",o+"px");let s=t.documentElement.getAttribute("height");if((!s||s.indexOf("%")>=0)&&t.documentElement.setAttribute("height",a+"px"),l&&l.indexOf("%")>=0&&s&&-1===s.indexOf("%")){let e=parseFloat(s)/parseFloat(a);t.documentElement.setAttribute("width",e*parseFloat(o)+"px")}if(s&&s.indexOf("%")>=0&&l&&-1===l.indexOf("%")){let e=parseFloat(l)/parseFloat(o);t.documentElement.setAttribute("height",e*parseFloat(a)+"px")}return new XMLSerializer().serializeToString(t)}let i0=(e,t)=>{if(!e||!t)return!1;let n=s(N).Util.colorToRGBA(e),r=s(N).Util.colorToRGBA(t);if(n&&r)return n.r===r.r&&n.g===r.g&&n.b===r.b&&n.a===r.a};function i1(e,t){var n=new DOMParser().parseFromString(e,"image/svg+xml");let r=i$(n),i=Array.from(t.keys());return r.forEach(e=>{let{fill:r,stroke:o}=iW(e);[{prop:"fill",color:r},{prop:"stroke",color:o}].forEach(({prop:r,color:o})=>{let a=i.find(e=>i0(e,o));if(a){let i=t.get(a);if(ik(i)){let{rotation:t,stops:o}=iT(i),a=o.map(e=>({offset:100*e.offset+"%","stop-color":e.color})),l="color"+Math.round(1e8*Math.random());(function(e,t,n,r){var i=e.namespaceURI,o=document.createElementNS(i,"linearGradient");let a=s(N).Util.degToRad(n+90),l=(Math.cos(a)+1)/2,u=(Math.sin(a)+1)/2,c=(Math.cos(a+Math.PI)+1)/2,d=(Math.sin(a+Math.PI)+1)/2;o.setAttribute("x1",100*l+"%"),o.setAttribute("y1",100*u+"%"),o.setAttribute("x2",100*c+"%"),o.setAttribute("y2",100*d+"%"),o.setAttribute("gradientUnits","userSpaceOnUse"),o.setAttribute("id",t);for(var h=0;h<r.length;h++){var f=r[h],p=document.createElementNS(i,"stop");for(var g in f)f.hasOwnProperty(g)&&p.setAttribute(g,f[g]);o.appendChild(p)}(e.querySelector("defs")||e.insertBefore(document.createElementNS(i,"defs"),e.firstChild)).appendChild(o)})(n.children[0],l,t,a),e.style[r]=null,e.setAttribute(r,`url('#${l}')`)}else e.style[r]=t.get(a)}})}),iQ(new XMLSerializer().serializeToString(n))}let i2=e=>{let[t,n]=s(y).useState([]);return s(y).useEffect(()=>{let t=!1;return(async()=>{n([]);let r=function(e){let t=i$(new DOMParser().parseFromString(e,"image/svg+xml")),n=[];return t.forEach(e=>{let{fill:t,stroke:r}=iW(e);[t,r].forEach(e=>{e&&s(N).Util.colorToRGBA(e)&&-1===n.indexOf(e)&&n.push(e)})}),n}(await iX(e));t||n(r)})(),()=>{t=!0}},[e]),t};function i5(){return document.createElement("canvas")}async function i3(e){return e.indexOf("data:image/svg+xml")>=0||e.indexOf(".svg")>=0?iQ(iJ(await iX(e))):e}let i4=e=>{let[t,n]=s(y).useState(e);return s(y).useEffect(()=>{(async()=>{let r=await i3(e);r!==t&&n(r)})()},[e]),t},i6=(e,t,n)=>{let r=s(y).useMemo(()=>{let{flipX:r,flipY:i}=e,o="svg"===e.type||e.src.indexOf("data:image/svg+xml")>=0||e.src.indexOf(".svg")>=0,a=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&o||e.maskSrc;if(!r&&!i&&!a)return t;if(!t||!t.width||!t.height)return null;let l=i5(),s=1;"svg"===e.type&&(s=Math.max(e.a.width/t.width*n,e.a.height/t.height*n)),l.width=Math.max(t.width*s,1),l.height=Math.max(t.height*s,1);let u=r?-l.width:0,c=i?-l.height:0;return l.getContext("2d")?.scale(r?-1:1,i?-1:1),l.getContext("2d")?.drawImage(t,u,c,l.width,l.height),l},[e.maskSrc,e.flipX,e.flipY,t,e.a.width,e.a.height,n]);return s(y).useEffect(()=>()=>{r&&"CANVAS"===r.nodeName&&s(N).Util.releaseCanvas(r)},[r]),r},i8=(e,t)=>{let[n,r]=or(e.maskSrc,"anonymous");return oi(e.maskSrc?r:"loaded",e.id+"-mask"),s(y).useMemo(()=>{if(!n||!t||!t.width||!t.height)return t;let r=i5();r.width=Math.max(t.width,1),r.height=Math.max(t.height,1);let i=r.getContext("2d");if(!i)return t;i.drawImage(t,0,0),i.globalCompositeOperation="source-in";let o=function(e,t){let n,r;let i=t.width/t.height;return i>=e.width/e.height?(n=e.width,r=e.width/i):(n=e.height*i,r=e.height),{x:(e.width-n)/2,y:(e.height-r)/2,width:n,height:r}}(n,e);return i.drawImage(n,o.x,o.y,o.width,o.height,0,0,t.width,t.height),r},[t,n,e.a.width,e.a.height])},i9=(e,t,n,r,i=0,o=!1)=>{let a=Math.floor(Math.max(e.a.width*r,1)),l=Math.floor(Math.max(e.a.height*r,1)),u=Math.min(i*r,a/2,l/2),c=Math.max(e.a.width/n.width,e.a.height/n.height)*r,d=e.page._exporting&&iE.imageDownScalingEnabled&&c<1&&!o,h=0===n.x&&0===n.y&&n.width===t?.width&&n.height===t?.height,f=s(y).useMemo(()=>{if(!t||!t.width||!t.height)return;let e=0===u,n=!d;if(!h||!e||!n)return i5()},[t,u,d,h]);return s(y).useLayoutEffect(()=>{if(!f||!t)return;f.width=a,f.height=l;let e=f.getContext("2d");if(!e)return;u&&(e.beginPath(),e.moveTo(u,0),e.lineTo(a-u,0),e.arc(a-u,u,u,3*Math.PI/2,0,!1),e.lineTo(a,l-u),e.arc(a-u,l-u,u,0,Math.PI/2,!1),e.lineTo(u,l),e.arc(u,l-u,u,Math.PI/2,Math.PI,!1),e.lineTo(0,u),e.arc(u,u,u,Math.PI,3*Math.PI/2,!1),e.clip());let r=d?function(e,t){let n=i5();n.width=e.width,n.height=e.height,n.getContext("2d")?.drawImage(e,0,0,n.width,n.height);let r=function(e,t,n,r,i,o,a){for(var l=new ImageData(t,n),s=new Int32Array(e.data.buffer),u=e.width,c=new Int32Array(l.data.buffer),d=l.width,h=t/o,f=n/a,p=Math.round(1/h),g=Math.round(1/f),m=p*g,v=0;v<l.height;v++)for(var y=0;y<d;y++){for(var b=0+Math.round(y/h)+(0+Math.round(v/f))*u,w=0,x=0,_=0,E=0,S=0;S<g;S++)for(var O=0;O<p;O++){var C=s[b+O+S*u];w+=C<<24>>>24,x+=C<<16>>>24,_+=C<<8>>>24,E+=C>>>24}w=Math.round(w/m),x=Math.round(x/m),_=Math.round(_/m),E=Math.round(E/m),c[y+v*d]=E<<24|_<<16|x<<8|w}return l}(n.getContext("2d").getImageData(0,0,n.width,n.height),Math.floor(n.width*t),Math.floor(n.height*t),0,0,n.width,n.height);return n.width=Math.floor(n.width*t),n.height=Math.floor(n.height*t),n.getContext("2d")?.putImageData(r,0,0),n}(t,c):t,i=d?{x:Math.floor(n.x*c),y:Math.floor(n.y*c),width:Math.floor(n.width*c),height:Math.floor(n.height*c)}:n;e.drawImage(r,i.x,i.y,i.width,i.height,0,0,f.width,f.height)},[f,e.a.width,e.a.height,n.x,n.y,n.width,n.height,i,r,o,e.page._exporting,d]),s(y).useEffect(()=>()=>{f&&"CANVAS"===f.nodeName&&s(N).Util.releaseCanvas(f)},[f]),f||t},i7=(e,t,n,r)=>{let[i,o]=or(i4(e.clipSrc||""),"anonymous");oi(e.clipSrc?o:"loaded",e.id+"-clip");let a=s(y).useMemo(()=>{if(t&&i)return i5()},[t,i]);return s(y).useLayoutEffect(()=>{if(!i||!t||!t.width||!t.height||!i||!i.width||!i.height||!a)return;let r=i5(),o=Math.max(e.a.width/i.width*n,e.a.height/i.height*n);r.width=i.width*o,r.height=i.height*o,r.getContext("2d")?.drawImage(i,0,0,r.width,r.height),a.width=Math.max(t.width,1),a.height=Math.max(t.height,1);let l=a.getContext("2d");l&&(l.save(),l.drawImage(r,0,0,t.width,t.height),s(N).Util.releaseCanvas(r),l.globalCompositeOperation="source-in",l.drawImage(t,0,0,a.width,a.height),l.restore())},[a,t,i,e.a.width,e.a.height,n,...r]),e.clipSrc&&i?a:t},oe=i5(),ot=T(({element:e})=>{let t=Math.min(30,e.a.width/4,e.a.height/4),n=s(y).useRef(null);return s(y).useEffect(()=>{let e=n.current;if(!e)return;let t=new(s(N)).Animation(t=>{e.rotate((t?.timeDiff||0)/2)},e.getLayer());return t.start(),()=>{t.stop()}}),(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport,children:[(0,g.jsx)(rK,{width:e.a.width,height:e.a.height,fill:"rgba(124, 173, 212, 0.8)"}),(0,g.jsx)("Arc",{ref:n,x:e.a.width/2,y:e.a.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270})]})}),on=T(({element:e})=>{let t="Can not load the image...",n=Math.max(10,Math.min(30,e.a.width/t.length));return(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport,children:[(0,g.jsx)(rK,{width:e.a.width,height:e.a.height,fill:"rgba(223, 102, 102, 0.8)"}),(0,g.jsx)(rQ,{text:t,fontSize:n,width:e.a.width,height:e.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5})]})}),or=s(r2),oi=(e,t)=>{let n=s(y).useRef(),r=()=>{n.current?.(),n.current=void 0};s(y).useEffect(()=>r,[]),s(y).useLayoutEffect(()=>{"loading"!==e||n.current||(n.current=il(`image ${t}`)),"loading"!==e&&r(),"failed"===e&&ic(`image ${t}`)},[e])},oo=({image:e,status:t,type:n})=>{let r=s(y).useRef();return s(y).useEffect(()=>{r.current=e||r.current},[e]),"failed"!==t||"failed"!==t&&"svg"===n?r.current:void 0},oa=e=>{let[t,n]=s(y).useReducer(e=>e+1,0),r=s(y).useRef("loading"),i=s(y).useRef(e.src),o=s(y).useRef(e.src);return(o.current!==e.src&&(o.current=e.src,r.current="loading"),s(y).useEffect(()=>{if("svg"!==e.type||!e.src)return;let t=!1;return(async()=>{r.current="loading",n();let o=i1(iJ(await iX(e.src)),e.colorsReplace);t||(i.current=o,r.current="loaded",n())})(),()=>{t=!0}},[e.src,JSON.stringify(e.colorsReplace)]),"svg"!==e.type)?[e.src,"loaded"]:[i.current,r.current]},ol=T(({element:e,store:t})=>{let n,r;let[i,o]=s(y).useState(!1),a=s(y).useRef(null),l=s(y).useRef(null),[u,c]=s(y).useState(!1),d=t.selectedElements.indexOf(e)>=0,[h,f]=oa(e),[p,m]=or(h,"anonymous");oi("svg"!==e.type||"loaded"===f?m:"loading",e.id);let v=oo({image:p,status:m,type:e.type}),w=i8(e,i6(e,p||v,t._elementsPixelRatio))||oe,{cropX:x,cropY:_,cropWidth:E,cropHeight:S}=e;"loaded"!==m&&(x=_=0,E=S=1);let O=w.width*E,C=w.height*S,k=e.a.width/e.a.height,P=O/C,T="svg"===e.type;T?(n=O,r=C):k>=P?(n=O,r=O/k):(n=C*k,r=C);let A={x:w.width*x,y:w.height*_,width:n,height:r},N=e.cornerRadius??0,j=i7(e,i9(e,w,A,t._elementsPixelRatio,N,i||e._cropModeEnabled||"svg"===e.type),t._elementsPixelRatio,[A,N,t._elementsPixelRatio]),R=Math.max(e.a.width/n,e.a.height/r);s(y).useEffect(()=>{if(!e._cropModeEnabled)return;let t=a.current?.getStage();function n(t){e._cropModeEnabled&&t.target!==l.current&&e.toggleCropMode(!1)}function r(t){e._cropModeEnabled&&"CANVAS"!==t.target.nodeName&&e.toggleCropMode(!1)}return document.body.addEventListener("click",r),t?.on("click",n),t?.on("tap",n),()=>{document.body.removeEventListener("click",r),document.body.removeEventListener("touchstart",r),t?.off("click",n),t?.off("click",n)}},[e._cropModeEnabled]),s(y).useLayoutEffect(()=>{if(!i&&!e._cropModeEnabled)return iA(a.current,e),(0,b.autorun)(()=>{iA(a.current,e)},{delay:100})},[w,i,E,S,e._cropModeEnabled]),s(y).useLayoutEffect(()=>{i||e._cropModeEnabled?a.current?.clearCache():iA(a.current,e)},[i,e.a.width,e.a.height,e._cropModeEnabled]),s(y).useEffect(()=>{iA(a.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);let I=s(y).useRef(null),L=s(y).useRef(null),M=s(y).useRef(null);s(y).useLayoutEffect(()=>{e._cropModeEnabled&&(L.current.nodes([I.current]),M.current.nodes([l.current]))},[e._cropModeEnabled]);let D=t=>{Math.round(t.target.x())>0&&(t.target.x(0),t.target.scaleX(1)),Math.round(t.target.y())>0&&(t.target.y(0),t.target.scaleY(1));let i=t.target.width()*t.target.scaleX(),o=t.target.height()*t.target.scaleY(),a=Math.min(1,n/i),l=Math.min(1,r/o),s=Math.min(1-a,Math.max(0,Math.round(-t.target.x())/i)),u=Math.min(1-l,Math.max(0,Math.round(-t.target.y())/o));t.target.setAttrs({x:-s*w.width,y:-u*w.height,scaleX:1,scaleY:1}),e.set({cropX:s,cropY:u,cropWidth:a,cropHeight:l})},F=()=>{"svg"!==e.type&&e.contentEditable&&setTimeout(()=>{e.toggleCropMode(!0)})},z="svg"===e.type&&v,B="loading"===m&&!z,U="failed"===m,H=!B&&!U,V=s(y).useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),q=H?e.a.opacity:0;ii(a,q);let G=e.selectable||"admin"===t.role,W=iL();return(0,g.jsxs)(s(y).Fragment,{children:[B&&(0,g.jsx)(ot,{element:e}),U&&(0,g.jsx)(on,{element:e}),(0,g.jsx)(rX,{ref:a,name:"element",id:e.id,image:j,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.rotation,opacity:q,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:A,listening:G,draggable:W?e.draggable&&d:e.draggable,preventDefault:!W||d,hideInExport:!e.showInExport,onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)},onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDblClick:F,onDblTap:F,onTransformStart:()=>{o(!0),V.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:t=>{let i=t.currentTarget,o=1e-7>Math.abs(i.scaleX()-1)?1:i.scaleX(),a=1e-7>Math.abs(i.scaleY()-1)?1:i.scaleY();i.scaleX(1),i.scaleY(1);let l=t.target.getStage()?.findOne("Transformer"),s=Math.min(1-n/w.width,Math.max(0,e.cropX)),u=Math.min(1-r/w.height,Math.max(0,e.cropY)),c=l.getActiveAnchor(),d=!(c.indexOf("middle")>=0||c.indexOf("center")>=0),h=!d&&o<1&&V.current.cropHeight>r/w.height,f=d?e.cropWidth:e.cropWidth*o;h&&(f=e.cropWidth);let p=!d&&a<1&&V.current.cropWidth>n/w.width,g=d?e.cropHeight:e.cropHeight*a;p&&(g=e.cropHeight),T&&(f=e.cropWidth,g=e.cropHeight),e.set({cropX:s,cropY:u,x:i.x(),y:i.y(),width:i.width()*o,height:i.height()*a,rotation:t.target.rotation(),cropWidth:Math.min(f,1-s),cropHeight:Math.min(g,1-u)})},onTransformEnd:t=>{let i=t.currentTarget;e.set({width:i.width(),height:i.height(),x:i.x(),y:i.y(),rotation:t.target.rotation(),cropWidth:n/w.width,cropHeight:r/w.height}),o(!1)}}),(0,g.jsx)(rK,{x:e.x,y:e.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:q,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,N-e.borderSize),hideInExport:!e.showInExport}),e._cropModeEnabled&&(0,g.jsxs)(r6,{selector:".page-abs-container",enabled:!0,children:[(0,g.jsx)(rK,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),(0,g.jsx)(rX,{listening:!1,image:j,x:e.x,y:e.y,width:e.a.width,height:e.a.height,rotation:e.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,scaleX:R,scaleY:R,children:[(0,g.jsx)(rX,{image:w,ref:l,opacity:.4,draggable:!0,x:-e.cropX*w.width,y:-e.cropY*w.height,onDragMove:D,onTransform:D}),(0,g.jsx)(rJ,{ref:M,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),(0,g.jsx)(rK,{width:n,height:r,ref:I,listening:!1,onTransform:t=>{t.target.x()<-e.cropX*w.width-1e-9&&(t.target.x(-e.cropX*w.width),t.target.scaleX(1)),t.target.y()<-e.cropY*w.height-1e-9&&(t.target.y(-e.cropY*w.height),t.target.scaleY(1));let n=Math.min(1,Math.max(0,e.cropX+t.target.x()/w.width)),r=Math.min(1,Math.max(0,t.target.y()/w.height+e.cropY)),i=t.target.width()*t.target.scaleX(),o=t.target.height()*t.target.scaleY(),a=Math.min(1-n,i/w.width),l=Math.min(1-r,o/w.height),s=t.target.getAbsolutePosition(t.target.getParent().getParent());t.target.scale({x:1,y:1}),t.target.position({x:0,y:0}),e.set({x:s.x,y:s.y,cropX:n,cropY:r,cropWidth:a,cropHeight:l,width:Math.min(i*R,w.width*(1-n)*R),height:Math.min(o*R,w.height*(1-r)*R)})}}),(0,g.jsx)(rJ,{ref:L,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2})]})]}),(u||d)&&(0,g.jsx)(ij,{element:e})]})});var y=f("8NFma"),os={};k_=function(e){for(var t,n=e.length,r=n%3,i=[],o=0,a=n-r;o<a;o+=16383)i.push(function(e,t,n){for(var r,i=[],o=t;o<n;o+=3)i.push(ou[(r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]))>>18&63]+ou[r>>12&63]+ou[r>>6&63]+ou[63&r]);return i.join("")}(e,o,o+16383>a?a:o+16383));return 1===r?i.push(ou[(t=e[n-1])>>2]+ou[t<<4&63]+"=="):2===r&&i.push(ou[(t=(e[n-2]<<8)+e[n-1])>>10]+ou[t>>4&63]+ou[t<<2&63]+"="),i.join("")};for(var ou=[],oc=[],od="undefined"!=typeof Uint8Array?Uint8Array:Array,oh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",of=0,op=oh.length;of<op;++of)ou[of]=oh[of],oc[oh.charCodeAt(of)]=of;oc["-".charCodeAt(0)]=62,oc["_".charCodeAt(0)]=63,kE=function(e,t,n,r,i){var o,a,l=8*i-r-1,s=(1<<l)-1,u=s>>1,c=-7,d=n?i-1:0,h=n?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-c)-1,f>>=-c,c+=l;c>0;o=256*o+e[t+d],d+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+d],d+=h,c-=8);if(0===o)o=1-u;else{if(o===s)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=u}return(f?-1:1)*a*Math.pow(2,o-r)},kS=function(e,t,n,r,i,o){var a,l,s,u=8*o-i-1,c=(1<<u)-1,d=c>>1,h=23===i?5960464477539062e-23:0,f=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(l=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),a+d>=1?t+=h/s:t+=h*Math.pow(2,1-d),t*s>=2&&(a++,s/=2),a+d>=c?(l=0,a=c):a+d>=1?(l=(t*s-1)*Math.pow(2,i),a+=d):(l=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&l,f+=p,l/=256,i-=8);for(a=a<<i|l,u+=i;u>0;e[n+f]=255&a,f+=p,a/=256,u-=8);e[n+f-p]|=128*g};let og="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function om(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,ov.prototype),t}function ov(e,t,n){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return ow(e)}return oy(e,t,n)}function oy(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!ov.isEncoding(t))throw TypeError("Unknown encoding: "+t);let n=0|oS(e,t),r=om(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(oK(e,Uint8Array)){let t=new Uint8Array(e);return o_(t.buffer,t.byteOffset,t.byteLength)}return ox(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(oK(e,ArrayBuffer)||e&&oK(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(oK(e,SharedArrayBuffer)||e&&oK(e.buffer,SharedArrayBuffer)))return o_(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return ov.from(r,t,n);let i=function(e){var t;if(ov.isBuffer(e)){let t=0|oE(e.length),n=om(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?om(0):ox(e):"Buffer"===e.type&&Array.isArray(e.data)?ox(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return ov.from(e[Symbol.toPrimitive]("string"),t,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function ob(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function ow(e){return ob(e),om(e<0?0:0|oE(e))}function ox(e){let t=e.length<0?0:0|oE(e.length),n=om(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function o_(e,t,n){let r;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),ov.prototype),r}function oE(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function oS(e,t){if(ov.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||oK(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return oq(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return oG(e).length;default:if(i)return r?-1:oq(e).length;t=(""+t).toLowerCase(),i=!0}}function oO(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=o$[e[r]];return i}(this,t,n);case"utf8":case"utf-8":return oT(this,t,n);case"ascii":return function(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}(this,t,n);case"latin1":case"binary":return function(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}(this,t,n);case"base64":var i,o;return i=t,o=n,0===i&&o===this.length?k_(this):k_(this.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){let r=e.slice(t,n),i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}(this,t,n);default:if(r)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function oC(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function ok(e,t,n,r,i){var o;if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),(o=n=+n)!=o&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return -1;n=e.length-1}else if(n<0){if(!i)return -1;n=0}if("string"==typeof t&&(t=ov.from(t,r)),ov.isBuffer(t))return 0===t.length?-1:oP(e,t,n,r,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):oP(e,[t],n,r,i);throw TypeError("val must be string, number or Buffer")}function oP(e,t,n,r,i){let o,a=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;a=2,l/=2,s/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;o<l;o++)if(u(e,o)===u(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===s)return r*a}else -1!==r&&(o-=o-r),r=-1}else for(n+s>l&&(n=l-s),o=n;o>=0;o--){let n=!0;for(let r=0;r<s;r++)if(u(e,o+r)!==u(t,r)){n=!1;break}if(n)return o}return -1}function oT(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,l,s;switch(a){case 1:t<128&&(o=t);break;case 2:(192&(n=e[i+1]))==128&&(s=(31&t)<<6|63&n)>127&&(o=s);break;case 3:n=e[i+1],r=e[i+2],(192&n)==128&&(192&r)==128&&(s=(15&t)<<12|(63&n)<<6|63&r)>2047&&(s<55296||s>57343)&&(o=s);break;case 4:n=e[i+1],r=e[i+2],l=e[i+3],(192&n)==128&&(192&r)==128&&(192&l)==128&&(s=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&l)>65535&&s<1114112&&(o=s)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}function oA(e,t,n){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>n)throw RangeError("Trying to access beyond buffer length")}function oN(e,t,n,r,i,o){if(!ov.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function oj(e,t,n,r,i){oB(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function oR(e,t,n,r,i){oB(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function oI(e,t,n,r,i,o){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function oL(e,t,n,r,i){return t=+t,n>>>=0,i||oI(e,t,n,4,34028234663852886e22,-34028234663852886e22),kS(e,t,n,r,23,4),n+4}function oM(e,t,n,r,i){return t=+t,n>>>=0,i||oI(e,t,n,8,17976931348623157e292,-17976931348623157e292),kS(e,t,n,r,52,8),n+8}ov.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),ov.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(ov.prototype,"parent",{enumerable:!0,get:function(){if(ov.isBuffer(this))return this.buffer}}),Object.defineProperty(ov.prototype,"offset",{enumerable:!0,get:function(){if(ov.isBuffer(this))return this.byteOffset}}),ov.poolSize=8192,ov.from=function(e,t,n){return oy(e,t,n)},Object.setPrototypeOf(ov.prototype,Uint8Array.prototype),Object.setPrototypeOf(ov,Uint8Array),ov.alloc=function(e,t,n){return(ob(e),e<=0)?om(e):void 0!==t?"string"==typeof n?om(e).fill(t,n):om(e).fill(t):om(e)},ov.allocUnsafe=function(e){return ow(e)},ov.allocUnsafeSlow=function(e){return ow(e)},ov.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==ov.prototype},ov.compare=function(e,t){if(oK(e,Uint8Array)&&(e=ov.from(e,e.offset,e.byteLength)),oK(t,Uint8Array)&&(t=ov.from(t,t.offset,t.byteLength)),!ov.isBuffer(e)||!ov.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},ov.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ov.concat=function(e,t){let n;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return ov.alloc(0);if(void 0===t)for(n=0,t=0;n<e.length;++n)t+=e[n].length;let r=ov.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(oK(t,Uint8Array))i+t.length>r.length?(ov.isBuffer(t)||(t=ov.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(ov.isBuffer(t))t.copy(r,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return r},ov.byteLength=oS,ov.prototype._isBuffer=!0,ov.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)oC(this,t,t+1);return this},ov.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)oC(this,t,t+3),oC(this,t+1,t+2);return this},ov.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)oC(this,t,t+7),oC(this,t+1,t+6),oC(this,t+2,t+5),oC(this,t+3,t+4);return this},ov.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?oT(this,0,e):oO.apply(this,arguments)},ov.prototype.toLocaleString=ov.prototype.toString,ov.prototype.equals=function(e){if(!ov.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===ov.compare(this,e)},ov.prototype.inspect=function(){let e="";return e=this.toString("hex",0,50).replace(/(.{2})/g,"$1 ").trim(),this.length>50&&(e+=" ... "),"<Buffer "+e+">"},og&&(ov.prototype[og]=ov.prototype.inspect),ov.prototype.compare=function(e,t,n,r,i){if(oK(e,Uint8Array)&&(e=ov.from(e,e.offset,e.byteLength)),!ov.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let o=i-r,a=n-t,l=Math.min(o,a),s=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<l;++e)if(s[e]!==u[e]){o=s[e],a=u[e];break}return o<a?-1:a<o?1:0},ov.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},ov.prototype.indexOf=function(e,t,n){return ok(this,e,t,n,!0)},ov.prototype.lastIndexOf=function(e,t,n){return ok(this,e,t,n,!1)},ov.prototype.write=function(e,t,n,r){var i,o,a,l,s,u,c,d;if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-t;if((void 0===n||n>h)&&(n=h),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let f=!1;for(;;)switch(r){case"hex":return function(e,t,n,r){let i;n=Number(n)||0;let o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;let a=t.length;for(r>a/2&&(r=a/2),i=0;i<r;++i){let r=parseInt(t.substr(2*i,2),16);if(r!=r)break;e[n+i]=r}return i}(this,e,t,n);case"utf8":case"utf-8":return i=t,o=n,oW(oq(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return a=t,l=n,oW(function(e){let t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(e),this,a,l);case"base64":return s=t,u=n,oW(oG(e),this,s,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=n,oW(function(e,t){let n,r;let i=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i.push(n%256),i.push(r);return i}(e,this.length-c),this,c,d);default:if(f)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),f=!0}},ov.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},ov.prototype.slice=function(e,t){let n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,ov.prototype),r},ov.prototype.readUintLE=ov.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||oA(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},ov.prototype.readUintBE=ov.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||oA(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},ov.prototype.readUint8=ov.prototype.readUInt8=function(e,t){return e>>>=0,t||oA(e,1,this.length),this[e]},ov.prototype.readUint16LE=ov.prototype.readUInt16LE=function(e,t){return e>>>=0,t||oA(e,2,this.length),this[e]|this[e+1]<<8},ov.prototype.readUint16BE=ov.prototype.readUInt16BE=function(e,t){return e>>>=0,t||oA(e,2,this.length),this[e]<<8|this[e+1]},ov.prototype.readUint32LE=ov.prototype.readUInt32LE=function(e,t){return e>>>=0,t||oA(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},ov.prototype.readUint32BE=ov.prototype.readUInt32BE=function(e,t){return e>>>=0,t||oA(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},ov.prototype.readBigUInt64LE=oY(function(e){oU(e>>>=0,"offset");let t=this[e],n=this[e+7];(void 0===t||void 0===n)&&oH(e,this.length-8);let r=t+256*this[++e]+65536*this[++e]+16777216*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+16777216*n;return BigInt(r)+(BigInt(i)<<BigInt(32))}),ov.prototype.readBigUInt64BE=oY(function(e){oU(e>>>=0,"offset");let t=this[e],n=this[e+7];(void 0===t||void 0===n)&&oH(e,this.length-8);let r=16777216*t+65536*this[++e]+256*this[++e]+this[++e],i=16777216*this[++e]+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),ov.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||oA(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},ov.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||oA(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},ov.prototype.readInt8=function(e,t){return(e>>>=0,t||oA(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},ov.prototype.readInt16LE=function(e,t){e>>>=0,t||oA(e,2,this.length);let n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},ov.prototype.readInt16BE=function(e,t){e>>>=0,t||oA(e,2,this.length);let n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},ov.prototype.readInt32LE=function(e,t){return e>>>=0,t||oA(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},ov.prototype.readInt32BE=function(e,t){return e>>>=0,t||oA(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},ov.prototype.readBigInt64LE=oY(function(e){oU(e>>>=0,"offset");let t=this[e],n=this[e+7];return(void 0===t||void 0===n)&&oH(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+16777216*this[++e])}),ov.prototype.readBigInt64BE=oY(function(e){oU(e>>>=0,"offset");let t=this[e],n=this[e+7];return(void 0===t||void 0===n)&&oH(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(16777216*this[++e]+65536*this[++e]+256*this[++e]+n)}),ov.prototype.readFloatLE=function(e,t){return e>>>=0,t||oA(e,4,this.length),kE(this,e,!0,23,4)},ov.prototype.readFloatBE=function(e,t){return e>>>=0,t||oA(e,4,this.length),kE(this,e,!1,23,4)},ov.prototype.readDoubleLE=function(e,t){return e>>>=0,t||oA(e,8,this.length),kE(this,e,!0,52,8)},ov.prototype.readDoubleBE=function(e,t){return e>>>=0,t||oA(e,8,this.length),kE(this,e,!1,52,8)},ov.prototype.writeUintLE=ov.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=Math.pow(2,8*n)-1;oN(this,e,t,n,r,0)}let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},ov.prototype.writeUintBE=ov.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=Math.pow(2,8*n)-1;oN(this,e,t,n,r,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},ov.prototype.writeUint8=ov.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,1,255,0),this[t]=255&e,t+1},ov.prototype.writeUint16LE=ov.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},ov.prototype.writeUint16BE=ov.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},ov.prototype.writeUint32LE=ov.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},ov.prototype.writeUint32BE=ov.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},ov.prototype.writeBigUInt64LE=oY(function(e,t=0){return oj(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),ov.prototype.writeBigUInt64BE=oY(function(e,t=0){return oR(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),ov.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=Math.pow(2,8*n-1);oN(this,e,t,n,r-1,-r)}let i=0,o=1,a=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},ov.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=Math.pow(2,8*n-1);oN(this,e,t,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},ov.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},ov.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},ov.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},ov.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},ov.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},ov.prototype.writeBigInt64LE=oY(function(e,t=0){return oj(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),ov.prototype.writeBigInt64BE=oY(function(e,t=0){return oR(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),ov.prototype.writeFloatLE=function(e,t,n){return oL(this,e,t,!0,n)},ov.prototype.writeFloatBE=function(e,t,n){return oL(this,e,t,!1,n)},ov.prototype.writeDoubleLE=function(e,t,n){return oM(this,e,t,!0,n)},ov.prototype.writeDoubleBE=function(e,t,n){return oM(this,e,t,!1,n)},ov.prototype.copy=function(e,t,n,r){if(!ov.isBuffer(e))throw TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},ov.prototype.fill=function(e,t,n,r){let i;if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!ov.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){let t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{let o=ov.isBuffer(e)?e:ov.from(e,r),a=o.length;if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%a]}return this};let oD={};function oF(e,t,n){oD[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function oz(e){let t="",n=e.length,r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function oB(e,t,n,r,i,o){if(e>n||e<t){let r;let i="bigint"==typeof t?"n":"";throw r=o>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(o+1)*8}${i}`:`>= -(2${i} ** ${(o+1)*8-1}${i}) and < 2 ** ${(o+1)*8-1}${i}`:`>= ${t}${i} and <= ${n}${i}`,new oD.ERR_OUT_OF_RANGE("value",r,e)}oU(i,"offset"),(void 0===r[i]||void 0===r[i+o])&&oH(i,r.length-(o+1))}function oU(e,t){if("number"!=typeof e)throw new oD.ERR_INVALID_ARG_TYPE(t,"number",e)}function oH(e,t,n){if(Math.floor(e)!==e)throw oU(e,n),new oD.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new oD.ERR_BUFFER_OUT_OF_BOUNDS;throw new oD.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}oF("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),oF("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),oF("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>4294967296?i=oz(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=oz(i)),i+="n"),r+=` It must be ${t}. Received ${i}`},RangeError);let oV=/[^+/0-9A-Za-z-_]/g;function oq(e,t){let n;t=t||1/0;let r=e.length,i=null,o=[];for(let a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319||a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return o}function oG(e){return function(e){var t,n,r=function(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}(e),i=r[0],o=r[1],a=new od((i+o)*3/4-o),l=0,s=o>0?i-4:i;for(n=0;n<s;n+=4)t=oc[e.charCodeAt(n)]<<18|oc[e.charCodeAt(n+1)]<<12|oc[e.charCodeAt(n+2)]<<6|oc[e.charCodeAt(n+3)],a[l++]=t>>16&255,a[l++]=t>>8&255,a[l++]=255&t;return 2===o&&(t=oc[e.charCodeAt(n)]<<2|oc[e.charCodeAt(n+1)]>>4,a[l++]=255&t),1===o&&(t=oc[e.charCodeAt(n)]<<10|oc[e.charCodeAt(n+1)]<<4|oc[e.charCodeAt(n+2)]>>2,a[l++]=t>>8&255,a[l++]=255&t),a}(function(e){if((e=(e=e.split("=")[0]).trim().replace(oV,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function oW(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length)&&!(i>=e.length);++i)t[i+n]=e[i];return i}function oK(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let o$=function(){let e="0123456789abcdef",t=Array(256);for(let n=0;n<16;++n){let r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function oY(e){return"undefined"==typeof BigInt?oX:e}function oX(){throw Error("BigInt not supported")}"undefined"!=typeof self&&self,os=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=109)}([function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(17),i=n(18),o=n(19),a=n(45),l=n(46),s=n(47),u=n(48),c=n(49),d=n(12),h=n(32),f=n(33),p=n(31),g=n(1),m={Scope:g.Scope,create:g.create,find:g.find,query:g.query,register:g.register,Container:r.default,Format:i.default,Leaf:o.default,Embed:u.default,Scroll:a.default,Block:s.default,Inline:l.default,Text:c.default,Attributor:{Attribute:d.default,Class:h.default,Style:f.default,Store:p.default}};t.default=m},function(e,t,n){var r,i,o,a=this&&this.__extends||(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(t){var n=this;return t="[Parchment] "+t,(n=e.call(this,t)||this).message=t,n.name=n.constructor.name,n}return a(t,e),t}(Error);t.ParchmentError=l;var s={},u={},c={},d={};function h(e,t){if(void 0===t&&(t=o.ANY),"string"==typeof e)n=d[e]||s[e];else if(e instanceof Text||e.nodeType===Node.TEXT_NODE)n=d.text;else if("number"==typeof e)e&o.LEVEL&o.BLOCK?n=d.block:e&o.LEVEL&o.INLINE&&(n=d.inline);else if(e instanceof HTMLElement){var n,r=(e.getAttribute("class")||"").split(/\s+/);for(var i in r)if(n=u[r[i]])break;n=n||c[e.tagName]}return null==n?null:t&o.LEVEL&n.scope&&t&o.TYPE&n.scope?n:null}t.DATA_KEY="__blot",(r=o=t.Scope||(t.Scope={}))[r.TYPE=3]="TYPE",r[r.LEVEL=12]="LEVEL",r[r.ATTRIBUTE=13]="ATTRIBUTE",r[r.BLOT=14]="BLOT",r[r.INLINE=7]="INLINE",r[r.BLOCK=11]="BLOCK",r[r.BLOCK_BLOT=10]="BLOCK_BLOT",r[r.INLINE_BLOT=6]="INLINE_BLOT",r[r.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",r[r.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",r[r.ANY=15]="ANY",t.create=function(e,t){var n=h(e);if(null==n)throw new l("Unable to create "+e+" blot");var r=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:n.create(t);return new n(r,t)},t.find=function e(n,r){return(void 0===r&&(r=!1),null==n)?null:null!=n[t.DATA_KEY]?n[t.DATA_KEY].blot:r?e(n.parentNode,r):null},t.query=h,t.register=function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length>1)return t.map(function(t){return e(t)});var r=t[0];if("string"!=typeof r.blotName&&"string"!=typeof r.attrName)throw new l("Invalid definition");if("abstract"===r.blotName)throw new l("Cannot register abstract class");return d[r.blotName||r.attrName]=r,"string"==typeof r.keyName?s[r.keyName]=r:(null!=r.className&&(u[r.className]=r),null!=r.tagName&&(Array.isArray(r.tagName)?r.tagName=r.tagName.map(function(e){return e.toUpperCase()}):r.tagName=r.tagName.toUpperCase(),(Array.isArray(r.tagName)?r.tagName:[r.tagName]).forEach(function(e){(null==c[e]||null==r.className)&&(c[e]=r)}))),r}},function(e,t,n){var r=n(51),i=n(11),o=n(3),a=n(20),l=function(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]};l.prototype.insert=function(e,t){var n={};return 0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))},l.prototype.delete=function(e){return e<=0?this:this.push({delete:e})},l.prototype.retain=function(e,t){if(e<=0)return this;var n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)},l.prototype.push=function(e){var t=this.ops.length,n=this.ops[t-1];if(e=o(!0,{},e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,"object"!=typeof(n=this.ops[t-1])))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this},l.prototype.chop=function(){var e=this.ops[this.ops.length-1];return e&&e.retain&&!e.attributes&&this.ops.pop(),this},l.prototype.filter=function(e){return this.ops.filter(e)},l.prototype.forEach=function(e){this.ops.forEach(e)},l.prototype.map=function(e){return this.ops.map(e)},l.prototype.partition=function(e){var t=[],n=[];return this.forEach(function(r){(e(r)?t:n).push(r)}),[t,n]},l.prototype.reduce=function(e,t){return this.ops.reduce(e,t)},l.prototype.changeLength=function(){return this.reduce(function(e,t){return t.insert?e+a.length(t):t.delete?e-t.delete:e},0)},l.prototype.length=function(){return this.reduce(function(e,t){return e+a.length(t)},0)},l.prototype.slice=function(e,t){e=e||0,"number"!=typeof t&&(t=1/0);for(var n,r=[],i=a.iterator(this.ops),o=0;o<t&&i.hasNext();)o<e?n=i.next(e-o):(n=i.next(t-o),r.push(n)),o+=a.length(n);return new l(r)},l.prototype.compose=function(e){var t=a.iterator(this.ops),n=a.iterator(e.ops),r=[],o=n.peek();if(null!=o&&"number"==typeof o.retain&&null==o.attributes){for(var s=o.retain;"insert"===t.peekType()&&t.peekLength()<=s;)s-=t.peekLength(),r.push(t.next());o.retain-s>0&&n.next(o.retain-s)}for(var u=new l(r);t.hasNext()||n.hasNext();)if("insert"===n.peekType())u.push(n.next());else if("delete"===t.peekType())u.push(t.next());else{var c=Math.min(t.peekLength(),n.peekLength()),d=t.next(c),h=n.next(c);if("number"==typeof h.retain){var f={};"number"==typeof d.retain?f.retain=c:f.insert=d.insert;var p=a.attributes.compose(d.attributes,h.attributes,"number"==typeof d.retain);if(p&&(f.attributes=p),u.push(f),!n.hasNext()&&i(u.ops[u.ops.length-1],f)){var g=new l(t.rest());return u.concat(g).chop()}}else"number"==typeof h.delete&&"number"==typeof d.retain&&u.push(h)}return u.chop()},l.prototype.concat=function(e){var t=new l(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t},l.prototype.diff=function(e,t){if(this.ops===e.ops)return new l;var n=[this,e].map(function(t){return t.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:"\x00";throw Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")}),o=new l,s=r(n[0],n[1],t),u=a.iterator(this.ops),c=a.iterator(e.ops);return s.forEach(function(e){for(var t=e[1].length;t>0;){var n=0;switch(e[0]){case r.INSERT:n=Math.min(c.peekLength(),t),o.push(c.next(n));break;case r.DELETE:n=Math.min(t,u.peekLength()),u.next(n),o.delete(n);break;case r.EQUAL:n=Math.min(u.peekLength(),c.peekLength(),t);var l=u.next(n),s=c.next(n);i(l.insert,s.insert)?o.retain(n,a.attributes.diff(l.attributes,s.attributes)):o.push(s).delete(n)}t-=n}}),o.chop()},l.prototype.eachLine=function(e,t){t=t||"\n";for(var n=a.iterator(this.ops),r=new l,i=0;n.hasNext();){if("insert"!==n.peekType())return;var o=n.peek(),s=a.length(o)-n.peekLength(),u="string"==typeof o.insert?o.insert.indexOf(t,s)-s:-1;if(u<0)r.push(n.next());else if(u>0)r.push(n.next(u));else{if(!1===e(r,n.next(1).attributes||{},i))return;i+=1,r=new l}}r.length()>0&&e(r,{},i)},l.prototype.transform=function(e,t){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);for(var n=a.iterator(this.ops),r=a.iterator(e.ops),i=new l;n.hasNext()||r.hasNext();)if("insert"===n.peekType()&&(t||"insert"!==r.peekType()))i.retain(a.length(n.next()));else if("insert"===r.peekType())i.push(r.next());else{var o=Math.min(n.peekLength(),r.peekLength()),s=n.next(o),u=r.next(o);if(s.delete)continue;u.delete?i.push(u):i.retain(o,a.attributes.transform(s.attributes,u.attributes,t))}return i.chop()},l.prototype.transformPosition=function(e,t){t=!!t;for(var n=a.iterator(this.ops),r=0;n.hasNext()&&r<=e;){var i=n.peekLength(),o=n.peekType();if(n.next(),"delete"===o){e-=Math.min(i,e-r);continue}"insert"===o&&(r<e||!t)&&(e+=i),r+=i}return e},e.exports=l},function(e,t){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,i=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(t in e);return void 0===t||n.call(e,t)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!n.call(e,t))return;if(o)return o(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,c,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(t=arguments[h],null!=t)for(n in t)r=u(d,n),d!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,c=r&&a(r)?r:[]):c=r&&l(r)?r:{},s(d,{name:n,newValue:e(p,c,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BlockEmbed=t.bubbleFormats=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=d(n(3)),a=d(n(2)),l=d(n(0)),s=d(n(16)),u=d(n(6)),c=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function p(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=function(e){function t(){return h(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),r(t,[{key:"attach",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"attach",this).call(this),this.attributes=new l.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new a.default().insert(this.value(),(0,o.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(e,t){var n=l.default.query(e,l.default.Scope.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}},{key:"formatAt",value:function(e,t,n,r){this.format(n,r)}},{key:"insertAt",value:function(e,n,r){if("string"==typeof n&&n.endsWith("\n")){var o=l.default.create(m.blotName);this.parent.insertBefore(o,0===e?this:this.next),o.insertAt(0,n.slice(0,-1))}else i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,r)}}]),t}(l.default.Embed);g.scope=l.default.Scope.BLOCK_BLOT;var m=function(e){function t(e){h(this,t);var n=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.cache={},n}return p(t,e),r(t,[{key:"delta",value:function(){return null==this.cache.delta&&(this.cache.delta=this.descendants(l.default.Leaf).reduce(function(e,t){return 0===t.length()?e:e.insert(t.value(),v(t))},new a.default).insert("\n",v(this))),this.cache.delta}},{key:"deleteAt",value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"deleteAt",this).call(this,e,n),this.cache={}}},{key:"formatAt",value:function(e,n,r,o){n<=0||(l.default.query(r,l.default.Scope.BLOCK)?e+n===this.length()&&this.format(r,o):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,Math.min(n,this.length()-e-1),r,o),this.cache={})}},{key:"insertAt",value:function(e,n,r){if(null!=r)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,r);if(0!==n.length){var o=n.split("\n"),a=o.shift();a.length>0&&(e<this.length()-1||null==this.children.tail?i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,Math.min(e,this.length()-1),a):this.children.tail.insertAt(this.children.tail.length(),a),this.cache={});var l=this;o.reduce(function(e,t){return(l=l.split(e,!0)).insertAt(0,t),t.length},e+a.length)}}},{key:"insertBefore",value:function(e,n){var r=this.children.head;i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n),r instanceof s.default&&r.remove(),this.cache={}}},{key:"length",value:function(){return null==this.cache.length&&(this.cache.length=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"length",this).call(this)+1),this.cache.length}},{key:"moveChildren",value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"moveChildren",this).call(this,e,n),this.cache={}}},{key:"optimize",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.cache={}}},{key:"path",value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,e,!0)}},{key:"removeChild",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"removeChild",this).call(this,e),this.cache={}}},{key:"split",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===e||e>=this.length()-1)){var r=this.clone();return 0===e?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"split",this).call(this,e,n);return this.cache={},o}}]),t}(l.default.Block);function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==e?t:("function"==typeof e.formats&&(t=(0,o.default)(t,e.formats())),null==e.parent||"scroll"==e.parent.blotName||e.parent.statics.scope!==e.statics.scope)?t:v(e.parent,t)}m.blotName="block",m.tagName="P",m.defaultChild="break",m.allowedChildren=[u.default,l.default.Embed,c.default],t.bubbleFormats=v,t.BlockEmbed=g,t.default=m},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.overload=t.expandConfig=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n(50);var a=m(n(2)),l=m(n(14)),s=m(n(8)),u=m(n(9)),c=m(n(0)),d=n(15),h=m(d),f=m(n(3)),p=m(n(10)),g=m(n(34));function m(e){return e&&e.__esModule?e:{default:e}}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=(0,p.default)("quill"),b=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),this.options=w(t,r),this.container=this.options.container,null==this.container)return y.error("Invalid Quill container",t);this.options.debug&&e.debug(this.options.debug);var i=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 s.default,this.scroll=c.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new l.default(this.scroll),this.selection=new h.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(s.default.events.EDITOR_CHANGE,function(e){e===s.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(s.default.events.SCROLL_UPDATE,function(e,t){var r=n.selection.lastRange,i=r&&0===r.length?r.index:void 0;x.call(n,function(){return n.editor.update(null,t,i)},e)});var o=this.clipboard.convert("<div class='ql-editor' style=\"white-space: normal;\">"+i+"<p><br></p></div>");this.setContents(o),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(e,null,[{key:"debug",value:function(e){!0===e&&(e="log"),p.default.level(e)}},{key:"find",value:function(e){return e.__quill||c.default.find(e)}},{key:"import",value:function(e){return null==this.imports[e]&&y.error("Cannot import "+e+". Are you sure it was registered?"),this.imports[e]}},{key:"register",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e){var i=e.attrName||e.blotName;"string"==typeof i?this.register("formats/"+i,e,t):Object.keys(e).forEach(function(r){n.register(r,e[r],t)})}else null==this.imports[e]||r||y.warn("Overwriting "+e+" with",t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&"abstract"!==t.blotName?c.default.register(t):e.startsWith("modules")&&"function"==typeof t.register&&t.register()}}]),o(e,[{key:"addContainer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){var n=e;(e=document.createElement("div")).classList.add(n)}return this.container.insertBefore(e,t),e}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(e,t,n){var r=this,o=i(_(e,t,n),4);return e=o[0],t=o[1],x.call(this,function(){return r.editor.deleteText(e,t)},n=o[3],e,-1*t)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}},{key:"focus",value:function(){var e=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=e,this.scrollIntoView()}},{key:"format",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.default.sources.API;return x.call(this,function(){var r=n.getSelection(!0),i=new a.default;if(null==r)return i;if(c.default.query(e,c.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,v({},e,t));else{if(0===r.length)return n.selection.format(e,t),i;i=n.editor.formatText(r.index,r.length,v({},e,t))}return n.setSelection(r,s.default.sources.SILENT),i},r)}},{key:"formatLine",value:function(e,t,n,r,o){var a=this,l=void 0,s=i(_(e,t,n,r,o),4);return e=s[0],t=s[1],l=s[2],x.call(this,function(){return a.editor.formatLine(e,t,l)},o=s[3],e,0)}},{key:"formatText",value:function(e,t,n,r,o){var a=this,l=void 0,s=i(_(e,t,n,r,o),4);return e=s[0],t=s[1],l=s[2],x.call(this,function(){return a.editor.formatText(e,t,l)},o=s[3],e,0)}},{key:"getBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"==typeof e?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=i(_(e,t),2);return e=n[0],t=n[1],this.editor.getContents(e,t)}},{key:"getFormat",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}},{key:"getIndex",value:function(e){return e.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(e){return this.scroll.leaf(e)}},{key:"getLine",value:function(e){return this.scroll.line(e)}},{key:"getLines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}},{key:"getModule",value:function(e){return this.theme.modules[e]}},{key:"getSelection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=i(_(e,t),2);return e=n[0],t=n[1],this.editor.getText(e,t)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.sources.API;return x.call(this,function(){return i.editor.insertEmbed(t,n,r)},o,t)}},{key:"insertText",value:function(e,t,n,r,o){var a=this,l=void 0,s=i(_(e,0,n,r,o),4);return e=s[0],l=s[2],x.call(this,function(){return a.editor.insertText(e,t,l)},o=s[3],e,t.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(e,t,n){this.clipboard.dangerouslyPasteHTML(e,t,n)}},{key:"removeFormat",value:function(e,t,n){var r=this,o=i(_(e,t,n),4);return e=o[0],t=o[1],x.call(this,function(){return r.editor.removeFormat(e,t)},n=o[3],e)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API;return x.call(this,function(){e=new a.default(e);var n=t.getLength(),r=t.editor.deleteText(0,n),i=t.editor.applyDelta(e),o=i.ops[i.ops.length-1];return null!=o&&"string"==typeof o.insert&&"\n"===o.insert[o.insert.length-1]&&(t.editor.deleteText(t.getLength()-1,1),i.delete(1)),r.compose(i)},n)}},{key:"setSelection",value:function(t,n,r){if(null==t)this.selection.setRange(null,n||e.sources.API);else{var o=i(_(t,n,r),4);t=o[0],n=o[1],r=o[3],this.selection.setRange(new d.Range(t,n),r),r!==s.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API,n=new a.default().insert(e);return this.setContents(n,t)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.default.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}},{key:"updateContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API;return x.call(this,function(){return e=new a.default(e),t.editor.applyDelta(e,n)},n,!0)}}]),e}();function w(e,t){if((t=(0,f.default)(!0,{container:e,modules:{clipboard:!0,keyboard:!0,history:!0}},t)).theme&&t.theme!==b.DEFAULTS.theme){if(t.theme=b.import("themes/"+t.theme),null==t.theme)throw Error("Invalid theme "+t.theme+". Did you register it?")}else t.theme=g.default;var n=(0,f.default)(!0,{},t.theme.DEFAULTS);[n,t].forEach(function(e){e.modules=e.modules||{},Object.keys(e.modules).forEach(function(t){!0===e.modules[t]&&(e.modules[t]={})})});var r=Object.keys(n.modules).concat(Object.keys(t.modules)).reduce(function(e,t){var n=b.import("modules/"+t);return null==n?y.error("Cannot load "+t+" module. Are you sure you registered it?"):e[t]=n.DEFAULTS||{},e},{});return null!=t.modules&&t.modules.toolbar&&t.modules.toolbar.constructor!==Object&&(t.modules.toolbar={container:t.modules.toolbar}),t=(0,f.default)(!0,{},b.DEFAULTS,{modules:r},n,t),["bounds","container","scrollingContainer"].forEach(function(e){"string"==typeof t[e]&&(t[e]=document.querySelector(t[e]))}),t.modules=Object.keys(t.modules).reduce(function(e,n){return t.modules[n]&&(e[n]=t.modules[n]),e},{}),t}function x(e,t,n,r){if(this.options.strict&&!this.isEnabled()&&t===s.default.sources.USER)return new a.default;var i=null==n?null:this.getSelection(),o=this.editor.delta,l=e();if(null!=i&&(!0===n&&(n=i.index),null==r?i=E(i,l,t):0!==r&&(i=E(i,n,r,t)),this.setSelection(i,s.default.sources.SILENT)),l.length()>0){var u,c,d=[s.default.events.TEXT_CHANGE,l,o,t];(u=this.emitter).emit.apply(u,[s.default.events.EDITOR_CHANGE].concat(d)),t!==s.default.sources.SILENT&&(c=this.emitter).emit.apply(c,d)}return l}function _(e,t,n,i,o){var a={};return"number"==typeof e.index&&"number"==typeof e.length?("number"!=typeof t&&(o=i,i=n,n=t),t=e.length,e=e.index):"number"!=typeof t&&(o=i,i=n,n=t,t=0),(void 0===n?"undefined":r(n))==="object"?(a=n,o=i):"string"==typeof n&&(null!=i?a[n]=i:o=n),[e,t,a,o=o||s.default.sources.API]}function E(e,t,n,r){if(null==e)return null;var o=void 0,l=void 0;if(t instanceof a.default){var u=i([e.index,e.index+e.length].map(function(e){return t.transformPosition(e,r!==s.default.sources.USER)}),2);o=u[0],l=u[1]}else{var c=i([e.index,e.index+e.length].map(function(e){return e<t||e===t&&r===s.default.sources.USER?e:n>=0?e+n:Math.max(t,e+n)}),2);o=c[0],l=c[1]}return new d.Range(o,l-o)}b.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},b.events=s.default.events,b.sources=s.default.sources,b.version="1.3.7",b.imports={delta:a.default,parchment:c.default,"core/module":u.default,"core/theme":g.default},t.expandConfig=w,t.overload=_,t.default=b},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=l(n(7)),a=l(n(0));function l(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"formatAt",value:function(e,n,r,o){if(0>t.compare(this.statics.blotName,r)&&a.default.query(r,a.default.Scope.BLOT)){var l=this.isolate(e,n);o&&l.wrap(r,o)}else i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,n,r,o)}},{key:"optimize",value:function(e){if(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.parent instanceof t&&t.compare(this.statics.blotName,this.parent.statics.blotName)>0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(e,n){var r=t.order.indexOf(e),i=t.order.indexOf(n);return r>=0||i>=0?r-i:e===n?0:e<n?-1:1}}]),t}(a.default.Inline);s.allowedChildren=[s,a.default.Embed,o.default],s.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],t.default=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(0))&&r.__esModule?r:{default:r}).default.Text);t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=a(n(54));function a(e){return e&&e.__esModule?e:{default:e}}var l=(0,a(n(10)).default)("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(function(e){document.addEventListener(e,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(e){if(e.__quill&&e.__quill.emitter){var n;(n=e.__quill.emitter).handleDOM.apply(n,t)}})})});var s=function(e){function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.listeners={},e.on("error",l.error),e}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"emit",value:function(){l.log.apply(l,arguments),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(this.listeners[e.type]||[]).forEach(function(t){var r=t.node,i=t.handler;(e.target===r||r.contains(e.target))&&i.apply(void 0,[e].concat(n))})}},{key:"listenDOM",value:function(e,t,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push({node:t,handler:n})}}]),t}(o.default);s.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},s.sources={API:"api",SILENT:"silent",USER:"user"},t.default=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.quill=t,this.options=n};r.DEFAULTS={},t.default=r},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=["error","warn","log","info"],i="warn";function o(e){if(r.indexOf(e)<=r.indexOf(i)){for(var t,n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];(t=console)[e].apply(t,o)}}function a(e){return r.reduce(function(t,n){return t[n]=o.bind(console,n,e),t},{})}o.level=a.level=function(e){i=e},t.default=a},function(e,t,n){var r=Array.prototype.slice,i=n(52),o=n(53),a=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():e&&t&&("object"==typeof e||"object"==typeof t)?function(e,t,n){if(null==e||null==t||e.prototype!==t.prototype)return!1;if(o(e))return!!o(t)&&a(e=r.call(e),t=r.call(t),n);if(l(e)){if(!l(t)||e.length!==t.length)return!1;for(s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}try{var s,u,c=i(e),d=i(t)}catch(e){return!1}if(c.length!=d.length)return!1;for(c.sort(),d.sort(),s=c.length-1;s>=0;s--)if(c[s]!=d[s])return!1;for(s=c.length-1;s>=0;s--)if(!a(e[u=c[s]],t[u],n))return!1;return typeof e==typeof t}(e,t,n):n.strict?e===t:e==t)};function l(e){return!!e&&"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.copy&&"function"==typeof e.slice&&(!(e.length>0)||"number"==typeof e[0])}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(e,t,n){void 0===n&&(n={}),this.attrName=e,this.keyName=t;var i=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|i:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return e.keys=function(e){return[].map.call(e.attributes,function(e){return e.name})},e.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)},e.prototype.canAdd=function(e,t){return null!=r.query(e,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1))},e.prototype.remove=function(e){e.removeAttribute(this.keyName)},e.prototype.value=function(e){var t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""},e}();t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Code=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=d(n(2)),l=d(n(0)),s=d(n(4)),u=d(n(6)),c=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function p(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=function(e){function t(){return h(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),t}(u.default);g.blotName="code",g.tagName="CODE";var m=function(e){function t(){return h(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),i(t,[{key:"delta",value:function(){var e=this,t=this.domNode.textContent;return t.endsWith("\n")&&(t=t.slice(0,-1)),t.split("\n").reduce(function(t,n){return t.insert(n).insert("\n",e.formats())},new a.default)}},{key:"format",value:function(e,n){if(e!==this.statics.blotName||!n){var i=r(this.descendant(c.default,this.length()-1),1)[0];null!=i&&i.deleteAt(i.length()-1,1),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}},{key:"formatAt",value:function(e,n,r,i){if(0!==n&&null!=l.default.query(r,l.default.Scope.BLOCK)&&(r!==this.statics.blotName||i!==this.statics.formats(this.domNode))){var o=this.newlineIndex(e);if(!(o<0)&&!(o>=e+n)){var a=this.newlineIndex(e,!0)+1,s=o-a+1,u=this.isolate(a,s),c=u.next;u.format(r,i),c instanceof t&&c.formatAt(0,e-a+n-s,r,i)}}}},{key:"insertAt",value:function(e,t,n){if(null==n){var i=r(this.descendant(c.default,e),2),o=i[0],a=i[1];o.insertAt(a,t)}}},{key:"length",value:function(){var e=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?e:e+1}},{key:"newlineIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t)return this.domNode.textContent.slice(0,e).lastIndexOf("\n");var n=this.domNode.textContent.slice(e).indexOf("\n");return n>-1?e+n:-1}},{key:"optimize",value:function(e){this.domNode.textContent.endsWith("\n")||this.appendChild(l.default.create("text","\n")),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(e),n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(e){var t=l.default.find(e);null==t?e.parentNode.removeChild(e):t instanceof l.default.Embed?t.remove():t.unwrap()})}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),t}(s.default);m.blotName="code-block",m.tagName="PRE",m.TAB=" ",t.Code=g,t.default=m},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=v(n(2)),l=v(n(20)),s=v(n(0)),u=v(n(13)),c=v(n(24)),d=n(4),h=v(d),f=v(n(16)),p=v(n(21)),g=v(n(11)),m=v(n(3));function v(e){return e&&e.__esModule?e:{default:e}}var y=/^[ -~]*$/,b=function(){function e(t){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.scroll=t,this.delta=this.getDelta()}return o(e,[{key:"applyDelta",value:function(e){var t=this,n=!1;this.scroll.update();var o=this.scroll.length();return this.scroll.batchStart(),(e=e.reduce(function(e,t){if(1===t.insert){var n=(0,p.default)(t.attributes);return delete n.image,e.insert({image:t.attributes.image},n)}if(null!=t.attributes&&(!0===t.attributes.list||!0===t.attributes.bullet)&&((t=(0,p.default)(t)).attributes.list?t.attributes.list="ordered":(t.attributes.list="bullet",delete t.attributes.bullet)),"string"==typeof t.insert){var r=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(r,t.attributes)}return e.push(t)},new a.default)).reduce(function(e,a){var u=a.retain||a.delete||a.insert.length||1,c=a.attributes||{};if(null!=a.insert){if("string"==typeof a.insert){var f=a.insert;f.endsWith("\n")&&n&&(n=!1,f=f.slice(0,-1)),e>=o&&!f.endsWith("\n")&&(n=!0),t.scroll.insertAt(e,f);var p=i(t.scroll.line(e),2),g=p[0],v=p[1],y=(0,m.default)({},(0,d.bubbleFormats)(g));if(g instanceof h.default){var b=i(g.descendant(s.default.Leaf,v),1)[0];y=(0,m.default)(y,(0,d.bubbleFormats)(b))}c=l.default.attributes.diff(y,c)||{}}else if("object"===r(a.insert)){var w=Object.keys(a.insert)[0];if(null==w)return e;t.scroll.insertAt(e,w,a.insert[w])}o+=u}return Object.keys(c).forEach(function(n){t.scroll.formatAt(e,u,n,c[n])}),e+u},0),e.reduce(function(e,n){return"number"==typeof n.delete?(t.scroll.deleteAt(e,n.delete),e):e+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(e)}},{key:"deleteText",value:function(e,t){return this.scroll.deleteAt(e,t),this.update(new a.default().retain(e).delete(t))}},{key:"formatLine",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(i){if(null==n.scroll.whitelist||n.scroll.whitelist[i]){var o=n.scroll.lines(e,Math.max(t,1)),a=t;o.forEach(function(t){var o=t.length();if(t instanceof u.default){var l=e-t.offset(n.scroll),s=t.newlineIndex(l+a)-l+1;t.formatAt(l,s,i,r[i])}else t.format(i,r[i]);a-=o})}}),this.scroll.optimize(),this.update(new a.default().retain(e).retain(t,(0,p.default)(r)))}},{key:"formatText",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(i){n.scroll.formatAt(e,t,i,r[i])}),this.update(new a.default().retain(e).retain(t,(0,p.default)(r)))}},{key:"getContents",value:function(e,t){return this.delta.slice(e,e+t)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(e,t){return e.concat(t.delta())},new a.default)}},{key:"getFormat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===t?this.scroll.path(e).forEach(function(e){var t=i(e,1)[0];t instanceof h.default?n.push(t):t instanceof s.default.Leaf&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(s.default.Leaf,e,t));var o=[n,r].map(function(e){if(0===e.length)return{};for(var t=(0,d.bubbleFormats)(e.shift());Object.keys(t).length>0;){var n=e.shift();if(null==n)break;t=function(e,t){return Object.keys(t).reduce(function(n,r){return null==e[r]||(t[r]===e[r]?n[r]=t[r]:Array.isArray(t[r])?0>t[r].indexOf(e[r])&&(n[r]=t[r].concat([e[r]])):n[r]=[t[r],e[r]]),n},{})}((0,d.bubbleFormats)(n),t)}return t});return m.default.apply(m.default,o)}},{key:"getText",value:function(e,t){return this.getContents(e,t).filter(function(e){return"string"==typeof e.insert}).map(function(e){return e.insert}).join("")}},{key:"insertEmbed",value:function(e,t,n){var r;return this.scroll.insertAt(e,t,n),this.update(new a.default().retain(e).insert((t in(r={})?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r)))}},{key:"insertText",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(r).forEach(function(i){n.scroll.formatAt(e,t.length,i,r[i])}),this.update(new a.default().retain(e).insert(t,(0,p.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var e=this.scroll.children.head;return e.statics.blotName===h.default.blotName&&!(e.children.length>1)&&e.children.head instanceof f.default}},{key:"removeFormat",value:function(e,t){var n=this.getText(e,t),r=i(this.scroll.line(e+t),2),o=r[0],l=r[1],s=0,c=new a.default;null!=o&&(s=o instanceof u.default?o.newlineIndex(l)-l+1:o.length()-l,c=o.delta().slice(l,l+s-1).insert("\n"));var d=this.getContents(e,t+s).diff(new a.default().insert(n).concat(c)),h=new a.default().retain(e).concat(d);return this.applyDelta(h)}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(y)&&s.default.find(t[0].target)){var i=s.default.find(t[0].target),o=(0,d.bubbleFormats)(i),l=i.offset(this.scroll),u=t[0].oldValue.replace(c.default.CONTENTS,""),h=new a.default().insert(u),f=new a.default().insert(i.value());e=new a.default().retain(l).concat(h.diff(f,n)).reduce(function(e,t){return t.insert?e.insert(t.insert,o):e.push(t)},new a.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),e&&(0,g.default)(r.compose(e),this.delta)||(e=r.diff(this.delta,n));return e}}]),e}();t.default=b},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Range=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(0)),a=u(n(21)),l=u(n(11)),s=u(n(8));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){if(!Array.isArray(e))return Array.from(e);for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}function d(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var h=(0,u(n(10)).default)("quill:selection"),f=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;d(this,e),this.index=t,this.length=n},p=function(){function e(t,n){var r=this;d(this,e),this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=o.default.create("cursor",this),this.lastRange=this.savedRange=new f(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){r.mouseDown||setTimeout(r.update.bind(r,s.default.sources.USER),1)}),this.emitter.on(s.default.events.EDITOR_CHANGE,function(e,t){e===s.default.events.TEXT_CHANGE&&t.length()>0&&r.update(s.default.sources.SILENT)}),this.emitter.on(s.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var e=r.getNativeRange();null!=e&&e.start.node!==r.cursor.textNode&&r.emitter.once(s.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset)}catch(e){}})}}),this.emitter.on(s.default.events.SCROLL_OPTIMIZE,function(e,t){if(t.range){var n=t.range,i=n.startNode,o=n.startOffset,a=n.endNode,l=n.endOffset;r.setNativeRange(i,o,a,l)}}),this.update(s.default.sources.SILENT)}return i(e,[{key:"handleComposition",value:function(){var e=this;this.root.addEventListener("compositionstart",function(){e.composing=!0}),this.root.addEventListener("compositionend",function(){if(e.composing=!1,e.cursor.parent){var t=e.cursor.restore();t&&setTimeout(function(){e.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}},{key:"handleDragging",value:function(){var e=this;this.emitter.listenDOM("mousedown",document.body,function(){e.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){e.mouseDown=!1,e.update(s.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(e,t){if(null==this.scroll.whitelist||this.scroll.whitelist[e]){this.scroll.update();var n=this.getNativeRange();if(!(null==n||!n.native.collapsed||o.default.query(e,o.default.Scope.BLOCK))){if(n.start.node!==this.cursor.textNode){var r=o.default.find(n.start.node,!1);if(null==r)return;if(r instanceof o.default.Leaf){var i=r.split(n.start.offset);r.parent.insertBefore(this.cursor,i)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min((e=Math.min(e,n-1))+t,n-1)-e;var i=void 0,o=r(this.scroll.leaf(e),2),a=o[0],l=o[1];if(null==a)return null;var s=r(a.position(l,!0),2);i=s[0],l=s[1];var u=document.createRange();if(t>0){u.setStart(i,l);var c=r(this.scroll.leaf(e+t),2);if(a=c[0],l=c[1],null==a)return null;var d=r(a.position(l,!0),2);return i=d[0],l=d[1],u.setEnd(i,l),u.getBoundingClientRect()}var h="left",f=void 0;return i instanceof Text?(l<i.data.length?(u.setStart(i,l),u.setEnd(i,l+1)):(u.setStart(i,l-1),u.setEnd(i,l),h="right"),f=u.getBoundingClientRect()):(f=a.domNode.getBoundingClientRect(),l>0&&(h="right")),{bottom:f.top+f.height,height:f.height,left:f[h],right:f[h],top:f.top,width:0}}},{key:"getNativeRange",value:function(){var e=document.getSelection();if(null==e||e.rangeCount<=0)return null;var t=e.getRangeAt(0);if(null==t)return null;var n=this.normalizeNative(t);return h.info("getNativeRange",n),n}},{key:"getRange",value:function(){var e=this.getNativeRange();return null==e?[null,null]:[this.normalizedToRange(e),e]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(e){var t=this,n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);var i=n.map(function(e){var n=r(e,2),i=n[0],a=n[1],l=o.default.find(i,!0),s=l.offset(t.scroll);return 0===a?s:l instanceof o.default.Container?s+l.length():s+l.index(i,a)}),a=Math.min(Math.max.apply(Math,c(i)),this.scroll.length()-1),l=Math.min.apply(Math,[a].concat(c(i)));return new f(l,a-l)}},{key:"normalizeNative",value:function(e){if(!g(this.root,e.startContainer)||!e.collapsed&&!g(this.root,e.endContainer))return null;var t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(function(e){for(var t=e.node,n=e.offset;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else if(t.childNodes.length===n)n=(t=t.lastChild)instanceof Text?t.data.length:t.childNodes.length+1;else break;e.node=t,e.offset=n}),t}},{key:"rangeToNative",value:function(e){var t=this,n=e.collapsed?[e.index]:[e.index,e.index+e.length],i=[],o=this.scroll.length();return n.forEach(function(e,n){e=Math.min(o-1,e);var a=void 0,l=r(t.scroll.leaf(e),2),s=l[0],u=l[1],c=r(s.position(u,0!==n),2);a=c[0],u=c[1],i.push(a,u)}),i.length<2&&(i=i.concat(i)),i}},{key:"scrollIntoView",value:function(e){var t=this.lastRange;if(null!=t){var n=this.getBounds(t.index,t.length);if(null!=n){var i=this.scroll.length()-1,o=r(this.scroll.line(Math.min(t.index,i)),1)[0],a=o;if(t.length>0&&(a=r(this.scroll.line(Math.min(t.index+t.length,i)),1)[0]),null!=o&&null!=a){var l=e.getBoundingClientRect();n.top<l.top?e.scrollTop-=l.top-n.top:n.bottom>l.bottom&&(e.scrollTop+=n.bottom-l.bottom)}}}}},{key:"setNativeRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(h.info("setNativeRange",e,t,n,r),null==e||null!=this.root.parentNode&&null!=e.parentNode&&null!=n.parentNode){var o=document.getSelection();if(null!=o){if(null!=e){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||i||e!==a.startContainer||t!==a.startOffset||n!==a.endContainer||r!==a.endOffset){"BR"==e.tagName&&(t=[].indexOf.call(e.parentNode.childNodes,e),e=e.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var l=document.createRange();l.setStart(e,t),l.setEnd(n,r),o.removeAllRanges(),o.addRange(l)}}else o.removeAllRanges(),this.root.blur(),document.body.focus()}}}},{key:"setRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.default.sources.API;if("string"==typeof t&&(n=t,t=!1),h.info("setRange",e),null!=e){var r=this.rangeToNative(e);this.setNativeRange.apply(this,c(r).concat([t]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.default.sources.USER,t=this.lastRange,n=r(this.getRange(),2),i=n[0],o=n[1];if(this.lastRange=i,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,l.default)(t,this.lastRange)){!this.composing&&null!=o&&o.native.collapsed&&o.start.node!==this.cursor.textNode&&this.cursor.restore();var u,c,d=[s.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(t),e];(u=this.emitter).emit.apply(u,[s.default.events.EDITOR_CHANGE].concat(d)),e!==s.default.sources.SILENT&&(c=this.emitter).emit.apply(c,d)}}}]),e}();function g(e,t){try{t.parentNode}catch(e){return!1}return t instanceof Text&&(t=t.parentNode),e.contains(t)}t.Range=f,t.default=p},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"insertInto",value:function(e,n){0===e.children.length?o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertInto",this).call(this,e,n):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),t}(((r=n(0))&&r.__esModule?r:{default:r}).default.Embed);a.blotName="break",a.tagName="BR",t.default=a},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(44),a=n(30),l=n(1),s=function(e){function t(t){var n=e.call(this,t)||this;return n.build(),n}return i(t,e),t.prototype.appendChild=function(e){this.insertBefore(e)},t.prototype.attach=function(){e.prototype.attach.call(this),this.children.forEach(function(e){e.attach()})},t.prototype.build=function(){var e=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(t){try{var n=u(t);e.insertBefore(n,e.children.head||void 0)}catch(e){if(e instanceof l.ParchmentError)return;throw e}})},t.prototype.deleteAt=function(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,function(e,t,n){e.deleteAt(t,n)})},t.prototype.descendant=function(e,n){var r=this.children.find(n),i=r[0],o=r[1];return null==e.blotName&&e(i)||null!=e.blotName&&i instanceof e?[i,o]:i instanceof t?i.descendant(e,o):[null,-1]},t.prototype.descendants=function(e,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var i=[],o=r;return this.children.forEachAt(n,r,function(n,r,a){(null==e.blotName&&e(n)||null!=e.blotName&&n instanceof e)&&i.push(n),n instanceof t&&(i=i.concat(n.descendants(e,r,o))),o-=a}),i},t.prototype.detach=function(){this.children.forEach(function(e){e.detach()}),e.prototype.detach.call(this)},t.prototype.formatAt=function(e,t,n,r){this.children.forEachAt(e,t,function(e,t,i){e.formatAt(t,i,n,r)})},t.prototype.insertAt=function(e,t,n){var r=this.children.find(e),i=r[0],o=r[1];if(i)i.insertAt(o,t,n);else{var a=null==n?l.create("text",t):l.create(t,n);this.appendChild(a)}},t.prototype.insertBefore=function(e,t){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(t){return e instanceof t}))throw new l.ParchmentError("Cannot insert "+e.statics.blotName+" into "+this.statics.blotName);e.insertInto(this,t)},t.prototype.length=function(){return this.children.reduce(function(e,t){return e+t.length()},0)},t.prototype.moveChildren=function(e,t){this.children.forEach(function(n){e.insertBefore(n,t)})},t.prototype.optimize=function(t){if(e.prototype.optimize.call(this,t),0===this.children.length){if(null!=this.statics.defaultChild){var n=l.create(this.statics.defaultChild);this.appendChild(n),n.optimize(t)}else this.remove()}},t.prototype.path=function(e,n){void 0===n&&(n=!1);var r=this.children.find(e,n),i=r[0],o=r[1],a=[[this,e]];return i instanceof t?a.concat(i.path(o,n)):(null!=i&&a.push([i,o]),a)},t.prototype.removeChild=function(e){this.children.remove(e)},t.prototype.replace=function(n){n instanceof t&&n.moveChildren(this),e.prototype.replace.call(this,n)},t.prototype.split=function(e,t){if(void 0===t&&(t=!1),!t){if(0===e)return this;if(e===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(e,this.length(),function(e,r,i){e=e.split(r,t),n.appendChild(e)}),n},t.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},t.prototype.update=function(e,t){var n=this,r=[],i=[];e.forEach(function(e){e.target===n.domNode&&"childList"===e.type&&(r.push.apply(r,e.addedNodes),i.push.apply(i,e.removedNodes))}),i.forEach(function(e){if(!(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var t=l.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===n.domNode)&&t.detach()}}),r.filter(function(e){return e.parentNode==n.domNode}).sort(function(e,t){return e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(e){var t=null;null!=e.nextSibling&&(t=l.find(e.nextSibling));var r=u(e);(r.next!=t||null==r.next)&&(null!=r.parent&&r.parent.removeChild(n),n.insertBefore(r,t||void 0))})},t}(a.default);function u(e){var t=l.find(e);if(null==t)try{t=l.create(e)}catch(n){t=l.create(l.Scope.INLINE),[].slice.call(e.childNodes).forEach(function(e){t.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(t.domNode,e),t.attach()}return t}t.default=s},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(12),a=n(31),l=n(17),s=n(1),u=function(e){function t(t){var n=e.call(this,t)||this;return n.attributes=new a.default(n.domNode),n}return i(t,e),t.formats=function(e){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?e.tagName.toLowerCase():void 0)},t.prototype.format=function(e,t){var n=s.query(e);n instanceof o.default?this.attributes.attribute(n,t):t&&null!=n&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)},t.prototype.formats=function(){var e=this.attributes.values(),t=this.statics.formats(this.domNode);return null!=t&&(e[this.statics.blotName]=t),e},t.prototype.replaceWith=function(t,n){var r=e.prototype.replaceWith.call(this,t,n);return this.attributes.copy(r),r},t.prototype.update=function(t,n){var r=this;e.prototype.update.call(this,t,n),t.some(function(e){return e.target===r.domNode&&"attributes"===e.type})&&this.attributes.build()},t.prototype.wrap=function(n,r){var i=e.prototype.wrap.call(this,n,r);return i instanceof t&&i.statics.scope===this.statics.scope&&this.attributes.move(i),i},t}(l.default);t.default=u},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(30),a=n(1),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.value=function(e){return!0},t.prototype.index=function(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1},t.prototype.position=function(e,t){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]},t.prototype.value=function(){var e;return(e={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,e},t.scope=a.Scope.INLINE_BLOT,t}(o.default);t.default=l},function(e,t,n){var r=n(11),i=n(3),o={attributes:{compose:function(e,t,n){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var r=i(!0,{},t);for(var o in n||(r=Object.keys(r).reduce(function(e,t){return null!=r[t]&&(e[t]=r[t]),e},{})),e)void 0!==e[o]&&void 0===t[o]&&(r[o]=e[o]);return Object.keys(r).length>0?r:void 0},diff:function(e,t){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var n=Object.keys(e).concat(Object.keys(t)).reduce(function(n,i){return r(e[i],t[i])||(n[i]=void 0===t[i]?null:t[i]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(e,t,n){if("object"!=typeof e)return t;if("object"==typeof t){if(!n)return t;var r=Object.keys(t).reduce(function(n,r){return void 0===e[r]&&(n[r]=t[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(e){return new a(e)},length:function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"string"==typeof e.insert?e.insert.length:1}};function a(e){this.ops=e,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(e){e||(e=1/0);var t=this.ops[this.index];if(!t)return{retain:1/0};var n=this.offset,r=o.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};var i={};return t.attributes&&(i.attributes=t.attributes),"number"==typeof t.retain?i.retain=e:"string"==typeof t.insert?i.insert=t.insert.substr(n,e):i.insert=t.insert,i},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},a.prototype.peekType=function(){if(this.ops[this.index]){if("number"==typeof this.ops[this.index].delete)return"delete";if("number"!=typeof this.ops[this.index].retain)return"insert"}return"retain"},a.prototype.rest=function(){if(!this.hasNext())return[];if(0===this.offset)return this.ops.slice(this.index);var e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)},e.exports=o},function(e,t){var n=function(){var e,t,n;function r(e,t){return null!=t&&e instanceof t}try{e=Map}catch(t){e=function(){}}try{t=Set}catch(e){t=function(){}}try{n=Promise}catch(e){n=function(){}}function i(o,l,s,u,c){"object"==typeof l&&(s=l.depth,u=l.prototype,c=l.includeNonEnumerable,l=l.circular);var d=[],h=[];return void 0===l&&(l=!0),void 0===s&&(s=1/0),function o(s,f){if(null===s)return null;if(0===f||"object"!=typeof s)return s;if(r(s,e))p=new e;else if(r(s,t))p=new t;else if(r(s,n))p=new n(function(e,t){s.then(function(t){e(o(t,f-1))},function(e){t(o(e,f-1))})});else if(i.__isArray(s))p=[];else if(i.__isRegExp(s))p=new RegExp(s.source,a(s)),s.lastIndex&&(p.lastIndex=s.lastIndex);else if(i.__isDate(s))p=new Date(s.getTime());else{if(ov.isBuffer(s))return p=ov.allocUnsafe?ov.allocUnsafe(s.length):new ov(s.length),s.copy(p),p;r(s,Error)?p=Object.create(s):void 0===u?p=Object.create(g=Object.getPrototypeOf(s)):(p=Object.create(u),g=u)}if(l){var p,g,m,v=d.indexOf(s);if(-1!=v)return h[v];d.push(s),h.push(p)}for(var y in r(s,e)&&s.forEach(function(e,t){var n=o(t,f-1),r=o(e,f-1);p.set(n,r)}),r(s,t)&&s.forEach(function(e){var t=o(e,f-1);p.add(t)}),s)g&&(m=Object.getOwnPropertyDescriptor(g,y)),m&&null==m.set||(p[y]=o(s[y],f-1));if(Object.getOwnPropertySymbols)for(var b=Object.getOwnPropertySymbols(s),y=0;y<b.length;y++){var w=b[y],x=Object.getOwnPropertyDescriptor(s,w);(!x||x.enumerable||c)&&(p[w]=o(s[w],f-1),x.enumerable||Object.defineProperty(p,w,{enumerable:!1}))}if(c)for(var _=Object.getOwnPropertyNames(s),y=0;y<_.length;y++){var E=_[y],x=Object.getOwnPropertyDescriptor(s,E);x&&x.enumerable||(p[E]=o(s[E],f-1),Object.defineProperty(p,E,{enumerable:!1}))}return p}(o,s)}function o(e){return Object.prototype.toString.call(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return i.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},i.__objToStr=o,i.__isDate=function(e){return"object"==typeof e&&"[object Date]"===o(e)},i.__isArray=function(e){return"object"==typeof e&&"[object Array]"===o(e)},i.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===o(e)},i.__getRegExpFlags=a,i}();"object"==typeof e&&e.exports&&(e.exports=n)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=f(n(0)),l=f(n(8)),s=n(4),u=f(s),c=f(n(16)),d=f(n(13)),h=f(n(25));function f(e){return e&&e.__esModule?e:{default:e}}function p(e){return e instanceof u.default||e instanceof s.BlockEmbed}var g=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.emitter=n.emitter,Array.isArray(n.whitelist)&&(r.whitelist=n.whitelist.reduce(function(e,t){return e[t]=!0,e},{})),r.domNode.addEventListener("DOMNodeInserted",function(){}),r.optimize(),r.enable(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(e,n){var i=r(this.line(e),2),a=i[0],l=i[1],u=r(this.line(e+n),1)[0];if(o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"deleteAt",this).call(this,e,n),null!=u&&a!==u&&l>0){if(a instanceof s.BlockEmbed||u instanceof s.BlockEmbed){this.optimize();return}if(a instanceof d.default){var h=a.newlineIndex(a.length(),!0);if(h>-1&&(a=a.split(h+1))===u){this.optimize();return}}else if(u instanceof d.default){var f=u.newlineIndex(0);f>-1&&u.split(f+1)}var p=u.children.head instanceof c.default?null:u.children.head;a.moveChildren(u,p),a.remove()}this.optimize()}},{key:"enable",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.domNode.setAttribute("contenteditable",e)}},{key:"formatAt",value:function(e,n,r,i){(null==this.whitelist||this.whitelist[r])&&(o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,n,r,i),this.optimize())}},{key:"insertAt",value:function(e,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(e>=this.length()){if(null==r||null==a.default.query(n,a.default.Scope.BLOCK)){var i=a.default.create(this.statics.defaultChild);this.appendChild(i),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),i.insertAt(0,n,r)}else{var l=a.default.create(n,r);this.appendChild(l)}}else o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,r);this.optimize()}}},{key:"insertBefore",value:function(e,n){if(e.statics.scope===a.default.Scope.INLINE_BLOT){var r=a.default.create(this.statics.defaultChild);r.appendChild(e),e=r}o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n)}},{key:"leaf",value:function(e){return this.path(e).pop()||[null,-1]}},{key:"line",value:function(e){return e===this.length()?this.line(e-1):this.descendant(p,e)}},{key:"lines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return function e(t,n,r){var i=[],o=r;return t.children.forEachAt(n,r,function(t,n,r){p(t)?i.push(t):t instanceof a.default.Container&&(i=i.concat(e(t,n,o))),o-=r}),i}(this,e,t)}},{key:"optimize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e,n),e.length>0&&this.emitter.emit(l.default.events.SCROLL_OPTIMIZE,e,n))}},{key:"path",value:function(e){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,e).slice(1)}},{key:"update",value:function(e){if(!0!==this.batch){var n=l.default.sources.USER;"string"==typeof e&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e.length>0&&this.emitter.emit(l.default.events.SCROLL_BEFORE_UPDATE,n,e),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"update",this).call(this,e.concat([])),e.length>0&&this.emitter.emit(l.default.events.SCROLL_UPDATE,n,e)}}}]),t}(a.default.Scroll);g.blotName="scroll",g.className="ql-editor",g.tagName="DIV",g.defaultChild="block",g.allowedChildren=[u.default,s.BlockEmbed,h.default],t.default=g},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SHORTKEY=t.default=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=g(n(21)),l=g(n(11)),s=g(n(3)),u=g(n(2)),c=g(n(20)),d=g(n(0)),h=g(n(5)),f=g(n(10)),p=g(n(9));function g(e){return e&&e.__esModule?e:{default:e}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=(0,f.default)("quill:keyboard"),y=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",b=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.bindings={},Object.keys(r.options.bindings).forEach(function(t){("list autofill"!==t||null==e.scroll.whitelist||e.scroll.whitelist.list)&&r.options.bindings[t]&&r.addBinding(r.options.bindings[t])}),r.addBinding({key:t.keys.ENTER,shiftKey:null},S),r.addBinding({key:t.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(r.addBinding({key:t.keys.BACKSPACE},{collapsed:!0},x),r.addBinding({key:t.keys.DELETE},{collapsed:!0},_)):(r.addBinding({key:t.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},x),r.addBinding({key:t.keys.DELETE},{collapsed:!0,suffix:/^.?$/},_)),r.addBinding({key:t.keys.BACKSPACE},{collapsed:!1},E),r.addBinding({key:t.keys.DELETE},{collapsed:!1},E),r.addBinding({key:t.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},x),r.listen(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,null,[{key:"match",value:function(e,t){return t=k(t),!["altKey","ctrlKey","metaKey","shiftKey"].some(function(n){return!!t[n]!==e[n]&&null!==t[n]})&&t.key===(e.which||e.keyCode)}}]),o(t,[{key:"addBinding",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=k(e);if(null==r||null==r.key)return v.warn("Attempted to add invalid keyboard binding",r);"function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n}),r=(0,s.default)(r,t,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var e=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var o=n.which||n.keyCode,a=(e.bindings[o]||[]).filter(function(e){return t.match(n,e)});if(0!==a.length){var s=e.quill.getSelection();if(null!=s&&e.quill.hasFocus()){var u=i(e.quill.getLine(s.index),2),c=u[0],h=u[1],f=i(e.quill.getLeaf(s.index),2),p=f[0],g=f[1],m=i(0===s.length?[p,g]:e.quill.getLeaf(s.index+s.length),2),v=m[0],y=m[1],b=p instanceof d.default.Text?p.value().slice(0,g):"",w=v instanceof d.default.Text?v.value().slice(y):"",x={collapsed:0===s.length,empty:0===s.length&&1>=c.length(),format:e.quill.getFormat(s),offset:h,prefix:b,suffix:w};a.some(function(t){if(null!=t.collapsed&&t.collapsed!==x.collapsed||null!=t.empty&&t.empty!==x.empty||null!=t.offset&&t.offset!==x.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(function(e){return null==x.format[e]}))return!1}else if("object"===r(t.format)&&!Object.keys(t.format).every(function(e){return!0===t.format[e]?null!=x.format[e]:!1===t.format[e]?null==x.format[e]:(0,l.default)(t.format[e],x.format[e])}))return!1;return!!((null==t.prefix||t.prefix.test(x.prefix))&&(null==t.suffix||t.suffix.test(x.suffix)))&&!0!==t.handler.call(e,s,x)})&&n.preventDefault()}}}})}}]),t}(p.default);function w(e,t){var n,r=e===b.keys.LEFT?"prefix":"suffix";return m(n={key:e,shiftKey:t,altKey:null},r,/^$/),m(n,"handler",function(n){var r=n.index;return e===b.keys.RIGHT&&(r+=n.length+1),!(i(this.quill.getLeaf(r),1)[0]instanceof d.default.Embed)||(e===b.keys.LEFT?t?this.quill.setSelection(n.index-1,n.length+1,h.default.sources.USER):this.quill.setSelection(n.index-1,h.default.sources.USER):t?this.quill.setSelection(n.index,n.length+1,h.default.sources.USER):this.quill.setSelection(n.index+n.length+1,h.default.sources.USER),!1)}),n}function x(e,t){if(!(0===e.index||1>=this.quill.getLength())){var n=i(this.quill.getLine(e.index),1)[0],r={};if(0===t.offset){var o=i(this.quill.getLine(e.index-1),1)[0];if(null!=o&&o.length()>1){var a=n.formats(),l=this.quill.getFormat(e.index-1,1);r=c.default.attributes.diff(a,l)||{}}}var s=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;this.quill.deleteText(e.index-s,s,h.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(e.index-s,s,r,h.default.sources.USER),this.quill.focus()}}function _(e,t){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(!(e.index>=this.quill.getLength()-n)){var r={},o=0,a=i(this.quill.getLine(e.index),1)[0];if(t.offset>=a.length()-1){var l=i(this.quill.getLine(e.index+1),1)[0];if(l){var s=a.formats(),u=this.quill.getFormat(e.index,1);r=c.default.attributes.diff(s,u)||{},o=l.length()}}this.quill.deleteText(e.index,n,h.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(e.index+o-1,n,r,h.default.sources.USER)}}function E(e){var t=this.quill.getLines(e),n={};if(t.length>1){var r=t[0].formats(),i=t[t.length-1].formats();n=c.default.attributes.diff(i,r)||{}}this.quill.deleteText(e,h.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(e.index,1,n,h.default.sources.USER),this.quill.setSelection(e.index,h.default.sources.SILENT),this.quill.focus()}function S(e,t){var n=this;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);var r=Object.keys(t.format).reduce(function(e,n){return d.default.query(n,d.default.Scope.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e},{});this.quill.insertText(e.index,"\n",r,h.default.sources.USER),this.quill.setSelection(e.index+1,h.default.sources.SILENT),this.quill.focus(),Object.keys(t.format).forEach(function(e){null!=r[e]||Array.isArray(t.format[e])||"link"===e||n.quill.format(e,t.format[e],h.default.sources.USER)})}function O(e){return{key:b.keys.TAB,shiftKey:!e,format:{"code-block":!0},handler:function(t){var n=d.default.query("code-block"),r=t.index,o=t.length,a=i(this.quill.scroll.descendant(n,r),2),l=a[0],s=a[1];if(null!=l){var u=this.quill.getIndex(l),c=l.newlineIndex(s,!0)+1,f=l.newlineIndex(u+s+o),p=l.domNode.textContent.slice(c,f).split("\n");s=0,p.forEach(function(t,i){e?(l.insertAt(c+s,n.TAB),s+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):t.startsWith(n.TAB)&&(l.deleteAt(c+s,n.TAB.length),s-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),s+=t.length+1}),this.quill.update(h.default.sources.USER),this.quill.setSelection(r,o,h.default.sources.SILENT)}}}}function C(e){return{key:e[0].toUpperCase(),shortKey:!0,handler:function(t,n){this.quill.format(e,!n.format[e],h.default.sources.USER)}}}function k(e){if("string"==typeof e||"number"==typeof e)return k({key:e});if((void 0===e?"undefined":r(e))==="object"&&(e=(0,a.default)(e,!1)),"string"==typeof e.key){if(null!=b.keys[e.key.toUpperCase()])e.key=b.keys[e.key.toUpperCase()];else{if(1!==e.key.length)return null;e.key=e.key.toUpperCase().charCodeAt(0)}}return e.shortKey&&(e[y]=e.shortKey,delete e.shortKey),e}b.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},b.DEFAULTS={bindings:{bold:C("bold"),italic:C("italic"),underline:C("underline"),indent:{key:b.keys.TAB,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","+1",h.default.sources.USER)}},outdent:{key:b.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","-1",h.default.sources.USER)}},"outdent backspace":{key:b.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(e,t){null!=t.format.indent?this.quill.format("indent","-1",h.default.sources.USER):null!=t.format.list&&this.quill.format("list",!1,h.default.sources.USER)}},"indent code-block":O(!0),"outdent code-block":O(!1),"remove tab":{key:b.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(e){this.quill.deleteText(e.index-1,1,h.default.sources.USER)}},tab:{key:b.keys.TAB,handler:function(e){this.quill.history.cutoff();var t=new u.default().retain(e.index).delete(e.length).insert(" ");this.quill.updateContents(t,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,h.default.sources.SILENT)}},"list empty enter":{key:b.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(e,t){this.quill.format("list",!1,h.default.sources.USER),t.format.indent&&this.quill.format("indent",!1,h.default.sources.USER)}},"checklist enter":{key:b.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(e){var t=i(this.quill.getLine(e.index),2),n=t[0],r=t[1],o=(0,s.default)({},n.formats(),{list:"checked"}),a=new u.default().retain(e.index).insert("\n",o).retain(n.length()-r-1).retain(1,{list:"unchecked"});this.quill.updateContents(a,h.default.sources.USER),this.quill.setSelection(e.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:b.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(e,t){var n=i(this.quill.getLine(e.index),2),r=n[0],o=n[1],a=new u.default().retain(e.index).insert("\n",t.format).retain(r.length()-o-1).retain(1,{header:null});this.quill.updateContents(a,h.default.sources.USER),this.quill.setSelection(e.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(e,t){var n=t.prefix.length,r=i(this.quill.getLine(e.index),2),o=r[0],a=r[1];if(a>n)return!0;var l=void 0;switch(t.prefix.trim()){case"[]":case"[ ]":l="unchecked";break;case"[x]":l="checked";break;case"-":case"*":l="bullet";break;default:l="ordered"}this.quill.insertText(e.index," ",h.default.sources.USER),this.quill.history.cutoff();var s=new u.default().retain(e.index-a).delete(n+1).retain(o.length()-2-a).retain(1,{list:l});this.quill.updateContents(s,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,h.default.sources.SILENT)}},"code exit":{key:b.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(e){var t=i(this.quill.getLine(e.index),2),n=t[0],r=t[1],o=new u.default().retain(e.index+n.length()-r-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(o,h.default.sources.USER)}},"embed left":w(b.keys.LEFT,!1),"embed left shift":w(b.keys.LEFT,!0),"embed right":w(b.keys.RIGHT,!1),"embed right shift":w(b.keys.RIGHT,!0)}},t.default=b,t.SHORTKEY=y},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=s(n(0)),l=s(n(7));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.selection=n,r.textNode=document.createTextNode(t.CONTENTS),r.domNode.appendChild(r.textNode),r._length=0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,null,[{key:"value",value:function(){}}]),o(t,[{key:"detach",value:function(){null!=this.parent&&this.parent.removeChild(this)}},{key:"format",value:function(e,n){if(0!==this._length)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n);for(var r=this,o=0;null!=r&&r.statics.scope!==a.default.Scope.BLOCK_BLOT;)o+=r.offset(r.parent),r=r.parent;null!=r&&(this._length=t.CONTENTS.length,r.optimize(),r.formatAt(o,t.CONTENTS.length,e,n),this._length=0)}},{key:"index",value:function(e,n){return e===this.textNode?0:i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"index",this).call(this,e,n)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!this.selection.composing&&null!=this.parent){var e=this.textNode,n=this.selection.getNativeRange(),i=void 0,o=void 0,s=void 0;if(null!=n&&n.start.node===e&&n.end.node===e){var u=[e,n.start.offset,n.end.offset];i=u[0],o=u[1],s=u[2]}for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==t.CONTENTS){var c=this.textNode.data.split(t.CONTENTS).join("");this.next instanceof l.default?(i=this.next.domNode,this.next.insertAt(0,c),this.textNode.data=t.CONTENTS):(this.textNode.data=c,this.parent.insertBefore(a.default.create(this.textNode),this),this.textNode=document.createTextNode(t.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),null!=o){var d=r([o,s].map(function(e){return Math.max(0,Math.min(i.data.length,e-1))}),2);return o=d[0],s=d[1],{startNode:i,startOffset:o,endNode:i,endOffset:s}}}}},{key:"update",value:function(e,t){var n=this;if(e.some(function(e){return"characterData"===e.type&&e.target===n.textNode})){var r=this.restore();r&&(t.range=r)}}},{key:"value",value:function(){return""}}]),t}(a.default.Embed);u.blotName="cursor",u.className="ql-cursor",u.tagName="span",u.CONTENTS="\uFEFF",t.default=u},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=n(4),o=a(i);function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(r.default.Container);l.allowedChildren=[o.default,i.BlockEmbed,l],t.default=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorStyle=t.ColorClass=t.ColorAttributor=void 0;var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=(r=n(0))&&r.__esModule?r:{default:r},l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"value",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e);return n.startsWith("rgb(")?"#"+(n=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"")).split(",").map(function(e){return("00"+parseInt(e).toString(16)).slice(-2)}).join(""):n}}]),t}(a.default.Attributor.Style),s=new a.default.Attributor.Class("color","ql-color",{scope:a.default.Scope.INLINE}),u=new l("color","color",{scope:a.default.Scope.INLINE});t.ColorAttributor=l,t.ColorClass=s,t.ColorStyle=u},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sanitize=t.default=void 0;var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"format",value:function(e,n){if(e!==this.statics.blotName||!n)return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n);n=this.constructor.sanitize(n),this.domNode.setAttribute("href",n)}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return e=this.sanitize(e),n.setAttribute("href",e),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}},{key:"formats",value:function(e){return e.getAttribute("href")}},{key:"sanitize",value:function(e){return l(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}}]),t}(((r=n(6))&&r.__esModule?r:{default:r}).default);function l(e,t){var n=document.createElement("a");n.href=e;var r=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(r)>-1}a.blotName="link",a.tagName="A",a.SANITIZED_URL="about:blank",a.PROTOCOL_WHITELIST=["http","https","mailto","tel"],t.default=a,t.sanitize=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=l(n(23)),a=l(n(107));function l(e){return e&&e.__esModule?e:{default:e}}var s=0;function u(e,t){e.setAttribute(t,"true"!==e.getAttribute(t))}var c=function(){function e(t){var n=this;(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){n.togglePicker()}),this.label.addEventListener("keydown",function(e){switch(e.keyCode){case o.default.keys.ENTER:n.togglePicker();break;case o.default.keys.ESCAPE:n.escape(),e.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}return i(e,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),u(this.label,"aria-expanded"),u(this.options,"aria-hidden")}},{key:"buildItem",value:function(e){var t=this,n=document.createElement("span");return n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item"),e.hasAttribute("value")&&n.setAttribute("data-value",e.getAttribute("value")),e.textContent&&n.setAttribute("data-label",e.textContent),n.addEventListener("click",function(){t.selectItem(n,!0)}),n.addEventListener("keydown",function(e){switch(e.keyCode){case o.default.keys.ENTER:t.selectItem(n,!0),e.preventDefault();break;case o.default.keys.ESCAPE:t.escape(),e.preventDefault()}}),n}},{key:"buildLabel",value:function(){var e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=a.default,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}},{key:"buildOptions",value:function(){var e=this,t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id="ql-picker-options-"+s,s+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,[].slice.call(this.select.options).forEach(function(n){var r=e.buildItem(n);t.appendChild(r),!0===n.selected&&e.selectItem(r)}),this.container.appendChild(t)}},{key:"buildPicker",value:function(){var e=this;[].slice.call(this.select.attributes).forEach(function(t){e.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var e=this;this.close(),setTimeout(function(){return e.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(e.parentNode.children,e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if(("undefined"==typeof Event?"undefined":r(Event))==="object"){var i=document.createEvent("Event");i.initEvent("change",!0,!0),this.select.dispatchEvent(i)}this.close()}}},{key:"update",value:function(){var e=void 0;if(this.select.selectedIndex>-1){var t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);var n=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),e}();t.default=c},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(0)),i=v(n(5)),o=n(4),a=v(o),l=v(n(16)),s=v(n(25)),u=v(n(24)),c=v(n(35)),d=v(n(6)),h=v(n(22)),f=v(n(7)),p=v(n(55)),g=v(n(42)),m=v(n(23));function v(e){return e&&e.__esModule?e:{default:e}}i.default.register({"blots/block":a.default,"blots/block/embed":o.BlockEmbed,"blots/break":l.default,"blots/container":s.default,"blots/cursor":u.default,"blots/embed":c.default,"blots/inline":d.default,"blots/scroll":h.default,"blots/text":f.default,"modules/clipboard":p.default,"modules/history":g.default,"modules/keyboard":m.default}),r.default.register(a.default,l.default,u.default,d.default,h.default,f.default),t.default=i.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(e){this.domNode=e,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(e.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),e.create=function(e){var t;if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");return Array.isArray(this.tagName)?("string"==typeof e&&parseInt(e=e.toUpperCase()).toString()===e&&(e=parseInt(e)),t="number"==typeof e?document.createElement(this.tagName[e-1]):this.tagName.indexOf(e)>-1?document.createElement(e):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t},e.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},e.prototype.clone=function(){var e=this.domNode.cloneNode(!1);return r.create(e)},e.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},e.prototype.deleteAt=function(e,t){this.isolate(e,t).remove()},e.prototype.formatAt=function(e,t,n,i){var o=this.isolate(e,t);if(null!=r.query(n,r.Scope.BLOT)&&i)o.wrap(n,i);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var a=r.create(this.statics.scope);o.wrap(a),a.format(n,i)}},e.prototype.insertAt=function(e,t,n){var i=null==n?r.create("text",t):r.create(t,n),o=this.split(e);this.parent.insertBefore(i,o)},e.prototype.insertInto=function(e,t){void 0===t&&(t=null),null!=this.parent&&this.parent.children.remove(this);var n=null;e.children.insertBefore(this,t),null!=t&&(n=t.domNode),(this.domNode.parentNode!=e.domNode||this.domNode.nextSibling!=n)&&e.domNode.insertBefore(this.domNode,n),this.parent=e,this.attach()},e.prototype.isolate=function(e,t){var n=this.split(e);return n.split(t),n},e.prototype.length=function(){return 1},e.prototype.offset=function(e){return(void 0===e&&(e=this.parent),null==this.parent||this==e)?0:this.parent.children.offset(this)+this.parent.offset(e)},e.prototype.optimize=function(e){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},e.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},e.prototype.replace=function(e){null!=e.parent&&(e.parent.insertBefore(this,e.next),e.remove())},e.prototype.replaceWith=function(e,t){var n="string"==typeof e?r.create(e,t):e;return n.replace(this),n},e.prototype.split=function(e,t){return 0===e?this:this.next},e.prototype.update=function(e,t){},e.prototype.wrap=function(e,t){var n="string"==typeof e?r.create(e,t):e;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},e.blotName="abstract",e}();t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(32),o=n(33),a=n(1),l=function(){function e(e){this.attributes={},this.domNode=e,this.build()}return e.prototype.attribute=function(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])},e.prototype.build=function(){var e=this;this.attributes={};var t=r.default.keys(this.domNode),n=i.default.keys(this.domNode),l=o.default.keys(this.domNode);t.concat(n).concat(l).forEach(function(t){var n=a.query(t,a.Scope.ATTRIBUTE);n instanceof r.default&&(e.attributes[n.attrName]=n)})},e.prototype.copy=function(e){var t=this;Object.keys(this.attributes).forEach(function(n){var r=t.attributes[n].value(t.domNode);e.format(n,r)})},e.prototype.move=function(e){var t=this;this.copy(e),Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)}),this.attributes={}},e.prototype.values=function(){var e=this;return Object.keys(this.attributes).reduce(function(t,n){return t[n]=e.attributes[n].value(e.domNode),t},{})},e}();t.default=l},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function o(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(function(e){return 0===e.indexOf(t+"-")})}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.keys=function(e){return(e.getAttribute("class")||"").split(/\s+/).map(function(e){return e.split("-").slice(0,-1).join("-")})},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(this.keyName+"-"+t),!0)},t.prototype.remove=function(e){o(e,this.keyName).forEach(function(t){e.classList.remove(t)}),0===e.classList.length&&e.removeAttribute("class")},t.prototype.value=function(e){var t=(o(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=a},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function o(e){var t=e.split("-"),n=t.slice(1).map(function(e){return e[0].toUpperCase()+e.slice(1)}).join("");return t[0]+n}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.keys=function(e){return(e.getAttribute("style")||"").split(";").map(function(e){return e.split(":")[0].trim()})},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.style[o(this.keyName)]=t,!0)},t.prototype.remove=function(e){e.style[o(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")},t.prototype.value=function(e){var t=e.style[o(this.keyName)];return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.quill=t,this.options=n,this.modules={}}return r(e,[{key:"init",value:function(){var e=this;Object.keys(this.options.modules).forEach(function(t){null==e.modules[t]&&e.addModule(t)})}},{key:"addModule",value:function(e){var t=this.quill.constructor.import("modules/"+e);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}]),e}();i.DEFAULTS={modules:{}},i.themes={default:i},t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=l(n(0)),a=l(n(7));function l(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.contentNode=document.createElement("span"),n.contentNode.setAttribute("contenteditable",!1),[].slice.call(n.domNode.childNodes).forEach(function(e){n.contentNode.appendChild(e)}),n.leftGuard=document.createTextNode("\uFEFF"),n.rightGuard=document.createTextNode("\uFEFF"),n.domNode.appendChild(n.leftGuard),n.domNode.appendChild(n.contentNode),n.domNode.appendChild(n.rightGuard),n}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"index",value:function(e,n){return e===this.leftGuard?0:e===this.rightGuard?1:i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"index",this).call(this,e,n)}},{key:"restore",value:function(e){var t=void 0,n=void 0,r=e.data.split("\uFEFF").join("");if(e===this.leftGuard){if(this.prev instanceof a.default){var i=this.prev.length();this.prev.insertAt(i,r),t={startNode:this.prev.domNode,startOffset:i+r.length}}else n=document.createTextNode(r),this.parent.insertBefore(o.default.create(n),this),t={startNode:n,startOffset:r.length}}else e===this.rightGuard&&(this.next instanceof a.default?(this.next.insertAt(0,r),t={startNode:this.next.domNode,startOffset:r.length}):(n=document.createTextNode(r),this.parent.insertBefore(o.default.create(n),this.next),t={startNode:n,startOffset:r.length}));return e.data="\uFEFF",t}},{key:"update",value:function(e,t){var n=this;e.forEach(function(e){if("characterData"===e.type&&(e.target===n.leftGuard||e.target===n.rightGuard)){var r=n.restore(e.target);r&&(t.range=r)}})}}]),t}(o.default.Embed);t.default=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.AlignStyle=t.AlignClass=t.AlignAttribute=void 0;var r,i=(r=n(0))&&r.__esModule?r:{default:r},o={scope:i.default.Scope.BLOCK,whitelist:["right","center","justify"]},a=new i.default.Attributor.Attribute("align","align",o),l=new i.default.Attributor.Class("align","ql-align",o),s=new i.default.Attributor.Style("align","text-align",o);t.AlignAttribute=a,t.AlignClass=l,t.AlignStyle=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.BackgroundStyle=t.BackgroundClass=void 0;var r,i=(r=n(0))&&r.__esModule?r:{default:r},o=n(26),a=new i.default.Attributor.Class("background","ql-bg",{scope:i.default.Scope.INLINE}),l=new o.ColorAttributor("background","background-color",{scope:i.default.Scope.INLINE});t.BackgroundClass=a,t.BackgroundStyle=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.DirectionStyle=t.DirectionClass=t.DirectionAttribute=void 0;var r,i=(r=n(0))&&r.__esModule?r:{default:r},o={scope:i.default.Scope.BLOCK,whitelist:["rtl"]},a=new i.default.Attributor.Attribute("direction","dir",o),l=new i.default.Attributor.Class("direction","ql-direction",o),s=new i.default.Attributor.Style("direction","direction",o);t.DirectionAttribute=a,t.DirectionClass=l,t.DirectionStyle=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.FontClass=t.FontStyle=void 0;var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=(r=n(0))&&r.__esModule?r:{default:r},l={scope:a.default.Scope.INLINE,whitelist:["serif","monospace"]},s=new a.default.Attributor.Class("font","ql-font",l),u=new(function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"value",value:function(e){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e).replace(/["']/g,"")}}]),t}(a.default.Attributor.Style))("font","font-family",l);t.FontStyle=u,t.FontClass=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SizeStyle=t.SizeClass=void 0;var r,i=(r=n(0))&&r.__esModule?r:{default:r},o=new i.default.Attributor.Class("size","ql-size",{scope:i.default.Scope.INLINE,whitelist:["small","large","huge"]}),a=new i.default.Attributor.Style("size","font-size",{scope:i.default.Scope.INLINE,whitelist:["10px","18px","32px"]});t.SizeClass=o,t.SizeStyle=a},function(e,t,n){e.exports={align:{"":n(76),center:n(77),right:n(78),justify:n(79)},background:n(80),blockquote:n(81),bold:n(82),clean:n(83),code:n(58),"code-block":n(58),color:n(84),direction:{"":n(85),rtl:n(86)},float:{center:n(87),full:n(88),left:n(89),right:n(90)},formula:n(91),header:{1:n(92),2:n(93)},italic:n(94),image:n(95),indent:{"+1":n(96),"-1":n(97)},link:n(98),list:{ordered:n(99),bullet:n(100),check:n(101)},script:{sub:n(102),super:n(103)},strike:n(104),underline:n(105),video:n(106)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getLastChangeIndex=t.default=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(0)),o=a(n(5));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.lastRecorded=0,r.ignoreChange=!1,r.clear(),r.quill.on(o.default.events.EDITOR_CHANGE,function(e,t,n,i){e!==o.default.events.TEXT_CHANGE||r.ignoreChange||(r.options.userOnly&&i!==o.default.sources.USER?r.transform(t):r.record(t,n))}),r.quill.keyboard.addBinding({key:"Z",shortKey:!0},r.undo.bind(r)),r.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},r.redo.bind(r)),/Win/i.test(navigator.platform)&&r.quill.keyboard.addBinding({key:"Y",shortKey:!0},r.redo.bind(r)),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"change",value:function(e,t){if(0!==this.stack[e].length){var n=this.stack[e].pop();this.stack[t].push(n),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n[e],o.default.sources.USER),this.ignoreChange=!1;var r=s(n[e]);this.quill.setSelection(r)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(e,t){if(0!==e.ops.length){this.stack.redo=[];var n=this.quill.getContents().diff(t),r=Date.now();if(this.lastRecorded+this.options.delay>r&&this.stack.undo.length>0){var i=this.stack.undo.pop();n=n.compose(i.undo),e=i.redo.compose(e)}else this.lastRecorded=r;this.stack.undo.push({redo:e,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(e){this.stack.undo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)}),this.stack.redo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),t}(a(n(9)).default);function s(e){var t,n=e.reduce(function(e,t){return e+(t.delete||0)},0),r=e.length()-n;return null!=(t=e.ops[e.ops.length-1])&&(null!=t.insert?"string"==typeof t.insert&&t.insert.endsWith("\n"):null!=t.attributes&&Object.keys(t.attributes).some(function(e){return null!=i.default.query(e,i.default.Scope.BLOCK)}))&&(r-=1),r}l.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},t.default=l,t.getLastChangeIndex=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BaseTooltip=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=p(n(3)),a=p(n(2)),l=p(n(8)),s=p(n(23)),u=p(n(34)),c=p(n(59)),d=p(n(60)),h=p(n(28)),f=p(n(61));function p(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function m(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function v(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var y=[!1,"center","right","justify"],b=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],w=[!1,"serif","monospace"],x=["1","2","3",!1],_=["small",!1,"large","huge"],E=function(e){function t(e,n){g(this,t);var r=m(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return e.emitter.listenDOM("click",document.body,function t(n){if(!document.body.contains(e.root))return document.body.removeEventListener("click",t);null==r.tooltip||r.tooltip.root.contains(n.target)||document.activeElement===r.tooltip.textbox||r.quill.hasFocus()||r.tooltip.hide(),null!=r.pickers&&r.pickers.forEach(function(e){e.container.contains(n.target)||e.close()})}),r}return v(t,e),r(t,[{key:"addModule",value:function(e){var n=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"addModule",this).call(this,e);return"toolbar"===e&&this.extendToolbar(n),n}},{key:"buildButtons",value:function(e,t){e.forEach(function(e){(e.getAttribute("class")||"").split(/\s+/).forEach(function(n){if(n.startsWith("ql-")&&null!=t[n=n.slice(3)]){if("direction"===n)e.innerHTML=t[n][""]+t[n].rtl;else if("string"==typeof t[n])e.innerHTML=t[n];else{var r=e.value||"";null!=r&&t[n][r]&&(e.innerHTML=t[n][r])}}})})}},{key:"buildPickers",value:function(e,t){var n=this;this.pickers=e.map(function(e){if(e.classList.contains("ql-align"))return null==e.querySelector("option")&&O(e,y),new d.default(e,t.align);if(!(e.classList.contains("ql-background")||e.classList.contains("ql-color")))return null==e.querySelector("option")&&(e.classList.contains("ql-font")?O(e,w):e.classList.contains("ql-header")?O(e,x):e.classList.contains("ql-size")&&O(e,_)),new h.default(e);var n=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&O(e,b,"background"===n?"#ffffff":"#000000"),new c.default(e,t[n])}),this.quill.on(l.default.events.EDITOR_CHANGE,function(){n.pickers.forEach(function(e){e.update()})})}}]),t}(u.default);E.DEFAULTS=(0,o.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var e=this,t=this.container.querySelector("input.ql-image[type=file]");null==t&&((t=document.createElement("input")).setAttribute("type","file"),t.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),t.classList.add("ql-image"),t.addEventListener("change",function(){if(null!=t.files&&null!=t.files[0]){var n=new FileReader;n.onload=function(n){var r=e.quill.getSelection(!0);e.quill.updateContents(new a.default().retain(r.index).delete(r.length).insert({image:n.target.result}),l.default.sources.USER),e.quill.setSelection(r.index+1,l.default.sources.SILENT),t.value=""},n.readAsDataURL(t.files[0])}}),this.container.appendChild(t)),t.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var S=function(e){function t(e,n){g(this,t);var r=m(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.textbox=r.root.querySelector('input[type="text"]'),r.listen(),r}return v(t,e),r(t,[{key:"listen",value:function(){var e=this;this.textbox.addEventListener("keydown",function(t){s.default.match(t,"enter")?(e.save(),t.preventDefault()):s.default.match(t,"escape")&&(e.cancel(),t.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=t?this.textbox.value=t:e!==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-"+e)||""),this.root.setAttribute("data-mode",e)}},{key:"restoreFocus",value:function(){var e=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=e}},{key:"save",value:function(){var e,t,n=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var r=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",n,l.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",n,l.default.sources.USER)),this.quill.root.scrollTop=r;break;case"video":n=(t=(e=n).match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/))?(t[1]||"https")+"://www.youtube.com/embed/"+t[2]+"?showinfo=0":(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(t[1]||"https")+"://player.vimeo.com/video/"+t[2]+"/":e;case"formula":if(!n)break;var i=this.quill.getSelection(!0);if(null!=i){var o=i.index+i.length;this.quill.insertEmbed(o,this.root.getAttribute("data-mode"),n,l.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(o+1," ",l.default.sources.USER),this.quill.setSelection(o+2,l.default.sources.USER)}}this.textbox.value="",this.hide()}}]),t}(f.default);function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach(function(t){var r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",t),e.appendChild(r)})}t.BaseTooltip=S,t.default=E},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.head=this.tail=null,this.length=0}return e.prototype.append=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.insertBefore(e[0],null),e.length>1&&this.append.apply(this,e.slice(1))},e.prototype.contains=function(e){for(var t,n=this.iterator();t=n();)if(t===e)return!0;return!1},e.prototype.insertBefore=function(e,t){e&&(e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)},e.prototype.offset=function(e){for(var t=0,n=this.head;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return -1},e.prototype.remove=function(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)},e.prototype.iterator=function(e){return void 0===e&&(e=this.head),function(){var t=e;return null!=e&&(e=e.next),t}},e.prototype.find=function(e,t){void 0===t&&(t=!1);for(var n,r=this.iterator();n=r();){var i=n.length();if(e<i||t&&e===i&&(null==n.next||0!==n.next.length()))return[n,e];e-=i}return[null,0]},e.prototype.forEach=function(e){for(var t,n=this.iterator();t=n();)e(t)},e.prototype.forEachAt=function(e,t,n){if(!(t<=0))for(var r,i=this.find(e),o=i[0],a=e-i[1],l=this.iterator(o);(r=l())&&a<e+t;){var s=r.length();e>a?n(r,e-a,Math.min(t,a+s-e)):n(r,0,Math.min(s,e+t-a)),a+=s}},e.prototype.map=function(e){return this.reduce(function(t,n){return t.push(e(n)),t},[])},e.prototype.reduce=function(e,t){for(var n,r=this.iterator();n=r();)t=e(t,n);return t},e}();t.default=r},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),a=n(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},s=function(e){function t(t){var n=e.call(this,t)||this;return n.scroll=n,n.observer=new MutationObserver(function(e){n.update(e)}),n.observer.observe(n.domNode,l),n.attach(),n}return i(t,e),t.prototype.detach=function(){e.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(t,n){this.update(),0===t&&n===this.length()?this.children.forEach(function(e){e.remove()}):e.prototype.deleteAt.call(this,t,n)},t.prototype.formatAt=function(t,n,r,i){this.update(),e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.insertAt=function(t,n,r){this.update(),e.prototype.insertAt.call(this,t,n,r)},t.prototype.optimize=function(t,n){var r=this;void 0===t&&(t=[]),void 0===n&&(n={}),e.prototype.optimize.call(this,n);for(var i=[].slice.call(this.observer.takeRecords());i.length>0;)t.push(i.pop());for(var l=function(e,t){void 0===t&&(t=!0),null!=e&&e!==r&&null!=e.domNode.parentNode&&(null==e.domNode[a.DATA_KEY].mutations&&(e.domNode[a.DATA_KEY].mutations=[]),t&&l(e.parent))},s=function(e){null!=e.domNode[a.DATA_KEY]&&null!=e.domNode[a.DATA_KEY].mutations&&(e instanceof o.default&&e.children.forEach(s),e.optimize(n))},u=t,c=0;u.length>0;c+=1){if(c>=100)throw Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(function(e){var t=a.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(l(a.find(e.previousSibling,!1)),[].forEach.call(e.addedNodes,function(e){var t=a.find(e,!1);l(t,!1),t instanceof o.default&&t.children.forEach(function(e){l(e,!1)})})):"attributes"===e.type&&l(t.prev)),l(t))}),this.children.forEach(s),i=(u=[].slice.call(this.observer.takeRecords())).slice();i.length>0;)t.push(i.pop())}},t.prototype.update=function(t,n){var r=this;void 0===n&&(n={}),(t=t||this.observer.takeRecords()).map(function(e){var t=a.find(e.target,!0);return null==t?null:null==t.domNode[a.DATA_KEY].mutations?(t.domNode[a.DATA_KEY].mutations=[e],t):(t.domNode[a.DATA_KEY].mutations.push(e),null)}).forEach(function(e){null!=e&&e!==r&&null!=e.domNode[a.DATA_KEY]&&e.update(e.domNode[a.DATA_KEY].mutations||[],n)}),null!=this.domNode[a.DATA_KEY].mutations&&e.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(t,n)},t.blotName="scroll",t.defaultChild="block",t.scope=a.Scope.BLOCK_BLOT,t.tagName="DIV",t}(o.default);t.default=s},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(18),a=n(1),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.formats=function(n){if(n.tagName!==t.tagName)return e.formats.call(this,n)},t.prototype.format=function(n,r){var i=this;n!==this.statics.blotName||r?e.prototype.format.call(this,n,r):(this.children.forEach(function(e){e instanceof o.default||(e=e.wrap(t.blotName,!0)),i.attributes.copy(e)}),this.unwrap())},t.prototype.formatAt=function(t,n,r,i){null!=this.formats()[r]||a.query(r,a.Scope.ATTRIBUTE)?this.isolate(t,n).format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var i=this.next;i instanceof t&&i.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(e[n]!==t[n])return!1;return!0}(r,i.formats())&&(i.moveChildren(this),i.remove())},t.blotName="inline",t.scope=a.Scope.INLINE_BLOT,t.tagName="SPAN",t}(o.default);t.default=l},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(18),a=n(1),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.formats=function(n){var r=a.query(t.blotName).tagName;if(n.tagName!==r)return e.formats.call(this,n)},t.prototype.format=function(n,r){null!=a.query(n,a.Scope.BLOCK)&&(n!==this.statics.blotName||r?e.prototype.format.call(this,n,r):this.replaceWith(t.blotName))},t.prototype.formatAt=function(t,n,r,i){null!=a.query(r,a.Scope.BLOCK)?this.format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.insertAt=function(t,n,r){if(null==r||null!=a.query(n,a.Scope.INLINE))e.prototype.insertAt.call(this,t,n,r);else{var i=this.split(t),o=a.create(n,r);i.parent.insertBefore(o,i)}},t.prototype.update=function(t,n){navigator.userAgent.match(/Trident/)?this.build():e.prototype.update.call(this,t,n)},t.blotName="block",t.scope=a.Scope.BLOCK_BLOT,t.tagName="P",t}(o.default);t.default=l},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.formats=function(e){},t.prototype.format=function(t,n){e.prototype.formatAt.call(this,0,this.length(),t,n)},t.prototype.formatAt=function(t,n,r,i){0===t&&n===this.length()?this.format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.formats=function(){return this.statics.formats(this.domNode)},t}(n(19).default);t.default=o},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(19),a=n(1),l=function(e){function t(t){var n=e.call(this,t)||this;return n.text=n.statics.value(n.domNode),n}return i(t,e),t.create=function(e){return document.createTextNode(e)},t.value=function(e){var t=e.data;return t.normalize&&(t=t.normalize()),t},t.prototype.deleteAt=function(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)},t.prototype.index=function(e,t){return this.domNode===e?t:-1},t.prototype.insertAt=function(t,n,r){null==r?(this.text=this.text.slice(0,t)+n+this.text.slice(t),this.domNode.data=this.text):e.prototype.insertAt.call(this,t,n,r)},t.prototype.length=function(){return this.text.length},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},t.prototype.position=function(e,t){return void 0===t&&(t=!1),[this.domNode,e]},t.prototype.split=function(e,t){if(void 0===t&&(t=!1),!t){if(0===e)return this;if(e===this.length())return this.next}var n=a.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},t.prototype.update=function(e,t){var n=this;e.some(function(e){return"characterData"===e.type&&e.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},t.prototype.value=function(){return this.text},t.blotName="text",t.scope=a.Scope.INLINE_BLOT,t}(o.default);t.default=l},function(e,t,n){var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return arguments.length>1&&!this.contains(e)==!t?t:i.call(this,e)}}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var n=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>n.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return -1!==r&&r===t}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(this===null)throw TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof e)throw TypeError("predicate must be a function");for(var t,n=Object(this),r=n.length>>>0,i=arguments[1],o=0;o<r;o++)if(t=n[o],e.call(i,t,o,n))return t}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(e,t){function n(e,t,l){if(e==t)return e?[[0,e]]:[];(l<0||e.length<l)&&(l=null);var s=i(e,t),u=e.substring(0,s);s=o(e=e.substring(s),t=t.substring(s));var c=e.substring(e.length-s),d=function(e,t){if(!e)return[[1,t]];if(!t)return[[-1,e]];var a,l=e.length>t.length?e:t,s=e.length>t.length?t:e,u=l.indexOf(s);if(-1!=u)return a=[[1,l.substring(0,u)],[0,s],[1,l.substring(u+s.length)]],e.length>t.length&&(a[0][0]=a[2][0]=-1),a;if(1==s.length)return[[-1,e],[1,t]];var c=function(e,t){var n,r,a,l,s,u=e.length>t.length?e:t,c=e.length>t.length?t:e;if(u.length<4||2*c.length<u.length)return null;function d(e,t,n){for(var r,a,l,s,u=e.substring(n,n+Math.floor(e.length/4)),c=-1,d="";-1!=(c=t.indexOf(u,c+1));){var h=i(e.substring(n),t.substring(c)),f=o(e.substring(0,n),t.substring(0,c));d.length<f+h&&(d=t.substring(c-f,c)+t.substring(c,c+h),r=e.substring(0,n-f),a=e.substring(n+h),l=t.substring(0,c-f),s=t.substring(c+h))}return 2*d.length>=e.length?[r,a,l,s,d]:null}var h=d(u,c,Math.ceil(u.length/4)),f=d(u,c,Math.ceil(u.length/2));return h||f?(n=f?h&&h[4].length>f[4].length?h:f:h,e.length>t.length?(r=n[0],a=n[1],l=n[2],s=n[3]):(l=n[0],s=n[1],r=n[2],a=n[3]),[r,a,l,s,n[4]]):null}(e,t);if(c){var d=c[0],h=c[1],f=c[2],p=c[3],g=c[4],m=n(d,f),v=n(h,p);return m.concat([[0,g]],v)}return function(e,t){for(var n=e.length,i=t.length,o=Math.ceil((n+i)/2),a=2*o,l=Array(a),s=Array(a),u=0;u<a;u++)l[u]=-1,s[u]=-1;l[o+1]=0,s[o+1]=0;for(var c=n-i,d=c%2!=0,h=0,f=0,p=0,g=0,m=0;m<o;m++){for(var v=-m+h;v<=m-f;v+=2){for(var y,b=o+v,w=(y=v==-m||v!=m&&l[b-1]<l[b+1]?l[b+1]:l[b-1]+1)-v;y<n&&w<i&&e.charAt(y)==t.charAt(w);)y++,w++;if(l[b]=y,y>n)f+=2;else if(w>i)h+=2;else if(d){var x=o+c-v;if(x>=0&&x<a&&-1!=s[x]){var _=n-s[x];if(y>=_)return r(e,t,y,w)}}}for(var E=-m+p;E<=m-g;E+=2){for(var _,x=o+E,S=(_=E==-m||E!=m&&s[x-1]<s[x+1]?s[x+1]:s[x-1]+1)-E;_<n&&S<i&&e.charAt(n-_-1)==t.charAt(i-S-1);)_++,S++;if(s[x]=_,_>n)g+=2;else if(S>i)p+=2;else if(!d){var b=o+c-E;if(b>=0&&b<a&&-1!=l[b]){var y=l[b],w=o+y-b;if(y>=(_=n-_))return r(e,t,y,w)}}}}return[[-1,e],[1,t]]}(e,t)}(e=e.substring(0,e.length-s),t=t.substring(0,t.length-s));return u&&d.unshift([0,u]),c&&d.push([0,c]),function e(t){t.push([0,""]);for(var n,r=0,a=0,l=0,s="",u="";r<t.length;)switch(t[r][0]){case 1:l++,u+=t[r][1],r++;break;case -1:a++,s+=t[r][1],r++;break;case 0:a+l>1?(0!==a&&0!==l&&(0!==(n=i(u,s))&&(r-a-l>0&&0==t[r-a-l-1][0]?t[r-a-l-1][1]+=u.substring(0,n):(t.splice(0,0,[0,u.substring(0,n)]),r++),u=u.substring(n),s=s.substring(n)),0!==(n=o(u,s))&&(t[r][1]=u.substring(u.length-n)+t[r][1],u=u.substring(0,u.length-n),s=s.substring(0,s.length-n))),0===a?t.splice(r-l,a+l,[1,u]):0===l?t.splice(r-a,a+l,[-1,s]):t.splice(r-a-l,a+l,[-1,s],[1,u]),r=r-a-l+(a?1:0)+(l?1:0)+1):0!==r&&0==t[r-1][0]?(t[r-1][1]+=t[r][1],t.splice(r,1)):r++,l=0,a=0,s="",u=""}""===t[t.length-1][1]&&t.pop();var c=!1;for(r=1;r<t.length-1;)0==t[r-1][0]&&0==t[r+1][0]&&(t[r][1].substring(t[r][1].length-t[r-1][1].length)==t[r-1][1]?(t[r][1]=t[r-1][1]+t[r][1].substring(0,t[r][1].length-t[r-1][1].length),t[r+1][1]=t[r-1][1]+t[r+1][1],t.splice(r-1,1),c=!0):t[r][1].substring(0,t[r+1][1].length)==t[r+1][1]&&(t[r-1][1]+=t[r+1][1],t[r][1]=t[r][1].substring(t[r+1][1].length)+t[r+1][1],t.splice(r+1,1),c=!0)),r++;c&&e(t)}(d),null!=l&&(d=function(e,t){var n=function(e,t){if(0===t)return[0,e];for(var n=0,r=0;r<e.length;r++){var i=e[r];if(-1===i[0]||0===i[0]){var o=n+i[1].length;if(t===o)return[r+1,e];if(t<o){e=e.slice();var a=t-n,l=[i[0],i[1].slice(0,a)],s=[i[0],i[1].slice(a)];return e.splice(r,1,l,s),[r+1,e]}n=o}}throw Error("cursor_pos is out of bounds!")}(e,t),r=n[1],i=n[0],o=r[i],l=r[i+1];if(null==o||0!==o[0])return e;if(null!=l&&o[1]+l[1]===l[1]+o[1])return r.splice(i,2,l,o),a(r,i,2);if(null==l||0!==l[1].indexOf(o[1]))return e;r.splice(i,2,[l[0],o[1]],[0,o[1]]);var s=l[1].slice(o[1].length);return s.length>0&&r.splice(i+2,0,[l[0],s]),a(r,i,3)}(d,l)),d=function(e){for(var t,n=!1,r=function(e){return e.charCodeAt(0)>=56320&&57343>=e.charCodeAt(0)},i=2;i<e.length;i+=1)0===e[i-2][0]&&(t=e[i-2][1]).charCodeAt(t.length-1)>=55296&&56319>=t.charCodeAt(t.length-1)&&-1===e[i-1][0]&&r(e[i-1][1])&&1===e[i][0]&&r(e[i][1])&&(n=!0,e[i-1][1]=e[i-2][1].slice(-1)+e[i-1][1],e[i][1]=e[i-2][1].slice(-1)+e[i][1],e[i-2][1]=e[i-2][1].slice(0,-1));if(!n)return e;for(var o=[],i=0;i<e.length;i+=1)e[i][1].length>0&&o.push(e[i]);return o}(d)}function r(e,t,r,i){var o=e.substring(0,r),a=t.substring(0,i),l=e.substring(r),s=t.substring(i),u=n(o,a),c=n(l,s);return u.concat(c)}function i(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(o,i)==t.substring(o,i)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return i}function o(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(e.length-i,e.length-o)==t.substring(t.length-i,t.length-o)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return i}function a(e,t,n){for(var r=t+n-1;r>=0&&r>=t-1;r--)if(r+1<e.length){var i=e[r],o=e[r+1];i[0]===o[1]&&e.splice(r,2,[i[0],i[1]+o[1]])}return e}n.INSERT=1,n.DELETE=-1,n.EQUAL=0,e.exports=n},function(e,t){(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n;function n(e){var t=[];for(var n in e)t.push(n);return t}},function(e,t){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function r(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function i(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}(t=e.exports=n?r:i).supported=r,t.unsupported=i},function(e,t){var n=Object.prototype.hasOwnProperty,r="~";function i(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1)),a.prototype.eventNames=function(){var e,t,i=[];if(0===this._eventsCount)return i;for(t in e=this._events)n.call(e,t)&&i.push(r?t.slice(1):t);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e,t){var n=r?r+e:e,i=this._events[n];if(t)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var o=0,a=i.length,l=Array(a);o<a;o++)l[o]=i[o].fn;return l},a.prototype.emit=function(e,t,n,i,o,a){var l=r?r+e:e;if(!this._events[l])return!1;var s,u,c=this._events[l],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,o),!0;case 6:return c.fn.call(c.context,t,n,i,o,a),!0}for(u=1,s=Array(d-1);u<d;u++)s[u-1]=arguments[u];c.fn.apply(c.context,s)}else{var h,f=c.length;for(u=0;u<f;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),d){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,i);break;default:if(!s)for(h=1,s=Array(d-1);h<d;h++)s[h-1]=arguments[h];c[u].fn.apply(c[u].context,s)}}return!0},a.prototype.on=function(e,t,n){var i=new o(t,n||this),a=r?r+e:e;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):(this._events[a]=i,this._eventsCount++),this},a.prototype.once=function(e,t,n){var i=new o(t,n||this,!0),a=r?r+e:e;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):(this._events[a]=i,this._eventsCount++),this},a.prototype.removeListener=function(e,t,n,o){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return 0==--this._eventsCount?this._events=new i:delete this._events[a],this;var l=this._events[a];if(l.fn)l.fn!==t||o&&!l.once||n&&l.context!==n||(0==--this._eventsCount?this._events=new i:delete this._events[a]);else{for(var s=0,u=[],c=l.length;s<c;s++)(l[s].fn!==t||o&&!l[s].once||n&&l[s].context!==n)&&u.push(l[s]);u.length?this._events[a]=1===u.length?u[0]:u:0==--this._eventsCount?this._events=new i:delete this._events[a]}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&(0==--this._eventsCount?this._events=new i:delete this._events[t])):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prototype.setMaxListeners=function(){return this},a.prefixed=r,a.EventEmitter=a,void 0!==e&&(e.exports=a)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.matchText=t.matchSpacing=t.matchNewline=t.matchBlot=t.matchAttributor=t.default=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=b(n(3)),l=b(n(2)),s=b(n(0)),u=b(n(5)),c=b(n(10)),d=b(n(9)),h=n(36),f=n(37),p=b(n(13)),g=n(26),m=n(38),v=n(39),y=n(40);function b(e){return e&&e.__esModule?e:{default:e}}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=(0,c.default)("quill:clipboard"),_="__ql-matcher",E=[[Node.TEXT_NODE,M],[Node.TEXT_NODE,I],["br",function(e,t){return T(t,"\n")||t.insert("\n"),t}],[Node.ELEMENT_NODE,I],[Node.ELEMENT_NODE,R],[Node.ELEMENT_NODE,L],[Node.ELEMENT_NODE,j],[Node.ELEMENT_NODE,function(e,t){var n={},r=e.style||{};return r.fontStyle&&"italic"===P(e).fontStyle&&(n.italic=!0),r.fontWeight&&(P(e).fontWeight.startsWith("bold")||parseInt(P(e).fontWeight)>=700)&&(n.bold=!0),Object.keys(n).length>0&&(t=k(t,n)),parseFloat(r.textIndent||0)>0&&(t=new l.default().insert(" ").concat(t)),t}],["li",function(e,t){var n=s.default.query(e);if(null==n||"list-item"!==n.blotName||!T(t,"\n"))return t;for(var r=-1,i=e.parentNode;!i.classList.contains("ql-clipboard");)"list"===(s.default.query(i)||{}).blotName&&(r+=1),i=i.parentNode;return r<=0?t:t.compose(new l.default().retain(t.length()-1).retain(1,{indent:r}))}],["b",N.bind(N,"bold")],["i",N.bind(N,"italic")],["style",function(){return new l.default}]],S=[h.AlignAttribute,m.DirectionAttribute].reduce(function(e,t){return e[t.keyName]=t,e},{}),O=[h.AlignStyle,f.BackgroundStyle,g.ColorStyle,m.DirectionStyle,v.FontStyle,y.SizeStyle].reduce(function(e,t){return e[t.keyName]=t,e},{}),C=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.root.addEventListener("paste",r.onPaste.bind(r)),r.container=r.quill.addContainer("ql-clipboard"),r.container.setAttribute("contenteditable",!0),r.container.setAttribute("tabindex",-1),r.matchers=[],E.concat(r.options.matchers).forEach(function(e){var t=i(e,2),o=t[0],a=t[1];(n.matchVisual||a!==L)&&r.addMatcher(o,a)}),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"addMatcher",value:function(e,t){this.matchers.push([e,t])}},{key:"convert",value:function(e){if("string"==typeof e)return this.container.innerHTML=e.replace(/\>\r?\n +\</g,"><"),this.convert();var t=this.quill.getFormat(this.quill.selection.savedRange.index);if(t[p.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",new l.default().insert(n,w({},p.default.blotName,t[p.default.blotName]))}var r=i(this.prepareMatching(),2),o=r[0],a=r[1],s=function e(t,n,r){return t.nodeType===t.TEXT_NODE?r.reduce(function(e,n){return n(t,e)},new l.default):t.nodeType===t.ELEMENT_NODE?[].reduce.call(t.childNodes||[],function(i,o){var a=e(o,n,r);return o.nodeType===t.ELEMENT_NODE&&(a=n.reduce(function(e,t){return t(o,e)},a),a=(o[_]||[]).reduce(function(e,t){return t(o,e)},a)),i.concat(a)},new l.default):new l.default}(this.container,o,a);return T(s,"\n")&&null==s.ops[s.ops.length-1].attributes&&(s=s.compose(new l.default().retain(s.length()-1).delete(1))),x.log("convert",this.container.innerHTML,s),this.container.innerHTML="",s}},{key:"dangerouslyPasteHTML",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default.sources.API;if("string"==typeof e)this.quill.setContents(this.convert(e),t),this.quill.setSelection(0,u.default.sources.SILENT);else{var r=this.convert(t);this.quill.updateContents(new l.default().retain(e).concat(r),n),this.quill.setSelection(e+r.length(),u.default.sources.SILENT)}}},{key:"onPaste",value:function(e){var t=this;if(!e.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=new l.default().retain(n.index),i=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(u.default.sources.SILENT),setTimeout(function(){r=r.concat(t.convert()).delete(n.length),t.quill.updateContents(r,u.default.sources.USER),t.quill.setSelection(r.length()-n.length,u.default.sources.SILENT),t.quill.scrollingContainer.scrollTop=i,t.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var e=this,t=[],n=[];return this.matchers.forEach(function(r){var o=i(r,2),a=o[0],l=o[1];switch(a){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:t.push(l);break;default:[].forEach.call(e.container.querySelectorAll(a),function(e){e[_]=e[_]||[],e[_].push(l)})}}),[t,n]}}]),t}(d.default);function k(e,t,n){return(void 0===t?"undefined":r(t))==="object"?Object.keys(t).reduce(function(e,n){return k(e,n,t[n])},e):e.reduce(function(e,r){return r.attributes&&r.attributes[t]?e.push(r):e.insert(r.insert,(0,a.default)({},w({},t,n),r.attributes))},new l.default)}function P(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};var t="__ql-computed-style";return e[t]||(e[t]=window.getComputedStyle(e))}function T(e,t){for(var n="",r=e.ops.length-1;r>=0&&n.length<t.length;--r){var i=e.ops[r];if("string"!=typeof i.insert)break;n=i.insert+n}return n.slice(-1*t.length)===t}function A(e){return 0!==e.childNodes.length&&["block","list-item"].indexOf(P(e).display)>-1}function N(e,t,n){return k(n,e,!0)}function j(e,t){var n=s.default.Attributor.Attribute.keys(e),r=s.default.Attributor.Class.keys(e),i=s.default.Attributor.Style.keys(e),o={};return n.concat(r).concat(i).forEach(function(t){var n=s.default.query(t,s.default.Scope.ATTRIBUTE);null!=n&&(o[n.attrName]=n.value(e),o[n.attrName])||(null!=(n=S[t])&&(n.attrName===t||n.keyName===t)&&(o[n.attrName]=n.value(e)||void 0),null!=(n=O[t])&&(n.attrName===t||n.keyName===t)&&(o[(n=O[t]).attrName]=n.value(e)||void 0))}),Object.keys(o).length>0&&(t=k(t,o)),t}function R(e,t){var n=s.default.query(e);if(null==n)return t;if(n.prototype instanceof s.default.Embed){var r={},i=n.value(e);null!=i&&(r[n.blotName]=i,t=new l.default().insert(r,n.formats(e)))}else"function"==typeof n.formats&&(t=k(t,n.blotName,n.formats(e)));return t}function I(e,t){return!T(t,"\n")&&(A(e)||t.length()>0&&e.nextSibling&&A(e.nextSibling))&&t.insert("\n"),t}function L(e,t){if(A(e)&&null!=e.nextElementSibling&&!T(t,"\n\n")){var n=e.offsetHeight+parseFloat(P(e).marginTop)+parseFloat(P(e).marginBottom);e.nextElementSibling.offsetTop>e.offsetTop+1.5*n&&t.insert("\n")}return t}function M(e,t){var n=e.data;if("O:P"===e.parentNode.tagName)return t.insert(n.trim());if(0===n.trim().length&&e.parentNode.classList.contains("ql-clipboard"))return t;if(!P(e.parentNode).whiteSpace.startsWith("pre")){var r=function(e,t){return(t=t.replace(/[^\u00a0]/g,"")).length<1&&e?" ":t};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,r.bind(r,!0)),(null==e.previousSibling&&A(e.parentNode)||null!=e.previousSibling&&A(e.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==e.nextSibling&&A(e.parentNode)||null!=e.nextSibling&&A(e.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return t.insert(n)}C.DEFAULTS={matchers:[],matchVisual:!0},t.default=C,t.matchAttributor=j,t.matchBlot=R,t.matchNewline=I,t.matchSpacing=L,t.matchText=M},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"optimize",value:function(e){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),t}(((r=n(6))&&r.__esModule?r:{default:r}).default);a.blotName="bold",a.tagName=["STRONG","B"],t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.addControls=t.default=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=c(n(2)),a=c(n(0)),l=c(n(5)),s=c(n(10)),u=c(n(9));function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var h=(0,s.default)("quill:toolbar"),f=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var i,o=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(Array.isArray(o.options.container)){var a=document.createElement("div");g(a,o.options.container),e.container.parentNode.insertBefore(a,e.container),o.container=a}else"string"==typeof o.options.container?o.container=document.querySelector(o.options.container):o.container=o.options.container;return o.container instanceof HTMLElement?(o.container.classList.add("ql-toolbar"),o.controls=[],o.handlers={},Object.keys(o.options.handlers).forEach(function(e){o.addHandler(e,o.options.handlers[e])}),[].forEach.call(o.container.querySelectorAll("button, select"),function(e){o.attach(e)}),o.quill.on(l.default.events.EDITOR_CHANGE,function(e,t){e===l.default.events.SELECTION_CHANGE&&o.update(t)}),o.quill.on(l.default.events.SCROLL_OPTIMIZE,function(){var e=r(o.quill.selection.getRange(),1)[0];o.update(e)}),o):(i=h.error("Container required for toolbar",o.options),d(o,i))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"addHandler",value:function(e,t){this.handlers[e]=t}},{key:"attach",value:function(e){var t=this,n=[].find.call(e.classList,function(e){return 0===e.indexOf("ql-")});if(n){if(n=n.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[n]){if(null!=this.quill.scroll.whitelist&&null==this.quill.scroll.whitelist[n]){h.warn("ignoring attaching to disabled format",n,e);return}if(null==a.default.query(n)){h.warn("ignoring attaching to nonexistent format",n,e);return}}var i="SELECT"===e.tagName?"change":"click";e.addEventListener(i,function(i){var s,u,c,d=void 0;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;var h=e.options[e.selectedIndex];d=!h.hasAttribute("selected")&&(h.value||!1)}else d=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),i.preventDefault();t.quill.focus();var f=r(t.quill.selection.getRange(),1)[0];if(null!=t.handlers[n])t.handlers[n].call(t,d);else if(a.default.query(n).prototype instanceof a.default.Embed){if(!(d=prompt("Enter "+n)))return;t.quill.updateContents(new o.default().retain(f.index).delete(f.length).insert((s={},u=n,c=d,u in s?Object.defineProperty(s,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):s[u]=c,s)),l.default.sources.USER)}else t.quill.format(n,d,l.default.sources.USER);t.update(f)}),this.controls.push([n,e])}}},{key:"update",value:function(e){var t=null==e?{}:this.quill.getFormat(e);this.controls.forEach(function(n){var i=r(n,2),o=i[0],a=i[1];if("SELECT"===a.tagName){var l=void 0;if(null==e)l=null;else if(null==t[o])l=a.querySelector("option[selected]");else if(!Array.isArray(t[o])){var s=t[o];"string"==typeof s&&(s=s.replace(/\"/g,'\\"')),l=a.querySelector('option[value="'+s+'"]')}null==l?(a.value="",a.selectedIndex=-1):l.selected=!0}else if(null==e)a.classList.remove("ql-active");else if(a.hasAttribute("value")){var u=t[o]===a.getAttribute("value")||null!=t[o]&&t[o].toString()===a.getAttribute("value")||null==t[o]&&!a.getAttribute("value");a.classList.toggle("ql-active",u)}else a.classList.toggle("ql-active",null!=t[o])})}}]),t}(u.default);function p(e,t,n){var r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+t),null!=n&&(r.value=n),e.appendChild(r)}function g(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(function(t){var n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(function(e){if("string"==typeof e)p(n,e);else{var t,r=Object.keys(e)[0],i=e[r];Array.isArray(i)?((t=document.createElement("select")).classList.add("ql-"+r),i.forEach(function(e){var n=document.createElement("option");!1!==e?n.setAttribute("value",e):n.setAttribute("selected","selected"),t.appendChild(n)}),n.appendChild(t)):p(n,r,i)}}),e.appendChild(n)})}f.DEFAULTS={},f.DEFAULTS={container:null,handlers:{clean:function(){var e=this,t=this.quill.getSelection();null!=t&&(0==t.length?Object.keys(this.quill.getFormat()).forEach(function(t){null!=a.default.query(t,a.default.Scope.INLINE)&&e.quill.format(t,!1)}):this.quill.removeFormat(t,l.default.sources.USER))},direction:function(e){var t=this.quill.getFormat().align;"rtl"===e&&null==t?this.quill.format("align","right",l.default.sources.USER):e||"right"!==t||this.quill.format("align",!1,l.default.sources.USER),this.quill.format("direction",e,l.default.sources.USER)},indent:function(e){var t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0);if("+1"===e||"-1"===e){var i="+1"===e?1:-1;"rtl"===n.direction&&(i*=-1),this.quill.format("indent",r+i,l.default.sources.USER)}},link:function(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,l.default.sources.USER)},list:function(e){var t=this.quill.getSelection(),n=this.quill.getFormat(t);"check"===e?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,l.default.sources.USER):this.quill.format("list","unchecked",l.default.sources.USER):this.quill.format("list",e,l.default.sources.USER)}}},t.default=f,t.addControls=g},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.label.innerHTML=n,r.container.classList.add("ql-color-picker"),[].slice.call(r.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(e){e.classList.add("ql-primary")}),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"buildItem",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"buildItem",this).call(this,e);return n.style.backgroundColor=e.getAttribute("value")||"",n}},{key:"selectItem",value:function(e,n){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"selectItem",this).call(this,e,n);var r=this.label.querySelector(".ql-color-label"),i=e&&e.getAttribute("data-value")||"";r&&("line"===r.tagName?r.style.stroke=i:r.style.fill=i)}}]),t}(((r=n(28))&&r.__esModule?r:{default:r}).default);t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.container.classList.add("ql-icon-picker"),[].forEach.call(r.container.querySelectorAll(".ql-picker-item"),function(e){e.innerHTML=n[e.getAttribute("data-value")||""]}),r.defaultItem=r.container.querySelector(".ql-selected"),r.selectItem(r.defaultItem),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"selectItem",value:function(e,n){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"selectItem",this).call(this,e,n),e=e||this.defaultItem,this.label.innerHTML=e.innerHTML}}]),t}(((r=n(28))&&r.__esModule?r:{default:r}).default);t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n){var r=this;(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.quill=t,this.boundsContainer=n||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){r.root.style.marginTop=-1*r.quill.root.scrollTop+"px"}),this.hide()}return r(e,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(e){var t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=t+"px",this.root.style.top=n+"px",this.root.classList.remove("ql-flip");var r=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect(),o=0;if(i.right>r.right&&(o=r.right-i.right,this.root.style.left=t+o+"px"),i.left<r.left&&(o=r.left-i.left,this.root.style.left=t+o+"px"),i.bottom>r.bottom){var a=i.bottom-i.top,l=e.bottom-e.top+a;this.root.style.top=n-l+"px",this.root.classList.add("ql-flip")}return o}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),e}();t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=f(n(3)),l=f(n(8)),s=n(43),u=f(s),c=f(n(27)),d=n(15),h=f(n(41));function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function m(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var v=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],y=function(e){function t(e,n){p(this,t),null!=n.modules.toolbar&&null==n.modules.toolbar.container&&(n.modules.toolbar.container=v);var r=g(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.container.classList.add("ql-snow"),r}return m(t,e),o(t,[{key:"extendToolbar",value:function(e){e.container.classList.add("ql-snow"),this.buildButtons([].slice.call(e.container.querySelectorAll("button")),h.default),this.buildPickers([].slice.call(e.container.querySelectorAll("select")),h.default),this.tooltip=new b(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(t,n){e.handlers.link.call(e,!n.format.link)})}}]),t}(u.default);y.DEFAULTS=(0,a.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(e){if(e){var t=this.quill.getSelection();if(null!=t&&0!=t.length){var n=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(n)&&0!==n.indexOf("mailto:")&&(n="mailto:"+n),this.quill.theme.tooltip.edit("link",n)}}else this.quill.format("link",!1)}}}}});var b=function(e){function t(e,n){p(this,t);var r=g(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.preview=r.root.querySelector("a.ql-preview"),r}return m(t,e),o(t,[{key:"listen",value:function(){var e=this;i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(t){e.root.classList.contains("ql-editing")?e.save():e.edit("link",e.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(t){if(null!=e.linkRange){var n=e.linkRange;e.restoreFocus(),e.quill.formatText(n,"link",!1,l.default.sources.USER),delete e.linkRange}t.preventDefault(),e.hide()}),this.quill.on(l.default.events.SELECTION_CHANGE,function(t,n,i){if(null!=t){if(0===t.length&&i===l.default.sources.USER){var o=r(e.quill.scroll.descendant(c.default,t.index),2),a=o[0],s=o[1];if(null!=a){e.linkRange=new d.Range(t.index-s,a.length());var u=c.default.formats(a.domNode);e.preview.textContent=u,e.preview.setAttribute("href",u),e.show(),e.position(e.quill.getBounds(e.linkRange));return}}else delete e.linkRange;e.hide()}})}},{key:"show",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),t}(s.BaseTooltip);b.TEMPLATE='<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a><input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL"><a class="ql-action"></a><a class="ql-remove"></a>',t.default=y},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=L(n(29)),i=n(36),o=n(38),a=n(64),l=L(n(65)),s=L(n(66)),u=n(67),c=L(u),d=n(37),h=n(26),f=n(39),p=n(40),g=L(n(56)),m=L(n(68)),v=L(n(27)),y=L(n(69)),b=L(n(70)),w=L(n(71)),x=L(n(72)),_=L(n(73)),E=n(13),S=L(E),O=L(n(74)),C=L(n(75)),k=L(n(57)),P=L(n(41)),T=L(n(28)),A=L(n(59)),N=L(n(60)),j=L(n(61)),R=L(n(108)),I=L(n(62));function L(e){return e&&e.__esModule?e:{default:e}}r.default.register({"attributors/attribute/direction":o.DirectionAttribute,"attributors/class/align":i.AlignClass,"attributors/class/background":d.BackgroundClass,"attributors/class/color":h.ColorClass,"attributors/class/direction":o.DirectionClass,"attributors/class/font":f.FontClass,"attributors/class/size":p.SizeClass,"attributors/style/align":i.AlignStyle,"attributors/style/background":d.BackgroundStyle,"attributors/style/color":h.ColorStyle,"attributors/style/direction":o.DirectionStyle,"attributors/style/font":f.FontStyle,"attributors/style/size":p.SizeStyle},!0),r.default.register({"formats/align":i.AlignClass,"formats/direction":o.DirectionClass,"formats/indent":a.IndentClass,"formats/background":d.BackgroundStyle,"formats/color":h.ColorStyle,"formats/font":f.FontClass,"formats/size":p.SizeClass,"formats/blockquote":l.default,"formats/code-block":S.default,"formats/header":s.default,"formats/list":c.default,"formats/bold":g.default,"formats/code":E.Code,"formats/italic":m.default,"formats/link":v.default,"formats/script":y.default,"formats/strike":b.default,"formats/underline":w.default,"formats/image":x.default,"formats/video":_.default,"formats/list/item":u.ListItem,"modules/formula":O.default,"modules/syntax":C.default,"modules/toolbar":k.default,"themes/bubble":R.default,"themes/snow":I.default,"ui/icons":P.default,"ui/picker":T.default,"ui/icon-picker":N.default,"ui/color-picker":A.default,"ui/tooltip":j.default},!0),t.default=r.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.IndentClass=void 0;var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=(r=n(0))&&r.__esModule?r:{default:r},l=new(function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"add",value:function(e,n){if("+1"===n||"-1"===n){var r=this.value(e)||0;n="+1"===n?r+1:r-1}return 0===n?(this.remove(e),!0):o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"add",this).call(this,e,n)}},{key:"canAdd",value:function(e,n){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"canAdd",this).call(this,e,n)||o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"canAdd",this).call(this,e,parseInt(n))}},{key:"value",value:function(e){return parseInt(o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e))||void 0}}]),t}(a.default.Attributor.Class))("indent","ql-indent",{scope:a.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});t.IndentClass=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(4))&&r.__esModule?r:{default:r}).default);i.blotName="blockquote",i.tagName="blockquote",t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,null,[{key:"formats",value:function(e){return this.tagName.indexOf(e.tagName)+1}}]),t}(((r=n(4))&&r.__esModule?r:{default:r}).default);o.blotName="header",o.tagName=["H1","H2","H3","H4","H5","H6"],t.default=o},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ListItem=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=s(n(0)),a=s(n(4)),l=s(n(25));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function d(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){function t(){return u(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),r(t,[{key:"format",value:function(e,n){e!==f.blotName||n?i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n):this.replaceWith(o.default.create(this.statics.scope))}},{key:"remove",value:function(){null==this.prev&&null==this.next?this.parent.remove():i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(e,n){return(this.parent.isolate(this.offset(this.parent),this.length()),e===this.parent.statics.blotName)?(this.parent.replaceWith(e,n),this):(this.parent.unwrap(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replaceWith",this).call(this,e,n))}}],[{key:"formats",value:function(e){return e.tagName===this.tagName?void 0:i(t.__proto__||Object.getPrototypeOf(t),"formats",this).call(this,e)}}]),t}(a.default);h.blotName="list-item",h.tagName="LI";var f=function(e){function t(e){u(this,t);var n=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=function(t){if(t.target.parentNode===e){var r=n.statics.formats(e),i=o.default.find(t.target);"checked"===r?i.format("list","unchecked"):"unchecked"===r&&i.format("list","checked")}};return e.addEventListener("touchstart",r),e.addEventListener("mousedown",r),n}return d(t,e),r(t,null,[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,"ordered"===e?"OL":"UL");return("checked"===e||"unchecked"===e)&&n.setAttribute("data-checked","checked"===e),n}},{key:"formats",value:function(e){return"OL"===e.tagName?"ordered":"UL"===e.tagName?e.hasAttribute("data-checked")?"true"===e.getAttribute("data-checked")?"checked":"unchecked":"bullet":void 0}}]),r(t,[{key:"format",value:function(e,t){this.children.length>0&&this.children.tail.format(e,t)}},{key:"formats",value:function(){var e,t,n;return e={},t=this.statics.blotName,n=this.statics.formats(this.domNode),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"insertBefore",value:function(e,n){if(e instanceof h)i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(e,o)}}},{key:"optimize",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){if(e.statics.blotName!==this.statics.blotName){var n=o.default.create(this.statics.defaultChild);e.moveChildren(n),this.appendChild(n)}i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e)}}]),t}(l.default);f.blotName="list",f.scope=o.default.Scope.BLOCK_BLOT,f.tagName=["OL","UL"],f.defaultChild="list-item",f.allowedChildren=[h],t.ListItem=h,t.default=f},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(56))&&r.__esModule?r:{default:r}).default);i.blotName="italic",i.tagName=["EM","I"],t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,null,[{key:"create",value:function(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e)}},{key:"formats",value:function(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}}]),t}(((r=n(6))&&r.__esModule?r:{default:r}).default);a.blotName="script",a.tagName=["SUB","SUP"],t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(6))&&r.__esModule?r:{default:r}).default);i.blotName="strike",i.tagName="S",t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(6))&&r.__esModule?r:{default:r}).default);i.blotName="underline",i.tagName="U",t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=(r=n(0))&&r.__esModule?r:{default:r},l=n(27),s=["alt","height","width"],u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"format",value:function(e,n){s.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return"string"==typeof e&&n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return s.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:"match",value:function(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}},{key:"sanitize",value:function(e){return(0,l.sanitize)(e,["http","https","data"])?e:"//:0"}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}(a.default.Embed);u.blotName="image",u.tagName="IMG",t.default=u},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=n(4),l=(r=n(27))&&r.__esModule?r:{default:r},s=["height","width"],u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"format",value:function(e,n){s.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return s.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:"sanitize",value:function(e){return l.default.sanitize(e)}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}(a.BlockEmbed);u.blotName="video",u.className="ql-video",u.tagName="IFRAME",t.default=u},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FormulaBlot=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=s(n(35)),a=s(n(5)),l=s(n(9));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function d(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){function t(){return u(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),r(t,null,[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return"string"==typeof e&&(window.katex.render(e,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",e)),n}},{key:"value",value:function(e){return e.getAttribute("data-value")}}]),t}(o.default);h.blotName="formula",h.className="ql-formula",h.tagName="SPAN";var f=function(e){function t(){u(this,t);var e=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(null==window.katex)throw Error("Formula module requires KaTeX.");return e}return d(t,e),r(t,null,[{key:"register",value:function(){a.default.register(h,!0)}}]),t}(l.default);t.FormulaBlot=h,t.default=f},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CodeToken=t.CodeBlock=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=s(n(0)),a=s(n(5)),l=s(n(9));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function d(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){function t(){return u(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),r(t,[{key:"replaceWith",value:function(e){this.domNode.textContent=this.domNode.textContent,this.attach(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replaceWith",this).call(this,e)}},{key:"highlight",value:function(e){var t=this.domNode.textContent;this.cachedText!==t&&((t.trim().length>0||null==this.cachedText)&&(this.domNode.innerHTML=e(t),this.domNode.normalize(),this.attach()),this.cachedText=t)}}]),t}(s(n(13)).default);h.className="ql-syntax";var f=new o.default.Attributor.Class("token","hljs",{scope:o.default.Scope.INLINE}),p=function(e){function t(e,n){u(this,t);var r=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if("function"!=typeof r.options.highlight)throw Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var i=null;return r.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(i),i=setTimeout(function(){r.highlight(),i=null},r.options.interval)}),r.highlight(),r}return d(t,e),r(t,null,[{key:"register",value:function(){a.default.register(f,!0),a.default.register(h,!0)}}]),r(t,[{key:"highlight",value:function(){var e=this;if(!this.quill.selection.composing){this.quill.update(a.default.sources.USER);var t=this.quill.getSelection();this.quill.scroll.descendants(h).forEach(function(t){t.highlight(e.options.highlight)}),this.quill.update(a.default.sources.SILENT),null!=t&&this.quill.setSelection(t,a.default.sources.SILENT)}}}]),t}(l.default);p.DEFAULTS={highlight:null==window.hljs?null:function(e){return window.hljs.highlightAuto(e).value},interval:1e3},t.CodeBlock=h,t.CodeToken=f,t.default=p},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(e,t){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(e,t){e.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(e,t){e.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(e,t){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BubbleTooltip=void 0;var r=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=d(n(3)),a=d(n(8)),l=n(43),s=d(l),u=n(15),c=d(n(41));function d(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function p(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],m=function(e){function t(e,n){h(this,t),null!=n.modules.toolbar&&null==n.modules.toolbar.container&&(n.modules.toolbar.container=g);var r=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.container.classList.add("ql-bubble"),r}return p(t,e),i(t,[{key:"extendToolbar",value:function(e){this.tooltip=new v(this.quill,this.options.bounds),this.tooltip.root.appendChild(e.container),this.buildButtons([].slice.call(e.container.querySelectorAll("button")),c.default),this.buildPickers([].slice.call(e.container.querySelectorAll("select")),c.default)}}]),t}(s.default);m.DEFAULTS=(0,o.default)(!0,{},s.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var v=function(e){function t(e,n){h(this,t);var r=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.on(a.default.events.EDITOR_CHANGE,function(e,t,n,i){if(e===a.default.events.SELECTION_CHANGE){if(null!=t&&t.length>0&&i===a.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var o=r.quill.getLines(t.index,t.length);if(1===o.length)r.position(r.quill.getBounds(t));else{var l=o[o.length-1],s=r.quill.getIndex(l),c=Math.min(l.length()-1,t.index+t.length-s),d=r.quill.getBounds(new u.Range(s,c));r.position(d)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}}),r}return p(t,e),i(t,[{key:"listen",value:function(){var e=this;r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){e.root.classList.remove("ql-editing")}),this.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!e.root.classList.contains("ql-hidden")){var t=e.quill.getSelection();null!=t&&e.position(e.quill.getBounds(t))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(e){var n=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"position",this).call(this,e),i=this.root.querySelector(".ql-tooltip-arrow");if(i.style.marginLeft="",0===n)return n;i.style.marginLeft=-1*n-i.offsetWidth/2+"px"}}]),t}(l.BaseTooltip);v.TEMPLATE='<span class="ql-tooltip-arrow"></span><div class="ql-tooltip-editor"><input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL"><a class="ql-close"></a></div>',t.BubbleTooltip=v,t.default=m},function(e,t,n){e.exports=n(63)}]).default;var b=f("2SBKn"),oQ={};C0=oQ,C1=function(e,t,n,r){var i,o,a,l,s,u,c,d,h,f,p,g,m,v,y,b,w,x,_,E,S,O,C,k,P,T,A,N,j,R,I,L,M,D,F,z,B,U,H,V,q,G,W,K,$,Y,X,Q,Z,J,ee,et=(o=[],(i={}).joinUrl=function(t,n){return t?e.resolve(t,n):n},i.getConstantUniqueIdFor=function(e){return 0>o.indexOf(e)&&o.push(e),o.indexOf(e)},i.clone=function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},i.parseOptionalParameters=function(e){var t,n={canvas:null,options:{}};return null==e[0]||"object"==typeof(t=e[0])&&null!==t&&Object.prototype.toString.apply(t).match(/\[object (Canvas|HTMLCanvasElement)\]/i)?(n.canvas=e[0]||null,n.options=i.clone(e[1])):n.options=i.clone(e[0]),n},i),en=(a={},l=function(e,t,n){var r=e[t];return e[t]=function(){var e=Array.prototype.slice.call(arguments);return n.apply(this,[e,r])},r},a.baseUrlRespectingXhr=function(e,t){return function(){var n=new e;return l(n,"open",function(e,n){var r=e.shift(),i=e.shift(),o=et.joinUrl(t,i);return n.apply(this,[r,o].concat(e))}),n}},a.finishNotifyingXhr=function(e){var t,n=0,r=0,i=!1,o=new Promise(function(e){t=function(){n-r<=0&&i&&e({totalCount:n})}}),a=function(){var i=new e;return l(i,"send",function(e,t){return n+=1,t.apply(this,arguments)}),i.addEventListener("load",function(){r+=1,t()}),i};return a.waitForRequestsToFinish=function(){return i=!0,t(),o},a},a),er=(s={},u=function(e){return Array.prototype.slice.call(e)},s.addClassName=function(e,t){e.className+=" "+t},s.addClassNameRecursively=function(e,t){s.addClassName(e,t),e.parentNode!==e.ownerDocument&&s.addClassNameRecursively(e.parentNode,t)},c=function(e,t){var n=e.parentStyleSheet,r=u(n.cssRules).indexOf(e);n.insertRule(t,r+1),n.deleteRule(r)},d=function(e,t){var n=e.cssText.replace(/^[^\{]+/,"");c(e,t+" "+n)},h=function(e){e.textContent=u(e.sheet.cssRules).reduce(function(e,t){return e+t.cssText},"")},f=function(e){var t=document.implementation.createHTMLDocument(""),n=document.createElement("style");n.textContent=e.textContent,t.body.appendChild(n),e.sheet=n.sheet},p=function(e,t,n){var r="((?:^|[^.#:\\w])|(?=\\W))("+t.join("|")+")(?=\\W|$)";u(e.querySelectorAll("style")).forEach(function(e){void 0===e.sheet&&f(e);var t=u(e.sheet.cssRules).filter(function(e){return e.selectorText&&RegExp(r,"i").test(e.selectorText)});t.length&&(t.forEach(function(e){var t=e.selectorText.replace(RegExp(r,"gi"),function(e,t,r){return t+n(r)});t!==e.selectorText&&d(e,t)}),h(e))})},s.rewriteCssSelectorWith=function(e,t,n){p(e,[t],function(){return n})},s.lowercaseCssTypeSelectors=function(e,t){p(e,t,function(e){return e.toLowerCase()})},s.findHtmlOnlyNodeNames=function(e){var t,n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r={},i={};do t=n.currentNode.tagName.toLowerCase(),"http://www.w3.org/1999/xhtml"===n.currentNode.namespaceURI?r[t]=!0:i[t]=!0;while(n.nextNode())return Object.keys(r).filter(function(e){return!i[e]})},g={},m=function(e){return Array.prototype.slice.call(e)},v={active:!0,hover:!0,focus:!1,target:!1},g.fakeUserAction=function(e,t,n){var r=e.querySelector(t),i="rasterizehtml"+n;r&&(v[n]?s.addClassNameRecursively(r,i):s.addClassName(r,i),s.rewriteCssSelectorWith(e,":"+n,"."+i))},g.persistInputValues=function(e){var t=e.querySelectorAll("input"),n=e.querySelectorAll("textarea"),r=function(e){return"checkbox"===e.type||"radio"===e.type};m(t).filter(r).forEach(function(e){e.checked?e.setAttribute("checked",""):e.removeAttribute("checked")}),m(t).filter(function(e){return!r(e)}).forEach(function(e){e.setAttribute("value",e.value)}),m(n).forEach(function(e){e.textContent=e.value})},g.rewriteTagNameSelectorsToLowerCase=function(e){s.lowercaseCssTypeSelectors(e,s.findHtmlOnlyNodeNames(e))},g),ei=(y=window,b={},w=function(e,t,n,r){var i=e.createElement(t);return i.style.visibility="hidden",i.style.width=n+"px",i.style.height=r+"px",i.style.position="absolute",i.style.top=-1e4-r+"px",i.style.left=-1e4-n+"px",e.getElementsByTagName("body")[0].appendChild(i),i},b.executeJavascript=function(e,t){return new Promise(function(n){var r=w(y.document,"iframe",t.width,t.height),i=e.outerHTML,o=[],a=t.executeJsTimeout||0,l=function(){y.document.getElementsByTagName("body")[0].removeChild(r)},s=function(){n({document:r.contentDocument,errors:o,cleanUp:l})},u=r.contentWindow.XMLHttpRequest,c=en.finishNotifyingXhr(u),d=en.baseUrlRespectingXhr(c,t.baseUrl);r.onload=function(){(a>0?new Promise(function(e){setTimeout(e,a)}):Promise.resolve()).then(c.waitForRequestsToFinish).then(s)},r.contentDocument.open(),r.contentWindow.XMLHttpRequest=d,r.contentWindow.onerror=function(e){o.push({resourceType:"scriptExecution",msg:e})},r.contentDocument.write("<!DOCTYPE html>"),r.contentDocument.write(i),r.contentDocument.close()})},x=function(e,t,n){var r=e.createElement("iframe");return r.style.width=t+"px",r.style.height=n+"px",r.style.visibility="hidden",r.style.position="absolute",r.style.top=-1e4-n+"px",r.style.left=-1e4-t+"px",r.style.borderWidth=0,r.sandbox="allow-same-origin",r.scrolling="no",r},_=function(e,t,n){var r=Math.floor(e/n),i=Math.floor(t/n);return x(y.document,r,i)},E=function(e,t){var n=e.querySelector(t);if(n)return n;if(e.ownerDocument.querySelector(t)===e)return e;throw{message:"Clipping selector not found"}},S=function(e,t,n,r,i){var o,a,l,s,u,c,d,h,f=Math.max(e.scrollWidth,e.clientWidth),p=Math.max(e.scrollHeight,e.clientHeight);return t?(a=(d=E(e,t).getBoundingClientRect()).top,l=d.left,s=d.width,u=d.height):(a=0,l=0,s=f,u=p),h={width:Math.max((o={width:s,height:u}).width*i,n),height:Math.max(o.height*i,r)},c=y.getComputedStyle(e.ownerDocument.documentElement).fontSize,{left:l,top:a,width:h.width,height:h.height,viewportWidth:f,viewportHeight:p,rootFontSize:c}},O=function(e,t){var n=e.tagName;return t.querySelector(n)},C=function(e){var t=e.tagName.toLowerCase();return"html"===t||"body"===t?e.outerHTML:'<body style="margin: 0;">'+e.outerHTML+"</body>"},b.calculateDocumentContentSize=function(e,t){return new Promise(function(n,r){var i,o=t.zoom||1;i=_(t.width,t.height,o),y.document.getElementsByTagName("body")[0].appendChild(i),i.onload=function(){var a,l=i.contentDocument;try{a=S(O(e,l),t.clip,t.width,t.height,o),n(a)}catch(e){r(e)}finally{y.document.getElementsByTagName("body")[0].removeChild(i)}},i.contentDocument.open(),i.contentDocument.write("<!DOCTYPE html>"),i.contentDocument.write(C(e)),i.contentDocument.close()})},b.parseHtmlFragment=function(e){var t=y.document.implementation.createHTMLDocument("");t.documentElement.innerHTML=e;var n=t.querySelector("body").firstChild;if(!n)throw"Invalid source";return n},k=function(e,t){var n,r,i,o,a=/<html((?:\s+[^>]*)?)>/im.exec(t),l=y.document.implementation.createHTMLDocument("");if(a)for(r=0,n="<div"+a[1]+"></div>",l.documentElement.innerHTML=n,i=l.querySelector("div");r<i.attributes.length;r++)o=i.attributes[r],e.documentElement.setAttribute(o.name,o.value)},b.parseHTML=function(e){var t=y.document.implementation.createHTMLDocument("");return t.documentElement.innerHTML=e,k(t,e),t},P=function(e){try{return n.failOnParseError(e)}catch(e){throw{message:"Invalid source",originalError:e}}},b.validateXHTML=function(e){P(new DOMParser().parseFromString(e,"application/xml"))},T=null,b.loadDocument=function(e,t){return new Promise(function(n,r){var i,o,a=new window.XMLHttpRequest,l=(i=et.joinUrl(t.baseUrl,e),"none"===(o=t.cache)||"repeated"===o?((null===T||"repeated"!==o)&&(T=Date.now()),i+"?_="+T):i),s=function(e){r({message:"Unable to load page",originalError:e})};a.addEventListener("load",function(){200===a.status||0===a.status?n(a.responseXML):s(a.statusText)},!1),a.addEventListener("error",function(e){s(e)},!1);try{a.open("GET",l,!0),a.responseType="document",a.send(null)}catch(e){s(e)}}).then(function(e){return P(e)})},b),eo=(A=window,j={},R=function(e,t){return t?URL.createObjectURL(new Blob([e],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e)},I=function(e){e instanceof Blob&&URL.revokeObjectURL(e)},L='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',M=function(e){return new Promise(function(t,n){var r=document.createElement("canvas"),i=new Image;i.onload=function(){var e=r.getContext("2d");try{e.drawImage(i,0,0),r.toDataURL("image/png"),t(!0)}catch(e){t(!1)}},i.onerror=n,i.src=e})},D=function(){var e=R(L,!0);return M(e).then(function(t){return I(e),!t&&M(R(L,!1)).then(function(e){return e})},function(){return!1})},F=function(){if(A.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch(e){}return!1},j.renderSvg=function(e){return new Promise(function(t,n){var r,i,o=function(){i.onload=null,i.onerror=null},a=function(){r&&I(r)};(i=new Image).onload=function(){o(),a(),t(i)},i.onerror=function(){a(),n()},(void 0===N&&(N=new Promise(function(e,t){F()&&A.URL?D().then(function(t){e(!t)},function(){t()}):e(!1)})),N).then(function(t){return R(e,t)}).then(function(e){r=e,i.src=r},n)})},j),ea=(z={},B=function(e,t){var n=t||1,r={width:e.width,height:e.height,"font-size":e.rootFontSize};return 1!==n&&(r.style="transform:scale("+n+"); transform-origin: 0 0;"),r},U=function(e){var t,n;return t=Math.round(e.viewportWidth),n=Math.round(e.viewportHeight),{x:-e.left,y:-e.top,width:t,height:n}},H=function(e){var t=e.style||"";e.style=t+"float: left;"},V=function(e){e.externalResourcesRequired=!0},q=function(e){var t=Object.keys(e);return t.length?" "+t.map(function(t){return t+'="'+e[t]+'"'}).join(" "):""},G=function(e,n,r){var i=t.serializeToString(e);ei.validateXHTML(i);var o=U(n);return H(o),V(o),'<svg xmlns="http://www.w3.org/2000/svg"'+q(B(n,r))+'><style scoped="">html::-webkit-scrollbar { display: none; }</style><foreignObject'+q(o)+">"+i+"</foreignObject></svg>"},z.getSvgForDocument=function(e,t,n){return er.rewriteTagNameSelectorsToLowerCase(e),G(e,t,n)},z.drawDocumentAsSvg=function(e,t){return["hover","active","focus","target"].forEach(function(n){t[n]&&er.fakeUserAction(e,t[n],n)}),ei.calculateDocumentContentSize(e,t).then(function(n){return z.getSvgForDocument(e,n,t.zoom)})},z),el=(W={},K=function(e){return{message:"Error rendering page",originalError:e}},$=function(e){return eo.renderSvg(e).then(function(t){return{image:t,svg:e}},function(e){throw K(e)})},Y=function(e,t){try{t.getContext("2d").drawImage(e,0,0)}catch(e){throw K(e)}},W.rasterize=function(e,t,n){var i;return(i=et.clone(n)).inlineScripts=!0===n.executeJs,r.inlineReferences(e,i).then(function(t){return n.executeJs?ei.executeJavascript(e,n).then(function(e){var t=e.document;return er.persistInputValues(t),{document:t,errors:e.errors,cleanUp:e.cleanUp}}).then(function(e){return{element:e.document.documentElement,errors:t.concat(e.errors),cleanUp:e.cleanUp}}):{element:e,errors:t,cleanUp:function(){}}}).then(function(e){var r;return(r=e.element,ea.drawDocumentAsSvg(r,n).then($).then(function(e){return t&&Y(e.image,t),e})).then(function(t){return e.cleanUp(),{image:t.image,svg:t.svg,errors:e.errors}})})},W);return X={},Q=function(e,t){var n=e?e.width:300,r=e?e.height:200;return{width:void 0!==t.width?t.width:n,height:void 0!==t.height?t.height:r}},Z=function(e){var t,n=Q(e.canvas,e.options);return(t=et.clone(e.options)).width=n.width,t.height=n.height,t},X.drawDocument=function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1),n=et.parseOptionalParameters(t),r=e.documentElement?e.documentElement:e;return el.rasterize(r,n.canvas,Z(n))},J=function(e,t,n){var r=ei.parseHTML(e);return X.drawDocument(r,t,n)},X.drawHTML=function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1),n=et.parseOptionalParameters(t);return J(e,n.canvas,n.options)},ee=function(e,t,n){var r=document.implementation.createHTMLDocument("");r.replaceChild(e.documentElement,r.documentElement);var i=n?et.clone(n):{};return n.baseUrl||(i.baseUrl=t),{document:r,options:i}},X.drawURL=function(){var e,t,n=arguments[0],r=Array.prototype.slice.call(arguments,1),i=et.parseOptionalParameters(r);return e=i.canvas,t=i.options,ei.loadDocument(n,t).then(function(r){var i=ee(r,n,t);return X.drawDocument(i.document,e,i.options)})},X},void 0===C0&&void 0!==window&&(C0=window),"function"==typeof define&&define.amd?define(["url","xmlserializer","sane-domparser-error","inlineresources"],function(e,t,n,r){return C0.rasterizeHTML=C1(e,t,n,r)}):oQ?oQ=C1(f("kRFNf"),f("l4MZj"),f("lDFX4"),f("6cJtK")):C0.rasterizeHTML=C1(C0.url,C0.xmlserializer,C0.sanedomparsererror,C0.inlineresources);let oZ=`
|
|
42
|
+
`;iM.innerHTML="",iM.appendChild(document.createTextNode(n)),JSON.stringify(e)!==JSON.stringify(o)&&a(e)});let u=s(y).useRef(null);s(y).useEffect(()=>{let e=setTimeout(()=>{let e=u.current;if(!e)return;u.current?.focus();let t=i||e.value.length;e.selectionStart=e.selectionEnd=t,r&&(e?.select(),document.execCommand("selectAll",!1,null))});return()=>{clearTimeout(e)}},[]);let c=0,d=l.textArr.length*l.lineHeight()*l.fontSize();"middle"===t.verticalAlign&&(c=(t.a.height-d)/2),"bottom"===t.verticalAlign&&(c=t.a.height-d);let h=iS(t.text);return(0,g.jsx)(r4,{children:(0,g.jsx)("textarea",{className:"polotno-input",ref:u,dir:iF(h),style:{...iD,...o,paddingTop:c+"px"},value:h,onChange:e=>{t.set({text:e.target.value})},placeholder:t.placeholder,onBlur:n})})}),iB=e=>{let[t,n]=s(y).useState(!1),r=s(y).useRef(!1);return s(y).useEffect(()=>{var t=!0;return setTimeout(()=>{t&&(e._editModeEnabled&&(r.current=!0),n(!0),setTimeout(()=>{r.current=!1},50))},50),()=>{t=!1}},[]),{editorEnabled:t&&e._editModeEnabled,selectAll:r.current}},iU=(e,t)=>{let[n,r]=s(y).useReducer(e=>e+1,0),i=s(y).useRef(ib(t));return s(y).useLayoutEffect(()=>{if(i.current=ib(t),i.current)return;let n=!0;return(async()=>{i.current=!1,r();let o=il(`text ${t}`);await e.loadFont(t),s(N).Util.requestAnimFrame(o),n&&(i.current=!0,r())})(),()=>{n=!1}},[t]),[i.current]},iH=({fontLoaded:e,fontFamily:t,fontSize:n,lineHeight:r})=>s(y).useMemo(()=>{if("number"==typeof r)return r;let e=document.createElement("div");e.style.fontFamily=t,e.style.fontSize=n+"px",e.style.lineHeight=r,e.innerText="Test text",document.body.appendChild(e);let i=e.offsetHeight;return document.body.removeChild(e),i/n},[e,t,n,r]);function iV(e){let t=s(y).useRef(e),n=s(y).useRef(e);return s(y).useMemo(()=>{n.current=t.current,t.current=e},[e]),n.current}let iq=e=>s(y).useMemo(()=>{if(!ik(e.fill))return{fill:e.fill};let{stops:t,rotation:n}=iT(e.fill),r={x:e.a.width/2,y:e.a.height/2},i=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)),o=s(N).Util.degToRad(n)-Math.PI/2,a=[];return t.forEach(({offset:e,color:t})=>{a.push(e,t)}),{fillLinearGradientStartPointX:r.x-i*Math.cos(o),fillLinearGradientStartPointY:r.y-i*Math.sin(o),fillLinearGradientColorStops:a,fillLinearGradientEndPointX:r.x+i*Math.cos(o),fillLinearGradientEndPointY:r.y+i*Math.sin(o),fill:t[1].color,fillPriority:"linear-gradient"}},[e.fill]),iG=T(({element:e,store:t})=>{let n=s(y).useRef(null),r=s(y).useRef(null),{editorEnabled:i,selectAll:o}=iB(e),[a,l]=s(y).useState(!1),[u,c]=s(y).useState(!1),d=s(y).useRef(e.a.height),h=t.selectedElements.indexOf(e)>=0,{textVerticalResizeEnabled:f}=iE,p=iV(e.fontFamily),[m,v]=s(y).useState([]);s(y).useEffect(()=>{let e=n.current?.textArr??[];JSON.stringify(e)!==JSON.stringify(m)&&v(e)}),s(y).useEffect(()=>{if(e.a.width)return;let t=n.current;t.width(600),e.set({width:1.4*t.getTextWidth()})},[]),s(y).useLayoutEffect(()=>(0,b.autorun)(()=>{iA(n.current,e)}));let[w]=iU(t,e.fontFamily),x=iS(e.text),_=()=>{let e=n.current.clone({height:void 0}),t=Math.ceil(e.fontSize()*e.lineHeight()*e.textArr.length+1);return e.destroy(),t};s(y).useLayoutEffect(()=>{if(!w)return;let{textOverflow:r}=iE;if(!e.a.height){let n=_();t.history.ignore(()=>{e.set({height:n})},!1,!0);return}if("change-font-size"!==r||u||t.isPlaying){if("resize"===r){let r=_();f&&e.a.height<r&&t.history.ignore(()=>{e.set({height:r}),n.current.height(r)},!1,!0),f||e.a.height===r||t.history.ignore(()=>{e.set({height:r}),n.current.height(r)},!1,!0)}}else{let r=function(e,t){let n=e.fontSize(),r=e.height(),i=iS(t.text),o=t.a.fontSize;e.height(void 0);let a=Math.round(2*t.a.fontSize)-1;for(let n=1;n<a;n++){let n=t.a.height&&e.height()>t.a.height,r=i.split("\n").join(" ").split(/[\s-]+/),a=e.textArr.map(e=>e.text).join(";"),l=r.find(e=>!a.includes(e)||(a=a.replace(e,""),!1));if(!(n||l))break;o-=.5,e.fontSize(o)}return e.fontSize(n),e.height(r),o}(n.current,e);if(r!==e.a.fontSize){t.history.ignore(()=>{e.set({fontSize:r})},!1,!0);return}let i=_();e.a.height===i||f||t.history.ignore(()=>{e.set({height:i})},!1,!0)}}),s(y).useLayoutEffect(()=>{let t=n.current;t&&(t.width(t.width()+1e-8),t._setTextData(),iA(t,e))},[w]);let E=s(y).useRef(null),S=s(y).useRef(0),O=n=>{n.evt.preventDefault(),t.selectedShapes.find(t=>t===e)&&e.contentEditable&&(S.current=function(e){var t,n;let r=e.target,i=((t=r.getAbsoluteTransform().copy()).invert(),n=r.getStage().getPointerPosition(),t.point(n)),o=r.textArr,a=Math.floor(i.y/(r.fontSize()*r.lineHeight())),l=o.slice(0,a).reduce((e,t)=>e+t.text.length,a),s=o[a]??o[0],u=0;return"right"===r.align()?u=r.width()-s.width:"center"===r.align()&&(u=r.width()/2-s.width/2),l+Math.round((i.x-u)/s.width*s.text.length)}(n),e.toggleEditMode())},C=!x&&e.placeholder?.6:e.a.opacity;ii(n,C);let k=iH({fontLoaded:w,fontFamily:e.fontFamily,fontSize:e.a.fontSize,lineHeight:e.lineHeight}),P=e.selectable||"admin"===t.role,T=iq(e),A=s(y).useMemo(()=>e.backgroundEnabled?function({lines:e,lineHeight:t,width:n,align:r="left",padding:i=0,cornerRadius:o=0}){let a,l;e.forEach((e,t)=>{e.cx=n/2,"right"===r?e.cx=n-e.width/2:"left"===r&&(e.cx=e.width/2),"justify"!==r||e.lastInParagraph||(e.width=n),"justify"===r&&(e.cx=e.width/2)});let s=`M ${e[0]?.cx} ${-i}`;e.forEach((n,r)=>{let{cx:o}=n,a=e[r-1];a&&a.width>n.width?s+=` L ${o+n.width/2+i} ${r*t+i}`:s+=` L ${o+n.width/2+i} ${r*t-i}`;let l=e[r+1];l&&l.width>n.width?s+=` L ${o+n.width/2+i} ${(r+1)*t-i}`:s+=` L ${o+n.width/2+i} ${(r+1)*t+i}`});for(var u,c,d=e.length-1;d>=0;d--){let n=e[d],{cx:r}=n,o=e[d+1];o&&o.width>n.width?s+=` L ${r-n.width/2-i} ${(d+1)*t-i}`:s+=` L ${r-n.width/2-i} ${(d+1)*t+i}`;let a=e[d-1];a&&a.width>n.width?s+=` L ${r-n.width/2-i} ${d*t+i}`:s+=` L ${r-n.width/2-i} ${d*t-i}`}return(u=function(e){let t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g)].map(e=>({marker:e[0],index:e.index})).reduceRight((t,n)=>{let r=e.substring(n.index,t.length?t[t.length-1].index:e.length);return t.concat([{marker:n.marker,index:n.index,chunk:r.length>0?r.substr(1,r.length-1):r}])},[]).reverse().flatMap(e=>{let n=e.chunk.match(t),r=n?n.map(parseFloat):[];return function(e,t){let n=[];switch(e.toUpperCase()){case"M":for(let r=0;r<t.length;r+=2){let i;i=e===e.toUpperCase()?0===r?"M":"L":0===r?"m":"l",n.push({marker:i,values:{x:t[r],y:t[r+1]}})}break;case"L":for(let r=0;r<t.length;r+=2)n.push({marker:e,values:{x:t[r],y:t[r+1]}});break;case"H":for(let r=0;r<t.length;r++)n.push({marker:e,values:{x:t[r],y:0}});break;case"V":for(let r=0;r<t.length;r++)n.push({marker:e,values:{x:0,y:t[r]}});break;case"C":for(let r=0;r<t.length;r+=6)n.push({marker:e,values:{x1:t[r],y1:t[r+1],x2:t[r+2],y2:t[r+3],x:t[r+4],y:t[r+5]}});break;case"S":for(let r=0;r<t.length;r+=4)n.push({marker:e,values:{x2:t[r],y2:t[r+1],x:t[r+2],y:t[r+3]}});break;case"Q":for(let r=0;r<t.length;r+=4)n.push({marker:e,values:{x1:t[r],y1:t[r+1],x:t[r+2],y:t[r+3]}});break;case"T":for(let r=0;r<t.length;r+=2)n.push({marker:e,values:{x:t[r],y:t[r+1]}});break;case"A":for(let r=0;r<t.length;r+=7)n.push({marker:e,values:{radiusX:t[r],radiusY:t[r+1],rotation:t[r+2],largeArc:t[r+3],sweep:t[r+4],x:t[r+5],y:t[r+6]}});break;case"Z":n.push({marker:e,values:{x:0,y:0}})}return n}(e.marker,r)}).map(r8)}(s+=" Z"),a=[],l=[],c&&u.forEach(e=>(Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(c))),e)),u.forEach(e=>{"M"===e.marker&&a.push([]),a[a.length-1].push(e)}),a.forEach(e=>{e.map(r9),function e(t,n){let r=["x","y"].every(e=>0===Math.round(Math.abs(t[n].values[e]-t[0].values[e])));"L"===t[n].marker&&r&&(t[n].overlap=!0,e(t,n-1)),"Z"===t[n].marker&&e(t,n-1)}(e,e.length-1);let t="Z"==e[e.length-1].marker;e.filter(e=>!e.overlap).map((e,n,r)=>{let i,a,s;let u=function e(t,n,r){var i;let o=n-1,a=r[(o%(i=r.length)+i)%i];return"Z"!==a.marker?a:e(t,o,r)}(e,n,r),c=function e(t,n,r){var i;let o=n+1,a=r[(o%(i=r.length)+i)%i];return"Z"===a.marker?e(t,o,r):a}(e,n,r),d=r7(e.values,u.values),h=r7(e.values,c.values),f=h-d,p=180/Math.PI*f,g=Math.min(o,Math.abs(function(e,t,n){let r=ie(e.values,n.values);return Math.min(ie(t.values,e.values),r)}(e,u,c)/2*Math.tan(f/2))),m=(a=0,(s=180/Math.PI*f)<0&&s>=-180||s>180&&s<360?i=it(f/2,-g):(i=it(f/2,g),a=1,i===1/0&&(i=g)),{offset:i,sweepFlag:a}),v=m.offset,y=m.sweepFlag,b=(0==n||n==r.length-1)&&!t;switch(e.marker){case"M":case"L":let w=[e.values.x+Math.sin(d)*v,e.values.y+Math.cos(d)*v],x=[e.values.x+Math.sin(h)*v,e.values.y+Math.cos(h)*v];b?l.push({marker:e.marker,values:e.values}):l.push({marker:e.marker,values:{x:parseFloat(w[0].toFixed(3)),y:parseFloat(w[1].toFixed(3))}}),b||"L"!==c.marker&&"M"!==c.marker||l.push({marker:"A",radius:g,values:{radiusX:g,radiusY:g,rotation:p,largeArc:0,sweep:y,x:parseFloat(x[0].toFixed(3)),y:parseFloat(x[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":l.push({marker:e.marker,values:e.values})}})}),{path:function(e){let t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(e=>{let n="";if("Z"!==e.marker){let r=Object.keys(e.values);n=t.filter(e=>-1!==r.indexOf(e)).map(t=>e.values[t]).join()}return`${e.marker}${n}`}).join("").trim()}(l),commands:l}).path}({lines:JSON.parse(JSON.stringify(m)),cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*k*.5),lineHeight:k*e.a.fontSize,padding:e.backgroundPadding*(e.a.fontSize*k*.5),width:e.a.width,align:e.align}):"",[e.backgroundEnabled,e.backgroundCornerRadius,e.a.fontSize,k,e.backgroundPadding,e.a.width,e.align,m]),N=iL(),j=0;return"middle"===e.verticalAlign?j=(e.a.height-m.length*k*e.a.fontSize)/2:"bottom"===e.verticalAlign&&(j=e.a.height-m.length*k*e.a.fontSize),(0,g.jsxs)(s(y).Fragment,{children:[(0,g.jsx)(rZ,{ref:r,x:e.a.x,y:e.a.y,rotation:e.a.rotation,hideInExport:!e.showInExport||!x,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity,data:A,fill:e.backgroundColor,offsetY:-j}),(0,g.jsx)(rQ,{ref:n,id:e.id,name:"element",hideInExport:!e.showInExport||!x,editModeEnabled:e._editModeEnabled,x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,text:x||e.placeholder,...T,stroke:e.stroke,lineJoin:"round",strokeWidth:e.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:e.a.fontSize,fontFamily:`"${e.fontFamily}", "${p}"`,fontStyle:e.fontStyle+" "+e.fontWeight,textDecoration:e.textDecoration,align:e.align,verticalAlign:e.verticalAlign,draggable:N?e.draggable&&h:e.draggable,preventDefault:!N||h,opacity:C,visible:!e._editModeEnabled,ellipsis:"ellipsis"===iE.textOverflow,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,lineHeight:k,letterSpacing:e.letterSpacing*e.a.fontSize,listening:P,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},onClick:O,onTap:O,onTransformStart:()=>{c(!0),d.current=n.current.height()},onTransform:t=>{let n=t.target;r.current?.setAttrs({x:n.x(),y:n.y(),rotation:n.rotation(),scale:n.scale()});let i=n.getStage()?.findOne("Transformer").getActiveAnchor();if("middle-left"===i||"middle-right"===i){let t=n.scaleX(),r=n.width()*t,i=e.a.fontSize,o=r;r<i&&(o=i,E.current&&n.position(E.current)),n.width(o),n.scaleX(1),n.scaleY(1);let a=_();if("ellipsis"!==iE.textOverflow){let t=Math.max(a,d.current);n.height(t),e.set({height:n.height()})}e.set({x:n.x(),y:n.y(),width:n.width(),rotation:n.rotation()}),iA(n,e)}if("top-center"===i||"bottom-center"===i){let n="resize"===iE.textOverflow?_():k*e.a.fontSize;t.target.height(Math.max(n,t.target.height()*t.target.scaleY())),t.target.scaleY(1)}t.target.strokeWidth(e.strokeWidth/t.target.scaleX()),E.current=t.target.position()},onTransformEnd:t=>{let n=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),t.target.strokeWidth(e.strokeWidth),e.set({fontSize:Math.round(e.a.fontSize*n),width:Math.ceil(t.target.width()*n),x:t.target.x(),y:t.target.y(),rotation:t.target.rotation(),height:t.target.height()*n}),r.current?.setAttrs({scaleX:1,scaleY:1}),c(!1)}}),i&&(0,g.jsx)(rG,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,children:(0,g.jsx)(iz,{textNodeRef:n,element:e,selectAll:o,cursorPosition:S.current,onBlur:()=>{e.toggleEditMode(!1)}})}),!u&&(a||h)&&(0,g.jsx)(ij,{element:e})]})});var y=f("8NFma"),b=f("2SBKn"),y=f("8NFma");function iW(e){let t={fill:"",stroke:""};return e.getAttribute("fill")&&"none"!==e.getAttribute("fill")&&(t.fill=e.getAttribute("fill")),!t.fill&&e.style.fill&&"none"!==e.style.fill&&(t.fill=e.style.fill),e.getAttribute("stroke")&&(t.stroke=e.getAttribute("stroke")),!t.stroke&&e.style.stroke&&(t.stroke=e.style.stroke),t.stroke||t.fill||(t.fill="black"),t}let iK=["path","rect","circle"];function i$(e){for(var t=[],n=e.getElementsByTagName("*"),r=0,i=n.length;r<i;r++){let e=n[r];!function(e){for(;e.parentNode;){if("defs"===e.nodeName)return!0;e=e.parentNode}return!1}(e)&&(null!==e.getAttribute("fill")&&t.push(e),null!==e.getAttribute("stroke")?t.push(e):e.style&&e.style.fill?t.push(e):iK.indexOf(e.nodeName)>=0&&t.push(e))}return t}async function iY(e){let t=await fetch(e);return iQ(await t.text())}async function iX(e){let t=await fetch(e,{mode:"cors"});return await t.text()}function iQ(e){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(e)))}async function iZ(e){let t=await iX(e),n=new DOMParser().parseFromString(t,"image/svg+xml").documentElement.getAttribute("viewBox"),[r,i,o,a]=n?.split(" ")||[];return{width:parseFloat(o),height:parseFloat(a)}}function iJ(e){var t=new DOMParser().parseFromString(e,"image/svg+xml");let n=t.documentElement.getAttribute("viewBox"),[r,i,o,a]=n?.split(" ")||[],l=t.documentElement.getAttribute("width");l||t.documentElement.setAttribute("width",o+"px");let s=t.documentElement.getAttribute("height");if((!s||s.indexOf("%")>=0)&&t.documentElement.setAttribute("height",a+"px"),l&&l.indexOf("%")>=0&&s&&-1===s.indexOf("%")){let e=parseFloat(s)/parseFloat(a);t.documentElement.setAttribute("width",e*parseFloat(o)+"px")}if(s&&s.indexOf("%")>=0&&l&&-1===l.indexOf("%")){let e=parseFloat(l)/parseFloat(o);t.documentElement.setAttribute("height",e*parseFloat(a)+"px")}return new XMLSerializer().serializeToString(t)}let i0=(e,t)=>{if(!e||!t)return!1;let n=s(N).Util.colorToRGBA(e),r=s(N).Util.colorToRGBA(t);if(n&&r)return n.r===r.r&&n.g===r.g&&n.b===r.b&&n.a===r.a};function i1(e,t){var n=new DOMParser().parseFromString(e,"image/svg+xml");let r=i$(n),i=Array.from(t.keys());return r.forEach(e=>{let{fill:r,stroke:o}=iW(e);[{prop:"fill",color:r},{prop:"stroke",color:o}].forEach(({prop:r,color:o})=>{let a=i.find(e=>i0(e,o));if(a){let i=t.get(a);if(ik(i)){let{rotation:t,stops:o}=iT(i),a=o.map(e=>({offset:100*e.offset+"%","stop-color":e.color})),l="color"+Math.round(1e8*Math.random());(function(e,t,n,r){var i=e.namespaceURI,o=document.createElementNS(i,"linearGradient");let a=s(N).Util.degToRad(n+90),l=(Math.cos(a)+1)/2,u=(Math.sin(a)+1)/2,c=(Math.cos(a+Math.PI)+1)/2,d=(Math.sin(a+Math.PI)+1)/2;o.setAttribute("x1",100*l+"%"),o.setAttribute("y1",100*u+"%"),o.setAttribute("x2",100*c+"%"),o.setAttribute("y2",100*d+"%"),o.setAttribute("gradientUnits","userSpaceOnUse"),o.setAttribute("id",t);for(var h=0;h<r.length;h++){var f=r[h],p=document.createElementNS(i,"stop");for(var g in f)f.hasOwnProperty(g)&&p.setAttribute(g,f[g]);o.appendChild(p)}(e.querySelector("defs")||e.insertBefore(document.createElementNS(i,"defs"),e.firstChild)).appendChild(o)})(n.children[0],l,t,a),e.style[r]=null,e.setAttribute(r,`url('#${l}')`)}else e.style[r]=t.get(a)}})}),iQ(new XMLSerializer().serializeToString(n))}let i2=e=>{let[t,n]=s(y).useState([]);return s(y).useEffect(()=>{let t=!1;return(async()=>{n([]);let r=function(e){let t=i$(new DOMParser().parseFromString(e,"image/svg+xml")),n=[];return t.forEach(e=>{let{fill:t,stroke:r}=iW(e);[t,r].forEach(e=>{e&&s(N).Util.colorToRGBA(e)&&-1===n.indexOf(e)&&n.push(e)})}),n}(await iX(e));t||n(r)})(),()=>{t=!0}},[e]),t};function i5(){return document.createElement("canvas")}async function i3(e){return e.indexOf("data:image/svg+xml")>=0||e.indexOf(".svg")>=0?iQ(iJ(await iX(e))):e}let i4=e=>{let[t,n]=s(y).useState(e);return s(y).useEffect(()=>{(async()=>{let r=await i3(e);r!==t&&n(r)})()},[e]),t},i6=(e,t,n)=>{let r=s(y).useMemo(()=>{let{flipX:r,flipY:i}=e,o="svg"===e.type||e.src.indexOf("data:image/svg+xml")>=0||e.src.indexOf(".svg")>=0,a=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&o||e.maskSrc;if(!r&&!i&&!a)return t;if(!t||!t.width||!t.height)return null;let l=i5(),s=1;"svg"===e.type&&(s=Math.max(e.a.width/t.width*n,e.a.height/t.height*n)),l.width=Math.max(t.width*s,1),l.height=Math.max(t.height*s,1);let u=r?-l.width:0,c=i?-l.height:0;return l.getContext("2d")?.scale(r?-1:1,i?-1:1),l.getContext("2d")?.drawImage(t,u,c,l.width,l.height),l},[e.maskSrc,e.flipX,e.flipY,t,e.a.width,e.a.height,n]);return s(y).useEffect(()=>()=>{r&&"CANVAS"===r.nodeName&&s(N).Util.releaseCanvas(r)},[r]),r},i8=(e,t)=>{let[n,r]=or(e.maskSrc,"anonymous");return oi(e.maskSrc?r:"loaded",e.id+"-mask"),s(y).useMemo(()=>{if(!n||!t||!t.width||!t.height)return t;let r=i5();r.width=Math.max(t.width,1),r.height=Math.max(t.height,1);let i=r.getContext("2d");if(!i)return t;i.drawImage(t,0,0),i.globalCompositeOperation="source-in";let o=function(e,t){let n,r;let i=t.width/t.height;return i>=e.width/e.height?(n=e.width,r=e.width/i):(n=e.height*i,r=e.height),{x:(e.width-n)/2,y:(e.height-r)/2,width:n,height:r}}(n,e);return i.drawImage(n,o.x,o.y,o.width,o.height,0,0,t.width,t.height),r},[t,n,e.a.width,e.a.height])},i9=(e,t,n,r,i=0,o=!1)=>{let a=Math.floor(Math.max(e.a.width*r,1)),l=Math.floor(Math.max(e.a.height*r,1)),u=Math.min(i*r,a/2,l/2),c=Math.max(e.a.width/n.width,e.a.height/n.height)*r,d=e.page._exporting&&iE.imageDownScalingEnabled&&c<1&&!o,h=0===n.x&&0===n.y&&n.width===t?.width&&n.height===t?.height,f=s(y).useMemo(()=>{if(!t||!t.width||!t.height)return;let e=0===u,n=!d;if(!h||!e||!n)return i5()},[t,u,d,h]);return s(y).useLayoutEffect(()=>{if(!f||!t)return;f.width=a,f.height=l;let e=f.getContext("2d");if(!e)return;u&&(e.beginPath(),e.moveTo(u,0),e.lineTo(a-u,0),e.arc(a-u,u,u,3*Math.PI/2,0,!1),e.lineTo(a,l-u),e.arc(a-u,l-u,u,0,Math.PI/2,!1),e.lineTo(u,l),e.arc(u,l-u,u,Math.PI/2,Math.PI,!1),e.lineTo(0,u),e.arc(u,u,u,Math.PI,3*Math.PI/2,!1),e.clip());let r=d?function(e,t){let n=i5();n.width=e.width,n.height=e.height,n.getContext("2d")?.drawImage(e,0,0,n.width,n.height);let r=function(e,t,n,r,i,o,a){for(var l=new ImageData(t,n),s=new Int32Array(e.data.buffer),u=e.width,c=new Int32Array(l.data.buffer),d=l.width,h=t/o,f=n/a,p=Math.round(1/h),g=Math.round(1/f),m=p*g,v=0;v<l.height;v++)for(var y=0;y<d;y++){for(var b=0+Math.round(y/h)+(0+Math.round(v/f))*u,w=0,x=0,_=0,E=0,S=0;S<g;S++)for(var O=0;O<p;O++){var C=s[b+O+S*u];w+=C<<24>>>24,x+=C<<16>>>24,_+=C<<8>>>24,E+=C>>>24}w=Math.round(w/m),x=Math.round(x/m),_=Math.round(_/m),E=Math.round(E/m),c[y+v*d]=E<<24|_<<16|x<<8|w}return l}(n.getContext("2d").getImageData(0,0,n.width,n.height),Math.floor(n.width*t),Math.floor(n.height*t),0,0,n.width,n.height);return n.width=Math.floor(n.width*t),n.height=Math.floor(n.height*t),n.getContext("2d")?.putImageData(r,0,0),n}(t,c):t,i=d?{x:Math.floor(n.x*c),y:Math.floor(n.y*c),width:Math.floor(n.width*c),height:Math.floor(n.height*c)}:n;e.drawImage(r,i.x,i.y,i.width,i.height,0,0,f.width,f.height)},[f,e.a.width,e.a.height,n.x,n.y,n.width,n.height,i,r,o,e.page._exporting,d]),s(y).useEffect(()=>()=>{f&&"CANVAS"===f.nodeName&&s(N).Util.releaseCanvas(f)},[f]),f||t},i7=(e,t,n,r)=>{let[i,o]=or(i4(e.clipSrc||""),"anonymous");oi(e.clipSrc?o:"loaded",e.id+"-clip");let a=s(y).useMemo(()=>{if(t&&i)return i5()},[t,i]);return s(y).useLayoutEffect(()=>{if(!i||!t||!t.width||!t.height||!i||!i.width||!i.height||!a)return;let r=i5(),o=Math.max(e.a.width/i.width*n,e.a.height/i.height*n);r.width=i.width*o,r.height=i.height*o,r.getContext("2d")?.drawImage(i,0,0,r.width,r.height),a.width=Math.max(t.width,1),a.height=Math.max(t.height,1);let l=a.getContext("2d");l&&(l.save(),l.drawImage(r,0,0,t.width,t.height),s(N).Util.releaseCanvas(r),l.globalCompositeOperation="source-in",l.drawImage(t,0,0,a.width,a.height),l.restore())},[a,t,i,e.a.width,e.a.height,n,...r]),e.clipSrc&&i?a:t},oe=i5(),ot=T(({element:e})=>{let t=Math.min(30,e.a.width/4,e.a.height/4),n=s(y).useRef(null);return s(y).useEffect(()=>{let e=n.current;if(!e)return;let t=new(s(N)).Animation(t=>{e.rotate((t?.timeDiff||0)/2)},e.getLayer());return t.start(),()=>{t.stop()}}),(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport,children:[(0,g.jsx)(rK,{width:e.a.width,height:e.a.height,fill:"rgba(124, 173, 212, 0.8)"}),(0,g.jsx)("Arc",{ref:n,x:e.a.width/2,y:e.a.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270})]})}),on=T(({element:e})=>{let t="Can not load the image...",n=Math.max(10,Math.min(30,e.a.width/t.length));return(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport,children:[(0,g.jsx)(rK,{width:e.a.width,height:e.a.height,fill:"rgba(223, 102, 102, 0.8)"}),(0,g.jsx)(rQ,{text:t,fontSize:n,width:e.a.width,height:e.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5})]})}),or=s(r2),oi=(e,t)=>{let n=s(y).useRef(),r=()=>{n.current?.(),n.current=void 0};s(y).useEffect(()=>r,[]),s(y).useLayoutEffect(()=>{"loading"!==e||n.current||(n.current=il(`image ${t}`)),"loading"!==e&&r(),"failed"===e&&ic(`image ${t}`)},[e])},oo=({image:e,status:t,type:n})=>{let r=s(y).useRef();return s(y).useEffect(()=>{r.current=e||r.current},[e]),"failed"!==t||"failed"!==t&&"svg"===n?r.current:void 0},oa=e=>{let[t,n]=s(y).useReducer(e=>e+1,0),r=s(y).useRef("loading"),i=s(y).useRef(e.src),o=s(y).useRef(e.src);return(o.current!==e.src&&(o.current=e.src,r.current="loading"),s(y).useEffect(()=>{if("svg"!==e.type||!e.src)return;let t=!1;return(async()=>{r.current="loading",n();let o=i1(iJ(await iX(e.src)),e.colorsReplace);t||(i.current=o,r.current="loaded",n())})(),()=>{t=!0}},[e.src,JSON.stringify(e.colorsReplace)]),"svg"!==e.type)?[e.src,"loaded"]:[i.current,r.current]},ol=T(({element:e,store:t})=>{let n,r;let[i,o]=s(y).useState(!1),a=s(y).useRef(null),l=s(y).useRef(null),[u,c]=s(y).useState(!1),d=t.selectedElements.indexOf(e)>=0,[h,f]=oa(e),[p,m]=or(h,"anonymous");oi("svg"!==e.type||"loaded"===f?m:"loading",e.id);let v=oo({image:p,status:m,type:e.type}),w=i8(e,i6(e,p||v,t._elementsPixelRatio))||oe,{cropX:x,cropY:_,cropWidth:E,cropHeight:S}=e;"loaded"!==m&&(x=_=0,E=S=1);let O=w.width*E,C=w.height*S,k=e.a.width/e.a.height,P=O/C,T="svg"===e.type;T?(n=O,r=C):k>=P?(n=O,r=O/k):(n=C*k,r=C);let A={x:w.width*x,y:w.height*_,width:n,height:r},N=e.cornerRadius??0,j=i7(e,i9(e,w,A,t._elementsPixelRatio,N,i||e._cropModeEnabled||"svg"===e.type),t._elementsPixelRatio,[A,N,t._elementsPixelRatio]),R=Math.max(e.a.width/n,e.a.height/r);s(y).useEffect(()=>{if(!e._cropModeEnabled)return;let t=a.current?.getStage();function n(t){e._cropModeEnabled&&t.target!==l.current&&e.toggleCropMode(!1)}function r(n){e._cropModeEnabled&&n.target.parentNode!==t.content&&e.toggleCropMode(!1)}return document.body.addEventListener("click",r),t?.on("click",n),t?.on("tap",n),()=>{document.body.removeEventListener("click",r),document.body.removeEventListener("touchstart",r),t?.off("click",n),t?.off("click",n)}},[e._cropModeEnabled]),s(y).useLayoutEffect(()=>{if(!i&&!e._cropModeEnabled)return iA(a.current,e),(0,b.autorun)(()=>{iA(a.current,e)},{delay:100})},[w,i,E,S,e._cropModeEnabled]),s(y).useLayoutEffect(()=>{i||e._cropModeEnabled?a.current?.clearCache():iA(a.current,e)},[i,e.a.width,e.a.height,e._cropModeEnabled]),s(y).useEffect(()=>{iA(a.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);let I=s(y).useRef(null),L=s(y).useRef(null),M=s(y).useRef(null);s(y).useLayoutEffect(()=>{e._cropModeEnabled&&(L.current.nodes([I.current]),M.current.nodes([l.current]))},[e._cropModeEnabled]);let D=t=>{Math.round(t.target.x())>0&&(t.target.x(0),t.target.scaleX(1)),Math.round(t.target.y())>0&&(t.target.y(0),t.target.scaleY(1));let i=t.target.width()*t.target.scaleX(),o=t.target.height()*t.target.scaleY(),a=Math.min(1,n/i),l=Math.min(1,r/o),s=Math.min(1-a,Math.max(0,Math.round(-t.target.x())/i)),u=Math.min(1-l,Math.max(0,Math.round(-t.target.y())/o));t.target.setAttrs({x:-s*w.width,y:-u*w.height,scaleX:1,scaleY:1}),e.set({cropX:s,cropY:u,cropWidth:a,cropHeight:l})},F=()=>{"svg"!==e.type&&e.contentEditable&&setTimeout(()=>{e.toggleCropMode(!0)})},z="svg"===e.type&&v,B="loading"===m&&!z,U="failed"===m,H=!B&&!U,V=s(y).useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),q=H?e.a.opacity:0;ii(a,q);let G=e.selectable||"admin"===t.role,W=iL();return(0,g.jsxs)(s(y).Fragment,{children:[B&&(0,g.jsx)(ot,{element:e}),U&&(0,g.jsx)(on,{element:e}),(0,g.jsx)(rX,{ref:a,name:"element",id:e.id,image:j,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.rotation,opacity:q,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:A,listening:G,draggable:W?e.draggable&&d:e.draggable,preventDefault:!W||d,hideInExport:!e.showInExport,onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)},onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDblClick:F,onDblTap:F,onTransformStart:()=>{o(!0),V.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:t=>{let i=t.currentTarget,o=1e-7>Math.abs(i.scaleX()-1)?1:i.scaleX(),a=1e-7>Math.abs(i.scaleY()-1)?1:i.scaleY();i.scaleX(1),i.scaleY(1);let l=t.target.getStage()?.findOne("Transformer"),s=Math.min(1-n/w.width,Math.max(0,e.cropX)),u=Math.min(1-r/w.height,Math.max(0,e.cropY)),c=l.getActiveAnchor(),d=!(c.indexOf("middle")>=0||c.indexOf("center")>=0),h=!d&&o<1&&V.current.cropHeight>r/w.height,f=d?e.cropWidth:e.cropWidth*o;h&&(f=e.cropWidth);let p=!d&&a<1&&V.current.cropWidth>n/w.width,g=d?e.cropHeight:e.cropHeight*a;p&&(g=e.cropHeight),T&&(f=e.cropWidth,g=e.cropHeight),e.set({cropX:s,cropY:u,x:i.x(),y:i.y(),width:i.width()*o,height:i.height()*a,rotation:t.target.rotation(),cropWidth:Math.min(f,1-s),cropHeight:Math.min(g,1-u)})},onTransformEnd:t=>{let i=t.currentTarget;e.set({width:i.width(),height:i.height(),x:i.x(),y:i.y(),rotation:t.target.rotation(),cropWidth:n/w.width,cropHeight:r/w.height}),o(!1)}}),(0,g.jsx)(rK,{x:e.x,y:e.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:q,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,N-e.borderSize),hideInExport:!e.showInExport}),e._cropModeEnabled&&(0,g.jsxs)(r6,{selector:".page-abs-container",enabled:!0,children:[(0,g.jsx)(rK,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),(0,g.jsx)(rX,{listening:!1,image:j,x:e.x,y:e.y,width:e.a.width,height:e.a.height,rotation:e.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,scaleX:R,scaleY:R,children:[(0,g.jsx)(rX,{image:w,ref:l,opacity:.4,draggable:!0,x:-e.cropX*w.width,y:-e.cropY*w.height,onDragMove:D,onTransform:D}),(0,g.jsx)(rJ,{ref:M,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),(0,g.jsx)(rK,{width:n,height:r,ref:I,listening:!1,onTransform:t=>{t.target.x()<-e.cropX*w.width-1e-9&&(t.target.x(-e.cropX*w.width),t.target.scaleX(1)),t.target.y()<-e.cropY*w.height-1e-9&&(t.target.y(-e.cropY*w.height),t.target.scaleY(1));let n=Math.min(1,Math.max(0,e.cropX+t.target.x()/w.width)),r=Math.min(1,Math.max(0,t.target.y()/w.height+e.cropY)),i=t.target.width()*t.target.scaleX(),o=t.target.height()*t.target.scaleY(),a=Math.min(1-n,i/w.width),l=Math.min(1-r,o/w.height),s=t.target.getAbsolutePosition(t.target.getParent().getParent());t.target.scale({x:1,y:1}),t.target.position({x:0,y:0}),e.set({x:s.x,y:s.y,cropX:n,cropY:r,cropWidth:a,cropHeight:l,width:Math.min(i*R,w.width*(1-n)*R),height:Math.min(o*R,w.height*(1-r)*R)})}}),(0,g.jsx)(rJ,{ref:L,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2})]})]}),(u||d)&&(0,g.jsx)(ij,{element:e})]})});var y=f("8NFma"),os={};k_=function(e){for(var t,n=e.length,r=n%3,i=[],o=0,a=n-r;o<a;o+=16383)i.push(function(e,t,n){for(var r,i=[],o=t;o<n;o+=3)i.push(ou[(r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]))>>18&63]+ou[r>>12&63]+ou[r>>6&63]+ou[63&r]);return i.join("")}(e,o,o+16383>a?a:o+16383));return 1===r?i.push(ou[(t=e[n-1])>>2]+ou[t<<4&63]+"=="):2===r&&i.push(ou[(t=(e[n-2]<<8)+e[n-1])>>10]+ou[t>>4&63]+ou[t<<2&63]+"="),i.join("")};for(var ou=[],oc=[],od="undefined"!=typeof Uint8Array?Uint8Array:Array,oh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",of=0,op=oh.length;of<op;++of)ou[of]=oh[of],oc[oh.charCodeAt(of)]=of;oc["-".charCodeAt(0)]=62,oc["_".charCodeAt(0)]=63,kE=function(e,t,n,r,i){var o,a,l=8*i-r-1,s=(1<<l)-1,u=s>>1,c=-7,d=n?i-1:0,h=n?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-c)-1,f>>=-c,c+=l;c>0;o=256*o+e[t+d],d+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+d],d+=h,c-=8);if(0===o)o=1-u;else{if(o===s)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=u}return(f?-1:1)*a*Math.pow(2,o-r)},kS=function(e,t,n,r,i,o){var a,l,s,u=8*o-i-1,c=(1<<u)-1,d=c>>1,h=23===i?5960464477539062e-23:0,f=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(l=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),a+d>=1?t+=h/s:t+=h*Math.pow(2,1-d),t*s>=2&&(a++,s/=2),a+d>=c?(l=0,a=c):a+d>=1?(l=(t*s-1)*Math.pow(2,i),a+=d):(l=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&l,f+=p,l/=256,i-=8);for(a=a<<i|l,u+=i;u>0;e[n+f]=255&a,f+=p,a/=256,u-=8);e[n+f-p]|=128*g};let og="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function om(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,ov.prototype),t}function ov(e,t,n){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return ow(e)}return oy(e,t,n)}function oy(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!ov.isEncoding(t))throw TypeError("Unknown encoding: "+t);let n=0|oS(e,t),r=om(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(oK(e,Uint8Array)){let t=new Uint8Array(e);return o_(t.buffer,t.byteOffset,t.byteLength)}return ox(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(oK(e,ArrayBuffer)||e&&oK(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(oK(e,SharedArrayBuffer)||e&&oK(e.buffer,SharedArrayBuffer)))return o_(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return ov.from(r,t,n);let i=function(e){var t;if(ov.isBuffer(e)){let t=0|oE(e.length),n=om(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?om(0):ox(e):"Buffer"===e.type&&Array.isArray(e.data)?ox(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return ov.from(e[Symbol.toPrimitive]("string"),t,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function ob(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function ow(e){return ob(e),om(e<0?0:0|oE(e))}function ox(e){let t=e.length<0?0:0|oE(e.length),n=om(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function o_(e,t,n){let r;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),ov.prototype),r}function oE(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function oS(e,t){if(ov.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||oK(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return oq(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return oG(e).length;default:if(i)return r?-1:oq(e).length;t=(""+t).toLowerCase(),i=!0}}function oO(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=o$[e[r]];return i}(this,t,n);case"utf8":case"utf-8":return oT(this,t,n);case"ascii":return function(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}(this,t,n);case"latin1":case"binary":return function(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}(this,t,n);case"base64":var i,o;return i=t,o=n,0===i&&o===this.length?k_(this):k_(this.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){let r=e.slice(t,n),i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}(this,t,n);default:if(r)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function oC(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function ok(e,t,n,r,i){var o;if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),(o=n=+n)!=o&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return -1;n=e.length-1}else if(n<0){if(!i)return -1;n=0}if("string"==typeof t&&(t=ov.from(t,r)),ov.isBuffer(t))return 0===t.length?-1:oP(e,t,n,r,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):oP(e,[t],n,r,i);throw TypeError("val must be string, number or Buffer")}function oP(e,t,n,r,i){let o,a=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;a=2,l/=2,s/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;o<l;o++)if(u(e,o)===u(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===s)return r*a}else -1!==r&&(o-=o-r),r=-1}else for(n+s>l&&(n=l-s),o=n;o>=0;o--){let n=!0;for(let r=0;r<s;r++)if(u(e,o+r)!==u(t,r)){n=!1;break}if(n)return o}return -1}function oT(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,l,s;switch(a){case 1:t<128&&(o=t);break;case 2:(192&(n=e[i+1]))==128&&(s=(31&t)<<6|63&n)>127&&(o=s);break;case 3:n=e[i+1],r=e[i+2],(192&n)==128&&(192&r)==128&&(s=(15&t)<<12|(63&n)<<6|63&r)>2047&&(s<55296||s>57343)&&(o=s);break;case 4:n=e[i+1],r=e[i+2],l=e[i+3],(192&n)==128&&(192&r)==128&&(192&l)==128&&(s=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&l)>65535&&s<1114112&&(o=s)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}function oA(e,t,n){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>n)throw RangeError("Trying to access beyond buffer length")}function oN(e,t,n,r,i,o){if(!ov.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function oj(e,t,n,r,i){oB(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function oR(e,t,n,r,i){oB(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function oI(e,t,n,r,i,o){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function oL(e,t,n,r,i){return t=+t,n>>>=0,i||oI(e,t,n,4,34028234663852886e22,-34028234663852886e22),kS(e,t,n,r,23,4),n+4}function oM(e,t,n,r,i){return t=+t,n>>>=0,i||oI(e,t,n,8,17976931348623157e292,-17976931348623157e292),kS(e,t,n,r,52,8),n+8}ov.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),ov.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(ov.prototype,"parent",{enumerable:!0,get:function(){if(ov.isBuffer(this))return this.buffer}}),Object.defineProperty(ov.prototype,"offset",{enumerable:!0,get:function(){if(ov.isBuffer(this))return this.byteOffset}}),ov.poolSize=8192,ov.from=function(e,t,n){return oy(e,t,n)},Object.setPrototypeOf(ov.prototype,Uint8Array.prototype),Object.setPrototypeOf(ov,Uint8Array),ov.alloc=function(e,t,n){return(ob(e),e<=0)?om(e):void 0!==t?"string"==typeof n?om(e).fill(t,n):om(e).fill(t):om(e)},ov.allocUnsafe=function(e){return ow(e)},ov.allocUnsafeSlow=function(e){return ow(e)},ov.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==ov.prototype},ov.compare=function(e,t){if(oK(e,Uint8Array)&&(e=ov.from(e,e.offset,e.byteLength)),oK(t,Uint8Array)&&(t=ov.from(t,t.offset,t.byteLength)),!ov.isBuffer(e)||!ov.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},ov.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ov.concat=function(e,t){let n;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return ov.alloc(0);if(void 0===t)for(n=0,t=0;n<e.length;++n)t+=e[n].length;let r=ov.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(oK(t,Uint8Array))i+t.length>r.length?(ov.isBuffer(t)||(t=ov.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(ov.isBuffer(t))t.copy(r,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return r},ov.byteLength=oS,ov.prototype._isBuffer=!0,ov.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)oC(this,t,t+1);return this},ov.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)oC(this,t,t+3),oC(this,t+1,t+2);return this},ov.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)oC(this,t,t+7),oC(this,t+1,t+6),oC(this,t+2,t+5),oC(this,t+3,t+4);return this},ov.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?oT(this,0,e):oO.apply(this,arguments)},ov.prototype.toLocaleString=ov.prototype.toString,ov.prototype.equals=function(e){if(!ov.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===ov.compare(this,e)},ov.prototype.inspect=function(){let e="";return e=this.toString("hex",0,50).replace(/(.{2})/g,"$1 ").trim(),this.length>50&&(e+=" ... "),"<Buffer "+e+">"},og&&(ov.prototype[og]=ov.prototype.inspect),ov.prototype.compare=function(e,t,n,r,i){if(oK(e,Uint8Array)&&(e=ov.from(e,e.offset,e.byteLength)),!ov.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let o=i-r,a=n-t,l=Math.min(o,a),s=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<l;++e)if(s[e]!==u[e]){o=s[e],a=u[e];break}return o<a?-1:a<o?1:0},ov.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},ov.prototype.indexOf=function(e,t,n){return ok(this,e,t,n,!0)},ov.prototype.lastIndexOf=function(e,t,n){return ok(this,e,t,n,!1)},ov.prototype.write=function(e,t,n,r){var i,o,a,l,s,u,c,d;if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-t;if((void 0===n||n>h)&&(n=h),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let f=!1;for(;;)switch(r){case"hex":return function(e,t,n,r){let i;n=Number(n)||0;let o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;let a=t.length;for(r>a/2&&(r=a/2),i=0;i<r;++i){let r=parseInt(t.substr(2*i,2),16);if(r!=r)break;e[n+i]=r}return i}(this,e,t,n);case"utf8":case"utf-8":return i=t,o=n,oW(oq(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return a=t,l=n,oW(function(e){let t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(e),this,a,l);case"base64":return s=t,u=n,oW(oG(e),this,s,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=n,oW(function(e,t){let n,r;let i=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i.push(n%256),i.push(r);return i}(e,this.length-c),this,c,d);default:if(f)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),f=!0}},ov.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},ov.prototype.slice=function(e,t){let n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,ov.prototype),r},ov.prototype.readUintLE=ov.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||oA(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},ov.prototype.readUintBE=ov.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||oA(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},ov.prototype.readUint8=ov.prototype.readUInt8=function(e,t){return e>>>=0,t||oA(e,1,this.length),this[e]},ov.prototype.readUint16LE=ov.prototype.readUInt16LE=function(e,t){return e>>>=0,t||oA(e,2,this.length),this[e]|this[e+1]<<8},ov.prototype.readUint16BE=ov.prototype.readUInt16BE=function(e,t){return e>>>=0,t||oA(e,2,this.length),this[e]<<8|this[e+1]},ov.prototype.readUint32LE=ov.prototype.readUInt32LE=function(e,t){return e>>>=0,t||oA(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},ov.prototype.readUint32BE=ov.prototype.readUInt32BE=function(e,t){return e>>>=0,t||oA(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},ov.prototype.readBigUInt64LE=oY(function(e){oU(e>>>=0,"offset");let t=this[e],n=this[e+7];(void 0===t||void 0===n)&&oH(e,this.length-8);let r=t+256*this[++e]+65536*this[++e]+16777216*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+16777216*n;return BigInt(r)+(BigInt(i)<<BigInt(32))}),ov.prototype.readBigUInt64BE=oY(function(e){oU(e>>>=0,"offset");let t=this[e],n=this[e+7];(void 0===t||void 0===n)&&oH(e,this.length-8);let r=16777216*t+65536*this[++e]+256*this[++e]+this[++e],i=16777216*this[++e]+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),ov.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||oA(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},ov.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||oA(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},ov.prototype.readInt8=function(e,t){return(e>>>=0,t||oA(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},ov.prototype.readInt16LE=function(e,t){e>>>=0,t||oA(e,2,this.length);let n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},ov.prototype.readInt16BE=function(e,t){e>>>=0,t||oA(e,2,this.length);let n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},ov.prototype.readInt32LE=function(e,t){return e>>>=0,t||oA(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},ov.prototype.readInt32BE=function(e,t){return e>>>=0,t||oA(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},ov.prototype.readBigInt64LE=oY(function(e){oU(e>>>=0,"offset");let t=this[e],n=this[e+7];return(void 0===t||void 0===n)&&oH(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+16777216*this[++e])}),ov.prototype.readBigInt64BE=oY(function(e){oU(e>>>=0,"offset");let t=this[e],n=this[e+7];return(void 0===t||void 0===n)&&oH(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(16777216*this[++e]+65536*this[++e]+256*this[++e]+n)}),ov.prototype.readFloatLE=function(e,t){return e>>>=0,t||oA(e,4,this.length),kE(this,e,!0,23,4)},ov.prototype.readFloatBE=function(e,t){return e>>>=0,t||oA(e,4,this.length),kE(this,e,!1,23,4)},ov.prototype.readDoubleLE=function(e,t){return e>>>=0,t||oA(e,8,this.length),kE(this,e,!0,52,8)},ov.prototype.readDoubleBE=function(e,t){return e>>>=0,t||oA(e,8,this.length),kE(this,e,!1,52,8)},ov.prototype.writeUintLE=ov.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=Math.pow(2,8*n)-1;oN(this,e,t,n,r,0)}let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},ov.prototype.writeUintBE=ov.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=Math.pow(2,8*n)-1;oN(this,e,t,n,r,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},ov.prototype.writeUint8=ov.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,1,255,0),this[t]=255&e,t+1},ov.prototype.writeUint16LE=ov.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},ov.prototype.writeUint16BE=ov.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},ov.prototype.writeUint32LE=ov.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},ov.prototype.writeUint32BE=ov.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},ov.prototype.writeBigUInt64LE=oY(function(e,t=0){return oj(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),ov.prototype.writeBigUInt64BE=oY(function(e,t=0){return oR(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),ov.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=Math.pow(2,8*n-1);oN(this,e,t,n,r-1,-r)}let i=0,o=1,a=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},ov.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=Math.pow(2,8*n-1);oN(this,e,t,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},ov.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},ov.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},ov.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},ov.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},ov.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||oN(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},ov.prototype.writeBigInt64LE=oY(function(e,t=0){return oj(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),ov.prototype.writeBigInt64BE=oY(function(e,t=0){return oR(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),ov.prototype.writeFloatLE=function(e,t,n){return oL(this,e,t,!0,n)},ov.prototype.writeFloatBE=function(e,t,n){return oL(this,e,t,!1,n)},ov.prototype.writeDoubleLE=function(e,t,n){return oM(this,e,t,!0,n)},ov.prototype.writeDoubleBE=function(e,t,n){return oM(this,e,t,!1,n)},ov.prototype.copy=function(e,t,n,r){if(!ov.isBuffer(e))throw TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},ov.prototype.fill=function(e,t,n,r){let i;if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!ov.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){let t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{let o=ov.isBuffer(e)?e:ov.from(e,r),a=o.length;if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%a]}return this};let oD={};function oF(e,t,n){oD[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function oz(e){let t="",n=e.length,r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function oB(e,t,n,r,i,o){if(e>n||e<t){let r;let i="bigint"==typeof t?"n":"";throw r=o>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(o+1)*8}${i}`:`>= -(2${i} ** ${(o+1)*8-1}${i}) and < 2 ** ${(o+1)*8-1}${i}`:`>= ${t}${i} and <= ${n}${i}`,new oD.ERR_OUT_OF_RANGE("value",r,e)}oU(i,"offset"),(void 0===r[i]||void 0===r[i+o])&&oH(i,r.length-(o+1))}function oU(e,t){if("number"!=typeof e)throw new oD.ERR_INVALID_ARG_TYPE(t,"number",e)}function oH(e,t,n){if(Math.floor(e)!==e)throw oU(e,n),new oD.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new oD.ERR_BUFFER_OUT_OF_BOUNDS;throw new oD.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}oF("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),oF("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),oF("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>4294967296?i=oz(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=oz(i)),i+="n"),r+=` It must be ${t}. Received ${i}`},RangeError);let oV=/[^+/0-9A-Za-z-_]/g;function oq(e,t){let n;t=t||1/0;let r=e.length,i=null,o=[];for(let a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319||a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return o}function oG(e){return function(e){var t,n,r=function(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}(e),i=r[0],o=r[1],a=new od((i+o)*3/4-o),l=0,s=o>0?i-4:i;for(n=0;n<s;n+=4)t=oc[e.charCodeAt(n)]<<18|oc[e.charCodeAt(n+1)]<<12|oc[e.charCodeAt(n+2)]<<6|oc[e.charCodeAt(n+3)],a[l++]=t>>16&255,a[l++]=t>>8&255,a[l++]=255&t;return 2===o&&(t=oc[e.charCodeAt(n)]<<2|oc[e.charCodeAt(n+1)]>>4,a[l++]=255&t),1===o&&(t=oc[e.charCodeAt(n)]<<10|oc[e.charCodeAt(n+1)]<<4|oc[e.charCodeAt(n+2)]>>2,a[l++]=t>>8&255,a[l++]=255&t),a}(function(e){if((e=(e=e.split("=")[0]).trim().replace(oV,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function oW(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length)&&!(i>=e.length);++i)t[i+n]=e[i];return i}function oK(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let o$=function(){let e="0123456789abcdef",t=Array(256);for(let n=0;n<16;++n){let r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function oY(e){return"undefined"==typeof BigInt?oX:e}function oX(){throw Error("BigInt not supported")}"undefined"!=typeof self&&self,os=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=109)}([function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(17),i=n(18),o=n(19),a=n(45),l=n(46),s=n(47),u=n(48),c=n(49),d=n(12),h=n(32),f=n(33),p=n(31),g=n(1),m={Scope:g.Scope,create:g.create,find:g.find,query:g.query,register:g.register,Container:r.default,Format:i.default,Leaf:o.default,Embed:u.default,Scroll:a.default,Block:s.default,Inline:l.default,Text:c.default,Attributor:{Attribute:d.default,Class:h.default,Style:f.default,Store:p.default}};t.default=m},function(e,t,n){var r,i,o,a=this&&this.__extends||(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){function t(t){var n=this;return t="[Parchment] "+t,(n=e.call(this,t)||this).message=t,n.name=n.constructor.name,n}return a(t,e),t}(Error);t.ParchmentError=l;var s={},u={},c={},d={};function h(e,t){if(void 0===t&&(t=o.ANY),"string"==typeof e)n=d[e]||s[e];else if(e instanceof Text||e.nodeType===Node.TEXT_NODE)n=d.text;else if("number"==typeof e)e&o.LEVEL&o.BLOCK?n=d.block:e&o.LEVEL&o.INLINE&&(n=d.inline);else if(e instanceof HTMLElement){var n,r=(e.getAttribute("class")||"").split(/\s+/);for(var i in r)if(n=u[r[i]])break;n=n||c[e.tagName]}return null==n?null:t&o.LEVEL&n.scope&&t&o.TYPE&n.scope?n:null}t.DATA_KEY="__blot",(r=o=t.Scope||(t.Scope={}))[r.TYPE=3]="TYPE",r[r.LEVEL=12]="LEVEL",r[r.ATTRIBUTE=13]="ATTRIBUTE",r[r.BLOT=14]="BLOT",r[r.INLINE=7]="INLINE",r[r.BLOCK=11]="BLOCK",r[r.BLOCK_BLOT=10]="BLOCK_BLOT",r[r.INLINE_BLOT=6]="INLINE_BLOT",r[r.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",r[r.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",r[r.ANY=15]="ANY",t.create=function(e,t){var n=h(e);if(null==n)throw new l("Unable to create "+e+" blot");var r=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:n.create(t);return new n(r,t)},t.find=function e(n,r){return(void 0===r&&(r=!1),null==n)?null:null!=n[t.DATA_KEY]?n[t.DATA_KEY].blot:r?e(n.parentNode,r):null},t.query=h,t.register=function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length>1)return t.map(function(t){return e(t)});var r=t[0];if("string"!=typeof r.blotName&&"string"!=typeof r.attrName)throw new l("Invalid definition");if("abstract"===r.blotName)throw new l("Cannot register abstract class");return d[r.blotName||r.attrName]=r,"string"==typeof r.keyName?s[r.keyName]=r:(null!=r.className&&(u[r.className]=r),null!=r.tagName&&(Array.isArray(r.tagName)?r.tagName=r.tagName.map(function(e){return e.toUpperCase()}):r.tagName=r.tagName.toUpperCase(),(Array.isArray(r.tagName)?r.tagName:[r.tagName]).forEach(function(e){(null==c[e]||null==r.className)&&(c[e]=r)}))),r}},function(e,t,n){var r=n(51),i=n(11),o=n(3),a=n(20),l=function(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]};l.prototype.insert=function(e,t){var n={};return 0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))},l.prototype.delete=function(e){return e<=0?this:this.push({delete:e})},l.prototype.retain=function(e,t){if(e<=0)return this;var n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)},l.prototype.push=function(e){var t=this.ops.length,n=this.ops[t-1];if(e=o(!0,{},e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,"object"!=typeof(n=this.ops[t-1])))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this},l.prototype.chop=function(){var e=this.ops[this.ops.length-1];return e&&e.retain&&!e.attributes&&this.ops.pop(),this},l.prototype.filter=function(e){return this.ops.filter(e)},l.prototype.forEach=function(e){this.ops.forEach(e)},l.prototype.map=function(e){return this.ops.map(e)},l.prototype.partition=function(e){var t=[],n=[];return this.forEach(function(r){(e(r)?t:n).push(r)}),[t,n]},l.prototype.reduce=function(e,t){return this.ops.reduce(e,t)},l.prototype.changeLength=function(){return this.reduce(function(e,t){return t.insert?e+a.length(t):t.delete?e-t.delete:e},0)},l.prototype.length=function(){return this.reduce(function(e,t){return e+a.length(t)},0)},l.prototype.slice=function(e,t){e=e||0,"number"!=typeof t&&(t=1/0);for(var n,r=[],i=a.iterator(this.ops),o=0;o<t&&i.hasNext();)o<e?n=i.next(e-o):(n=i.next(t-o),r.push(n)),o+=a.length(n);return new l(r)},l.prototype.compose=function(e){var t=a.iterator(this.ops),n=a.iterator(e.ops),r=[],o=n.peek();if(null!=o&&"number"==typeof o.retain&&null==o.attributes){for(var s=o.retain;"insert"===t.peekType()&&t.peekLength()<=s;)s-=t.peekLength(),r.push(t.next());o.retain-s>0&&n.next(o.retain-s)}for(var u=new l(r);t.hasNext()||n.hasNext();)if("insert"===n.peekType())u.push(n.next());else if("delete"===t.peekType())u.push(t.next());else{var c=Math.min(t.peekLength(),n.peekLength()),d=t.next(c),h=n.next(c);if("number"==typeof h.retain){var f={};"number"==typeof d.retain?f.retain=c:f.insert=d.insert;var p=a.attributes.compose(d.attributes,h.attributes,"number"==typeof d.retain);if(p&&(f.attributes=p),u.push(f),!n.hasNext()&&i(u.ops[u.ops.length-1],f)){var g=new l(t.rest());return u.concat(g).chop()}}else"number"==typeof h.delete&&"number"==typeof d.retain&&u.push(h)}return u.chop()},l.prototype.concat=function(e){var t=new l(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t},l.prototype.diff=function(e,t){if(this.ops===e.ops)return new l;var n=[this,e].map(function(t){return t.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:"\x00";throw Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")}),o=new l,s=r(n[0],n[1],t),u=a.iterator(this.ops),c=a.iterator(e.ops);return s.forEach(function(e){for(var t=e[1].length;t>0;){var n=0;switch(e[0]){case r.INSERT:n=Math.min(c.peekLength(),t),o.push(c.next(n));break;case r.DELETE:n=Math.min(t,u.peekLength()),u.next(n),o.delete(n);break;case r.EQUAL:n=Math.min(u.peekLength(),c.peekLength(),t);var l=u.next(n),s=c.next(n);i(l.insert,s.insert)?o.retain(n,a.attributes.diff(l.attributes,s.attributes)):o.push(s).delete(n)}t-=n}}),o.chop()},l.prototype.eachLine=function(e,t){t=t||"\n";for(var n=a.iterator(this.ops),r=new l,i=0;n.hasNext();){if("insert"!==n.peekType())return;var o=n.peek(),s=a.length(o)-n.peekLength(),u="string"==typeof o.insert?o.insert.indexOf(t,s)-s:-1;if(u<0)r.push(n.next());else if(u>0)r.push(n.next(u));else{if(!1===e(r,n.next(1).attributes||{},i))return;i+=1,r=new l}}r.length()>0&&e(r,{},i)},l.prototype.transform=function(e,t){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);for(var n=a.iterator(this.ops),r=a.iterator(e.ops),i=new l;n.hasNext()||r.hasNext();)if("insert"===n.peekType()&&(t||"insert"!==r.peekType()))i.retain(a.length(n.next()));else if("insert"===r.peekType())i.push(r.next());else{var o=Math.min(n.peekLength(),r.peekLength()),s=n.next(o),u=r.next(o);if(s.delete)continue;u.delete?i.push(u):i.retain(o,a.attributes.transform(s.attributes,u.attributes,t))}return i.chop()},l.prototype.transformPosition=function(e,t){t=!!t;for(var n=a.iterator(this.ops),r=0;n.hasNext()&&r<=e;){var i=n.peekLength(),o=n.peekType();if(n.next(),"delete"===o){e-=Math.min(i,e-r);continue}"insert"===o&&(r<e||!t)&&(e+=i),r+=i}return e},e.exports=l},function(e,t){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,i=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(t in e);return void 0===t||n.call(e,t)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!n.call(e,t))return;if(o)return o(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,c,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(t=arguments[h],null!=t)for(n in t)r=u(d,n),d!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,c=r&&a(r)?r:[]):c=r&&l(r)?r:{},s(d,{name:n,newValue:e(p,c,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BlockEmbed=t.bubbleFormats=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=d(n(3)),a=d(n(2)),l=d(n(0)),s=d(n(16)),u=d(n(6)),c=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function p(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=function(e){function t(){return h(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),r(t,[{key:"attach",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"attach",this).call(this),this.attributes=new l.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new a.default().insert(this.value(),(0,o.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(e,t){var n=l.default.query(e,l.default.Scope.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}},{key:"formatAt",value:function(e,t,n,r){this.format(n,r)}},{key:"insertAt",value:function(e,n,r){if("string"==typeof n&&n.endsWith("\n")){var o=l.default.create(m.blotName);this.parent.insertBefore(o,0===e?this:this.next),o.insertAt(0,n.slice(0,-1))}else i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,r)}}]),t}(l.default.Embed);g.scope=l.default.Scope.BLOCK_BLOT;var m=function(e){function t(e){h(this,t);var n=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.cache={},n}return p(t,e),r(t,[{key:"delta",value:function(){return null==this.cache.delta&&(this.cache.delta=this.descendants(l.default.Leaf).reduce(function(e,t){return 0===t.length()?e:e.insert(t.value(),v(t))},new a.default).insert("\n",v(this))),this.cache.delta}},{key:"deleteAt",value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"deleteAt",this).call(this,e,n),this.cache={}}},{key:"formatAt",value:function(e,n,r,o){n<=0||(l.default.query(r,l.default.Scope.BLOCK)?e+n===this.length()&&this.format(r,o):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,Math.min(n,this.length()-e-1),r,o),this.cache={})}},{key:"insertAt",value:function(e,n,r){if(null!=r)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,r);if(0!==n.length){var o=n.split("\n"),a=o.shift();a.length>0&&(e<this.length()-1||null==this.children.tail?i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,Math.min(e,this.length()-1),a):this.children.tail.insertAt(this.children.tail.length(),a),this.cache={});var l=this;o.reduce(function(e,t){return(l=l.split(e,!0)).insertAt(0,t),t.length},e+a.length)}}},{key:"insertBefore",value:function(e,n){var r=this.children.head;i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n),r instanceof s.default&&r.remove(),this.cache={}}},{key:"length",value:function(){return null==this.cache.length&&(this.cache.length=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"length",this).call(this)+1),this.cache.length}},{key:"moveChildren",value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"moveChildren",this).call(this,e,n),this.cache={}}},{key:"optimize",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.cache={}}},{key:"path",value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,e,!0)}},{key:"removeChild",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"removeChild",this).call(this,e),this.cache={}}},{key:"split",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===e||e>=this.length()-1)){var r=this.clone();return 0===e?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"split",this).call(this,e,n);return this.cache={},o}}]),t}(l.default.Block);function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==e?t:("function"==typeof e.formats&&(t=(0,o.default)(t,e.formats())),null==e.parent||"scroll"==e.parent.blotName||e.parent.statics.scope!==e.statics.scope)?t:v(e.parent,t)}m.blotName="block",m.tagName="P",m.defaultChild="break",m.allowedChildren=[u.default,l.default.Embed,c.default],t.bubbleFormats=v,t.BlockEmbed=g,t.default=m},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.overload=t.expandConfig=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n(50);var a=m(n(2)),l=m(n(14)),s=m(n(8)),u=m(n(9)),c=m(n(0)),d=n(15),h=m(d),f=m(n(3)),p=m(n(10)),g=m(n(34));function m(e){return e&&e.__esModule?e:{default:e}}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=(0,p.default)("quill"),b=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),this.options=w(t,r),this.container=this.options.container,null==this.container)return y.error("Invalid Quill container",t);this.options.debug&&e.debug(this.options.debug);var i=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 s.default,this.scroll=c.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new l.default(this.scroll),this.selection=new h.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(s.default.events.EDITOR_CHANGE,function(e){e===s.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(s.default.events.SCROLL_UPDATE,function(e,t){var r=n.selection.lastRange,i=r&&0===r.length?r.index:void 0;x.call(n,function(){return n.editor.update(null,t,i)},e)});var o=this.clipboard.convert("<div class='ql-editor' style=\"white-space: normal;\">"+i+"<p><br></p></div>");this.setContents(o),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(e,null,[{key:"debug",value:function(e){!0===e&&(e="log"),p.default.level(e)}},{key:"find",value:function(e){return e.__quill||c.default.find(e)}},{key:"import",value:function(e){return null==this.imports[e]&&y.error("Cannot import "+e+". Are you sure it was registered?"),this.imports[e]}},{key:"register",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e){var i=e.attrName||e.blotName;"string"==typeof i?this.register("formats/"+i,e,t):Object.keys(e).forEach(function(r){n.register(r,e[r],t)})}else null==this.imports[e]||r||y.warn("Overwriting "+e+" with",t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&"abstract"!==t.blotName?c.default.register(t):e.startsWith("modules")&&"function"==typeof t.register&&t.register()}}]),o(e,[{key:"addContainer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){var n=e;(e=document.createElement("div")).classList.add(n)}return this.container.insertBefore(e,t),e}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(e,t,n){var r=this,o=i(_(e,t,n),4);return e=o[0],t=o[1],x.call(this,function(){return r.editor.deleteText(e,t)},n=o[3],e,-1*t)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}},{key:"focus",value:function(){var e=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=e,this.scrollIntoView()}},{key:"format",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.default.sources.API;return x.call(this,function(){var r=n.getSelection(!0),i=new a.default;if(null==r)return i;if(c.default.query(e,c.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,v({},e,t));else{if(0===r.length)return n.selection.format(e,t),i;i=n.editor.formatText(r.index,r.length,v({},e,t))}return n.setSelection(r,s.default.sources.SILENT),i},r)}},{key:"formatLine",value:function(e,t,n,r,o){var a=this,l=void 0,s=i(_(e,t,n,r,o),4);return e=s[0],t=s[1],l=s[2],x.call(this,function(){return a.editor.formatLine(e,t,l)},o=s[3],e,0)}},{key:"formatText",value:function(e,t,n,r,o){var a=this,l=void 0,s=i(_(e,t,n,r,o),4);return e=s[0],t=s[1],l=s[2],x.call(this,function(){return a.editor.formatText(e,t,l)},o=s[3],e,0)}},{key:"getBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"==typeof e?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=i(_(e,t),2);return e=n[0],t=n[1],this.editor.getContents(e,t)}},{key:"getFormat",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}},{key:"getIndex",value:function(e){return e.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(e){return this.scroll.leaf(e)}},{key:"getLine",value:function(e){return this.scroll.line(e)}},{key:"getLines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}},{key:"getModule",value:function(e){return this.theme.modules[e]}},{key:"getSelection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=i(_(e,t),2);return e=n[0],t=n[1],this.editor.getText(e,t)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.sources.API;return x.call(this,function(){return i.editor.insertEmbed(t,n,r)},o,t)}},{key:"insertText",value:function(e,t,n,r,o){var a=this,l=void 0,s=i(_(e,0,n,r,o),4);return e=s[0],l=s[2],x.call(this,function(){return a.editor.insertText(e,t,l)},o=s[3],e,t.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(e,t,n){this.clipboard.dangerouslyPasteHTML(e,t,n)}},{key:"removeFormat",value:function(e,t,n){var r=this,o=i(_(e,t,n),4);return e=o[0],t=o[1],x.call(this,function(){return r.editor.removeFormat(e,t)},n=o[3],e)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API;return x.call(this,function(){e=new a.default(e);var n=t.getLength(),r=t.editor.deleteText(0,n),i=t.editor.applyDelta(e),o=i.ops[i.ops.length-1];return null!=o&&"string"==typeof o.insert&&"\n"===o.insert[o.insert.length-1]&&(t.editor.deleteText(t.getLength()-1,1),i.delete(1)),r.compose(i)},n)}},{key:"setSelection",value:function(t,n,r){if(null==t)this.selection.setRange(null,n||e.sources.API);else{var o=i(_(t,n,r),4);t=o[0],n=o[1],r=o[3],this.selection.setRange(new d.Range(t,n),r),r!==s.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API,n=new a.default().insert(e);return this.setContents(n,t)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.default.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}},{key:"updateContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API;return x.call(this,function(){return e=new a.default(e),t.editor.applyDelta(e,n)},n,!0)}}]),e}();function w(e,t){if((t=(0,f.default)(!0,{container:e,modules:{clipboard:!0,keyboard:!0,history:!0}},t)).theme&&t.theme!==b.DEFAULTS.theme){if(t.theme=b.import("themes/"+t.theme),null==t.theme)throw Error("Invalid theme "+t.theme+". Did you register it?")}else t.theme=g.default;var n=(0,f.default)(!0,{},t.theme.DEFAULTS);[n,t].forEach(function(e){e.modules=e.modules||{},Object.keys(e.modules).forEach(function(t){!0===e.modules[t]&&(e.modules[t]={})})});var r=Object.keys(n.modules).concat(Object.keys(t.modules)).reduce(function(e,t){var n=b.import("modules/"+t);return null==n?y.error("Cannot load "+t+" module. Are you sure you registered it?"):e[t]=n.DEFAULTS||{},e},{});return null!=t.modules&&t.modules.toolbar&&t.modules.toolbar.constructor!==Object&&(t.modules.toolbar={container:t.modules.toolbar}),t=(0,f.default)(!0,{},b.DEFAULTS,{modules:r},n,t),["bounds","container","scrollingContainer"].forEach(function(e){"string"==typeof t[e]&&(t[e]=document.querySelector(t[e]))}),t.modules=Object.keys(t.modules).reduce(function(e,n){return t.modules[n]&&(e[n]=t.modules[n]),e},{}),t}function x(e,t,n,r){if(this.options.strict&&!this.isEnabled()&&t===s.default.sources.USER)return new a.default;var i=null==n?null:this.getSelection(),o=this.editor.delta,l=e();if(null!=i&&(!0===n&&(n=i.index),null==r?i=E(i,l,t):0!==r&&(i=E(i,n,r,t)),this.setSelection(i,s.default.sources.SILENT)),l.length()>0){var u,c,d=[s.default.events.TEXT_CHANGE,l,o,t];(u=this.emitter).emit.apply(u,[s.default.events.EDITOR_CHANGE].concat(d)),t!==s.default.sources.SILENT&&(c=this.emitter).emit.apply(c,d)}return l}function _(e,t,n,i,o){var a={};return"number"==typeof e.index&&"number"==typeof e.length?("number"!=typeof t&&(o=i,i=n,n=t),t=e.length,e=e.index):"number"!=typeof t&&(o=i,i=n,n=t,t=0),(void 0===n?"undefined":r(n))==="object"?(a=n,o=i):"string"==typeof n&&(null!=i?a[n]=i:o=n),[e,t,a,o=o||s.default.sources.API]}function E(e,t,n,r){if(null==e)return null;var o=void 0,l=void 0;if(t instanceof a.default){var u=i([e.index,e.index+e.length].map(function(e){return t.transformPosition(e,r!==s.default.sources.USER)}),2);o=u[0],l=u[1]}else{var c=i([e.index,e.index+e.length].map(function(e){return e<t||e===t&&r===s.default.sources.USER?e:n>=0?e+n:Math.max(t,e+n)}),2);o=c[0],l=c[1]}return new d.Range(o,l-o)}b.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},b.events=s.default.events,b.sources=s.default.sources,b.version="1.3.7",b.imports={delta:a.default,parchment:c.default,"core/module":u.default,"core/theme":g.default},t.expandConfig=w,t.overload=_,t.default=b},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=l(n(7)),a=l(n(0));function l(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"formatAt",value:function(e,n,r,o){if(0>t.compare(this.statics.blotName,r)&&a.default.query(r,a.default.Scope.BLOT)){var l=this.isolate(e,n);o&&l.wrap(r,o)}else i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,n,r,o)}},{key:"optimize",value:function(e){if(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.parent instanceof t&&t.compare(this.statics.blotName,this.parent.statics.blotName)>0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(e,n){var r=t.order.indexOf(e),i=t.order.indexOf(n);return r>=0||i>=0?r-i:e===n?0:e<n?-1:1}}]),t}(a.default.Inline);s.allowedChildren=[s,a.default.Embed,o.default],s.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],t.default=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(0))&&r.__esModule?r:{default:r}).default.Text);t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=a(n(54));function a(e){return e&&e.__esModule?e:{default:e}}var l=(0,a(n(10)).default)("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(function(e){document.addEventListener(e,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(e){if(e.__quill&&e.__quill.emitter){var n;(n=e.__quill.emitter).handleDOM.apply(n,t)}})})});var s=function(e){function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.listeners={},e.on("error",l.error),e}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"emit",value:function(){l.log.apply(l,arguments),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(this.listeners[e.type]||[]).forEach(function(t){var r=t.node,i=t.handler;(e.target===r||r.contains(e.target))&&i.apply(void 0,[e].concat(n))})}},{key:"listenDOM",value:function(e,t,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push({node:t,handler:n})}}]),t}(o.default);s.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},s.sources={API:"api",SILENT:"silent",USER:"user"},t.default=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.quill=t,this.options=n};r.DEFAULTS={},t.default=r},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=["error","warn","log","info"],i="warn";function o(e){if(r.indexOf(e)<=r.indexOf(i)){for(var t,n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];(t=console)[e].apply(t,o)}}function a(e){return r.reduce(function(t,n){return t[n]=o.bind(console,n,e),t},{})}o.level=a.level=function(e){i=e},t.default=a},function(e,t,n){var r=Array.prototype.slice,i=n(52),o=n(53),a=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():e&&t&&("object"==typeof e||"object"==typeof t)?function(e,t,n){if(null==e||null==t||e.prototype!==t.prototype)return!1;if(o(e))return!!o(t)&&a(e=r.call(e),t=r.call(t),n);if(l(e)){if(!l(t)||e.length!==t.length)return!1;for(s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}try{var s,u,c=i(e),d=i(t)}catch(e){return!1}if(c.length!=d.length)return!1;for(c.sort(),d.sort(),s=c.length-1;s>=0;s--)if(c[s]!=d[s])return!1;for(s=c.length-1;s>=0;s--)if(!a(e[u=c[s]],t[u],n))return!1;return typeof e==typeof t}(e,t,n):n.strict?e===t:e==t)};function l(e){return!!e&&"object"==typeof e&&"number"==typeof e.length&&"function"==typeof e.copy&&"function"==typeof e.slice&&(!(e.length>0)||"number"==typeof e[0])}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(e,t,n){void 0===n&&(n={}),this.attrName=e,this.keyName=t;var i=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|i:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return e.keys=function(e){return[].map.call(e.attributes,function(e){return e.name})},e.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)},e.prototype.canAdd=function(e,t){return null!=r.query(e,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1))},e.prototype.remove=function(e){e.removeAttribute(this.keyName)},e.prototype.value=function(e){var t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""},e}();t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Code=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=d(n(2)),l=d(n(0)),s=d(n(4)),u=d(n(6)),c=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function p(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=function(e){function t(){return h(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),t}(u.default);g.blotName="code",g.tagName="CODE";var m=function(e){function t(){return h(this,t),f(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),i(t,[{key:"delta",value:function(){var e=this,t=this.domNode.textContent;return t.endsWith("\n")&&(t=t.slice(0,-1)),t.split("\n").reduce(function(t,n){return t.insert(n).insert("\n",e.formats())},new a.default)}},{key:"format",value:function(e,n){if(e!==this.statics.blotName||!n){var i=r(this.descendant(c.default,this.length()-1),1)[0];null!=i&&i.deleteAt(i.length()-1,1),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}},{key:"formatAt",value:function(e,n,r,i){if(0!==n&&null!=l.default.query(r,l.default.Scope.BLOCK)&&(r!==this.statics.blotName||i!==this.statics.formats(this.domNode))){var o=this.newlineIndex(e);if(!(o<0)&&!(o>=e+n)){var a=this.newlineIndex(e,!0)+1,s=o-a+1,u=this.isolate(a,s),c=u.next;u.format(r,i),c instanceof t&&c.formatAt(0,e-a+n-s,r,i)}}}},{key:"insertAt",value:function(e,t,n){if(null==n){var i=r(this.descendant(c.default,e),2),o=i[0],a=i[1];o.insertAt(a,t)}}},{key:"length",value:function(){var e=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?e:e+1}},{key:"newlineIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t)return this.domNode.textContent.slice(0,e).lastIndexOf("\n");var n=this.domNode.textContent.slice(e).indexOf("\n");return n>-1?e+n:-1}},{key:"optimize",value:function(e){this.domNode.textContent.endsWith("\n")||this.appendChild(l.default.create("text","\n")),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(e),n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(e){var t=l.default.find(e);null==t?e.parentNode.removeChild(e):t instanceof l.default.Embed?t.remove():t.unwrap()})}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),t}(s.default);m.blotName="code-block",m.tagName="PRE",m.TAB=" ",t.Code=g,t.default=m},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=v(n(2)),l=v(n(20)),s=v(n(0)),u=v(n(13)),c=v(n(24)),d=n(4),h=v(d),f=v(n(16)),p=v(n(21)),g=v(n(11)),m=v(n(3));function v(e){return e&&e.__esModule?e:{default:e}}var y=/^[ -~]*$/,b=function(){function e(t){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.scroll=t,this.delta=this.getDelta()}return o(e,[{key:"applyDelta",value:function(e){var t=this,n=!1;this.scroll.update();var o=this.scroll.length();return this.scroll.batchStart(),(e=e.reduce(function(e,t){if(1===t.insert){var n=(0,p.default)(t.attributes);return delete n.image,e.insert({image:t.attributes.image},n)}if(null!=t.attributes&&(!0===t.attributes.list||!0===t.attributes.bullet)&&((t=(0,p.default)(t)).attributes.list?t.attributes.list="ordered":(t.attributes.list="bullet",delete t.attributes.bullet)),"string"==typeof t.insert){var r=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(r,t.attributes)}return e.push(t)},new a.default)).reduce(function(e,a){var u=a.retain||a.delete||a.insert.length||1,c=a.attributes||{};if(null!=a.insert){if("string"==typeof a.insert){var f=a.insert;f.endsWith("\n")&&n&&(n=!1,f=f.slice(0,-1)),e>=o&&!f.endsWith("\n")&&(n=!0),t.scroll.insertAt(e,f);var p=i(t.scroll.line(e),2),g=p[0],v=p[1],y=(0,m.default)({},(0,d.bubbleFormats)(g));if(g instanceof h.default){var b=i(g.descendant(s.default.Leaf,v),1)[0];y=(0,m.default)(y,(0,d.bubbleFormats)(b))}c=l.default.attributes.diff(y,c)||{}}else if("object"===r(a.insert)){var w=Object.keys(a.insert)[0];if(null==w)return e;t.scroll.insertAt(e,w,a.insert[w])}o+=u}return Object.keys(c).forEach(function(n){t.scroll.formatAt(e,u,n,c[n])}),e+u},0),e.reduce(function(e,n){return"number"==typeof n.delete?(t.scroll.deleteAt(e,n.delete),e):e+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(e)}},{key:"deleteText",value:function(e,t){return this.scroll.deleteAt(e,t),this.update(new a.default().retain(e).delete(t))}},{key:"formatLine",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(i){if(null==n.scroll.whitelist||n.scroll.whitelist[i]){var o=n.scroll.lines(e,Math.max(t,1)),a=t;o.forEach(function(t){var o=t.length();if(t instanceof u.default){var l=e-t.offset(n.scroll),s=t.newlineIndex(l+a)-l+1;t.formatAt(l,s,i,r[i])}else t.format(i,r[i]);a-=o})}}),this.scroll.optimize(),this.update(new a.default().retain(e).retain(t,(0,p.default)(r)))}},{key:"formatText",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(i){n.scroll.formatAt(e,t,i,r[i])}),this.update(new a.default().retain(e).retain(t,(0,p.default)(r)))}},{key:"getContents",value:function(e,t){return this.delta.slice(e,e+t)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(e,t){return e.concat(t.delta())},new a.default)}},{key:"getFormat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===t?this.scroll.path(e).forEach(function(e){var t=i(e,1)[0];t instanceof h.default?n.push(t):t instanceof s.default.Leaf&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(s.default.Leaf,e,t));var o=[n,r].map(function(e){if(0===e.length)return{};for(var t=(0,d.bubbleFormats)(e.shift());Object.keys(t).length>0;){var n=e.shift();if(null==n)break;t=function(e,t){return Object.keys(t).reduce(function(n,r){return null==e[r]||(t[r]===e[r]?n[r]=t[r]:Array.isArray(t[r])?0>t[r].indexOf(e[r])&&(n[r]=t[r].concat([e[r]])):n[r]=[t[r],e[r]]),n},{})}((0,d.bubbleFormats)(n),t)}return t});return m.default.apply(m.default,o)}},{key:"getText",value:function(e,t){return this.getContents(e,t).filter(function(e){return"string"==typeof e.insert}).map(function(e){return e.insert}).join("")}},{key:"insertEmbed",value:function(e,t,n){var r;return this.scroll.insertAt(e,t,n),this.update(new a.default().retain(e).insert((t in(r={})?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r)))}},{key:"insertText",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(r).forEach(function(i){n.scroll.formatAt(e,t.length,i,r[i])}),this.update(new a.default().retain(e).insert(t,(0,p.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var e=this.scroll.children.head;return e.statics.blotName===h.default.blotName&&!(e.children.length>1)&&e.children.head instanceof f.default}},{key:"removeFormat",value:function(e,t){var n=this.getText(e,t),r=i(this.scroll.line(e+t),2),o=r[0],l=r[1],s=0,c=new a.default;null!=o&&(s=o instanceof u.default?o.newlineIndex(l)-l+1:o.length()-l,c=o.delta().slice(l,l+s-1).insert("\n"));var d=this.getContents(e,t+s).diff(new a.default().insert(n).concat(c)),h=new a.default().retain(e).concat(d);return this.applyDelta(h)}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(y)&&s.default.find(t[0].target)){var i=s.default.find(t[0].target),o=(0,d.bubbleFormats)(i),l=i.offset(this.scroll),u=t[0].oldValue.replace(c.default.CONTENTS,""),h=new a.default().insert(u),f=new a.default().insert(i.value());e=new a.default().retain(l).concat(h.diff(f,n)).reduce(function(e,t){return t.insert?e.insert(t.insert,o):e.push(t)},new a.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),e&&(0,g.default)(r.compose(e),this.delta)||(e=r.diff(this.delta,n));return e}}]),e}();t.default=b},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Range=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=u(n(0)),a=u(n(21)),l=u(n(11)),s=u(n(8));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){if(!Array.isArray(e))return Array.from(e);for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}function d(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var h=(0,u(n(10)).default)("quill:selection"),f=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;d(this,e),this.index=t,this.length=n},p=function(){function e(t,n){var r=this;d(this,e),this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=o.default.create("cursor",this),this.lastRange=this.savedRange=new f(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){r.mouseDown||setTimeout(r.update.bind(r,s.default.sources.USER),1)}),this.emitter.on(s.default.events.EDITOR_CHANGE,function(e,t){e===s.default.events.TEXT_CHANGE&&t.length()>0&&r.update(s.default.sources.SILENT)}),this.emitter.on(s.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var e=r.getNativeRange();null!=e&&e.start.node!==r.cursor.textNode&&r.emitter.once(s.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset)}catch(e){}})}}),this.emitter.on(s.default.events.SCROLL_OPTIMIZE,function(e,t){if(t.range){var n=t.range,i=n.startNode,o=n.startOffset,a=n.endNode,l=n.endOffset;r.setNativeRange(i,o,a,l)}}),this.update(s.default.sources.SILENT)}return i(e,[{key:"handleComposition",value:function(){var e=this;this.root.addEventListener("compositionstart",function(){e.composing=!0}),this.root.addEventListener("compositionend",function(){if(e.composing=!1,e.cursor.parent){var t=e.cursor.restore();t&&setTimeout(function(){e.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}},{key:"handleDragging",value:function(){var e=this;this.emitter.listenDOM("mousedown",document.body,function(){e.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){e.mouseDown=!1,e.update(s.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(e,t){if(null==this.scroll.whitelist||this.scroll.whitelist[e]){this.scroll.update();var n=this.getNativeRange();if(!(null==n||!n.native.collapsed||o.default.query(e,o.default.Scope.BLOCK))){if(n.start.node!==this.cursor.textNode){var r=o.default.find(n.start.node,!1);if(null==r)return;if(r instanceof o.default.Leaf){var i=r.split(n.start.offset);r.parent.insertBefore(this.cursor,i)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min((e=Math.min(e,n-1))+t,n-1)-e;var i=void 0,o=r(this.scroll.leaf(e),2),a=o[0],l=o[1];if(null==a)return null;var s=r(a.position(l,!0),2);i=s[0],l=s[1];var u=document.createRange();if(t>0){u.setStart(i,l);var c=r(this.scroll.leaf(e+t),2);if(a=c[0],l=c[1],null==a)return null;var d=r(a.position(l,!0),2);return i=d[0],l=d[1],u.setEnd(i,l),u.getBoundingClientRect()}var h="left",f=void 0;return i instanceof Text?(l<i.data.length?(u.setStart(i,l),u.setEnd(i,l+1)):(u.setStart(i,l-1),u.setEnd(i,l),h="right"),f=u.getBoundingClientRect()):(f=a.domNode.getBoundingClientRect(),l>0&&(h="right")),{bottom:f.top+f.height,height:f.height,left:f[h],right:f[h],top:f.top,width:0}}},{key:"getNativeRange",value:function(){var e=document.getSelection();if(null==e||e.rangeCount<=0)return null;var t=e.getRangeAt(0);if(null==t)return null;var n=this.normalizeNative(t);return h.info("getNativeRange",n),n}},{key:"getRange",value:function(){var e=this.getNativeRange();return null==e?[null,null]:[this.normalizedToRange(e),e]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(e){var t=this,n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);var i=n.map(function(e){var n=r(e,2),i=n[0],a=n[1],l=o.default.find(i,!0),s=l.offset(t.scroll);return 0===a?s:l instanceof o.default.Container?s+l.length():s+l.index(i,a)}),a=Math.min(Math.max.apply(Math,c(i)),this.scroll.length()-1),l=Math.min.apply(Math,[a].concat(c(i)));return new f(l,a-l)}},{key:"normalizeNative",value:function(e){if(!g(this.root,e.startContainer)||!e.collapsed&&!g(this.root,e.endContainer))return null;var t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(function(e){for(var t=e.node,n=e.offset;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else if(t.childNodes.length===n)n=(t=t.lastChild)instanceof Text?t.data.length:t.childNodes.length+1;else break;e.node=t,e.offset=n}),t}},{key:"rangeToNative",value:function(e){var t=this,n=e.collapsed?[e.index]:[e.index,e.index+e.length],i=[],o=this.scroll.length();return n.forEach(function(e,n){e=Math.min(o-1,e);var a=void 0,l=r(t.scroll.leaf(e),2),s=l[0],u=l[1],c=r(s.position(u,0!==n),2);a=c[0],u=c[1],i.push(a,u)}),i.length<2&&(i=i.concat(i)),i}},{key:"scrollIntoView",value:function(e){var t=this.lastRange;if(null!=t){var n=this.getBounds(t.index,t.length);if(null!=n){var i=this.scroll.length()-1,o=r(this.scroll.line(Math.min(t.index,i)),1)[0],a=o;if(t.length>0&&(a=r(this.scroll.line(Math.min(t.index+t.length,i)),1)[0]),null!=o&&null!=a){var l=e.getBoundingClientRect();n.top<l.top?e.scrollTop-=l.top-n.top:n.bottom>l.bottom&&(e.scrollTop+=n.bottom-l.bottom)}}}}},{key:"setNativeRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(h.info("setNativeRange",e,t,n,r),null==e||null!=this.root.parentNode&&null!=e.parentNode&&null!=n.parentNode){var o=document.getSelection();if(null!=o){if(null!=e){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||i||e!==a.startContainer||t!==a.startOffset||n!==a.endContainer||r!==a.endOffset){"BR"==e.tagName&&(t=[].indexOf.call(e.parentNode.childNodes,e),e=e.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var l=document.createRange();l.setStart(e,t),l.setEnd(n,r),o.removeAllRanges(),o.addRange(l)}}else o.removeAllRanges(),this.root.blur(),document.body.focus()}}}},{key:"setRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.default.sources.API;if("string"==typeof t&&(n=t,t=!1),h.info("setRange",e),null!=e){var r=this.rangeToNative(e);this.setNativeRange.apply(this,c(r).concat([t]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.default.sources.USER,t=this.lastRange,n=r(this.getRange(),2),i=n[0],o=n[1];if(this.lastRange=i,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,l.default)(t,this.lastRange)){!this.composing&&null!=o&&o.native.collapsed&&o.start.node!==this.cursor.textNode&&this.cursor.restore();var u,c,d=[s.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(t),e];(u=this.emitter).emit.apply(u,[s.default.events.EDITOR_CHANGE].concat(d)),e!==s.default.sources.SILENT&&(c=this.emitter).emit.apply(c,d)}}}]),e}();function g(e,t){try{t.parentNode}catch(e){return!1}return t instanceof Text&&(t=t.parentNode),e.contains(t)}t.Range=f,t.default=p},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"insertInto",value:function(e,n){0===e.children.length?o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertInto",this).call(this,e,n):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),t}(((r=n(0))&&r.__esModule?r:{default:r}).default.Embed);a.blotName="break",a.tagName="BR",t.default=a},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(44),a=n(30),l=n(1),s=function(e){function t(t){var n=e.call(this,t)||this;return n.build(),n}return i(t,e),t.prototype.appendChild=function(e){this.insertBefore(e)},t.prototype.attach=function(){e.prototype.attach.call(this),this.children.forEach(function(e){e.attach()})},t.prototype.build=function(){var e=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(t){try{var n=u(t);e.insertBefore(n,e.children.head||void 0)}catch(e){if(e instanceof l.ParchmentError)return;throw e}})},t.prototype.deleteAt=function(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,function(e,t,n){e.deleteAt(t,n)})},t.prototype.descendant=function(e,n){var r=this.children.find(n),i=r[0],o=r[1];return null==e.blotName&&e(i)||null!=e.blotName&&i instanceof e?[i,o]:i instanceof t?i.descendant(e,o):[null,-1]},t.prototype.descendants=function(e,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var i=[],o=r;return this.children.forEachAt(n,r,function(n,r,a){(null==e.blotName&&e(n)||null!=e.blotName&&n instanceof e)&&i.push(n),n instanceof t&&(i=i.concat(n.descendants(e,r,o))),o-=a}),i},t.prototype.detach=function(){this.children.forEach(function(e){e.detach()}),e.prototype.detach.call(this)},t.prototype.formatAt=function(e,t,n,r){this.children.forEachAt(e,t,function(e,t,i){e.formatAt(t,i,n,r)})},t.prototype.insertAt=function(e,t,n){var r=this.children.find(e),i=r[0],o=r[1];if(i)i.insertAt(o,t,n);else{var a=null==n?l.create("text",t):l.create(t,n);this.appendChild(a)}},t.prototype.insertBefore=function(e,t){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(t){return e instanceof t}))throw new l.ParchmentError("Cannot insert "+e.statics.blotName+" into "+this.statics.blotName);e.insertInto(this,t)},t.prototype.length=function(){return this.children.reduce(function(e,t){return e+t.length()},0)},t.prototype.moveChildren=function(e,t){this.children.forEach(function(n){e.insertBefore(n,t)})},t.prototype.optimize=function(t){if(e.prototype.optimize.call(this,t),0===this.children.length){if(null!=this.statics.defaultChild){var n=l.create(this.statics.defaultChild);this.appendChild(n),n.optimize(t)}else this.remove()}},t.prototype.path=function(e,n){void 0===n&&(n=!1);var r=this.children.find(e,n),i=r[0],o=r[1],a=[[this,e]];return i instanceof t?a.concat(i.path(o,n)):(null!=i&&a.push([i,o]),a)},t.prototype.removeChild=function(e){this.children.remove(e)},t.prototype.replace=function(n){n instanceof t&&n.moveChildren(this),e.prototype.replace.call(this,n)},t.prototype.split=function(e,t){if(void 0===t&&(t=!1),!t){if(0===e)return this;if(e===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(e,this.length(),function(e,r,i){e=e.split(r,t),n.appendChild(e)}),n},t.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},t.prototype.update=function(e,t){var n=this,r=[],i=[];e.forEach(function(e){e.target===n.domNode&&"childList"===e.type&&(r.push.apply(r,e.addedNodes),i.push.apply(i,e.removedNodes))}),i.forEach(function(e){if(!(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var t=l.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===n.domNode)&&t.detach()}}),r.filter(function(e){return e.parentNode==n.domNode}).sort(function(e,t){return e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(e){var t=null;null!=e.nextSibling&&(t=l.find(e.nextSibling));var r=u(e);(r.next!=t||null==r.next)&&(null!=r.parent&&r.parent.removeChild(n),n.insertBefore(r,t||void 0))})},t}(a.default);function u(e){var t=l.find(e);if(null==t)try{t=l.create(e)}catch(n){t=l.create(l.Scope.INLINE),[].slice.call(e.childNodes).forEach(function(e){t.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(t.domNode,e),t.attach()}return t}t.default=s},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(12),a=n(31),l=n(17),s=n(1),u=function(e){function t(t){var n=e.call(this,t)||this;return n.attributes=new a.default(n.domNode),n}return i(t,e),t.formats=function(e){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?e.tagName.toLowerCase():void 0)},t.prototype.format=function(e,t){var n=s.query(e);n instanceof o.default?this.attributes.attribute(n,t):t&&null!=n&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)},t.prototype.formats=function(){var e=this.attributes.values(),t=this.statics.formats(this.domNode);return null!=t&&(e[this.statics.blotName]=t),e},t.prototype.replaceWith=function(t,n){var r=e.prototype.replaceWith.call(this,t,n);return this.attributes.copy(r),r},t.prototype.update=function(t,n){var r=this;e.prototype.update.call(this,t,n),t.some(function(e){return e.target===r.domNode&&"attributes"===e.type})&&this.attributes.build()},t.prototype.wrap=function(n,r){var i=e.prototype.wrap.call(this,n,r);return i instanceof t&&i.statics.scope===this.statics.scope&&this.attributes.move(i),i},t}(l.default);t.default=u},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(30),a=n(1),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.value=function(e){return!0},t.prototype.index=function(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1},t.prototype.position=function(e,t){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]},t.prototype.value=function(){var e;return(e={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,e},t.scope=a.Scope.INLINE_BLOT,t}(o.default);t.default=l},function(e,t,n){var r=n(11),i=n(3),o={attributes:{compose:function(e,t,n){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var r=i(!0,{},t);for(var o in n||(r=Object.keys(r).reduce(function(e,t){return null!=r[t]&&(e[t]=r[t]),e},{})),e)void 0!==e[o]&&void 0===t[o]&&(r[o]=e[o]);return Object.keys(r).length>0?r:void 0},diff:function(e,t){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var n=Object.keys(e).concat(Object.keys(t)).reduce(function(n,i){return r(e[i],t[i])||(n[i]=void 0===t[i]?null:t[i]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(e,t,n){if("object"!=typeof e)return t;if("object"==typeof t){if(!n)return t;var r=Object.keys(t).reduce(function(n,r){return void 0===e[r]&&(n[r]=t[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(e){return new a(e)},length:function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"string"==typeof e.insert?e.insert.length:1}};function a(e){this.ops=e,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(e){e||(e=1/0);var t=this.ops[this.index];if(!t)return{retain:1/0};var n=this.offset,r=o.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};var i={};return t.attributes&&(i.attributes=t.attributes),"number"==typeof t.retain?i.retain=e:"string"==typeof t.insert?i.insert=t.insert.substr(n,e):i.insert=t.insert,i},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},a.prototype.peekType=function(){if(this.ops[this.index]){if("number"==typeof this.ops[this.index].delete)return"delete";if("number"!=typeof this.ops[this.index].retain)return"insert"}return"retain"},a.prototype.rest=function(){if(!this.hasNext())return[];if(0===this.offset)return this.ops.slice(this.index);var e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)},e.exports=o},function(e,t){var n=function(){var e,t,n;function r(e,t){return null!=t&&e instanceof t}try{e=Map}catch(t){e=function(){}}try{t=Set}catch(e){t=function(){}}try{n=Promise}catch(e){n=function(){}}function i(o,l,s,u,c){"object"==typeof l&&(s=l.depth,u=l.prototype,c=l.includeNonEnumerable,l=l.circular);var d=[],h=[];return void 0===l&&(l=!0),void 0===s&&(s=1/0),function o(s,f){if(null===s)return null;if(0===f||"object"!=typeof s)return s;if(r(s,e))p=new e;else if(r(s,t))p=new t;else if(r(s,n))p=new n(function(e,t){s.then(function(t){e(o(t,f-1))},function(e){t(o(e,f-1))})});else if(i.__isArray(s))p=[];else if(i.__isRegExp(s))p=new RegExp(s.source,a(s)),s.lastIndex&&(p.lastIndex=s.lastIndex);else if(i.__isDate(s))p=new Date(s.getTime());else{if(ov.isBuffer(s))return p=ov.allocUnsafe?ov.allocUnsafe(s.length):new ov(s.length),s.copy(p),p;r(s,Error)?p=Object.create(s):void 0===u?p=Object.create(g=Object.getPrototypeOf(s)):(p=Object.create(u),g=u)}if(l){var p,g,m,v=d.indexOf(s);if(-1!=v)return h[v];d.push(s),h.push(p)}for(var y in r(s,e)&&s.forEach(function(e,t){var n=o(t,f-1),r=o(e,f-1);p.set(n,r)}),r(s,t)&&s.forEach(function(e){var t=o(e,f-1);p.add(t)}),s)g&&(m=Object.getOwnPropertyDescriptor(g,y)),m&&null==m.set||(p[y]=o(s[y],f-1));if(Object.getOwnPropertySymbols)for(var b=Object.getOwnPropertySymbols(s),y=0;y<b.length;y++){var w=b[y],x=Object.getOwnPropertyDescriptor(s,w);(!x||x.enumerable||c)&&(p[w]=o(s[w],f-1),x.enumerable||Object.defineProperty(p,w,{enumerable:!1}))}if(c)for(var _=Object.getOwnPropertyNames(s),y=0;y<_.length;y++){var E=_[y],x=Object.getOwnPropertyDescriptor(s,E);x&&x.enumerable||(p[E]=o(s[E],f-1),Object.defineProperty(p,E,{enumerable:!1}))}return p}(o,s)}function o(e){return Object.prototype.toString.call(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return i.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},i.__objToStr=o,i.__isDate=function(e){return"object"==typeof e&&"[object Date]"===o(e)},i.__isArray=function(e){return"object"==typeof e&&"[object Array]"===o(e)},i.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===o(e)},i.__getRegExpFlags=a,i}();"object"==typeof e&&e.exports&&(e.exports=n)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=f(n(0)),l=f(n(8)),s=n(4),u=f(s),c=f(n(16)),d=f(n(13)),h=f(n(25));function f(e){return e&&e.__esModule?e:{default:e}}function p(e){return e instanceof u.default||e instanceof s.BlockEmbed}var g=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.emitter=n.emitter,Array.isArray(n.whitelist)&&(r.whitelist=n.whitelist.reduce(function(e,t){return e[t]=!0,e},{})),r.domNode.addEventListener("DOMNodeInserted",function(){}),r.optimize(),r.enable(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(e,n){var i=r(this.line(e),2),a=i[0],l=i[1],u=r(this.line(e+n),1)[0];if(o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"deleteAt",this).call(this,e,n),null!=u&&a!==u&&l>0){if(a instanceof s.BlockEmbed||u instanceof s.BlockEmbed){this.optimize();return}if(a instanceof d.default){var h=a.newlineIndex(a.length(),!0);if(h>-1&&(a=a.split(h+1))===u){this.optimize();return}}else if(u instanceof d.default){var f=u.newlineIndex(0);f>-1&&u.split(f+1)}var p=u.children.head instanceof c.default?null:u.children.head;a.moveChildren(u,p),a.remove()}this.optimize()}},{key:"enable",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.domNode.setAttribute("contenteditable",e)}},{key:"formatAt",value:function(e,n,r,i){(null==this.whitelist||this.whitelist[r])&&(o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,n,r,i),this.optimize())}},{key:"insertAt",value:function(e,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(e>=this.length()){if(null==r||null==a.default.query(n,a.default.Scope.BLOCK)){var i=a.default.create(this.statics.defaultChild);this.appendChild(i),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),i.insertAt(0,n,r)}else{var l=a.default.create(n,r);this.appendChild(l)}}else o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,r);this.optimize()}}},{key:"insertBefore",value:function(e,n){if(e.statics.scope===a.default.Scope.INLINE_BLOT){var r=a.default.create(this.statics.defaultChild);r.appendChild(e),e=r}o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n)}},{key:"leaf",value:function(e){return this.path(e).pop()||[null,-1]}},{key:"line",value:function(e){return e===this.length()?this.line(e-1):this.descendant(p,e)}},{key:"lines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return function e(t,n,r){var i=[],o=r;return t.children.forEachAt(n,r,function(t,n,r){p(t)?i.push(t):t instanceof a.default.Container&&(i=i.concat(e(t,n,o))),o-=r}),i}(this,e,t)}},{key:"optimize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e,n),e.length>0&&this.emitter.emit(l.default.events.SCROLL_OPTIMIZE,e,n))}},{key:"path",value:function(e){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,e).slice(1)}},{key:"update",value:function(e){if(!0!==this.batch){var n=l.default.sources.USER;"string"==typeof e&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e.length>0&&this.emitter.emit(l.default.events.SCROLL_BEFORE_UPDATE,n,e),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"update",this).call(this,e.concat([])),e.length>0&&this.emitter.emit(l.default.events.SCROLL_UPDATE,n,e)}}}]),t}(a.default.Scroll);g.blotName="scroll",g.className="ql-editor",g.tagName="DIV",g.defaultChild="block",g.allowedChildren=[u.default,s.BlockEmbed,h.default],t.default=g},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SHORTKEY=t.default=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=g(n(21)),l=g(n(11)),s=g(n(3)),u=g(n(2)),c=g(n(20)),d=g(n(0)),h=g(n(5)),f=g(n(10)),p=g(n(9));function g(e){return e&&e.__esModule?e:{default:e}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=(0,f.default)("quill:keyboard"),y=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",b=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.bindings={},Object.keys(r.options.bindings).forEach(function(t){("list autofill"!==t||null==e.scroll.whitelist||e.scroll.whitelist.list)&&r.options.bindings[t]&&r.addBinding(r.options.bindings[t])}),r.addBinding({key:t.keys.ENTER,shiftKey:null},S),r.addBinding({key:t.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(r.addBinding({key:t.keys.BACKSPACE},{collapsed:!0},x),r.addBinding({key:t.keys.DELETE},{collapsed:!0},_)):(r.addBinding({key:t.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},x),r.addBinding({key:t.keys.DELETE},{collapsed:!0,suffix:/^.?$/},_)),r.addBinding({key:t.keys.BACKSPACE},{collapsed:!1},E),r.addBinding({key:t.keys.DELETE},{collapsed:!1},E),r.addBinding({key:t.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},x),r.listen(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,null,[{key:"match",value:function(e,t){return t=k(t),!["altKey","ctrlKey","metaKey","shiftKey"].some(function(n){return!!t[n]!==e[n]&&null!==t[n]})&&t.key===(e.which||e.keyCode)}}]),o(t,[{key:"addBinding",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=k(e);if(null==r||null==r.key)return v.warn("Attempted to add invalid keyboard binding",r);"function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n}),r=(0,s.default)(r,t,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var e=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var o=n.which||n.keyCode,a=(e.bindings[o]||[]).filter(function(e){return t.match(n,e)});if(0!==a.length){var s=e.quill.getSelection();if(null!=s&&e.quill.hasFocus()){var u=i(e.quill.getLine(s.index),2),c=u[0],h=u[1],f=i(e.quill.getLeaf(s.index),2),p=f[0],g=f[1],m=i(0===s.length?[p,g]:e.quill.getLeaf(s.index+s.length),2),v=m[0],y=m[1],b=p instanceof d.default.Text?p.value().slice(0,g):"",w=v instanceof d.default.Text?v.value().slice(y):"",x={collapsed:0===s.length,empty:0===s.length&&1>=c.length(),format:e.quill.getFormat(s),offset:h,prefix:b,suffix:w};a.some(function(t){if(null!=t.collapsed&&t.collapsed!==x.collapsed||null!=t.empty&&t.empty!==x.empty||null!=t.offset&&t.offset!==x.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(function(e){return null==x.format[e]}))return!1}else if("object"===r(t.format)&&!Object.keys(t.format).every(function(e){return!0===t.format[e]?null!=x.format[e]:!1===t.format[e]?null==x.format[e]:(0,l.default)(t.format[e],x.format[e])}))return!1;return!!((null==t.prefix||t.prefix.test(x.prefix))&&(null==t.suffix||t.suffix.test(x.suffix)))&&!0!==t.handler.call(e,s,x)})&&n.preventDefault()}}}})}}]),t}(p.default);function w(e,t){var n,r=e===b.keys.LEFT?"prefix":"suffix";return m(n={key:e,shiftKey:t,altKey:null},r,/^$/),m(n,"handler",function(n){var r=n.index;return e===b.keys.RIGHT&&(r+=n.length+1),!(i(this.quill.getLeaf(r),1)[0]instanceof d.default.Embed)||(e===b.keys.LEFT?t?this.quill.setSelection(n.index-1,n.length+1,h.default.sources.USER):this.quill.setSelection(n.index-1,h.default.sources.USER):t?this.quill.setSelection(n.index,n.length+1,h.default.sources.USER):this.quill.setSelection(n.index+n.length+1,h.default.sources.USER),!1)}),n}function x(e,t){if(!(0===e.index||1>=this.quill.getLength())){var n=i(this.quill.getLine(e.index),1)[0],r={};if(0===t.offset){var o=i(this.quill.getLine(e.index-1),1)[0];if(null!=o&&o.length()>1){var a=n.formats(),l=this.quill.getFormat(e.index-1,1);r=c.default.attributes.diff(a,l)||{}}}var s=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;this.quill.deleteText(e.index-s,s,h.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(e.index-s,s,r,h.default.sources.USER),this.quill.focus()}}function _(e,t){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(!(e.index>=this.quill.getLength()-n)){var r={},o=0,a=i(this.quill.getLine(e.index),1)[0];if(t.offset>=a.length()-1){var l=i(this.quill.getLine(e.index+1),1)[0];if(l){var s=a.formats(),u=this.quill.getFormat(e.index,1);r=c.default.attributes.diff(s,u)||{},o=l.length()}}this.quill.deleteText(e.index,n,h.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(e.index+o-1,n,r,h.default.sources.USER)}}function E(e){var t=this.quill.getLines(e),n={};if(t.length>1){var r=t[0].formats(),i=t[t.length-1].formats();n=c.default.attributes.diff(i,r)||{}}this.quill.deleteText(e,h.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(e.index,1,n,h.default.sources.USER),this.quill.setSelection(e.index,h.default.sources.SILENT),this.quill.focus()}function S(e,t){var n=this;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);var r=Object.keys(t.format).reduce(function(e,n){return d.default.query(n,d.default.Scope.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e},{});this.quill.insertText(e.index,"\n",r,h.default.sources.USER),this.quill.setSelection(e.index+1,h.default.sources.SILENT),this.quill.focus(),Object.keys(t.format).forEach(function(e){null!=r[e]||Array.isArray(t.format[e])||"link"===e||n.quill.format(e,t.format[e],h.default.sources.USER)})}function O(e){return{key:b.keys.TAB,shiftKey:!e,format:{"code-block":!0},handler:function(t){var n=d.default.query("code-block"),r=t.index,o=t.length,a=i(this.quill.scroll.descendant(n,r),2),l=a[0],s=a[1];if(null!=l){var u=this.quill.getIndex(l),c=l.newlineIndex(s,!0)+1,f=l.newlineIndex(u+s+o),p=l.domNode.textContent.slice(c,f).split("\n");s=0,p.forEach(function(t,i){e?(l.insertAt(c+s,n.TAB),s+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):t.startsWith(n.TAB)&&(l.deleteAt(c+s,n.TAB.length),s-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),s+=t.length+1}),this.quill.update(h.default.sources.USER),this.quill.setSelection(r,o,h.default.sources.SILENT)}}}}function C(e){return{key:e[0].toUpperCase(),shortKey:!0,handler:function(t,n){this.quill.format(e,!n.format[e],h.default.sources.USER)}}}function k(e){if("string"==typeof e||"number"==typeof e)return k({key:e});if((void 0===e?"undefined":r(e))==="object"&&(e=(0,a.default)(e,!1)),"string"==typeof e.key){if(null!=b.keys[e.key.toUpperCase()])e.key=b.keys[e.key.toUpperCase()];else{if(1!==e.key.length)return null;e.key=e.key.toUpperCase().charCodeAt(0)}}return e.shortKey&&(e[y]=e.shortKey,delete e.shortKey),e}b.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},b.DEFAULTS={bindings:{bold:C("bold"),italic:C("italic"),underline:C("underline"),indent:{key:b.keys.TAB,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","+1",h.default.sources.USER)}},outdent:{key:b.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","-1",h.default.sources.USER)}},"outdent backspace":{key:b.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(e,t){null!=t.format.indent?this.quill.format("indent","-1",h.default.sources.USER):null!=t.format.list&&this.quill.format("list",!1,h.default.sources.USER)}},"indent code-block":O(!0),"outdent code-block":O(!1),"remove tab":{key:b.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(e){this.quill.deleteText(e.index-1,1,h.default.sources.USER)}},tab:{key:b.keys.TAB,handler:function(e){this.quill.history.cutoff();var t=new u.default().retain(e.index).delete(e.length).insert(" ");this.quill.updateContents(t,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,h.default.sources.SILENT)}},"list empty enter":{key:b.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(e,t){this.quill.format("list",!1,h.default.sources.USER),t.format.indent&&this.quill.format("indent",!1,h.default.sources.USER)}},"checklist enter":{key:b.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(e){var t=i(this.quill.getLine(e.index),2),n=t[0],r=t[1],o=(0,s.default)({},n.formats(),{list:"checked"}),a=new u.default().retain(e.index).insert("\n",o).retain(n.length()-r-1).retain(1,{list:"unchecked"});this.quill.updateContents(a,h.default.sources.USER),this.quill.setSelection(e.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:b.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(e,t){var n=i(this.quill.getLine(e.index),2),r=n[0],o=n[1],a=new u.default().retain(e.index).insert("\n",t.format).retain(r.length()-o-1).retain(1,{header:null});this.quill.updateContents(a,h.default.sources.USER),this.quill.setSelection(e.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(e,t){var n=t.prefix.length,r=i(this.quill.getLine(e.index),2),o=r[0],a=r[1];if(a>n)return!0;var l=void 0;switch(t.prefix.trim()){case"[]":case"[ ]":l="unchecked";break;case"[x]":l="checked";break;case"-":case"*":l="bullet";break;default:l="ordered"}this.quill.insertText(e.index," ",h.default.sources.USER),this.quill.history.cutoff();var s=new u.default().retain(e.index-a).delete(n+1).retain(o.length()-2-a).retain(1,{list:l});this.quill.updateContents(s,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,h.default.sources.SILENT)}},"code exit":{key:b.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(e){var t=i(this.quill.getLine(e.index),2),n=t[0],r=t[1],o=new u.default().retain(e.index+n.length()-r-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(o,h.default.sources.USER)}},"embed left":w(b.keys.LEFT,!1),"embed left shift":w(b.keys.LEFT,!0),"embed right":w(b.keys.RIGHT,!1),"embed right shift":w(b.keys.RIGHT,!0)}},t.default=b,t.SHORTKEY=y},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=s(n(0)),l=s(n(7));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.selection=n,r.textNode=document.createTextNode(t.CONTENTS),r.domNode.appendChild(r.textNode),r._length=0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,null,[{key:"value",value:function(){}}]),o(t,[{key:"detach",value:function(){null!=this.parent&&this.parent.removeChild(this)}},{key:"format",value:function(e,n){if(0!==this._length)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n);for(var r=this,o=0;null!=r&&r.statics.scope!==a.default.Scope.BLOCK_BLOT;)o+=r.offset(r.parent),r=r.parent;null!=r&&(this._length=t.CONTENTS.length,r.optimize(),r.formatAt(o,t.CONTENTS.length,e,n),this._length=0)}},{key:"index",value:function(e,n){return e===this.textNode?0:i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"index",this).call(this,e,n)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!this.selection.composing&&null!=this.parent){var e=this.textNode,n=this.selection.getNativeRange(),i=void 0,o=void 0,s=void 0;if(null!=n&&n.start.node===e&&n.end.node===e){var u=[e,n.start.offset,n.end.offset];i=u[0],o=u[1],s=u[2]}for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==t.CONTENTS){var c=this.textNode.data.split(t.CONTENTS).join("");this.next instanceof l.default?(i=this.next.domNode,this.next.insertAt(0,c),this.textNode.data=t.CONTENTS):(this.textNode.data=c,this.parent.insertBefore(a.default.create(this.textNode),this),this.textNode=document.createTextNode(t.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),null!=o){var d=r([o,s].map(function(e){return Math.max(0,Math.min(i.data.length,e-1))}),2);return o=d[0],s=d[1],{startNode:i,startOffset:o,endNode:i,endOffset:s}}}}},{key:"update",value:function(e,t){var n=this;if(e.some(function(e){return"characterData"===e.type&&e.target===n.textNode})){var r=this.restore();r&&(t.range=r)}}},{key:"value",value:function(){return""}}]),t}(a.default.Embed);u.blotName="cursor",u.className="ql-cursor",u.tagName="span",u.CONTENTS="\uFEFF",t.default=u},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=n(4),o=a(i);function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(r.default.Container);l.allowedChildren=[o.default,i.BlockEmbed,l],t.default=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorStyle=t.ColorClass=t.ColorAttributor=void 0;var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=(r=n(0))&&r.__esModule?r:{default:r},l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"value",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e);return n.startsWith("rgb(")?"#"+(n=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"")).split(",").map(function(e){return("00"+parseInt(e).toString(16)).slice(-2)}).join(""):n}}]),t}(a.default.Attributor.Style),s=new a.default.Attributor.Class("color","ql-color",{scope:a.default.Scope.INLINE}),u=new l("color","color",{scope:a.default.Scope.INLINE});t.ColorAttributor=l,t.ColorClass=s,t.ColorStyle=u},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sanitize=t.default=void 0;var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"format",value:function(e,n){if(e!==this.statics.blotName||!n)return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n);n=this.constructor.sanitize(n),this.domNode.setAttribute("href",n)}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return e=this.sanitize(e),n.setAttribute("href",e),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}},{key:"formats",value:function(e){return e.getAttribute("href")}},{key:"sanitize",value:function(e){return l(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}}]),t}(((r=n(6))&&r.__esModule?r:{default:r}).default);function l(e,t){var n=document.createElement("a");n.href=e;var r=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(r)>-1}a.blotName="link",a.tagName="A",a.SANITIZED_URL="about:blank",a.PROTOCOL_WHITELIST=["http","https","mailto","tel"],t.default=a,t.sanitize=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=l(n(23)),a=l(n(107));function l(e){return e&&e.__esModule?e:{default:e}}var s=0;function u(e,t){e.setAttribute(t,"true"!==e.getAttribute(t))}var c=function(){function e(t){var n=this;(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){n.togglePicker()}),this.label.addEventListener("keydown",function(e){switch(e.keyCode){case o.default.keys.ENTER:n.togglePicker();break;case o.default.keys.ESCAPE:n.escape(),e.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}return i(e,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),u(this.label,"aria-expanded"),u(this.options,"aria-hidden")}},{key:"buildItem",value:function(e){var t=this,n=document.createElement("span");return n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item"),e.hasAttribute("value")&&n.setAttribute("data-value",e.getAttribute("value")),e.textContent&&n.setAttribute("data-label",e.textContent),n.addEventListener("click",function(){t.selectItem(n,!0)}),n.addEventListener("keydown",function(e){switch(e.keyCode){case o.default.keys.ENTER:t.selectItem(n,!0),e.preventDefault();break;case o.default.keys.ESCAPE:t.escape(),e.preventDefault()}}),n}},{key:"buildLabel",value:function(){var e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=a.default,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}},{key:"buildOptions",value:function(){var e=this,t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id="ql-picker-options-"+s,s+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,[].slice.call(this.select.options).forEach(function(n){var r=e.buildItem(n);t.appendChild(r),!0===n.selected&&e.selectItem(r)}),this.container.appendChild(t)}},{key:"buildPicker",value:function(){var e=this;[].slice.call(this.select.attributes).forEach(function(t){e.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var e=this;this.close(),setTimeout(function(){return e.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(e.parentNode.children,e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if(("undefined"==typeof Event?"undefined":r(Event))==="object"){var i=document.createEvent("Event");i.initEvent("change",!0,!0),this.select.dispatchEvent(i)}this.close()}}},{key:"update",value:function(){var e=void 0;if(this.select.selectedIndex>-1){var t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);var n=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),e}();t.default=c},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(0)),i=v(n(5)),o=n(4),a=v(o),l=v(n(16)),s=v(n(25)),u=v(n(24)),c=v(n(35)),d=v(n(6)),h=v(n(22)),f=v(n(7)),p=v(n(55)),g=v(n(42)),m=v(n(23));function v(e){return e&&e.__esModule?e:{default:e}}i.default.register({"blots/block":a.default,"blots/block/embed":o.BlockEmbed,"blots/break":l.default,"blots/container":s.default,"blots/cursor":u.default,"blots/embed":c.default,"blots/inline":d.default,"blots/scroll":h.default,"blots/text":f.default,"modules/clipboard":p.default,"modules/history":g.default,"modules/keyboard":m.default}),r.default.register(a.default,l.default,u.default,d.default,h.default,f.default),t.default=i.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(e){this.domNode=e,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(e.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),e.create=function(e){var t;if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");return Array.isArray(this.tagName)?("string"==typeof e&&parseInt(e=e.toUpperCase()).toString()===e&&(e=parseInt(e)),t="number"==typeof e?document.createElement(this.tagName[e-1]):this.tagName.indexOf(e)>-1?document.createElement(e):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t},e.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},e.prototype.clone=function(){var e=this.domNode.cloneNode(!1);return r.create(e)},e.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},e.prototype.deleteAt=function(e,t){this.isolate(e,t).remove()},e.prototype.formatAt=function(e,t,n,i){var o=this.isolate(e,t);if(null!=r.query(n,r.Scope.BLOT)&&i)o.wrap(n,i);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var a=r.create(this.statics.scope);o.wrap(a),a.format(n,i)}},e.prototype.insertAt=function(e,t,n){var i=null==n?r.create("text",t):r.create(t,n),o=this.split(e);this.parent.insertBefore(i,o)},e.prototype.insertInto=function(e,t){void 0===t&&(t=null),null!=this.parent&&this.parent.children.remove(this);var n=null;e.children.insertBefore(this,t),null!=t&&(n=t.domNode),(this.domNode.parentNode!=e.domNode||this.domNode.nextSibling!=n)&&e.domNode.insertBefore(this.domNode,n),this.parent=e,this.attach()},e.prototype.isolate=function(e,t){var n=this.split(e);return n.split(t),n},e.prototype.length=function(){return 1},e.prototype.offset=function(e){return(void 0===e&&(e=this.parent),null==this.parent||this==e)?0:this.parent.children.offset(this)+this.parent.offset(e)},e.prototype.optimize=function(e){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},e.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},e.prototype.replace=function(e){null!=e.parent&&(e.parent.insertBefore(this,e.next),e.remove())},e.prototype.replaceWith=function(e,t){var n="string"==typeof e?r.create(e,t):e;return n.replace(this),n},e.prototype.split=function(e,t){return 0===e?this:this.next},e.prototype.update=function(e,t){},e.prototype.wrap=function(e,t){var n="string"==typeof e?r.create(e,t):e;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},e.blotName="abstract",e}();t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(32),o=n(33),a=n(1),l=function(){function e(e){this.attributes={},this.domNode=e,this.build()}return e.prototype.attribute=function(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])},e.prototype.build=function(){var e=this;this.attributes={};var t=r.default.keys(this.domNode),n=i.default.keys(this.domNode),l=o.default.keys(this.domNode);t.concat(n).concat(l).forEach(function(t){var n=a.query(t,a.Scope.ATTRIBUTE);n instanceof r.default&&(e.attributes[n.attrName]=n)})},e.prototype.copy=function(e){var t=this;Object.keys(this.attributes).forEach(function(n){var r=t.attributes[n].value(t.domNode);e.format(n,r)})},e.prototype.move=function(e){var t=this;this.copy(e),Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)}),this.attributes={}},e.prototype.values=function(){var e=this;return Object.keys(this.attributes).reduce(function(t,n){return t[n]=e.attributes[n].value(e.domNode),t},{})},e}();t.default=l},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function o(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(function(e){return 0===e.indexOf(t+"-")})}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.keys=function(e){return(e.getAttribute("class")||"").split(/\s+/).map(function(e){return e.split("-").slice(0,-1).join("-")})},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(this.keyName+"-"+t),!0)},t.prototype.remove=function(e){o(e,this.keyName).forEach(function(t){e.classList.remove(t)}),0===e.classList.length&&e.removeAttribute("class")},t.prototype.value=function(e){var t=(o(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=a},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function o(e){var t=e.split("-"),n=t.slice(1).map(function(e){return e[0].toUpperCase()+e.slice(1)}).join("");return t[0]+n}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.keys=function(e){return(e.getAttribute("style")||"").split(";").map(function(e){return e.split(":")[0].trim()})},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.style[o(this.keyName)]=t,!0)},t.prototype.remove=function(e){e.style[o(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")},t.prototype.value=function(e){var t=e.style[o(this.keyName)];return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.quill=t,this.options=n,this.modules={}}return r(e,[{key:"init",value:function(){var e=this;Object.keys(this.options.modules).forEach(function(t){null==e.modules[t]&&e.addModule(t)})}},{key:"addModule",value:function(e){var t=this.quill.constructor.import("modules/"+e);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}]),e}();i.DEFAULTS={modules:{}},i.themes={default:i},t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=l(n(0)),a=l(n(7));function l(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.contentNode=document.createElement("span"),n.contentNode.setAttribute("contenteditable",!1),[].slice.call(n.domNode.childNodes).forEach(function(e){n.contentNode.appendChild(e)}),n.leftGuard=document.createTextNode("\uFEFF"),n.rightGuard=document.createTextNode("\uFEFF"),n.domNode.appendChild(n.leftGuard),n.domNode.appendChild(n.contentNode),n.domNode.appendChild(n.rightGuard),n}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"index",value:function(e,n){return e===this.leftGuard?0:e===this.rightGuard?1:i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"index",this).call(this,e,n)}},{key:"restore",value:function(e){var t=void 0,n=void 0,r=e.data.split("\uFEFF").join("");if(e===this.leftGuard){if(this.prev instanceof a.default){var i=this.prev.length();this.prev.insertAt(i,r),t={startNode:this.prev.domNode,startOffset:i+r.length}}else n=document.createTextNode(r),this.parent.insertBefore(o.default.create(n),this),t={startNode:n,startOffset:r.length}}else e===this.rightGuard&&(this.next instanceof a.default?(this.next.insertAt(0,r),t={startNode:this.next.domNode,startOffset:r.length}):(n=document.createTextNode(r),this.parent.insertBefore(o.default.create(n),this.next),t={startNode:n,startOffset:r.length}));return e.data="\uFEFF",t}},{key:"update",value:function(e,t){var n=this;e.forEach(function(e){if("characterData"===e.type&&(e.target===n.leftGuard||e.target===n.rightGuard)){var r=n.restore(e.target);r&&(t.range=r)}})}}]),t}(o.default.Embed);t.default=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.AlignStyle=t.AlignClass=t.AlignAttribute=void 0;var r,i=(r=n(0))&&r.__esModule?r:{default:r},o={scope:i.default.Scope.BLOCK,whitelist:["right","center","justify"]},a=new i.default.Attributor.Attribute("align","align",o),l=new i.default.Attributor.Class("align","ql-align",o),s=new i.default.Attributor.Style("align","text-align",o);t.AlignAttribute=a,t.AlignClass=l,t.AlignStyle=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.BackgroundStyle=t.BackgroundClass=void 0;var r,i=(r=n(0))&&r.__esModule?r:{default:r},o=n(26),a=new i.default.Attributor.Class("background","ql-bg",{scope:i.default.Scope.INLINE}),l=new o.ColorAttributor("background","background-color",{scope:i.default.Scope.INLINE});t.BackgroundClass=a,t.BackgroundStyle=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.DirectionStyle=t.DirectionClass=t.DirectionAttribute=void 0;var r,i=(r=n(0))&&r.__esModule?r:{default:r},o={scope:i.default.Scope.BLOCK,whitelist:["rtl"]},a=new i.default.Attributor.Attribute("direction","dir",o),l=new i.default.Attributor.Class("direction","ql-direction",o),s=new i.default.Attributor.Style("direction","direction",o);t.DirectionAttribute=a,t.DirectionClass=l,t.DirectionStyle=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.FontClass=t.FontStyle=void 0;var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=(r=n(0))&&r.__esModule?r:{default:r},l={scope:a.default.Scope.INLINE,whitelist:["serif","monospace"]},s=new a.default.Attributor.Class("font","ql-font",l),u=new(function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"value",value:function(e){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e).replace(/["']/g,"")}}]),t}(a.default.Attributor.Style))("font","font-family",l);t.FontStyle=u,t.FontClass=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SizeStyle=t.SizeClass=void 0;var r,i=(r=n(0))&&r.__esModule?r:{default:r},o=new i.default.Attributor.Class("size","ql-size",{scope:i.default.Scope.INLINE,whitelist:["small","large","huge"]}),a=new i.default.Attributor.Style("size","font-size",{scope:i.default.Scope.INLINE,whitelist:["10px","18px","32px"]});t.SizeClass=o,t.SizeStyle=a},function(e,t,n){e.exports={align:{"":n(76),center:n(77),right:n(78),justify:n(79)},background:n(80),blockquote:n(81),bold:n(82),clean:n(83),code:n(58),"code-block":n(58),color:n(84),direction:{"":n(85),rtl:n(86)},float:{center:n(87),full:n(88),left:n(89),right:n(90)},formula:n(91),header:{1:n(92),2:n(93)},italic:n(94),image:n(95),indent:{"+1":n(96),"-1":n(97)},link:n(98),list:{ordered:n(99),bullet:n(100),check:n(101)},script:{sub:n(102),super:n(103)},strike:n(104),underline:n(105),video:n(106)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getLastChangeIndex=t.default=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(0)),o=a(n(5));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.lastRecorded=0,r.ignoreChange=!1,r.clear(),r.quill.on(o.default.events.EDITOR_CHANGE,function(e,t,n,i){e!==o.default.events.TEXT_CHANGE||r.ignoreChange||(r.options.userOnly&&i!==o.default.sources.USER?r.transform(t):r.record(t,n))}),r.quill.keyboard.addBinding({key:"Z",shortKey:!0},r.undo.bind(r)),r.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},r.redo.bind(r)),/Win/i.test(navigator.platform)&&r.quill.keyboard.addBinding({key:"Y",shortKey:!0},r.redo.bind(r)),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"change",value:function(e,t){if(0!==this.stack[e].length){var n=this.stack[e].pop();this.stack[t].push(n),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n[e],o.default.sources.USER),this.ignoreChange=!1;var r=s(n[e]);this.quill.setSelection(r)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(e,t){if(0!==e.ops.length){this.stack.redo=[];var n=this.quill.getContents().diff(t),r=Date.now();if(this.lastRecorded+this.options.delay>r&&this.stack.undo.length>0){var i=this.stack.undo.pop();n=n.compose(i.undo),e=i.redo.compose(e)}else this.lastRecorded=r;this.stack.undo.push({redo:e,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(e){this.stack.undo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)}),this.stack.redo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),t}(a(n(9)).default);function s(e){var t,n=e.reduce(function(e,t){return e+(t.delete||0)},0),r=e.length()-n;return null!=(t=e.ops[e.ops.length-1])&&(null!=t.insert?"string"==typeof t.insert&&t.insert.endsWith("\n"):null!=t.attributes&&Object.keys(t.attributes).some(function(e){return null!=i.default.query(e,i.default.Scope.BLOCK)}))&&(r-=1),r}l.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},t.default=l,t.getLastChangeIndex=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BaseTooltip=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=p(n(3)),a=p(n(2)),l=p(n(8)),s=p(n(23)),u=p(n(34)),c=p(n(59)),d=p(n(60)),h=p(n(28)),f=p(n(61));function p(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function m(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function v(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var y=[!1,"center","right","justify"],b=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],w=[!1,"serif","monospace"],x=["1","2","3",!1],_=["small",!1,"large","huge"],E=function(e){function t(e,n){g(this,t);var r=m(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return e.emitter.listenDOM("click",document.body,function t(n){if(!document.body.contains(e.root))return document.body.removeEventListener("click",t);null==r.tooltip||r.tooltip.root.contains(n.target)||document.activeElement===r.tooltip.textbox||r.quill.hasFocus()||r.tooltip.hide(),null!=r.pickers&&r.pickers.forEach(function(e){e.container.contains(n.target)||e.close()})}),r}return v(t,e),r(t,[{key:"addModule",value:function(e){var n=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"addModule",this).call(this,e);return"toolbar"===e&&this.extendToolbar(n),n}},{key:"buildButtons",value:function(e,t){e.forEach(function(e){(e.getAttribute("class")||"").split(/\s+/).forEach(function(n){if(n.startsWith("ql-")&&null!=t[n=n.slice(3)]){if("direction"===n)e.innerHTML=t[n][""]+t[n].rtl;else if("string"==typeof t[n])e.innerHTML=t[n];else{var r=e.value||"";null!=r&&t[n][r]&&(e.innerHTML=t[n][r])}}})})}},{key:"buildPickers",value:function(e,t){var n=this;this.pickers=e.map(function(e){if(e.classList.contains("ql-align"))return null==e.querySelector("option")&&O(e,y),new d.default(e,t.align);if(!(e.classList.contains("ql-background")||e.classList.contains("ql-color")))return null==e.querySelector("option")&&(e.classList.contains("ql-font")?O(e,w):e.classList.contains("ql-header")?O(e,x):e.classList.contains("ql-size")&&O(e,_)),new h.default(e);var n=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&O(e,b,"background"===n?"#ffffff":"#000000"),new c.default(e,t[n])}),this.quill.on(l.default.events.EDITOR_CHANGE,function(){n.pickers.forEach(function(e){e.update()})})}}]),t}(u.default);E.DEFAULTS=(0,o.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var e=this,t=this.container.querySelector("input.ql-image[type=file]");null==t&&((t=document.createElement("input")).setAttribute("type","file"),t.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),t.classList.add("ql-image"),t.addEventListener("change",function(){if(null!=t.files&&null!=t.files[0]){var n=new FileReader;n.onload=function(n){var r=e.quill.getSelection(!0);e.quill.updateContents(new a.default().retain(r.index).delete(r.length).insert({image:n.target.result}),l.default.sources.USER),e.quill.setSelection(r.index+1,l.default.sources.SILENT),t.value=""},n.readAsDataURL(t.files[0])}}),this.container.appendChild(t)),t.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var S=function(e){function t(e,n){g(this,t);var r=m(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.textbox=r.root.querySelector('input[type="text"]'),r.listen(),r}return v(t,e),r(t,[{key:"listen",value:function(){var e=this;this.textbox.addEventListener("keydown",function(t){s.default.match(t,"enter")?(e.save(),t.preventDefault()):s.default.match(t,"escape")&&(e.cancel(),t.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=t?this.textbox.value=t:e!==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-"+e)||""),this.root.setAttribute("data-mode",e)}},{key:"restoreFocus",value:function(){var e=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=e}},{key:"save",value:function(){var e,t,n=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var r=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",n,l.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",n,l.default.sources.USER)),this.quill.root.scrollTop=r;break;case"video":n=(t=(e=n).match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/))?(t[1]||"https")+"://www.youtube.com/embed/"+t[2]+"?showinfo=0":(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(t[1]||"https")+"://player.vimeo.com/video/"+t[2]+"/":e;case"formula":if(!n)break;var i=this.quill.getSelection(!0);if(null!=i){var o=i.index+i.length;this.quill.insertEmbed(o,this.root.getAttribute("data-mode"),n,l.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(o+1," ",l.default.sources.USER),this.quill.setSelection(o+2,l.default.sources.USER)}}this.textbox.value="",this.hide()}}]),t}(f.default);function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach(function(t){var r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",t),e.appendChild(r)})}t.BaseTooltip=S,t.default=E},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.head=this.tail=null,this.length=0}return e.prototype.append=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.insertBefore(e[0],null),e.length>1&&this.append.apply(this,e.slice(1))},e.prototype.contains=function(e){for(var t,n=this.iterator();t=n();)if(t===e)return!0;return!1},e.prototype.insertBefore=function(e,t){e&&(e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)},e.prototype.offset=function(e){for(var t=0,n=this.head;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return -1},e.prototype.remove=function(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)},e.prototype.iterator=function(e){return void 0===e&&(e=this.head),function(){var t=e;return null!=e&&(e=e.next),t}},e.prototype.find=function(e,t){void 0===t&&(t=!1);for(var n,r=this.iterator();n=r();){var i=n.length();if(e<i||t&&e===i&&(null==n.next||0!==n.next.length()))return[n,e];e-=i}return[null,0]},e.prototype.forEach=function(e){for(var t,n=this.iterator();t=n();)e(t)},e.prototype.forEachAt=function(e,t,n){if(!(t<=0))for(var r,i=this.find(e),o=i[0],a=e-i[1],l=this.iterator(o);(r=l())&&a<e+t;){var s=r.length();e>a?n(r,e-a,Math.min(t,a+s-e)):n(r,0,Math.min(s,e+t-a)),a+=s}},e.prototype.map=function(e){return this.reduce(function(t,n){return t.push(e(n)),t},[])},e.prototype.reduce=function(e,t){for(var n,r=this.iterator();n=r();)t=e(t,n);return t},e}();t.default=r},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),a=n(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},s=function(e){function t(t){var n=e.call(this,t)||this;return n.scroll=n,n.observer=new MutationObserver(function(e){n.update(e)}),n.observer.observe(n.domNode,l),n.attach(),n}return i(t,e),t.prototype.detach=function(){e.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(t,n){this.update(),0===t&&n===this.length()?this.children.forEach(function(e){e.remove()}):e.prototype.deleteAt.call(this,t,n)},t.prototype.formatAt=function(t,n,r,i){this.update(),e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.insertAt=function(t,n,r){this.update(),e.prototype.insertAt.call(this,t,n,r)},t.prototype.optimize=function(t,n){var r=this;void 0===t&&(t=[]),void 0===n&&(n={}),e.prototype.optimize.call(this,n);for(var i=[].slice.call(this.observer.takeRecords());i.length>0;)t.push(i.pop());for(var l=function(e,t){void 0===t&&(t=!0),null!=e&&e!==r&&null!=e.domNode.parentNode&&(null==e.domNode[a.DATA_KEY].mutations&&(e.domNode[a.DATA_KEY].mutations=[]),t&&l(e.parent))},s=function(e){null!=e.domNode[a.DATA_KEY]&&null!=e.domNode[a.DATA_KEY].mutations&&(e instanceof o.default&&e.children.forEach(s),e.optimize(n))},u=t,c=0;u.length>0;c+=1){if(c>=100)throw Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(function(e){var t=a.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(l(a.find(e.previousSibling,!1)),[].forEach.call(e.addedNodes,function(e){var t=a.find(e,!1);l(t,!1),t instanceof o.default&&t.children.forEach(function(e){l(e,!1)})})):"attributes"===e.type&&l(t.prev)),l(t))}),this.children.forEach(s),i=(u=[].slice.call(this.observer.takeRecords())).slice();i.length>0;)t.push(i.pop())}},t.prototype.update=function(t,n){var r=this;void 0===n&&(n={}),(t=t||this.observer.takeRecords()).map(function(e){var t=a.find(e.target,!0);return null==t?null:null==t.domNode[a.DATA_KEY].mutations?(t.domNode[a.DATA_KEY].mutations=[e],t):(t.domNode[a.DATA_KEY].mutations.push(e),null)}).forEach(function(e){null!=e&&e!==r&&null!=e.domNode[a.DATA_KEY]&&e.update(e.domNode[a.DATA_KEY].mutations||[],n)}),null!=this.domNode[a.DATA_KEY].mutations&&e.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(t,n)},t.blotName="scroll",t.defaultChild="block",t.scope=a.Scope.BLOCK_BLOT,t.tagName="DIV",t}(o.default);t.default=s},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(18),a=n(1),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.formats=function(n){if(n.tagName!==t.tagName)return e.formats.call(this,n)},t.prototype.format=function(n,r){var i=this;n!==this.statics.blotName||r?e.prototype.format.call(this,n,r):(this.children.forEach(function(e){e instanceof o.default||(e=e.wrap(t.blotName,!0)),i.attributes.copy(e)}),this.unwrap())},t.prototype.formatAt=function(t,n,r,i){null!=this.formats()[r]||a.query(r,a.Scope.ATTRIBUTE)?this.isolate(t,n).format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var i=this.next;i instanceof t&&i.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(e[n]!==t[n])return!1;return!0}(r,i.formats())&&(i.moveChildren(this),i.remove())},t.blotName="inline",t.scope=a.Scope.INLINE_BLOT,t.tagName="SPAN",t}(o.default);t.default=l},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(18),a=n(1),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.formats=function(n){var r=a.query(t.blotName).tagName;if(n.tagName!==r)return e.formats.call(this,n)},t.prototype.format=function(n,r){null!=a.query(n,a.Scope.BLOCK)&&(n!==this.statics.blotName||r?e.prototype.format.call(this,n,r):this.replaceWith(t.blotName))},t.prototype.formatAt=function(t,n,r,i){null!=a.query(r,a.Scope.BLOCK)?this.format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.insertAt=function(t,n,r){if(null==r||null!=a.query(n,a.Scope.INLINE))e.prototype.insertAt.call(this,t,n,r);else{var i=this.split(t),o=a.create(n,r);i.parent.insertBefore(o,i)}},t.prototype.update=function(t,n){navigator.userAgent.match(/Trident/)?this.build():e.prototype.update.call(this,t,n)},t.blotName="block",t.scope=a.Scope.BLOCK_BLOT,t.tagName="P",t}(o.default);t.default=l},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.formats=function(e){},t.prototype.format=function(t,n){e.prototype.formatAt.call(this,0,this.length(),t,n)},t.prototype.formatAt=function(t,n,r,i){0===t&&n===this.length()?this.format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.formats=function(){return this.statics.formats(this.domNode)},t}(n(19).default);t.default=o},function(e,t,n){var r,i=this&&this.__extends||(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(19),a=n(1),l=function(e){function t(t){var n=e.call(this,t)||this;return n.text=n.statics.value(n.domNode),n}return i(t,e),t.create=function(e){return document.createTextNode(e)},t.value=function(e){var t=e.data;return t.normalize&&(t=t.normalize()),t},t.prototype.deleteAt=function(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)},t.prototype.index=function(e,t){return this.domNode===e?t:-1},t.prototype.insertAt=function(t,n,r){null==r?(this.text=this.text.slice(0,t)+n+this.text.slice(t),this.domNode.data=this.text):e.prototype.insertAt.call(this,t,n,r)},t.prototype.length=function(){return this.text.length},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},t.prototype.position=function(e,t){return void 0===t&&(t=!1),[this.domNode,e]},t.prototype.split=function(e,t){if(void 0===t&&(t=!1),!t){if(0===e)return this;if(e===this.length())return this.next}var n=a.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},t.prototype.update=function(e,t){var n=this;e.some(function(e){return"characterData"===e.type&&e.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},t.prototype.value=function(){return this.text},t.blotName="text",t.scope=a.Scope.INLINE_BLOT,t}(o.default);t.default=l},function(e,t,n){var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return arguments.length>1&&!this.contains(e)==!t?t:i.call(this,e)}}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var n=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>n.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return -1!==r&&r===t}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(this===null)throw TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof e)throw TypeError("predicate must be a function");for(var t,n=Object(this),r=n.length>>>0,i=arguments[1],o=0;o<r;o++)if(t=n[o],e.call(i,t,o,n))return t}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(e,t){function n(e,t,l){if(e==t)return e?[[0,e]]:[];(l<0||e.length<l)&&(l=null);var s=i(e,t),u=e.substring(0,s);s=o(e=e.substring(s),t=t.substring(s));var c=e.substring(e.length-s),d=function(e,t){if(!e)return[[1,t]];if(!t)return[[-1,e]];var a,l=e.length>t.length?e:t,s=e.length>t.length?t:e,u=l.indexOf(s);if(-1!=u)return a=[[1,l.substring(0,u)],[0,s],[1,l.substring(u+s.length)]],e.length>t.length&&(a[0][0]=a[2][0]=-1),a;if(1==s.length)return[[-1,e],[1,t]];var c=function(e,t){var n,r,a,l,s,u=e.length>t.length?e:t,c=e.length>t.length?t:e;if(u.length<4||2*c.length<u.length)return null;function d(e,t,n){for(var r,a,l,s,u=e.substring(n,n+Math.floor(e.length/4)),c=-1,d="";-1!=(c=t.indexOf(u,c+1));){var h=i(e.substring(n),t.substring(c)),f=o(e.substring(0,n),t.substring(0,c));d.length<f+h&&(d=t.substring(c-f,c)+t.substring(c,c+h),r=e.substring(0,n-f),a=e.substring(n+h),l=t.substring(0,c-f),s=t.substring(c+h))}return 2*d.length>=e.length?[r,a,l,s,d]:null}var h=d(u,c,Math.ceil(u.length/4)),f=d(u,c,Math.ceil(u.length/2));return h||f?(n=f?h&&h[4].length>f[4].length?h:f:h,e.length>t.length?(r=n[0],a=n[1],l=n[2],s=n[3]):(l=n[0],s=n[1],r=n[2],a=n[3]),[r,a,l,s,n[4]]):null}(e,t);if(c){var d=c[0],h=c[1],f=c[2],p=c[3],g=c[4],m=n(d,f),v=n(h,p);return m.concat([[0,g]],v)}return function(e,t){for(var n=e.length,i=t.length,o=Math.ceil((n+i)/2),a=2*o,l=Array(a),s=Array(a),u=0;u<a;u++)l[u]=-1,s[u]=-1;l[o+1]=0,s[o+1]=0;for(var c=n-i,d=c%2!=0,h=0,f=0,p=0,g=0,m=0;m<o;m++){for(var v=-m+h;v<=m-f;v+=2){for(var y,b=o+v,w=(y=v==-m||v!=m&&l[b-1]<l[b+1]?l[b+1]:l[b-1]+1)-v;y<n&&w<i&&e.charAt(y)==t.charAt(w);)y++,w++;if(l[b]=y,y>n)f+=2;else if(w>i)h+=2;else if(d){var x=o+c-v;if(x>=0&&x<a&&-1!=s[x]){var _=n-s[x];if(y>=_)return r(e,t,y,w)}}}for(var E=-m+p;E<=m-g;E+=2){for(var _,x=o+E,S=(_=E==-m||E!=m&&s[x-1]<s[x+1]?s[x+1]:s[x-1]+1)-E;_<n&&S<i&&e.charAt(n-_-1)==t.charAt(i-S-1);)_++,S++;if(s[x]=_,_>n)g+=2;else if(S>i)p+=2;else if(!d){var b=o+c-E;if(b>=0&&b<a&&-1!=l[b]){var y=l[b],w=o+y-b;if(y>=(_=n-_))return r(e,t,y,w)}}}}return[[-1,e],[1,t]]}(e,t)}(e=e.substring(0,e.length-s),t=t.substring(0,t.length-s));return u&&d.unshift([0,u]),c&&d.push([0,c]),function e(t){t.push([0,""]);for(var n,r=0,a=0,l=0,s="",u="";r<t.length;)switch(t[r][0]){case 1:l++,u+=t[r][1],r++;break;case -1:a++,s+=t[r][1],r++;break;case 0:a+l>1?(0!==a&&0!==l&&(0!==(n=i(u,s))&&(r-a-l>0&&0==t[r-a-l-1][0]?t[r-a-l-1][1]+=u.substring(0,n):(t.splice(0,0,[0,u.substring(0,n)]),r++),u=u.substring(n),s=s.substring(n)),0!==(n=o(u,s))&&(t[r][1]=u.substring(u.length-n)+t[r][1],u=u.substring(0,u.length-n),s=s.substring(0,s.length-n))),0===a?t.splice(r-l,a+l,[1,u]):0===l?t.splice(r-a,a+l,[-1,s]):t.splice(r-a-l,a+l,[-1,s],[1,u]),r=r-a-l+(a?1:0)+(l?1:0)+1):0!==r&&0==t[r-1][0]?(t[r-1][1]+=t[r][1],t.splice(r,1)):r++,l=0,a=0,s="",u=""}""===t[t.length-1][1]&&t.pop();var c=!1;for(r=1;r<t.length-1;)0==t[r-1][0]&&0==t[r+1][0]&&(t[r][1].substring(t[r][1].length-t[r-1][1].length)==t[r-1][1]?(t[r][1]=t[r-1][1]+t[r][1].substring(0,t[r][1].length-t[r-1][1].length),t[r+1][1]=t[r-1][1]+t[r+1][1],t.splice(r-1,1),c=!0):t[r][1].substring(0,t[r+1][1].length)==t[r+1][1]&&(t[r-1][1]+=t[r+1][1],t[r][1]=t[r][1].substring(t[r+1][1].length)+t[r+1][1],t.splice(r+1,1),c=!0)),r++;c&&e(t)}(d),null!=l&&(d=function(e,t){var n=function(e,t){if(0===t)return[0,e];for(var n=0,r=0;r<e.length;r++){var i=e[r];if(-1===i[0]||0===i[0]){var o=n+i[1].length;if(t===o)return[r+1,e];if(t<o){e=e.slice();var a=t-n,l=[i[0],i[1].slice(0,a)],s=[i[0],i[1].slice(a)];return e.splice(r,1,l,s),[r+1,e]}n=o}}throw Error("cursor_pos is out of bounds!")}(e,t),r=n[1],i=n[0],o=r[i],l=r[i+1];if(null==o||0!==o[0])return e;if(null!=l&&o[1]+l[1]===l[1]+o[1])return r.splice(i,2,l,o),a(r,i,2);if(null==l||0!==l[1].indexOf(o[1]))return e;r.splice(i,2,[l[0],o[1]],[0,o[1]]);var s=l[1].slice(o[1].length);return s.length>0&&r.splice(i+2,0,[l[0],s]),a(r,i,3)}(d,l)),d=function(e){for(var t,n=!1,r=function(e){return e.charCodeAt(0)>=56320&&57343>=e.charCodeAt(0)},i=2;i<e.length;i+=1)0===e[i-2][0]&&(t=e[i-2][1]).charCodeAt(t.length-1)>=55296&&56319>=t.charCodeAt(t.length-1)&&-1===e[i-1][0]&&r(e[i-1][1])&&1===e[i][0]&&r(e[i][1])&&(n=!0,e[i-1][1]=e[i-2][1].slice(-1)+e[i-1][1],e[i][1]=e[i-2][1].slice(-1)+e[i][1],e[i-2][1]=e[i-2][1].slice(0,-1));if(!n)return e;for(var o=[],i=0;i<e.length;i+=1)e[i][1].length>0&&o.push(e[i]);return o}(d)}function r(e,t,r,i){var o=e.substring(0,r),a=t.substring(0,i),l=e.substring(r),s=t.substring(i),u=n(o,a),c=n(l,s);return u.concat(c)}function i(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(o,i)==t.substring(o,i)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return i}function o(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(e.length-i,e.length-o)==t.substring(t.length-i,t.length-o)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return i}function a(e,t,n){for(var r=t+n-1;r>=0&&r>=t-1;r--)if(r+1<e.length){var i=e[r],o=e[r+1];i[0]===o[1]&&e.splice(r,2,[i[0],i[1]+o[1]])}return e}n.INSERT=1,n.DELETE=-1,n.EQUAL=0,e.exports=n},function(e,t){(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n;function n(e){var t=[];for(var n in e)t.push(n);return t}},function(e,t){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function r(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function i(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}(t=e.exports=n?r:i).supported=r,t.unsupported=i},function(e,t){var n=Object.prototype.hasOwnProperty,r="~";function i(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1)),a.prototype.eventNames=function(){var e,t,i=[];if(0===this._eventsCount)return i;for(t in e=this._events)n.call(e,t)&&i.push(r?t.slice(1):t);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e,t){var n=r?r+e:e,i=this._events[n];if(t)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var o=0,a=i.length,l=Array(a);o<a;o++)l[o]=i[o].fn;return l},a.prototype.emit=function(e,t,n,i,o,a){var l=r?r+e:e;if(!this._events[l])return!1;var s,u,c=this._events[l],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,o),!0;case 6:return c.fn.call(c.context,t,n,i,o,a),!0}for(u=1,s=Array(d-1);u<d;u++)s[u-1]=arguments[u];c.fn.apply(c.context,s)}else{var h,f=c.length;for(u=0;u<f;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),d){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,i);break;default:if(!s)for(h=1,s=Array(d-1);h<d;h++)s[h-1]=arguments[h];c[u].fn.apply(c[u].context,s)}}return!0},a.prototype.on=function(e,t,n){var i=new o(t,n||this),a=r?r+e:e;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):(this._events[a]=i,this._eventsCount++),this},a.prototype.once=function(e,t,n){var i=new o(t,n||this,!0),a=r?r+e:e;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):(this._events[a]=i,this._eventsCount++),this},a.prototype.removeListener=function(e,t,n,o){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return 0==--this._eventsCount?this._events=new i:delete this._events[a],this;var l=this._events[a];if(l.fn)l.fn!==t||o&&!l.once||n&&l.context!==n||(0==--this._eventsCount?this._events=new i:delete this._events[a]);else{for(var s=0,u=[],c=l.length;s<c;s++)(l[s].fn!==t||o&&!l[s].once||n&&l[s].context!==n)&&u.push(l[s]);u.length?this._events[a]=1===u.length?u[0]:u:0==--this._eventsCount?this._events=new i:delete this._events[a]}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&(0==--this._eventsCount?this._events=new i:delete this._events[t])):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prototype.setMaxListeners=function(){return this},a.prefixed=r,a.EventEmitter=a,void 0!==e&&(e.exports=a)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.matchText=t.matchSpacing=t.matchNewline=t.matchBlot=t.matchAttributor=t.default=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=b(n(3)),l=b(n(2)),s=b(n(0)),u=b(n(5)),c=b(n(10)),d=b(n(9)),h=n(36),f=n(37),p=b(n(13)),g=n(26),m=n(38),v=n(39),y=n(40);function b(e){return e&&e.__esModule?e:{default:e}}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=(0,c.default)("quill:clipboard"),_="__ql-matcher",E=[[Node.TEXT_NODE,M],[Node.TEXT_NODE,I],["br",function(e,t){return T(t,"\n")||t.insert("\n"),t}],[Node.ELEMENT_NODE,I],[Node.ELEMENT_NODE,R],[Node.ELEMENT_NODE,L],[Node.ELEMENT_NODE,j],[Node.ELEMENT_NODE,function(e,t){var n={},r=e.style||{};return r.fontStyle&&"italic"===P(e).fontStyle&&(n.italic=!0),r.fontWeight&&(P(e).fontWeight.startsWith("bold")||parseInt(P(e).fontWeight)>=700)&&(n.bold=!0),Object.keys(n).length>0&&(t=k(t,n)),parseFloat(r.textIndent||0)>0&&(t=new l.default().insert(" ").concat(t)),t}],["li",function(e,t){var n=s.default.query(e);if(null==n||"list-item"!==n.blotName||!T(t,"\n"))return t;for(var r=-1,i=e.parentNode;!i.classList.contains("ql-clipboard");)"list"===(s.default.query(i)||{}).blotName&&(r+=1),i=i.parentNode;return r<=0?t:t.compose(new l.default().retain(t.length()-1).retain(1,{indent:r}))}],["b",N.bind(N,"bold")],["i",N.bind(N,"italic")],["style",function(){return new l.default}]],S=[h.AlignAttribute,m.DirectionAttribute].reduce(function(e,t){return e[t.keyName]=t,e},{}),O=[h.AlignStyle,f.BackgroundStyle,g.ColorStyle,m.DirectionStyle,v.FontStyle,y.SizeStyle].reduce(function(e,t){return e[t.keyName]=t,e},{}),C=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.root.addEventListener("paste",r.onPaste.bind(r)),r.container=r.quill.addContainer("ql-clipboard"),r.container.setAttribute("contenteditable",!0),r.container.setAttribute("tabindex",-1),r.matchers=[],E.concat(r.options.matchers).forEach(function(e){var t=i(e,2),o=t[0],a=t[1];(n.matchVisual||a!==L)&&r.addMatcher(o,a)}),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"addMatcher",value:function(e,t){this.matchers.push([e,t])}},{key:"convert",value:function(e){if("string"==typeof e)return this.container.innerHTML=e.replace(/\>\r?\n +\</g,"><"),this.convert();var t=this.quill.getFormat(this.quill.selection.savedRange.index);if(t[p.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",new l.default().insert(n,w({},p.default.blotName,t[p.default.blotName]))}var r=i(this.prepareMatching(),2),o=r[0],a=r[1],s=function e(t,n,r){return t.nodeType===t.TEXT_NODE?r.reduce(function(e,n){return n(t,e)},new l.default):t.nodeType===t.ELEMENT_NODE?[].reduce.call(t.childNodes||[],function(i,o){var a=e(o,n,r);return o.nodeType===t.ELEMENT_NODE&&(a=n.reduce(function(e,t){return t(o,e)},a),a=(o[_]||[]).reduce(function(e,t){return t(o,e)},a)),i.concat(a)},new l.default):new l.default}(this.container,o,a);return T(s,"\n")&&null==s.ops[s.ops.length-1].attributes&&(s=s.compose(new l.default().retain(s.length()-1).delete(1))),x.log("convert",this.container.innerHTML,s),this.container.innerHTML="",s}},{key:"dangerouslyPasteHTML",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default.sources.API;if("string"==typeof e)this.quill.setContents(this.convert(e),t),this.quill.setSelection(0,u.default.sources.SILENT);else{var r=this.convert(t);this.quill.updateContents(new l.default().retain(e).concat(r),n),this.quill.setSelection(e+r.length(),u.default.sources.SILENT)}}},{key:"onPaste",value:function(e){var t=this;if(!e.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=new l.default().retain(n.index),i=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(u.default.sources.SILENT),setTimeout(function(){r=r.concat(t.convert()).delete(n.length),t.quill.updateContents(r,u.default.sources.USER),t.quill.setSelection(r.length()-n.length,u.default.sources.SILENT),t.quill.scrollingContainer.scrollTop=i,t.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var e=this,t=[],n=[];return this.matchers.forEach(function(r){var o=i(r,2),a=o[0],l=o[1];switch(a){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:t.push(l);break;default:[].forEach.call(e.container.querySelectorAll(a),function(e){e[_]=e[_]||[],e[_].push(l)})}}),[t,n]}}]),t}(d.default);function k(e,t,n){return(void 0===t?"undefined":r(t))==="object"?Object.keys(t).reduce(function(e,n){return k(e,n,t[n])},e):e.reduce(function(e,r){return r.attributes&&r.attributes[t]?e.push(r):e.insert(r.insert,(0,a.default)({},w({},t,n),r.attributes))},new l.default)}function P(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};var t="__ql-computed-style";return e[t]||(e[t]=window.getComputedStyle(e))}function T(e,t){for(var n="",r=e.ops.length-1;r>=0&&n.length<t.length;--r){var i=e.ops[r];if("string"!=typeof i.insert)break;n=i.insert+n}return n.slice(-1*t.length)===t}function A(e){return 0!==e.childNodes.length&&["block","list-item"].indexOf(P(e).display)>-1}function N(e,t,n){return k(n,e,!0)}function j(e,t){var n=s.default.Attributor.Attribute.keys(e),r=s.default.Attributor.Class.keys(e),i=s.default.Attributor.Style.keys(e),o={};return n.concat(r).concat(i).forEach(function(t){var n=s.default.query(t,s.default.Scope.ATTRIBUTE);null!=n&&(o[n.attrName]=n.value(e),o[n.attrName])||(null!=(n=S[t])&&(n.attrName===t||n.keyName===t)&&(o[n.attrName]=n.value(e)||void 0),null!=(n=O[t])&&(n.attrName===t||n.keyName===t)&&(o[(n=O[t]).attrName]=n.value(e)||void 0))}),Object.keys(o).length>0&&(t=k(t,o)),t}function R(e,t){var n=s.default.query(e);if(null==n)return t;if(n.prototype instanceof s.default.Embed){var r={},i=n.value(e);null!=i&&(r[n.blotName]=i,t=new l.default().insert(r,n.formats(e)))}else"function"==typeof n.formats&&(t=k(t,n.blotName,n.formats(e)));return t}function I(e,t){return!T(t,"\n")&&(A(e)||t.length()>0&&e.nextSibling&&A(e.nextSibling))&&t.insert("\n"),t}function L(e,t){if(A(e)&&null!=e.nextElementSibling&&!T(t,"\n\n")){var n=e.offsetHeight+parseFloat(P(e).marginTop)+parseFloat(P(e).marginBottom);e.nextElementSibling.offsetTop>e.offsetTop+1.5*n&&t.insert("\n")}return t}function M(e,t){var n=e.data;if("O:P"===e.parentNode.tagName)return t.insert(n.trim());if(0===n.trim().length&&e.parentNode.classList.contains("ql-clipboard"))return t;if(!P(e.parentNode).whiteSpace.startsWith("pre")){var r=function(e,t){return(t=t.replace(/[^\u00a0]/g,"")).length<1&&e?" ":t};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,r.bind(r,!0)),(null==e.previousSibling&&A(e.parentNode)||null!=e.previousSibling&&A(e.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==e.nextSibling&&A(e.parentNode)||null!=e.nextSibling&&A(e.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return t.insert(n)}C.DEFAULTS={matchers:[],matchVisual:!0},t.default=C,t.matchAttributor=j,t.matchBlot=R,t.matchNewline=I,t.matchSpacing=L,t.matchText=M},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"optimize",value:function(e){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),t}(((r=n(6))&&r.__esModule?r:{default:r}).default);a.blotName="bold",a.tagName=["STRONG","B"],t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.addControls=t.default=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=c(n(2)),a=c(n(0)),l=c(n(5)),s=c(n(10)),u=c(n(9));function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var h=(0,s.default)("quill:toolbar"),f=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var i,o=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(Array.isArray(o.options.container)){var a=document.createElement("div");g(a,o.options.container),e.container.parentNode.insertBefore(a,e.container),o.container=a}else"string"==typeof o.options.container?o.container=document.querySelector(o.options.container):o.container=o.options.container;return o.container instanceof HTMLElement?(o.container.classList.add("ql-toolbar"),o.controls=[],o.handlers={},Object.keys(o.options.handlers).forEach(function(e){o.addHandler(e,o.options.handlers[e])}),[].forEach.call(o.container.querySelectorAll("button, select"),function(e){o.attach(e)}),o.quill.on(l.default.events.EDITOR_CHANGE,function(e,t){e===l.default.events.SELECTION_CHANGE&&o.update(t)}),o.quill.on(l.default.events.SCROLL_OPTIMIZE,function(){var e=r(o.quill.selection.getRange(),1)[0];o.update(e)}),o):(i=h.error("Container required for toolbar",o.options),d(o,i))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"addHandler",value:function(e,t){this.handlers[e]=t}},{key:"attach",value:function(e){var t=this,n=[].find.call(e.classList,function(e){return 0===e.indexOf("ql-")});if(n){if(n=n.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[n]){if(null!=this.quill.scroll.whitelist&&null==this.quill.scroll.whitelist[n]){h.warn("ignoring attaching to disabled format",n,e);return}if(null==a.default.query(n)){h.warn("ignoring attaching to nonexistent format",n,e);return}}var i="SELECT"===e.tagName?"change":"click";e.addEventListener(i,function(i){var s,u,c,d=void 0;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;var h=e.options[e.selectedIndex];d=!h.hasAttribute("selected")&&(h.value||!1)}else d=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),i.preventDefault();t.quill.focus();var f=r(t.quill.selection.getRange(),1)[0];if(null!=t.handlers[n])t.handlers[n].call(t,d);else if(a.default.query(n).prototype instanceof a.default.Embed){if(!(d=prompt("Enter "+n)))return;t.quill.updateContents(new o.default().retain(f.index).delete(f.length).insert((s={},u=n,c=d,u in s?Object.defineProperty(s,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):s[u]=c,s)),l.default.sources.USER)}else t.quill.format(n,d,l.default.sources.USER);t.update(f)}),this.controls.push([n,e])}}},{key:"update",value:function(e){var t=null==e?{}:this.quill.getFormat(e);this.controls.forEach(function(n){var i=r(n,2),o=i[0],a=i[1];if("SELECT"===a.tagName){var l=void 0;if(null==e)l=null;else if(null==t[o])l=a.querySelector("option[selected]");else if(!Array.isArray(t[o])){var s=t[o];"string"==typeof s&&(s=s.replace(/\"/g,'\\"')),l=a.querySelector('option[value="'+s+'"]')}null==l?(a.value="",a.selectedIndex=-1):l.selected=!0}else if(null==e)a.classList.remove("ql-active");else if(a.hasAttribute("value")){var u=t[o]===a.getAttribute("value")||null!=t[o]&&t[o].toString()===a.getAttribute("value")||null==t[o]&&!a.getAttribute("value");a.classList.toggle("ql-active",u)}else a.classList.toggle("ql-active",null!=t[o])})}}]),t}(u.default);function p(e,t,n){var r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+t),null!=n&&(r.value=n),e.appendChild(r)}function g(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(function(t){var n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(function(e){if("string"==typeof e)p(n,e);else{var t,r=Object.keys(e)[0],i=e[r];Array.isArray(i)?((t=document.createElement("select")).classList.add("ql-"+r),i.forEach(function(e){var n=document.createElement("option");!1!==e?n.setAttribute("value",e):n.setAttribute("selected","selected"),t.appendChild(n)}),n.appendChild(t)):p(n,r,i)}}),e.appendChild(n)})}f.DEFAULTS={},f.DEFAULTS={container:null,handlers:{clean:function(){var e=this,t=this.quill.getSelection();null!=t&&(0==t.length?Object.keys(this.quill.getFormat()).forEach(function(t){null!=a.default.query(t,a.default.Scope.INLINE)&&e.quill.format(t,!1)}):this.quill.removeFormat(t,l.default.sources.USER))},direction:function(e){var t=this.quill.getFormat().align;"rtl"===e&&null==t?this.quill.format("align","right",l.default.sources.USER):e||"right"!==t||this.quill.format("align",!1,l.default.sources.USER),this.quill.format("direction",e,l.default.sources.USER)},indent:function(e){var t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0);if("+1"===e||"-1"===e){var i="+1"===e?1:-1;"rtl"===n.direction&&(i*=-1),this.quill.format("indent",r+i,l.default.sources.USER)}},link:function(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,l.default.sources.USER)},list:function(e){var t=this.quill.getSelection(),n=this.quill.getFormat(t);"check"===e?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,l.default.sources.USER):this.quill.format("list","unchecked",l.default.sources.USER):this.quill.format("list",e,l.default.sources.USER)}}},t.default=f,t.addControls=g},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.label.innerHTML=n,r.container.classList.add("ql-color-picker"),[].slice.call(r.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(e){e.classList.add("ql-primary")}),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"buildItem",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"buildItem",this).call(this,e);return n.style.backgroundColor=e.getAttribute("value")||"",n}},{key:"selectItem",value:function(e,n){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"selectItem",this).call(this,e,n);var r=this.label.querySelector(".ql-color-label"),i=e&&e.getAttribute("data-value")||"";r&&("line"===r.tagName?r.style.stroke=i:r.style.fill=i)}}]),t}(((r=n(28))&&r.__esModule?r:{default:r}).default);t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.container.classList.add("ql-icon-picker"),[].forEach.call(r.container.querySelectorAll(".ql-picker-item"),function(e){e.innerHTML=n[e.getAttribute("data-value")||""]}),r.defaultItem=r.container.querySelector(".ql-selected"),r.selectItem(r.defaultItem),r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"selectItem",value:function(e,n){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"selectItem",this).call(this,e,n),e=e||this.defaultItem,this.label.innerHTML=e.innerHTML}}]),t}(((r=n(28))&&r.__esModule?r:{default:r}).default);t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n){var r=this;(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.quill=t,this.boundsContainer=n||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){r.root.style.marginTop=-1*r.quill.root.scrollTop+"px"}),this.hide()}return r(e,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(e){var t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=t+"px",this.root.style.top=n+"px",this.root.classList.remove("ql-flip");var r=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect(),o=0;if(i.right>r.right&&(o=r.right-i.right,this.root.style.left=t+o+"px"),i.left<r.left&&(o=r.left-i.left,this.root.style.left=t+o+"px"),i.bottom>r.bottom){var a=i.bottom-i.top,l=e.bottom-e.top+a;this.root.style.top=n-l+"px",this.root.classList.add("ql-flip")}return o}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),e}();t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(e,t);throw TypeError("Invalid attempt to destructure non-iterable instance")},i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=f(n(3)),l=f(n(8)),s=n(43),u=f(s),c=f(n(27)),d=n(15),h=f(n(41));function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function m(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var v=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],y=function(e){function t(e,n){p(this,t),null!=n.modules.toolbar&&null==n.modules.toolbar.container&&(n.modules.toolbar.container=v);var r=g(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.container.classList.add("ql-snow"),r}return m(t,e),o(t,[{key:"extendToolbar",value:function(e){e.container.classList.add("ql-snow"),this.buildButtons([].slice.call(e.container.querySelectorAll("button")),h.default),this.buildPickers([].slice.call(e.container.querySelectorAll("select")),h.default),this.tooltip=new b(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(t,n){e.handlers.link.call(e,!n.format.link)})}}]),t}(u.default);y.DEFAULTS=(0,a.default)(!0,{},u.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(e){if(e){var t=this.quill.getSelection();if(null!=t&&0!=t.length){var n=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(n)&&0!==n.indexOf("mailto:")&&(n="mailto:"+n),this.quill.theme.tooltip.edit("link",n)}}else this.quill.format("link",!1)}}}}});var b=function(e){function t(e,n){p(this,t);var r=g(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.preview=r.root.querySelector("a.ql-preview"),r}return m(t,e),o(t,[{key:"listen",value:function(){var e=this;i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(t){e.root.classList.contains("ql-editing")?e.save():e.edit("link",e.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(t){if(null!=e.linkRange){var n=e.linkRange;e.restoreFocus(),e.quill.formatText(n,"link",!1,l.default.sources.USER),delete e.linkRange}t.preventDefault(),e.hide()}),this.quill.on(l.default.events.SELECTION_CHANGE,function(t,n,i){if(null!=t){if(0===t.length&&i===l.default.sources.USER){var o=r(e.quill.scroll.descendant(c.default,t.index),2),a=o[0],s=o[1];if(null!=a){e.linkRange=new d.Range(t.index-s,a.length());var u=c.default.formats(a.domNode);e.preview.textContent=u,e.preview.setAttribute("href",u),e.show(),e.position(e.quill.getBounds(e.linkRange));return}}else delete e.linkRange;e.hide()}})}},{key:"show",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),t}(s.BaseTooltip);b.TEMPLATE='<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a><input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL"><a class="ql-action"></a><a class="ql-remove"></a>',t.default=y},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=L(n(29)),i=n(36),o=n(38),a=n(64),l=L(n(65)),s=L(n(66)),u=n(67),c=L(u),d=n(37),h=n(26),f=n(39),p=n(40),g=L(n(56)),m=L(n(68)),v=L(n(27)),y=L(n(69)),b=L(n(70)),w=L(n(71)),x=L(n(72)),_=L(n(73)),E=n(13),S=L(E),O=L(n(74)),C=L(n(75)),k=L(n(57)),P=L(n(41)),T=L(n(28)),A=L(n(59)),N=L(n(60)),j=L(n(61)),R=L(n(108)),I=L(n(62));function L(e){return e&&e.__esModule?e:{default:e}}r.default.register({"attributors/attribute/direction":o.DirectionAttribute,"attributors/class/align":i.AlignClass,"attributors/class/background":d.BackgroundClass,"attributors/class/color":h.ColorClass,"attributors/class/direction":o.DirectionClass,"attributors/class/font":f.FontClass,"attributors/class/size":p.SizeClass,"attributors/style/align":i.AlignStyle,"attributors/style/background":d.BackgroundStyle,"attributors/style/color":h.ColorStyle,"attributors/style/direction":o.DirectionStyle,"attributors/style/font":f.FontStyle,"attributors/style/size":p.SizeStyle},!0),r.default.register({"formats/align":i.AlignClass,"formats/direction":o.DirectionClass,"formats/indent":a.IndentClass,"formats/background":d.BackgroundStyle,"formats/color":h.ColorStyle,"formats/font":f.FontClass,"formats/size":p.SizeClass,"formats/blockquote":l.default,"formats/code-block":S.default,"formats/header":s.default,"formats/list":c.default,"formats/bold":g.default,"formats/code":E.Code,"formats/italic":m.default,"formats/link":v.default,"formats/script":y.default,"formats/strike":b.default,"formats/underline":w.default,"formats/image":x.default,"formats/video":_.default,"formats/list/item":u.ListItem,"modules/formula":O.default,"modules/syntax":C.default,"modules/toolbar":k.default,"themes/bubble":R.default,"themes/snow":I.default,"ui/icons":P.default,"ui/picker":T.default,"ui/icon-picker":N.default,"ui/color-picker":A.default,"ui/tooltip":j.default},!0),t.default=r.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.IndentClass=void 0;var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=(r=n(0))&&r.__esModule?r:{default:r},l=new(function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"add",value:function(e,n){if("+1"===n||"-1"===n){var r=this.value(e)||0;n="+1"===n?r+1:r-1}return 0===n?(this.remove(e),!0):o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"add",this).call(this,e,n)}},{key:"canAdd",value:function(e,n){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"canAdd",this).call(this,e,n)||o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"canAdd",this).call(this,e,parseInt(n))}},{key:"value",value:function(e){return parseInt(o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e))||void 0}}]),t}(a.default.Attributor.Class))("indent","ql-indent",{scope:a.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});t.IndentClass=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(4))&&r.__esModule?r:{default:r}).default);i.blotName="blockquote",i.tagName="blockquote",t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,null,[{key:"formats",value:function(e){return this.tagName.indexOf(e.tagName)+1}}]),t}(((r=n(4))&&r.__esModule?r:{default:r}).default);o.blotName="header",o.tagName=["H1","H2","H3","H4","H5","H6"],t.default=o},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ListItem=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=s(n(0)),a=s(n(4)),l=s(n(25));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function d(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){function t(){return u(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),r(t,[{key:"format",value:function(e,n){e!==f.blotName||n?i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n):this.replaceWith(o.default.create(this.statics.scope))}},{key:"remove",value:function(){null==this.prev&&null==this.next?this.parent.remove():i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(e,n){return(this.parent.isolate(this.offset(this.parent),this.length()),e===this.parent.statics.blotName)?(this.parent.replaceWith(e,n),this):(this.parent.unwrap(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replaceWith",this).call(this,e,n))}}],[{key:"formats",value:function(e){return e.tagName===this.tagName?void 0:i(t.__proto__||Object.getPrototypeOf(t),"formats",this).call(this,e)}}]),t}(a.default);h.blotName="list-item",h.tagName="LI";var f=function(e){function t(e){u(this,t);var n=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=function(t){if(t.target.parentNode===e){var r=n.statics.formats(e),i=o.default.find(t.target);"checked"===r?i.format("list","unchecked"):"unchecked"===r&&i.format("list","checked")}};return e.addEventListener("touchstart",r),e.addEventListener("mousedown",r),n}return d(t,e),r(t,null,[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,"ordered"===e?"OL":"UL");return("checked"===e||"unchecked"===e)&&n.setAttribute("data-checked","checked"===e),n}},{key:"formats",value:function(e){return"OL"===e.tagName?"ordered":"UL"===e.tagName?e.hasAttribute("data-checked")?"true"===e.getAttribute("data-checked")?"checked":"unchecked":"bullet":void 0}}]),r(t,[{key:"format",value:function(e,t){this.children.length>0&&this.children.tail.format(e,t)}},{key:"formats",value:function(){var e,t,n;return e={},t=this.statics.blotName,n=this.statics.formats(this.domNode),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{key:"insertBefore",value:function(e,n){if(e instanceof h)i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(e,o)}}},{key:"optimize",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){if(e.statics.blotName!==this.statics.blotName){var n=o.default.create(this.statics.defaultChild);e.moveChildren(n),this.appendChild(n)}i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e)}}]),t}(l.default);f.blotName="list",f.scope=o.default.Scope.BLOCK_BLOT,f.tagName=["OL","UL"],f.defaultChild="list-item",f.allowedChildren=[h],t.ListItem=h,t.default=f},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(56))&&r.__esModule?r:{default:r}).default);i.blotName="italic",i.tagName=["EM","I"],t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,null,[{key:"create",value:function(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e)}},{key:"formats",value:function(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}}]),t}(((r=n(6))&&r.__esModule?r:{default:r}).default);a.blotName="script",a.tagName=["SUB","SUP"],t.default=a},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(6))&&r.__esModule?r:{default:r}).default);i.blotName="strike",i.tagName="S",t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(6))&&r.__esModule?r:{default:r}).default);i.blotName="underline",i.tagName="U",t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=(r=n(0))&&r.__esModule?r:{default:r},l=n(27),s=["alt","height","width"],u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"format",value:function(e,n){s.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return"string"==typeof e&&n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return s.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:"match",value:function(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}},{key:"sanitize",value:function(e){return(0,l.sanitize)(e,["http","https","data"])?e:"//:0"}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}(a.default.Embed);u.blotName="image",u.tagName="IMG",t.default=u},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},a=n(4),l=(r=n(27))&&r.__esModule?r:{default:r},s=["height","width"],u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"format",value:function(e,n){s.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return s.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:"sanitize",value:function(e){return l.default.sanitize(e)}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}(a.BlockEmbed);u.blotName="video",u.className="ql-video",u.tagName="IFRAME",t.default=u},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FormulaBlot=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=s(n(35)),a=s(n(5)),l=s(n(9));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function d(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){function t(){return u(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),r(t,null,[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return"string"==typeof e&&(window.katex.render(e,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",e)),n}},{key:"value",value:function(e){return e.getAttribute("data-value")}}]),t}(o.default);h.blotName="formula",h.className="ql-formula",h.tagName="SPAN";var f=function(e){function t(){u(this,t);var e=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(null==window.katex)throw Error("Formula module requires KaTeX.");return e}return d(t,e),r(t,null,[{key:"register",value:function(){a.default.register(h,!0)}}]),t}(l.default);t.FormulaBlot=h,t.default=f},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CodeToken=t.CodeBlock=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},o=s(n(0)),a=s(n(5)),l=s(n(9));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function d(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){function t(){return u(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),r(t,[{key:"replaceWith",value:function(e){this.domNode.textContent=this.domNode.textContent,this.attach(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replaceWith",this).call(this,e)}},{key:"highlight",value:function(e){var t=this.domNode.textContent;this.cachedText!==t&&((t.trim().length>0||null==this.cachedText)&&(this.domNode.innerHTML=e(t),this.domNode.normalize(),this.attach()),this.cachedText=t)}}]),t}(s(n(13)).default);h.className="ql-syntax";var f=new o.default.Attributor.Class("token","hljs",{scope:o.default.Scope.INLINE}),p=function(e){function t(e,n){u(this,t);var r=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if("function"!=typeof r.options.highlight)throw Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var i=null;return r.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(i),i=setTimeout(function(){r.highlight(),i=null},r.options.interval)}),r.highlight(),r}return d(t,e),r(t,null,[{key:"register",value:function(){a.default.register(f,!0),a.default.register(h,!0)}}]),r(t,[{key:"highlight",value:function(){var e=this;if(!this.quill.selection.composing){this.quill.update(a.default.sources.USER);var t=this.quill.getSelection();this.quill.scroll.descendants(h).forEach(function(t){t.highlight(e.options.highlight)}),this.quill.update(a.default.sources.SILENT),null!=t&&this.quill.setSelection(t,a.default.sources.SILENT)}}}]),t}(l.default);p.DEFAULTS={highlight:null==window.hljs?null:function(e){return window.hljs.highlightAuto(e).value},interval:1e3},t.CodeBlock=h,t.CodeToken=f,t.default=p},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(e,t){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(e,t){e.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(e,t){e.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(e,t){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BubbleTooltip=void 0;var r=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);if(null===o)return;return e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=d(n(3)),a=d(n(8)),l=n(43),s=d(l),u=n(15),c=d(n(41));function d(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function p(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],m=function(e){function t(e,n){h(this,t),null!=n.modules.toolbar&&null==n.modules.toolbar.container&&(n.modules.toolbar.container=g);var r=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.container.classList.add("ql-bubble"),r}return p(t,e),i(t,[{key:"extendToolbar",value:function(e){this.tooltip=new v(this.quill,this.options.bounds),this.tooltip.root.appendChild(e.container),this.buildButtons([].slice.call(e.container.querySelectorAll("button")),c.default),this.buildPickers([].slice.call(e.container.querySelectorAll("select")),c.default)}}]),t}(s.default);m.DEFAULTS=(0,o.default)(!0,{},s.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var v=function(e){function t(e,n){h(this,t);var r=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.on(a.default.events.EDITOR_CHANGE,function(e,t,n,i){if(e===a.default.events.SELECTION_CHANGE){if(null!=t&&t.length>0&&i===a.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var o=r.quill.getLines(t.index,t.length);if(1===o.length)r.position(r.quill.getBounds(t));else{var l=o[o.length-1],s=r.quill.getIndex(l),c=Math.min(l.length()-1,t.index+t.length-s),d=r.quill.getBounds(new u.Range(s,c));r.position(d)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}}),r}return p(t,e),i(t,[{key:"listen",value:function(){var e=this;r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){e.root.classList.remove("ql-editing")}),this.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!e.root.classList.contains("ql-hidden")){var t=e.quill.getSelection();null!=t&&e.position(e.quill.getBounds(t))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(e){var n=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"position",this).call(this,e),i=this.root.querySelector(".ql-tooltip-arrow");if(i.style.marginLeft="",0===n)return n;i.style.marginLeft=-1*n-i.offsetWidth/2+"px"}}]),t}(l.BaseTooltip);v.TEMPLATE='<span class="ql-tooltip-arrow"></span><div class="ql-tooltip-editor"><input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL"><a class="ql-close"></a></div>',t.BubbleTooltip=v,t.default=m},function(e,t,n){e.exports=n(63)}]).default;var b=f("2SBKn"),oQ={};C0=oQ,C1=function(e,t,n,r){var i,o,a,l,s,u,c,d,h,f,p,g,m,v,y,b,w,x,_,E,S,O,C,k,P,T,A,N,j,R,I,L,M,D,F,z,B,U,H,V,q,G,W,K,$,Y,X,Q,Z,J,ee,et=(o=[],(i={}).joinUrl=function(t,n){return t?e.resolve(t,n):n},i.getConstantUniqueIdFor=function(e){return 0>o.indexOf(e)&&o.push(e),o.indexOf(e)},i.clone=function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},i.parseOptionalParameters=function(e){var t,n={canvas:null,options:{}};return null==e[0]||"object"==typeof(t=e[0])&&null!==t&&Object.prototype.toString.apply(t).match(/\[object (Canvas|HTMLCanvasElement)\]/i)?(n.canvas=e[0]||null,n.options=i.clone(e[1])):n.options=i.clone(e[0]),n},i),en=(a={},l=function(e,t,n){var r=e[t];return e[t]=function(){var e=Array.prototype.slice.call(arguments);return n.apply(this,[e,r])},r},a.baseUrlRespectingXhr=function(e,t){return function(){var n=new e;return l(n,"open",function(e,n){var r=e.shift(),i=e.shift(),o=et.joinUrl(t,i);return n.apply(this,[r,o].concat(e))}),n}},a.finishNotifyingXhr=function(e){var t,n=0,r=0,i=!1,o=new Promise(function(e){t=function(){n-r<=0&&i&&e({totalCount:n})}}),a=function(){var i=new e;return l(i,"send",function(e,t){return n+=1,t.apply(this,arguments)}),i.addEventListener("load",function(){r+=1,t()}),i};return a.waitForRequestsToFinish=function(){return i=!0,t(),o},a},a),er=(s={},u=function(e){return Array.prototype.slice.call(e)},s.addClassName=function(e,t){e.className+=" "+t},s.addClassNameRecursively=function(e,t){s.addClassName(e,t),e.parentNode!==e.ownerDocument&&s.addClassNameRecursively(e.parentNode,t)},c=function(e,t){var n=e.parentStyleSheet,r=u(n.cssRules).indexOf(e);n.insertRule(t,r+1),n.deleteRule(r)},d=function(e,t){var n=e.cssText.replace(/^[^\{]+/,"");c(e,t+" "+n)},h=function(e){e.textContent=u(e.sheet.cssRules).reduce(function(e,t){return e+t.cssText},"")},f=function(e){var t=document.implementation.createHTMLDocument(""),n=document.createElement("style");n.textContent=e.textContent,t.body.appendChild(n),e.sheet=n.sheet},p=function(e,t,n){var r="((?:^|[^.#:\\w])|(?=\\W))("+t.join("|")+")(?=\\W|$)";u(e.querySelectorAll("style")).forEach(function(e){void 0===e.sheet&&f(e);var t=u(e.sheet.cssRules).filter(function(e){return e.selectorText&&RegExp(r,"i").test(e.selectorText)});t.length&&(t.forEach(function(e){var t=e.selectorText.replace(RegExp(r,"gi"),function(e,t,r){return t+n(r)});t!==e.selectorText&&d(e,t)}),h(e))})},s.rewriteCssSelectorWith=function(e,t,n){p(e,[t],function(){return n})},s.lowercaseCssTypeSelectors=function(e,t){p(e,t,function(e){return e.toLowerCase()})},s.findHtmlOnlyNodeNames=function(e){var t,n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r={},i={};do t=n.currentNode.tagName.toLowerCase(),"http://www.w3.org/1999/xhtml"===n.currentNode.namespaceURI?r[t]=!0:i[t]=!0;while(n.nextNode())return Object.keys(r).filter(function(e){return!i[e]})},g={},m=function(e){return Array.prototype.slice.call(e)},v={active:!0,hover:!0,focus:!1,target:!1},g.fakeUserAction=function(e,t,n){var r=e.querySelector(t),i="rasterizehtml"+n;r&&(v[n]?s.addClassNameRecursively(r,i):s.addClassName(r,i),s.rewriteCssSelectorWith(e,":"+n,"."+i))},g.persistInputValues=function(e){var t=e.querySelectorAll("input"),n=e.querySelectorAll("textarea"),r=function(e){return"checkbox"===e.type||"radio"===e.type};m(t).filter(r).forEach(function(e){e.checked?e.setAttribute("checked",""):e.removeAttribute("checked")}),m(t).filter(function(e){return!r(e)}).forEach(function(e){e.setAttribute("value",e.value)}),m(n).forEach(function(e){e.textContent=e.value})},g.rewriteTagNameSelectorsToLowerCase=function(e){s.lowercaseCssTypeSelectors(e,s.findHtmlOnlyNodeNames(e))},g),ei=(y=window,b={},w=function(e,t,n,r){var i=e.createElement(t);return i.style.visibility="hidden",i.style.width=n+"px",i.style.height=r+"px",i.style.position="absolute",i.style.top=-1e4-r+"px",i.style.left=-1e4-n+"px",e.getElementsByTagName("body")[0].appendChild(i),i},b.executeJavascript=function(e,t){return new Promise(function(n){var r=w(y.document,"iframe",t.width,t.height),i=e.outerHTML,o=[],a=t.executeJsTimeout||0,l=function(){y.document.getElementsByTagName("body")[0].removeChild(r)},s=function(){n({document:r.contentDocument,errors:o,cleanUp:l})},u=r.contentWindow.XMLHttpRequest,c=en.finishNotifyingXhr(u),d=en.baseUrlRespectingXhr(c,t.baseUrl);r.onload=function(){(a>0?new Promise(function(e){setTimeout(e,a)}):Promise.resolve()).then(c.waitForRequestsToFinish).then(s)},r.contentDocument.open(),r.contentWindow.XMLHttpRequest=d,r.contentWindow.onerror=function(e){o.push({resourceType:"scriptExecution",msg:e})},r.contentDocument.write("<!DOCTYPE html>"),r.contentDocument.write(i),r.contentDocument.close()})},x=function(e,t,n){var r=e.createElement("iframe");return r.style.width=t+"px",r.style.height=n+"px",r.style.visibility="hidden",r.style.position="absolute",r.style.top=-1e4-n+"px",r.style.left=-1e4-t+"px",r.style.borderWidth=0,r.sandbox="allow-same-origin",r.scrolling="no",r},_=function(e,t,n){var r=Math.floor(e/n),i=Math.floor(t/n);return x(y.document,r,i)},E=function(e,t){var n=e.querySelector(t);if(n)return n;if(e.ownerDocument.querySelector(t)===e)return e;throw{message:"Clipping selector not found"}},S=function(e,t,n,r,i){var o,a,l,s,u,c,d,h,f=Math.max(e.scrollWidth,e.clientWidth),p=Math.max(e.scrollHeight,e.clientHeight);return t?(a=(d=E(e,t).getBoundingClientRect()).top,l=d.left,s=d.width,u=d.height):(a=0,l=0,s=f,u=p),h={width:Math.max((o={width:s,height:u}).width*i,n),height:Math.max(o.height*i,r)},c=y.getComputedStyle(e.ownerDocument.documentElement).fontSize,{left:l,top:a,width:h.width,height:h.height,viewportWidth:f,viewportHeight:p,rootFontSize:c}},O=function(e,t){var n=e.tagName;return t.querySelector(n)},C=function(e){var t=e.tagName.toLowerCase();return"html"===t||"body"===t?e.outerHTML:'<body style="margin: 0;">'+e.outerHTML+"</body>"},b.calculateDocumentContentSize=function(e,t){return new Promise(function(n,r){var i,o=t.zoom||1;i=_(t.width,t.height,o),y.document.getElementsByTagName("body")[0].appendChild(i),i.onload=function(){var a,l=i.contentDocument;try{a=S(O(e,l),t.clip,t.width,t.height,o),n(a)}catch(e){r(e)}finally{y.document.getElementsByTagName("body")[0].removeChild(i)}},i.contentDocument.open(),i.contentDocument.write("<!DOCTYPE html>"),i.contentDocument.write(C(e)),i.contentDocument.close()})},b.parseHtmlFragment=function(e){var t=y.document.implementation.createHTMLDocument("");t.documentElement.innerHTML=e;var n=t.querySelector("body").firstChild;if(!n)throw"Invalid source";return n},k=function(e,t){var n,r,i,o,a=/<html((?:\s+[^>]*)?)>/im.exec(t),l=y.document.implementation.createHTMLDocument("");if(a)for(r=0,n="<div"+a[1]+"></div>",l.documentElement.innerHTML=n,i=l.querySelector("div");r<i.attributes.length;r++)o=i.attributes[r],e.documentElement.setAttribute(o.name,o.value)},b.parseHTML=function(e){var t=y.document.implementation.createHTMLDocument("");return t.documentElement.innerHTML=e,k(t,e),t},P=function(e){try{return n.failOnParseError(e)}catch(e){throw{message:"Invalid source",originalError:e}}},b.validateXHTML=function(e){P(new DOMParser().parseFromString(e,"application/xml"))},T=null,b.loadDocument=function(e,t){return new Promise(function(n,r){var i,o,a=new window.XMLHttpRequest,l=(i=et.joinUrl(t.baseUrl,e),"none"===(o=t.cache)||"repeated"===o?((null===T||"repeated"!==o)&&(T=Date.now()),i+"?_="+T):i),s=function(e){r({message:"Unable to load page",originalError:e})};a.addEventListener("load",function(){200===a.status||0===a.status?n(a.responseXML):s(a.statusText)},!1),a.addEventListener("error",function(e){s(e)},!1);try{a.open("GET",l,!0),a.responseType="document",a.send(null)}catch(e){s(e)}}).then(function(e){return P(e)})},b),eo=(A=window,j={},R=function(e,t){return t?URL.createObjectURL(new Blob([e],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e)},I=function(e){e instanceof Blob&&URL.revokeObjectURL(e)},L='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',M=function(e){return new Promise(function(t,n){var r=document.createElement("canvas"),i=new Image;i.onload=function(){var e=r.getContext("2d");try{e.drawImage(i,0,0),r.toDataURL("image/png"),t(!0)}catch(e){t(!1)}},i.onerror=n,i.src=e})},D=function(){var e=R(L,!0);return M(e).then(function(t){return I(e),!t&&M(R(L,!1)).then(function(e){return e})},function(){return!1})},F=function(){if(A.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch(e){}return!1},j.renderSvg=function(e){return new Promise(function(t,n){var r,i,o=function(){i.onload=null,i.onerror=null},a=function(){r&&I(r)};(i=new Image).onload=function(){o(),a(),t(i)},i.onerror=function(){a(),n()},(void 0===N&&(N=new Promise(function(e,t){F()&&A.URL?D().then(function(t){e(!t)},function(){t()}):e(!1)})),N).then(function(t){return R(e,t)}).then(function(e){r=e,i.src=r},n)})},j),ea=(z={},B=function(e,t){var n=t||1,r={width:e.width,height:e.height,"font-size":e.rootFontSize};return 1!==n&&(r.style="transform:scale("+n+"); transform-origin: 0 0;"),r},U=function(e){var t,n;return t=Math.round(e.viewportWidth),n=Math.round(e.viewportHeight),{x:-e.left,y:-e.top,width:t,height:n}},H=function(e){var t=e.style||"";e.style=t+"float: left;"},V=function(e){e.externalResourcesRequired=!0},q=function(e){var t=Object.keys(e);return t.length?" "+t.map(function(t){return t+'="'+e[t]+'"'}).join(" "):""},G=function(e,n,r){var i=t.serializeToString(e);ei.validateXHTML(i);var o=U(n);return H(o),V(o),'<svg xmlns="http://www.w3.org/2000/svg"'+q(B(n,r))+'><style scoped="">html::-webkit-scrollbar { display: none; }</style><foreignObject'+q(o)+">"+i+"</foreignObject></svg>"},z.getSvgForDocument=function(e,t,n){return er.rewriteTagNameSelectorsToLowerCase(e),G(e,t,n)},z.drawDocumentAsSvg=function(e,t){return["hover","active","focus","target"].forEach(function(n){t[n]&&er.fakeUserAction(e,t[n],n)}),ei.calculateDocumentContentSize(e,t).then(function(n){return z.getSvgForDocument(e,n,t.zoom)})},z),el=(W={},K=function(e){return{message:"Error rendering page",originalError:e}},$=function(e){return eo.renderSvg(e).then(function(t){return{image:t,svg:e}},function(e){throw K(e)})},Y=function(e,t){try{t.getContext("2d").drawImage(e,0,0)}catch(e){throw K(e)}},W.rasterize=function(e,t,n){var i;return(i=et.clone(n)).inlineScripts=!0===n.executeJs,r.inlineReferences(e,i).then(function(t){return n.executeJs?ei.executeJavascript(e,n).then(function(e){var t=e.document;return er.persistInputValues(t),{document:t,errors:e.errors,cleanUp:e.cleanUp}}).then(function(e){return{element:e.document.documentElement,errors:t.concat(e.errors),cleanUp:e.cleanUp}}):{element:e,errors:t,cleanUp:function(){}}}).then(function(e){var r;return(r=e.element,ea.drawDocumentAsSvg(r,n).then($).then(function(e){return t&&Y(e.image,t),e})).then(function(t){return e.cleanUp(),{image:t.image,svg:t.svg,errors:e.errors}})})},W);return X={},Q=function(e,t){var n=e?e.width:300,r=e?e.height:200;return{width:void 0!==t.width?t.width:n,height:void 0!==t.height?t.height:r}},Z=function(e){var t,n=Q(e.canvas,e.options);return(t=et.clone(e.options)).width=n.width,t.height=n.height,t},X.drawDocument=function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1),n=et.parseOptionalParameters(t),r=e.documentElement?e.documentElement:e;return el.rasterize(r,n.canvas,Z(n))},J=function(e,t,n){var r=ei.parseHTML(e);return X.drawDocument(r,t,n)},X.drawHTML=function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1),n=et.parseOptionalParameters(t);return J(e,n.canvas,n.options)},ee=function(e,t,n){var r=document.implementation.createHTMLDocument("");r.replaceChild(e.documentElement,r.documentElement);var i=n?et.clone(n):{};return n.baseUrl||(i.baseUrl=t),{document:r,options:i}},X.drawURL=function(){var e,t,n=arguments[0],r=Array.prototype.slice.call(arguments,1),i=et.parseOptionalParameters(r);return e=i.canvas,t=i.options,ei.loadDocument(n,t).then(function(r){var i=ee(r,n,t);return X.drawDocument(i.document,e,i.options)})},X},void 0===C0&&void 0!==window&&(C0=window),"function"==typeof define&&define.amd?define(["url","xmlserializer","sane-domparser-error","inlineresources"],function(e,t,n,r){return C0.rasterizeHTML=C1(e,t,n,r)}):oQ?oQ=C1(f("kRFNf"),f("l4MZj"),f("lDFX4"),f("6cJtK")):C0.rasterizeHTML=C1(C0.url,C0.xmlserializer,C0.sanedomparsererror,C0.inlineresources);let oZ=`
|
|
43
43
|
<style>
|
|
44
44
|
html, body {
|
|
45
45
|
padding: 0;
|
|
@@ -93,7 +93,7 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
|
93
93
|
<path d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
94
94
|
<path d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
95
95
|
</svg>
|
|
96
|
-
`);let aO=(e,t,n,r,i=0,o=!1)=>{let a=Math.floor(Math.max(e.width*r,1)),l=Math.floor(Math.max(e.height*r,1)),u=Math.min(i*r,a/2,l/2),c=Math.max(e.width/n.width,e.height/n.height)*r,d=e.page._exporting&&iE.imageDownScalingEnabled&&c<1&&!o,h=0===n.x&&0===n.y&&n.width===t?.width&&n.height===t?.height,f=s(y).useMemo(()=>{if(!t||!t.width||!t.height)return;let e=0===u,n=!d;if(!h||!e||!n)return aw()},[t,u,d,h]);return s(y).useLayoutEffect(()=>{if(!f||!t)return;f.width=a,f.height=l;let e=f.getContext("2d");if(!e)return;u&&(e.beginPath(),e.moveTo(u,0),e.lineTo(a-u,0),e.arc(a-u,u,u,3*Math.PI/2,0,!1),e.lineTo(a,l-u),e.arc(a-u,l-u,u,0,Math.PI/2,!1),e.lineTo(u,l),e.arc(u,l-u,u,Math.PI/2,Math.PI,!1),e.lineTo(0,u),e.arc(u,u,u,Math.PI,3*Math.PI/2,!1),e.clip());let r=d?function(e,t){let n=aw();n.width=e.width,n.height=e.height,n.getContext("2d")?.drawImage(e,0,0,n.width,n.height);let r=function(e,t,n,r,i,o,a){for(var l=new ImageData(t,n),s=new Int32Array(e.data.buffer),u=e.width,c=new Int32Array(l.data.buffer),d=l.width,h=t/o,f=n/a,p=Math.round(1/h),g=Math.round(1/f),m=p*g,v=0;v<l.height;v++)for(var y=0;y<d;y++){for(var b=0+Math.round(y/h)+(0+Math.round(v/f))*u,w=0,x=0,_=0,E=0,S=0;S<g;S++)for(var O=0;O<p;O++){var C=s[b+O+S*u];w+=C<<24>>>24,x+=C<<16>>>24,_+=C<<8>>>24,E+=C>>>24}w=Math.round(w/m),x=Math.round(x/m),_=Math.round(_/m),E=Math.round(E/m),c[y+v*d]=E<<24|_<<16|x<<8|w}return l}(n.getContext("2d").getImageData(0,0,n.width,n.height),Math.floor(n.width*t),Math.floor(n.height*t),0,0,n.width,n.height);return n.width=Math.floor(n.width*t),n.height=Math.floor(n.height*t),n.getContext("2d")?.putImageData(r,0,0),n}(t,c):t,i=d?{x:Math.floor(n.x*c),y:Math.floor(n.y*c),width:Math.floor(n.width*c),height:Math.floor(n.height*c)}:n;e.drawImage(r,i.x,i.y,i.width,i.height,0,0,f.width,f.height)},[f,e.width,e.height,n.x,n.y,n.width,n.height,i,r,o,e.page._exporting,d]),s(y).useEffect(()=>()=>{f&&"CANVAS"===f.nodeName&&s(N).Util.releaseCanvas(f)},[f]),f||t},aC=(e,t,n,r)=>{let[i,o]=aA(a_(e.clipSrc||""),"anonymous");aN(e.clipSrc?o:"loaded",e.id+"-clip");let a=s(y).useMemo(()=>{if(t&&i)return aw()},[t,i]);return s(y).useLayoutEffect(()=>{if(!i||!t||!t.width||!t.height||!i||!i.width||!i.height||!a)return;let r=aw(),o=Math.max(e.width/i.width*n,e.height/i.height*n);r.width=i.width*o,r.height=i.height*o,r.getContext("2d")?.drawImage(i,0,0,r.width,r.height),a.width=Math.max(t.width,1),a.height=Math.max(t.height,1);let l=a.getContext("2d");l&&(l.save(),l.drawImage(r,0,0,t.width,t.height),s(N).Util.releaseCanvas(r),l.globalCompositeOperation="source-in",l.drawImage(t,0,0,a.width,a.height),l.restore())},[a,t,i,e.width,e.height,n,...r]),e.clipSrc&&i?a:t},ak=aw(),aP=T(({element:e})=>{let t=Math.min(30,e.width/4,e.height/4),n=s(y).useRef(null);return s(y).useEffect(()=>{let e=n.current;if(!e)return;let t=new(s(N)).Animation(t=>{e.rotate((t?.timeDiff||0)/2)},e.getLayer());return t.start(),()=>{t.stop()}}),(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport,children:[(0,g.jsx)(rK,{width:e.width,height:e.height,fill:"rgba(124, 173, 212, 0.8)"}),(0,g.jsx)("Arc",{ref:n,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270})]})}),aT=T(({element:e})=>{let t="Can not load the video...",n=Math.max(10,Math.min(30,e.width/t.length));return(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport,children:[(0,g.jsx)(rK,{width:e.width,height:e.height,fill:"rgba(223, 102, 102, 0.8)"}),(0,g.jsx)(rQ,{text:t,fontSize:n,width:e.width,height:e.height,align:"center",fill:"white",verticalAlign:"middle",padding:5})]})}),aA=s(r2),aN=(e,t)=>{let n=s(y).useRef(),r=()=>{n.current?.(),n.current=void 0};s(y).useEffect(()=>r,[]),s(y).useLayoutEffect(()=>{"loading"!==e||n.current||(n.current=il(`video ${t}`)),"loading"!==e&&r(),"failed"===e&&ic(`video ${t}`)},[e])},aj=T(({element:e,store:t})=>{let n,r;let[i,o]=s(y).useState(!1),a=s(y).useRef(null),l=s(y).useRef(null),[u,c]=s(y).useState(!1),d=t.selectedElements.indexOf(e)>=0,[h,f]=s(y).useState(!1),[p,m]=function(e,t,n){let r=s(y).useRef("loading"),i=s(y).useRef(),[o,a]=s(y).useState(0),l=s(y).useRef(),u=s(y).useRef(),c=s(y).useRef();return(l.current!==e||u.current!==t||c.current!==n)&&(r.current="loading",i.current=void 0,l.current=e,u.current=t,c.current=n),s(y).useLayoutEffect(function(){if(e){var o=document.createElement("video");return o.addEventListener("canplay",l),o.addEventListener("error",s),t&&(o.crossOrigin=t),n&&(o.referrerpolicy=n),o.src=e,function(){o.removeEventListener("canplay",l),o.removeEventListener("error",s)}}function l(){r.current="loaded",i.current=o,a(Math.random())}function s(e){r.current="failed",i.current=void 0,a(Math.random())}},[e,t,n]),[i.current,r.current]}(e.src,"anonymous");aN(m,e.id+"-video"),p&&(p.muted=!0,p.width=p.videoWidth,p.height=p.videoHeight);let v=p||ak;s(y).useEffect(()=>{p&&t.history.ignore(()=>{e.set({duration:1e3*p.duration})})},[p]),s(y).useEffect(()=>{if(!p)return;let n=t.isPlaying||h;if(!n){p.pause();return}n&&(p.currentTime=e.startTime*p.duration,p.play());let r=new(s(N)).Animation(()=>{},a.current?.getLayer());r.start();let i=()=>{f(!1),p.currentTime=e.startTime*p.duration},o=()=>{p.currentTime>=e.endTime*p.duration&&(p.pause(),p.currentTime=e.startTime*p.duration,f(!1))};return p.addEventListener("ended",i),p.addEventListener("timeupdate",o),()=>{r.stop(),p.removeEventListener("ended",i),p.removeEventListener("timeupdate",o)}},[p,h,t.isPlaying]),s(y).useEffect(()=>(0,b.autorun)(()=>{if(p){let n=(t.currentTime-e.page.startTime)%e.duration;p.currentTime=n/1e3,a.current?.getLayer()?.batchDraw()}}),[t,p]),s(y).useEffect(()=>{if(!p)return;let t=null,n=()=>{!function(e,t){for(var n=e.buffered,r=0;r<n.length;r++)if(t>=n.start(r)&&t<=n.end(r))return!0;return!1}(p,p.currentTime)&&(t&&console.error("finish already exists"),t=il(`video ${e.id}`))},r=()=>{t&&(t(),t=null)};return p.addEventListener("timeupdate",n),p.addEventListener("canplay",r),()=>{p.removeEventListener("timeupdate",n),p.removeEventListener("canplay",r)}},[p,e.id,il]);let{cropX:w,cropY:x,cropWidth:_,cropHeight:E}=e;"loaded"!==m&&(w=x=0,_=E=1);let S=v.width*_,O=v.height*E,C=e.width/e.height,k=S/O,P="svg"===e.type;P?(n=S,r=O):C>=k?(n=S,r=S/C):(n=O*C,r=O);let T={x:v.width*w,y:v.height*x,width:n,height:r},A=e.cornerRadius??0,j=aC(e,aO(e,v,T,t._elementsPixelRatio,A,i||e._cropModeEnabled||"svg"===e.type),t._elementsPixelRatio,[T,A,t._elementsPixelRatio]),R=Math.max(e.width/n,e.height/r);s(y).useEffect(()=>{if(!e._cropModeEnabled)return;let t=a.current?.getStage();function n(t){e._cropModeEnabled&&t.target!==l.current&&e.toggleCropMode(!1)}function r(t){e._cropModeEnabled&&"CANVAS"!==t.target.nodeName&&e.toggleCropMode(!1)}return document.body.addEventListener("click",r),t?.on("click",n),t?.on("tap",n),()=>{document.body.removeEventListener("click",r),document.body.removeEventListener("touchstart",r),t?.off("click",n),t?.off("click",n)}},[e._cropModeEnabled]),s(y).useLayoutEffect(()=>{if(!i&&!e._cropModeEnabled)return iA(a.current,e),(0,b.autorun)(()=>{iA(a.current,e)},{delay:100})},[v,i,_,E,e._cropModeEnabled]),s(y).useLayoutEffect(()=>{i||e._cropModeEnabled?a.current?.clearCache():iA(a.current,e)},[i,e.width,e.height,e._cropModeEnabled]),s(y).useEffect(()=>{iA(a.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);let I=s(y).useRef(null),L=s(y).useRef(null),M=s(y).useRef(null);s(y).useLayoutEffect(()=>{e._cropModeEnabled&&(L.current.nodes([I.current]),M.current.nodes([l.current]))},[e._cropModeEnabled]);let D=t=>{Math.round(t.target.x())>0&&(t.target.x(0),t.target.scaleX(1)),Math.round(t.target.y())>0&&(t.target.y(0),t.target.scaleY(1));let i=t.target.width()*t.target.scaleX(),o=t.target.height()*t.target.scaleY(),a=Math.min(1,n/i),l=Math.min(1,r/o),s=Math.min(1-a,Math.max(0,Math.round(-t.target.x())/i)),u=Math.min(1-l,Math.max(0,Math.round(-t.target.y())/o));t.target.setAttrs({x:-s*v.width,y:-u*v.height,scaleX:1,scaleY:1}),e.set({cropX:s,cropY:u,cropWidth:a,cropHeight:l})},F=()=>{"svg"!==e.type&&e.contentEditable&&setTimeout(()=>{e.toggleCropMode(!0)})},z="loading"===m,B="failed"===m,U=!z&&!B,H=s(y).useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),V=U?e.a.opacity:0;ii(a,V);let q=e.selectable||"admin"===t.role,G=iL();return(0,g.jsxs)(s(y).Fragment,{children:[z&&(0,g.jsx)(aP,{element:e}),B&&(0,g.jsx)(aT,{element:e}),(0,g.jsx)(rX,{ref:a,name:"element",id:e.id,image:v,x:e.x,y:e.y,width:e.width||1,height:e.height||1,rotation:e.rotation,opacity:V,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:T,listening:q,cropX:T.x,cropY:T.y,cropWidth:T.width,cropHeight:T.height,draggable:G?e.draggable&&d:e.draggable,preventDefault:!G||d,hideInExport:!e.showInExport,onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)},onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDblClick:F,onDblTap:F,onTransformStart:()=>{o(!0),H.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:t=>{let i=t.currentTarget,o=1e-7>Math.abs(i.scaleX()-1)?1:i.scaleX(),a=1e-7>Math.abs(i.scaleY()-1)?1:i.scaleY();i.scaleX(1),i.scaleY(1);let l=t.target.getStage()?.findOne("Transformer"),s=Math.min(1-n/v.width,Math.max(0,e.cropX)),u=Math.min(1-r/v.height,Math.max(0,e.cropY)),c=l.getActiveAnchor(),d=!(c.indexOf("middle")>=0||c.indexOf("center")>=0),h=!d&&o<1&&H.current.cropHeight>r/v.height,f=d?e.cropWidth:e.cropWidth*o;h&&(f=e.cropWidth);let p=!d&&a<1&&H.current.cropWidth>n/v.width,g=d?e.cropHeight:e.cropHeight*a;p&&(g=e.cropHeight),P&&(f=e.cropWidth,g=e.cropHeight),e.set({cropX:s,cropY:u,x:i.x(),y:i.y(),width:i.width()*o,height:i.height()*a,rotation:t.target.rotation(),cropWidth:Math.min(f,1-s),cropHeight:Math.min(g,1-u)})},onTransformEnd:t=>{let i=t.currentTarget;e.set({width:i.width(),height:i.height(),x:i.x(),y:i.y(),rotation:t.target.rotation(),cropWidth:n/v.width,cropHeight:r/v.height}),o(!1)}}),(0,g.jsx)(rK,{x:e.x,y:e.y,width:Math.max(e.width-e.borderSize,0),height:Math.max(e.height-e.borderSize,0),opacity:V,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,A-e.borderSize),hideInExport:!e.showInExport}),!h&&(0,g.jsx)(rX,{image:aE,x:e.x+e.width/2-15/t.scale,y:e.y+e.height/2-15/t.scale,width:30/t.scale,height:30/t.scale,hideInExport:!0,onClick:()=>{f(!0)}}),h&&(0,g.jsx)(rX,{image:aS,x:e.x+e.width/2-15/t.scale,y:e.y+e.height/2-15/t.scale,width:30/t.scale,height:30/t.scale,hideInExport:!0,onClick:()=>{f(!1)}}),e._cropModeEnabled&&(0,g.jsxs)(r6,{selector:".page-abs-container",enabled:!0,children:[(0,g.jsx)(rK,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),(0,g.jsx)(rX,{listening:!1,image:j,x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,scaleX:R,scaleY:R,children:[(0,g.jsx)(rX,{image:v,ref:l,opacity:.4,draggable:!0,x:-e.cropX*v.width,y:-e.cropY*v.height,onDragMove:D,onTransform:D}),(0,g.jsx)(rJ,{ref:M,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),(0,g.jsx)(rK,{width:n,height:r,ref:I,listening:!1,onTransform:t=>{t.target.x()<-e.cropX*v.width-1e-9&&(t.target.x(-e.cropX*v.width),t.target.scaleX(1)),t.target.y()<-e.cropY*v.height-1e-9&&(t.target.y(-e.cropY*v.height),t.target.scaleY(1));let n=Math.min(1,Math.max(0,e.cropX+t.target.x()/v.width)),r=Math.min(1,Math.max(0,t.target.y()/v.height+e.cropY)),i=t.target.width()*t.target.scaleX(),o=t.target.height()*t.target.scaleY(),a=Math.min(1-n,i/v.width),l=Math.min(1-r,o/v.height),s=t.target.getAbsolutePosition(t.target.getParent().getParent());t.target.scale({x:1,y:1}),t.target.position({x:0,y:0}),e.set({x:s.x,y:s.y,cropX:n,cropY:r,cropWidth:a,cropHeight:l,width:Math.min(i*R,v.width*(1-n)*R),height:Math.min(o*R,v.height*(1-r)*R)})}}),(0,g.jsx)(rJ,{ref:L,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2})]})]}),(u||d)&&(0,g.jsx)(ij,{element:e})]})});var y=f("8NFma");function aR(e,t,n=0){let r=e/2,i=t/2,o=e/2-n,a=t/2-n,l=o/2,s=a/2,u="",c=Math.PI/5;for(let e=0;e<10;e++){let t=e%2==0?o:l,n=e%2==0?a:s,d=r+t*Math.sin(e*c),h=i-n*Math.cos(e*c);0===e?u=`M ${d} ${h}`:u+=` L ${d} ${h}`}return u+" Z"}let aI={rect:T(({element:e,fillProps:t,strokeProps:n})=>(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(rK,{...t}),(0,g.jsx)(rK,{...n})]})),circle:T(({element:e,fillProps:t,strokeProps:n})=>(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(rK,{width:e.width,height:e.height,fill:"transparent"}),(0,g.jsx)(r$,{...t,offsetX:-e.width/2,offsetY:-e.height/2}),(0,g.jsx)(r$,{...n,offsetX:-e.width/2,offsetY:-e.height/2,x:0,y:0})]})),star:T(({element:e,fillProps:t,strokeProps:n})=>{let r=s(y).useRef(null);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(rK,{width:e.width,height:e.height,fill:"transparent"}),(0,g.jsx)(rZ,{...t,data:aR(e.width,e.height),ref:r}),(0,g.jsx)(rG,{clipFunc:e=>{let t=r.current;t&&t.drawScene.call(t,e.canvas,t)},children:(0,g.jsx)(rZ,{...n,x:0,y:0,data:aR(e.width,e.height,0)})})]})})},aL={text:iG,image:ol,svg:ol,line:ab,video:aj,figure:T(({element:e,store:t})=>{let n=e.selectable||"admin"===t.role,r=iL(),[i,o]=s(y).useState(!1),a=t.selectedElements.indexOf(e)>=0&&1===t.selectedElements.length,l=Math.min(e.strokeWidth,e.width/2,e.height/2),u=Math.max(0,Math.min(e.width/2,e.height/2,e.cornerRadius)),c={width:e.a.width,height:e.a.height,fill:e.fill,cornerRadius:u,opacity:e.animated("opacity"),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,listening:n,preventDefault:!r||a,hideInExport:!e.showInExport},d={visible:l>0,x:l/2,y:l/2,width:e.a.width-l,height:e.a.height-l,stroke:e.stroke,strokeWidth:l,cornerRadius:Math.max(0,u-l),dash:e.dash.map(e=>e*l),opacity:e.animated("opacity"),hideInExport:!e.showInExport,listening:!1},h=aI[e.subType]||rG;return(0,g.jsxs)(s(y).Fragment,{children:[(0,g.jsx)(rG,{id:e.id,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e.a.opacity,draggable:r?e.draggable&&a:e.draggable,name:"element",onMouseEnter:()=>{o(!0)},onMouseLeave:()=>{o(!1)},onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onTransform:t=>{let n=t.target.scale();t.target.scaleX(1),t.target.scaleY(1),e.set({width:e.width*n.x,height:e.height*n.y,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation()})},children:(0,g.jsx)(h,{element:e,fillProps:c,strokeProps:d})}),i&&!a&&(0,g.jsx)(ij,{element:e})]})}),group:T(e=>{let{element:t,store:n}=e,{children:r}=t,i=t.selectable||"admin"===n.role;return(0,g.jsx)(rG,{opacity:t.opacity,listening:i,children:r.map(t=>(0,y.createElement)(aM,{...e,key:t.id,store:n,element:t}))})})},aM=T(e=>{let t=aL[e.element.type];return("text"===e.element.type&&iE.htmlRenderEnabled&&(t=au),e.element.visible)?t?(0,g.jsx)(t,{...e}):(console.error("Can not find component for "+e.element.type),null):null});var b=f("2SBKn");let aD="https://api.polotno.dev/api",aF={},az=(e,t)=>{aF[e]||(aF[e]=!0,console.error(t))},aB=(e,t,n)=>e.replace(RegExp(t,"g"),n),aU=`API for iconscout is provided as a demonstration.
|
|
96
|
+
`);let aO=(e,t,n,r,i=0,o=!1)=>{let a=Math.floor(Math.max(e.width*r,1)),l=Math.floor(Math.max(e.height*r,1)),u=Math.min(i*r,a/2,l/2),c=Math.max(e.width/n.width,e.height/n.height)*r,d=e.page._exporting&&iE.imageDownScalingEnabled&&c<1&&!o,h=0===n.x&&0===n.y&&n.width===t?.width&&n.height===t?.height,f=s(y).useMemo(()=>{if(!t||!t.width||!t.height)return;let e=0===u,n=!d;if(!h||!e||!n)return aw()},[t,u,d,h]);return s(y).useLayoutEffect(()=>{if(!f||!t)return;f.width=a,f.height=l;let e=f.getContext("2d");if(!e)return;u&&(e.beginPath(),e.moveTo(u,0),e.lineTo(a-u,0),e.arc(a-u,u,u,3*Math.PI/2,0,!1),e.lineTo(a,l-u),e.arc(a-u,l-u,u,0,Math.PI/2,!1),e.lineTo(u,l),e.arc(u,l-u,u,Math.PI/2,Math.PI,!1),e.lineTo(0,u),e.arc(u,u,u,Math.PI,3*Math.PI/2,!1),e.clip());let r=d?function(e,t){let n=aw();n.width=e.width,n.height=e.height,n.getContext("2d")?.drawImage(e,0,0,n.width,n.height);let r=function(e,t,n,r,i,o,a){for(var l=new ImageData(t,n),s=new Int32Array(e.data.buffer),u=e.width,c=new Int32Array(l.data.buffer),d=l.width,h=t/o,f=n/a,p=Math.round(1/h),g=Math.round(1/f),m=p*g,v=0;v<l.height;v++)for(var y=0;y<d;y++){for(var b=0+Math.round(y/h)+(0+Math.round(v/f))*u,w=0,x=0,_=0,E=0,S=0;S<g;S++)for(var O=0;O<p;O++){var C=s[b+O+S*u];w+=C<<24>>>24,x+=C<<16>>>24,_+=C<<8>>>24,E+=C>>>24}w=Math.round(w/m),x=Math.round(x/m),_=Math.round(_/m),E=Math.round(E/m),c[y+v*d]=E<<24|_<<16|x<<8|w}return l}(n.getContext("2d").getImageData(0,0,n.width,n.height),Math.floor(n.width*t),Math.floor(n.height*t),0,0,n.width,n.height);return n.width=Math.floor(n.width*t),n.height=Math.floor(n.height*t),n.getContext("2d")?.putImageData(r,0,0),n}(t,c):t,i=d?{x:Math.floor(n.x*c),y:Math.floor(n.y*c),width:Math.floor(n.width*c),height:Math.floor(n.height*c)}:n;e.drawImage(r,i.x,i.y,i.width,i.height,0,0,f.width,f.height)},[f,e.width,e.height,n.x,n.y,n.width,n.height,i,r,o,e.page._exporting,d]),s(y).useEffect(()=>()=>{f&&"CANVAS"===f.nodeName&&s(N).Util.releaseCanvas(f)},[f]),f||t},aC=(e,t,n,r)=>{let[i,o]=aA(a_(e.clipSrc||""),"anonymous");aN(e.clipSrc?o:"loaded",e.id+"-clip");let a=s(y).useMemo(()=>{if(t&&i)return aw()},[t,i]);return s(y).useLayoutEffect(()=>{if(!i||!t||!t.width||!t.height||!i||!i.width||!i.height||!a)return;let r=aw(),o=Math.max(e.width/i.width*n,e.height/i.height*n);r.width=i.width*o,r.height=i.height*o,r.getContext("2d")?.drawImage(i,0,0,r.width,r.height),a.width=Math.max(t.width,1),a.height=Math.max(t.height,1);let l=a.getContext("2d");l&&(l.save(),l.drawImage(r,0,0,t.width,t.height),s(N).Util.releaseCanvas(r),l.globalCompositeOperation="source-in",l.drawImage(t,0,0,a.width,a.height),l.restore())},[a,t,i,e.width,e.height,n,...r]),e.clipSrc&&i?a:t},ak=aw(),aP=T(({element:e})=>{let t=Math.min(30,e.width/4,e.height/4),n=s(y).useRef(null);return s(y).useEffect(()=>{let e=n.current;if(!e)return;let t=new(s(N)).Animation(t=>{e.rotate((t?.timeDiff||0)/2)},e.getLayer());return t.start(),()=>{t.stop()}}),(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport,children:[(0,g.jsx)(rK,{width:e.width,height:e.height,fill:"rgba(124, 173, 212, 0.8)"}),(0,g.jsx)("Arc",{ref:n,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270})]})}),aT=T(({element:e})=>{let t="Can not load the video...",n=Math.max(10,Math.min(30,e.width/t.length));return(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport,children:[(0,g.jsx)(rK,{width:e.width,height:e.height,fill:"rgba(223, 102, 102, 0.8)"}),(0,g.jsx)(rQ,{text:t,fontSize:n,width:e.width,height:e.height,align:"center",fill:"white",verticalAlign:"middle",padding:5})]})}),aA=s(r2),aN=(e,t)=>{let n=s(y).useRef(),r=()=>{n.current?.(),n.current=void 0};s(y).useEffect(()=>r,[]),s(y).useLayoutEffect(()=>{"loading"!==e||n.current||(n.current=il(`video ${t}`)),"loading"!==e&&r(),"failed"===e&&ic(`video ${t}`)},[e])},aj=T(({element:e,store:t})=>{let n,r;let[i,o]=s(y).useState(!1),a=s(y).useRef(null),l=s(y).useRef(null),[u,c]=s(y).useState(!1),d=t.selectedElements.indexOf(e)>=0,[h,f]=s(y).useState(!1),[p,m]=function(e,t,n){let r=s(y).useRef("loading"),i=s(y).useRef(),[o,a]=s(y).useState(0),l=s(y).useRef(),u=s(y).useRef(),c=s(y).useRef();return(l.current!==e||u.current!==t||c.current!==n)&&(r.current="loading",i.current=void 0,l.current=e,u.current=t,c.current=n),s(y).useLayoutEffect(function(){if(e){var o=document.createElement("video");return o.addEventListener("canplay",l),o.addEventListener("error",s),t&&(o.crossOrigin=t),n&&(o.referrerpolicy=n),o.src=e,function(){o.removeEventListener("canplay",l),o.removeEventListener("error",s)}}function l(){r.current="loaded",i.current=o,a(Math.random())}function s(e){r.current="failed",i.current=void 0,a(Math.random())}},[e,t,n]),[i.current,r.current]}(e.src,"anonymous");aN(m,e.id+"-video"),p&&(p.muted=!0,p.width=p.videoWidth,p.height=p.videoHeight);let v=p||ak;s(y).useEffect(()=>{p&&t.history.ignore(()=>{e.set({duration:1e3*p.duration})})},[p]),s(y).useEffect(()=>{if(!p)return;let n=t.isPlaying||h;if(!n){p.pause();return}n&&(p.currentTime=e.startTime*p.duration,p.play());let r=new(s(N)).Animation(()=>{},a.current?.getLayer());r.start();let i=()=>{f(!1),p.currentTime=e.startTime*p.duration},o=()=>{p.currentTime>=e.endTime*p.duration&&(p.pause(),p.currentTime=e.startTime*p.duration,f(!1))};return p.addEventListener("ended",i),p.addEventListener("timeupdate",o),()=>{r.stop(),p.removeEventListener("ended",i),p.removeEventListener("timeupdate",o)}},[p,h,t.isPlaying]),s(y).useEffect(()=>(0,b.autorun)(()=>{if(p){let n=(t.currentTime-e.page.startTime)%e.duration;p.currentTime=n/1e3,a.current?.getLayer()?.batchDraw()}}),[t,p]),s(y).useEffect(()=>{if(!p)return;let t=null,n=()=>{!function(e,t){for(var n=e.buffered,r=0;r<n.length;r++)if(t>=n.start(r)&&t<=n.end(r))return!0;return!1}(p,p.currentTime)&&(t&&console.error("finish already exists"),t=il(`video ${e.id}`))},r=()=>{t&&(t(),t=null)};return p.addEventListener("timeupdate",n),p.addEventListener("canplay",r),()=>{p.removeEventListener("timeupdate",n),p.removeEventListener("canplay",r)}},[p,e.id,il]);let{cropX:w,cropY:x,cropWidth:_,cropHeight:E}=e;"loaded"!==m&&(w=x=0,_=E=1);let S=v.width*_,O=v.height*E,C=e.width/e.height,k=S/O,P="svg"===e.type;P?(n=S,r=O):C>=k?(n=S,r=S/C):(n=O*C,r=O);let T={x:v.width*w,y:v.height*x,width:n,height:r},A=e.cornerRadius??0,j=aC(e,aO(e,v,T,t._elementsPixelRatio,A,i||e._cropModeEnabled||"svg"===e.type),t._elementsPixelRatio,[T,A,t._elementsPixelRatio]),R=Math.max(e.width/n,e.height/r);s(y).useEffect(()=>{if(!e._cropModeEnabled)return;let t=a.current?.getStage();function n(t){e._cropModeEnabled&&t.target!==l.current&&e.toggleCropMode(!1)}function r(n){e._cropModeEnabled&&n.target.parentNode!==t.content&&e.toggleCropMode(!1)}return document.body.addEventListener("click",r),t?.on("click",n),t?.on("tap",n),()=>{document.body.removeEventListener("click",r),document.body.removeEventListener("touchstart",r),t?.off("click",n),t?.off("click",n)}},[e._cropModeEnabled]),s(y).useLayoutEffect(()=>{if(!i&&!e._cropModeEnabled)return iA(a.current,e),(0,b.autorun)(()=>{iA(a.current,e)},{delay:100})},[v,i,_,E,e._cropModeEnabled]),s(y).useLayoutEffect(()=>{i||e._cropModeEnabled?a.current?.clearCache():iA(a.current,e)},[i,e.width,e.height,e._cropModeEnabled]),s(y).useEffect(()=>{iA(a.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);let I=s(y).useRef(null),L=s(y).useRef(null),M=s(y).useRef(null);s(y).useLayoutEffect(()=>{e._cropModeEnabled&&(L.current.nodes([I.current]),M.current.nodes([l.current]))},[e._cropModeEnabled]);let D=t=>{Math.round(t.target.x())>0&&(t.target.x(0),t.target.scaleX(1)),Math.round(t.target.y())>0&&(t.target.y(0),t.target.scaleY(1));let i=t.target.width()*t.target.scaleX(),o=t.target.height()*t.target.scaleY(),a=Math.min(1,n/i),l=Math.min(1,r/o),s=Math.min(1-a,Math.max(0,Math.round(-t.target.x())/i)),u=Math.min(1-l,Math.max(0,Math.round(-t.target.y())/o));t.target.setAttrs({x:-s*v.width,y:-u*v.height,scaleX:1,scaleY:1}),e.set({cropX:s,cropY:u,cropWidth:a,cropHeight:l})},F=()=>{"svg"!==e.type&&e.contentEditable&&setTimeout(()=>{e.toggleCropMode(!0)})},z="loading"===m,B="failed"===m,U=!z&&!B,H=s(y).useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),V=U?e.a.opacity:0;ii(a,V);let q=e.selectable||"admin"===t.role,G=iL();return(0,g.jsxs)(s(y).Fragment,{children:[z&&(0,g.jsx)(aP,{element:e}),B&&(0,g.jsx)(aT,{element:e}),(0,g.jsx)(rX,{ref:a,name:"element",id:e.id,image:v,x:e.x,y:e.y,width:e.width||1,height:e.height||1,rotation:e.rotation,opacity:V,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:T,listening:q,cropX:T.x,cropY:T.y,cropWidth:T.width,cropHeight:T.height,draggable:G?e.draggable&&d:e.draggable,preventDefault:!G||d,hideInExport:!e.showInExport,onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)},onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDblClick:F,onDblTap:F,onTransformStart:()=>{o(!0),H.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:t=>{let i=t.currentTarget,o=1e-7>Math.abs(i.scaleX()-1)?1:i.scaleX(),a=1e-7>Math.abs(i.scaleY()-1)?1:i.scaleY();i.scaleX(1),i.scaleY(1);let l=t.target.getStage()?.findOne("Transformer"),s=Math.min(1-n/v.width,Math.max(0,e.cropX)),u=Math.min(1-r/v.height,Math.max(0,e.cropY)),c=l.getActiveAnchor(),d=!(c.indexOf("middle")>=0||c.indexOf("center")>=0),h=!d&&o<1&&H.current.cropHeight>r/v.height,f=d?e.cropWidth:e.cropWidth*o;h&&(f=e.cropWidth);let p=!d&&a<1&&H.current.cropWidth>n/v.width,g=d?e.cropHeight:e.cropHeight*a;p&&(g=e.cropHeight),P&&(f=e.cropWidth,g=e.cropHeight),e.set({cropX:s,cropY:u,x:i.x(),y:i.y(),width:i.width()*o,height:i.height()*a,rotation:t.target.rotation(),cropWidth:Math.min(f,1-s),cropHeight:Math.min(g,1-u)})},onTransformEnd:t=>{let i=t.currentTarget;e.set({width:i.width(),height:i.height(),x:i.x(),y:i.y(),rotation:t.target.rotation(),cropWidth:n/v.width,cropHeight:r/v.height}),o(!1)}}),(0,g.jsx)(rK,{x:e.x,y:e.y,width:Math.max(e.width-e.borderSize,0),height:Math.max(e.height-e.borderSize,0),opacity:V,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,A-e.borderSize),hideInExport:!e.showInExport}),!h&&(0,g.jsx)(rX,{image:aE,x:e.x+e.width/2-15/t.scale,y:e.y+e.height/2-15/t.scale,width:30/t.scale,height:30/t.scale,hideInExport:!0,onClick:()=>{f(!0)}}),h&&(0,g.jsx)(rX,{image:aS,x:e.x+e.width/2-15/t.scale,y:e.y+e.height/2-15/t.scale,width:30/t.scale,height:30/t.scale,hideInExport:!0,onClick:()=>{f(!1)}}),e._cropModeEnabled&&(0,g.jsxs)(r6,{selector:".page-abs-container",enabled:!0,children:[(0,g.jsx)(rK,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),(0,g.jsx)(rX,{listening:!1,image:j,x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),(0,g.jsxs)(rG,{x:e.x,y:e.y,rotation:e.rotation,scaleX:R,scaleY:R,children:[(0,g.jsx)(rX,{image:v,ref:l,opacity:.4,draggable:!0,x:-e.cropX*v.width,y:-e.cropY*v.height,onDragMove:D,onTransform:D}),(0,g.jsx)(rJ,{ref:M,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),(0,g.jsx)(rK,{width:n,height:r,ref:I,listening:!1,onTransform:t=>{t.target.x()<-e.cropX*v.width-1e-9&&(t.target.x(-e.cropX*v.width),t.target.scaleX(1)),t.target.y()<-e.cropY*v.height-1e-9&&(t.target.y(-e.cropY*v.height),t.target.scaleY(1));let n=Math.min(1,Math.max(0,e.cropX+t.target.x()/v.width)),r=Math.min(1,Math.max(0,t.target.y()/v.height+e.cropY)),i=t.target.width()*t.target.scaleX(),o=t.target.height()*t.target.scaleY(),a=Math.min(1-n,i/v.width),l=Math.min(1-r,o/v.height),s=t.target.getAbsolutePosition(t.target.getParent().getParent());t.target.scale({x:1,y:1}),t.target.position({x:0,y:0}),e.set({x:s.x,y:s.y,cropX:n,cropY:r,cropWidth:a,cropHeight:l,width:Math.min(i*R,v.width*(1-n)*R),height:Math.min(o*R,v.height*(1-r)*R)})}}),(0,g.jsx)(rJ,{ref:L,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2})]})]}),(u||d)&&(0,g.jsx)(ij,{element:e})]})});var y=f("8NFma");function aR(e,t,n=0){let r=e/2,i=t/2,o=e/2-n,a=t/2-n,l=o/2,s=a/2,u="",c=Math.PI/5;for(let e=0;e<10;e++){let t=e%2==0?o:l,n=e%2==0?a:s,d=r+t*Math.sin(e*c),h=i-n*Math.cos(e*c);0===e?u=`M ${d} ${h}`:u+=` L ${d} ${h}`}return u+" Z"}let aI={rect:T(({element:e,fillProps:t,strokeProps:n})=>(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(rK,{...t}),(0,g.jsx)(rK,{...n})]})),circle:T(({element:e,fillProps:t,strokeProps:n})=>(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(rK,{width:e.width,height:e.height,fill:"transparent"}),(0,g.jsx)(r$,{...t,offsetX:-e.width/2,offsetY:-e.height/2}),(0,g.jsx)(r$,{...n,offsetX:-e.width/2,offsetY:-e.height/2,x:0,y:0})]})),star:T(({element:e,fillProps:t,strokeProps:n})=>{let r=s(y).useRef(null);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(rK,{width:e.width,height:e.height,fill:"transparent"}),(0,g.jsx)(rZ,{...t,data:aR(e.width,e.height),ref:r}),(0,g.jsx)(rG,{clipFunc:e=>{let t=r.current;t&&t.drawScene.call(t,e.canvas,t)},children:(0,g.jsx)(rZ,{...n,x:0,y:0,data:aR(e.width,e.height,0)})})]})})},aL={text:iG,image:ol,svg:ol,line:ab,video:aj,figure:T(({element:e,store:t})=>{let n=e.selectable||"admin"===t.role,r=iL(),[i,o]=s(y).useState(!1),a=t.selectedElements.indexOf(e)>=0&&1===t.selectedElements.length,l=Math.min(e.strokeWidth,e.width/2,e.height/2),u=Math.max(0,Math.min(e.width/2,e.height/2,e.cornerRadius)),c={width:e.a.width,height:e.a.height,fill:e.fill,cornerRadius:u,opacity:e.animated("opacity"),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,listening:n,preventDefault:!r||a,hideInExport:!e.showInExport},d={visible:l>0,x:l/2,y:l/2,width:e.a.width-l,height:e.a.height-l,stroke:e.stroke,strokeWidth:l,cornerRadius:Math.max(0,u-l),dash:e.dash.map(e=>e*l),opacity:e.animated("opacity"),hideInExport:!e.showInExport,listening:!1},h=aI[e.subType]||rG;return(0,g.jsxs)(s(y).Fragment,{children:[(0,g.jsx)(rG,{id:e.id,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e.a.opacity,draggable:r?e.draggable&&a:e.draggable,name:"element",onMouseEnter:()=>{o(!0)},onMouseLeave:()=>{o(!1)},onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onTransform:t=>{let n=t.target.scale();t.target.scaleX(1),t.target.scaleY(1),e.set({width:e.width*n.x,height:e.height*n.y,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation()})},children:(0,g.jsx)(h,{element:e,fillProps:c,strokeProps:d})}),i&&!a&&(0,g.jsx)(ij,{element:e})]})}),group:T(e=>{let{element:t,store:n}=e,{children:r}=t,i=t.selectable||"admin"===n.role;return(0,g.jsx)(rG,{opacity:t.opacity,listening:i,children:r.map(t=>(0,y.createElement)(aM,{...e,key:t.id,store:n,element:t}))})})},aM=T(e=>{let t=aL[e.element.type];return("text"===e.element.type&&iE.htmlRenderEnabled&&(t=au),e.element.visible)?t?(0,g.jsx)(t,{...e}):(console.error("Can not find component for "+e.element.type),null):null});var b=f("2SBKn");let aD="https://api.polotno.dev/api",aF={},az=(e,t)=>{aF[e]||(aF[e]=!0,console.error(t))},aB=(e,t,n)=>e.replace(RegExp(t,"g"),n),aU=`API for iconscout is provided as a demonstration.
|
|
97
97
|
For production usage you have to use your own API endpoint.
|
|
98
98
|
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
99
99
|
https://polotno.com/docs/server-api`,aH={unsplashList:({query:e,page:t=1})=>`${aD}/get-unsplash?query=${e}&per_page=20&page=${t}&KEY=${a0()}`,unsplashDownload:e=>`${aD}/download-unsplash?id=${e}&KEY=${a0()}`,svgapiList:({query:e,page:t=0})=>`${aD}/get-svgapi?query=${e}&page=${t}&per_page=20&KEY=${a0()}`,svgapiDownload:e=>`${aD}/download-svgapi?path=${e}&KEY=${a0()}`,iconscoutList:({query:e,page:t=1})=>(az("iconscout",aU),`${aD}/get-iconscout?query=${e}&page=${t}&KEY=${a0()}`),iconscoutDownload:e=>(az("iconscout",aU),`${aD}/download-iconscout?uuid=${e}&KEY=${a0()}`),templateList:({query:e,page:t=1,sizeQuery:n})=>`${aD}/get-templates?${n}&query=${e}&per_page=30&page=${t}&KEY=${a0()}`},aV=()=>`${aD}/get-google-fonts?KEY=${a0()}`,aq=e=>`https://api.polotno.dev/google-fonts-previews/black/${aB(e," ","-")}.png`,aG=()=>`${aD}/get-basic-shapes?KEY=${a0()}`,aW=()=>`${aD}/remove-image-background?KEY=${a0()}`,aK=e=>aH.templateList(e),a$=()=>`${aD}/get-text-templates?KEY=${a0()}`,aY=e=>aH.unsplashList(e),aX=e=>aH.unsplashDownload(e),aQ=b.observable({value:!1}),aZ=b.action(()=>{aQ.value=!0}),aJ="",a0=()=>aJ||"",a1=window.location.origin,a2=navigator.userAgent.indexOf("Headless")>-1,a5=navigator.userAgent.indexOf("Electron")>-1;"file://"===a1&&a2&&(a1="headless"),"file://"===a1&&a5&&(a1="electron");let a3=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${a1}" here: https://polotno.com/cabinet`;async function a4(e){for(let n=0;n<5;n++)try{var t;let n=await fetch(aD+"/validate-key",{method:"POST",body:JSON.stringify({key:e,site:location.host})});if(!e)return console.warn("Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet"),!1;if(200!==n.status){await new Promise(e=>setTimeout(e,3e3));continue}let r=await n.json();return r.is_valid||console.warn("Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet"),r.is_paid||console.log("%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/","background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),r.is_domain_valid||console.log(a3,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),t=r.remove_background_enabled,iE.removeBackgroundEnabled=t,r.is_paid||!1}catch(e){await new Promise(e=>setTimeout(e,3e3))}return console.error("Can not validate Polotno API key. Please report to anton@polotno.com immediately."),!0}async function a6(e,t){aJ=e,(!await a4(e)||t)&&aZ()}let a8=({px:e,unit:t="px",dpi:n})=>{switch(t){case"pt":default:return e;case"mm":return e/(n/25.4);case"cm":return e/(n/2.54);case"in":return e/n}},a9=({px:e,precious:t=2,dpi:n=72,unit:r="px"})=>parseFloat(a8({px:e,dpi:n,unit:r}).toFixed(t)),a7=({unitVal:e,dpi:t,unit:n})=>e/a8({px:1,unit:n,dpi:t}),le=e=>{let t=parseFloat(a8(e).toFixed(1));switch(e.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}},lt=new(s(N)).Group;lt.add(new(s(N)).Rect({width:20,height:20,fill:"white"})),lt.add(new(s(N)).Path({scaleX:20/24,scaleY:20/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));let ln=lt.toCanvas({pixelRatio:2,width:20,height:20}),lr={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:e=>{e.hasName("rotater")&&e.setAttrs({width:20,height:20,cornerRadius:10,offsetX:10,offsetY:10,fillPatternImage:ln,fillPatternScaleX:.5,fillPatternScaleY:.5,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},li={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]}},lo=e=>(0,g.jsx)(rK,{...e,preventDefault:!1}),la=({url:e,...t})=>{let[n,r]=s(r2)(e,"anonymous"),i=n?function(e,t,n="scale"){let r,i;let o=t.width/t.height;o>=e.width/e.height?(r=e.width,i=e.width/o):(r=e.height*o,i=e.height);let a=0,l=0;return"left-top"===n?(a=0,l=0):"left-middle"===n?(a=0,l=(e.height-i)/2):"left-bottom"===n?(a=0,l=e.height-i):"center-top"===n?(a=(e.width-r)/2,l=0):"center-middle"===n?(a=(e.width-r)/2,l=(e.height-i)/2):"center-bottom"===n?(a=(e.width-r)/2,l=e.height-i):"right-top"===n?(a=e.width-r,l=0):"right-middle"===n?(a=e.width-r,l=(e.height-i)/2):"right-bottom"===n?(a=e.width-r,l=e.height-i):"scale"===n?(a=0,l=0,r=e.width,i=e.height):console.error(Error("Unknown clip position property - "+n)),{cropX:a,cropY:l,cropWidth:r,cropHeight:i}}(n,{width:t.width,height:t.height},"center-middle"):{};return oi(r,"background"),(0,g.jsx)(rX,{image:n,...t,...i})},ll=e=>(0,g.jsx)(rK,{...e}),ls=e=>{let{background:t,scale:n,borderColor:r,...i}=e,o=s(y).useMemo(()=>!!s(N).Util.colorToRGBA(t),[t]),a=s(y).useMemo(()=>{let e=document.createElement("canvas");e.width=60,e.height=60;let t=e.getContext("2d");return t&&(t.fillStyle="black",t.fillRect(30,0,30,30),t.fillRect(0,30,30,30)),e},[]);return(0,g.jsxs)(s(y).Fragment,{children:[(0,g.jsx)(rK,{fillPatternImage:a,...i,opacity:.1,hideInExport:!0}),o?(0,g.jsx)(ll,{fill:t,...i}):(0,g.jsx)(la,{url:t,...i})]})},lu=T(({selection:e})=>e.visible?(0,g.jsx)(rK,{name:"selection",x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),width:Math.abs(e.x1-e.x2),height:Math.abs(e.y1-e.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),lc=T(({x:e,y:t,width:n,height:r,rotation:i,anchor:o,store:a})=>{let l=ad({x:e,y:t,width:n,height:r,rotation:s(N).Util.radToDeg(i)});if(void 0===o)return null;let u=(r/2+70)*Math.cos(i-Math.PI/2),c=(r/2+70)*Math.sin(i-Math.PI/2),d=a9({unit:a.unit,dpi:a.dpi,px:n/a.scale,precious:"px"===a.unit?0:1})+" x "+a9({unit:a.unit,dpi:a.dpi,px:r/a.scale,precious:"px"===a.unit?0:1})+("px"===a.unit?"":" "+a.unit);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(rW,{x:(l.minX+l.maxX)/2+u,y:(l.minY+l.maxY)/2+c,offsetX:14,offsetY:14,visible:"rotater"===o,children:[(0,g.jsx)("Tag",{cornerRadius:5,fill:"rgb(0, 161, 255)"}),(0,g.jsx)(rQ,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(s(N).Util.radToDeg(i)).toString()+"°"})]}),(0,g.jsxs)(rW,{x:(l.minX+l.maxX)/2,y:l.maxY+20,visible:"rotater"!==o,children:[(0,g.jsx)("Tag",{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),(0,g.jsx)(rQ,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:d})]})]})}),ld=T(({elements:e,store:t})=>{let n=e.filter(e=>e.alwaysOnTop),r=e.filter(e=>!e.alwaysOnTop).concat(n);return(0,g.jsx)(s(y).Fragment,{children:r.map(e=>(0,g.jsx)(aM,{store:t,element:e,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}},e.id))})}),lh=null,lf=e=>{lh=e};var lp=T(({store:e,page:t,width:n,height:r,pageControlsEnabled:i,backColor:o,pageBorderColor:a,activePageBorderColor:l,components:u,bleedColor:c})=>{var d;let h=e.bleedVisible?t.bleed:0,f=t.computedWidth+2*h,p=t.computedHeight+2*h,m=(n-f*e.scale)/2,v=(r-p*e.scale)/2,w=s(y).useRef(null),x=s(y).useRef(null),_=s(y).useRef(null),[E,S]=s(y).useState(null),[O,C]=s(y).useState({}),k=e.selectedElements.find(e=>e._cropModeEnabled),P=e.selectedShapes.filter(e=>!e.resizable).length>0,T=e.selectedShapes.filter(e=>!e.draggable).length>0,A=e.selectedElements.filter(e=>!e.visible).length>0;s(y).useLayoutEffect(()=>{if(!w.current)return;let t=w.current.getStage(),n=e.selectedShapes.map(e=>e._cropModeEnabled?null:t.findOne("#"+e.id)).filter(e=>e),r=1===e.selectedElements.length&&e.selectedElements[0]?.type||"many";li[r]?(w.current.setAttrs({...lr,...li[r]}),"svg"!==r&&"image"!==r||e.selectedElements[0].keepRatio||w.current.setAttrs({enabledAnchors:lr.enabledAnchors}),"text"===r&&iE.textVerticalResizeEnabled&&w.current.setAttrs({enabledAnchors:li.text.enabledAnchors?.concat(["bottom-center"])})):w.current.setAttrs(lr),P&&w.current.enabledAnchors([]),T&&w.current.rotateEnabled(!1),n.find(e=>e?.isDragging())&&n.forEach(e=>{e.isDragging()||e?.startDrag()}),w.current.nodes(n),w.current.getLayer()?.batchDraw()},[e.selectedElements,k,P,A,T]);let j=(d=()=>({visible:!1,x1:0,y1:0,x2:0,y2:0}),(0,y.useState)(function(){return(0,b.observable)(d(),void 0,{autoBind:!0})})[0]),R=s(y).useRef(!1),I=iL(),L=(0,b.action)(e=>{if(I)return;R.current=!1;let t=e.target.findAncestor(".elements-container"),n=e.target.findAncestor("Transformer"),r=e.target.findAncestor(".page-abs-container");if(t||n||r)return;let i=e.target.getStage()?.getPointerPosition();i&&(j.visible=!0,j.x1=i.x,j.y1=i.y,j.x2=i.x,j.y2=i.y,e.target.getStage()?.getPointersPositions().length>=2&&(j.visible=!1))});s(y).useEffect(()=>{let t=(0,b.action)(e=>{if(!j.visible)return;x.current?.setPointersPositions(e);let t=x.current?.getPointerPosition()||{x:j.x2,y:j.y2};j.x2=t.x,j.y2=t.y}),n=(0,b.action)(()=>{if(!j.visible||!x.current)return;let t=x.current.findOne(".selection"),n=t?t.getClientRect():{width:0,height:0,x:0,y:0};if(n.width&&n.height){let t=[];x.current.find(".element").forEach(r=>{let i=r.getClientRect(),o=e.getElementById(r.id()),a=o?.draggable,l=o?.selectable;s(N).Util.haveIntersection(n,i)&&a&&l&&t.push(o.top.id)});let r=[...new Set(t)];e.selectElements(r)}j.visible=!1,R.current=!0});return window.addEventListener("mousemove",t),window.addEventListener("touchmove",t),window.addEventListener("mouseup",n),window.addEventListener("touchend",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n)}},[]);let M=n=>{if(e.activePage!==t&&t.select(),R.current)return;let r=n.evt.ctrlKey||n.evt.metaKey||n.evt.shiftKey,i=n.target.findAncestor(".elements-container"),o=n.target.findAncestor(".page-abs-container"),a=n.target.findAncestor("Transformer");if(!r&&!i&&!a&&!o){e.selectElements([]);return}let l=n.target.findAncestor(".element",!0),s=e.getElementById(l?.id()),u=s?.top,c=u?.id,d=e.selectedElementsIds.indexOf(c)>=0;c&&r&&!d?e.selectElements(e.selectedElementsIds.concat([c])):c&&r&&d?e.selectElements(e.selectedElementsIds.filter(e=>e!==c)):!c||r||d||e.selectElements([c])};!function(e){let t=e=>e.hasName("element")||e.hasName("page-background")||e.hasName("elements-area");function n(n){let r=e.current?.getStage();var i=[],o=[];return r.find(t).forEach(e=>{if(!(n.indexOf(e)>=0)){var t=e.getClientRect({skipShadow:!0,skipStroke:!0});i.push(t.x,t.x+t.width,t.x+t.width/2),o.push(t.y,t.y+t.height,t.y+t.height/2)}}),{vertical:i,horizontal:o}}function r(t){let n=e.current?.getLayer(),r=n?.children.find(e=>"line-guides"===e.name());t.forEach(e=>{if("H"===e.orientation){var t=new(s(N)).Line({points:[-6e3,e.lineGuide,6e3,e.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});r?.add(t),n.batchDraw()}else if("V"===e.orientation){var t=new(s(N)).Line({points:[e.lineGuide,-6e3,e.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});r?.add(t)}})}let i=e=>{e.target.getLayer().children.find(e=>"line-guides"===e.name()).destroyChildren();var t=af(n(e.target.nodes()),function(e){let t=e.__getNodeRect(),n=ad({...t,rotation:s(N).Util.radToDeg(t.rotation)}),r=e.getAbsolutePosition();return{vertical:[{guide:n.x,offset:r.x-n.x,snap:"start"},{guide:n.x+n.width/2,offset:r.x-n.x-n.width/2,snap:"center"},{guide:n.x+n.width,offset:r.x-n.x-n.width,snap:"end"}],horizontal:[{guide:n.y,offset:r.y-n.y,snap:"start"},{guide:n.y+n.height/2,offset:r.y-n.y-n.height/2,snap:"center"},{guide:n.y+n.height,offset:r.y-n.y-n.height,snap:"end"}]}}(e.target));if(!t.length)return;r(t);let i=e.target.getAbsolutePosition(),o={...i};t.forEach(e=>{switch(e.snap){case"start":case"center":case"end":switch(e.orientation){case"V":o.x=e.lineGuide+e.offset;break;case"H":o.y=e.lineGuide+e.offset}}});let a=o.x-i.x,l=o.y-i.y;e.evt.ctrlKey||e.evt.metaKey||e.target.nodes().forEach(e=>{let t=e.getAbsolutePosition();e.setAbsolutePosition({x:t.x+a,y:t.y+l})})},o=(t,i,o)=>{let a=e.current,l=a.getLayer();if(l.children.find(e=>"line-guides"===e.name()).destroyChildren(),"rotater"===a.getActiveAnchor()||Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))>50||!l)return i;var s=af(n(a.nodes()),{vertical:[{guide:i.x,offset:0,snap:"start"}],horizontal:[{guide:i.y,offset:0,snap:"start"}]});if(!s.length||(r(s),o.ctrlKey||o.metaKey))return i;let u=i.x,c=i.x;s.forEach(e=>{switch(e.orientation){case"V":u=e.lineGuide;break;case"H":c=e.lineGuide}});let d=Math.abs(i.x-u),h=Math.abs(i.y-c),f=d<10,p=h<10;return f&&!p?{x:u,y:t.y}:p&&!f?{x:t.x,y:c}:f&&p?{x:u,y:c}:i},a=e=>{if(!e.target)return;let t=e.target.getLayer();t.children.find(e=>"line-guides"===e.name()).destroyChildren(),t.batchDraw()};s(y).useEffect(()=>{e.current&&(e.current.anchorDragBoundFunc(o),e.current.on("dragstart",()=>{setTimeout(()=>{let e=[...s(N).DD._dragElements.entries()];e.reverse(),s(N).DD._dragElements.clear(),e.forEach(([e,t])=>{s(N).DD._dragElements.set(e,t)})})}),e.current.on("dragmove",i),e.current.on("dragend",a),e.current.on("transformend",a),e.current.on("transform",t=>{t.evt.ctrlKey||t.evt.metaKey?e.current?.rotationSnapTolerance(0):e.current?.rotationSnapTolerance(5)}))},[])}(w);let D=e.activePage===t,F=u?.PageControls,z=u?.Tooltip,B=1/e.scale,U=0/e.scale;return(0,g.jsxs)("div",{ref:_,onDragOver:e=>e.preventDefault(),onDrop:n=>{if(n.preventDefault(),!x.current)return;x.current.setPointersPositions(n);let r=x.current.findOne(".elements-container").getRelativePointerPosition(),i=x.current.getPointerPosition(),o=x.current.getAllIntersections(i).map(e=>e.findAncestor(".element",!0)).filter(Boolean),a=[...new Set(o.reverse())].map(t=>e.getElementById(t.id())),l=a[0];lh&&(lh(r,l,{elements:a,page:t}),lh=null)},style:{position:"relative",width:n+"px"},className:"polotno-page-container"+(D?" active-page":""),children:[(0,g.jsx)(r1,{ref:x,width:Math.min(n,4*window.innerWidth),height:Math.min(r,4*window.innerHeight),onClick:M,onTap:M,onMouseDown:L,onMouseMove:n=>{if(!n.evt.altKey&&E){S(null);return}if(!n.evt.altKey)return;let r=n.target.findAncestor(".element",!0),i=r?.id();if(!e.selectedElements[0]||e.selectedElementsIds.includes(i))return;let o=ah(e.selectedElements),a=ad(i?e.getElementById(i):{x:0,y:0,width:t.computedWidth,height:t.computedHeight,rotation:0}),l=[];o.minX>a.maxX&&l.push({distance:o.minX-a.maxX,box1:o,box2:a,points:[{x:o.minX,y:o.minY+o.height/2},{x:a.maxX,y:o.minY+o.height/2},{x:a.maxX,y:a.minY+a.height/2}]}),o.maxX<a.minX&&l.push({distance:a.minX-o.maxX,box1:o,box2:a,points:[{x:o.maxX,y:o.minY+o.height/2},{x:a.minX,y:o.minY+o.height/2},{x:a.minX,y:a.minY+a.height/2}]}),o.minY>a.maxY&&l.push({box1:o,box2:a,distance:o.minY-a.maxY,points:[{x:o.minX+o.width/2,y:o.minY},{x:o.minX+o.width/2,y:a.maxY},{x:a.minX+a.width/2,y:a.maxY}]}),o.maxY<a.minY&&l.push({box1:o,box2:a,distance:a.minY-o.maxY,points:[{x:o.minX+o.width/2,y:o.maxY},{x:o.minX+o.width/2,y:a.minY},{x:a.minX+a.width/2,y:a.minY}]}),o.minX>=a.minX&&o.maxX<=a.maxX&&o.minY>=a.minY&&o.maxY<=a.maxY&&(l.push({distance:o.minX-a.minX,box1:o,box2:a,points:[{x:o.minX,y:o.minY+o.height/2},{x:a.minX,y:o.minY+o.height/2},{x:a.minX,y:a.minY+a.height/2}]}),l.push({distance:a.maxX-o.maxX,box1:o,box2:a,points:[{x:o.maxX,y:o.minY+o.height/2},{x:a.maxX,y:o.minY+o.height/2},{x:a.maxX,y:a.minY+a.height/2}]}),l.push({box1:o,box2:a,distance:o.minY-a.minY,points:[{x:o.minX+o.width/2,y:o.minY},{x:o.minX+o.width/2,y:a.minY},{x:a.minX+a.width/2,y:a.minY}]}),l.push({box1:o,box2:a,distance:a.maxY-o.maxY,points:[{x:o.minX+o.width/2,y:o.maxY},{x:o.minX+o.width/2,y:a.maxY},{x:a.minX+a.width/2,y:a.maxY}]})),JSON.stringify(E)!==JSON.stringify(l)&&S(l)},onTouchStart:L,onDragStart:t=>{let n=t.target.findAncestor(".element",!0);if(n){let r=e.getElementById(n?.id()),i=r?.top,o=i?.id;!(e.selectedElementsIds.indexOf(o)>=0)&&o&&(e.selectElements([o]),t.target.stopDrag(),t.target.startDrag(t),w.current?.startDrag(t))}E&&S(null)},pageId:t.id,style:{position:"relative"},children:(0,g.jsxs)("Layer",{children:[(0,g.jsx)(lo,{width:n,height:r,fill:o}),(0,g.jsx)(rG,{x:m,y:v,scaleX:e.scale,scaleY:e.scale,name:"page-container",children:(0,g.jsxs)(rG,{name:"page-container-2",children:[(0,g.jsx)(rG,{name:"page-background-group",x:h,y:h,children:(0,g.jsx)(ls,{x:-t.bleed,y:-t.bleed,width:t.computedWidth+2*t.bleed,height:t.computedHeight+2*t.bleed,background:t.background,shadowBlur:10,shadowColor:"lightgrey",name:"page-background",preventDefault:!1,scale:e.scale})}),(0,g.jsxs)(rG,{x:h,y:h,name:"elements-container",listening:!e.isPlaying,children:[(0,g.jsx)(rK,{name:"elements-area",width:t.computedWidth,height:t.computedHeight,listening:!1}),(0,g.jsx)(ld,{elements:t.children,store:e})]}),(0,g.jsx)(rK,{stroke:c,name:"bleed",strokeWidth:t.bleed,x:t.bleed/2,y:t.bleed/2,width:t.computedWidth+t.bleed,height:t.computedHeight+t.bleed,listening:!1,visible:t.bleed>0&&e.bleedVisible,hideInExport:!0})]})}),(0,g.jsx)(rY,{name:"workspace-background",points:[0,0,n,0,n,r,0,r,0,0,m,v,m,r-v,n-m,r-v,n-m,v,m,v],listening:!1,closed:!0,fill:o}),(0,g.jsx)(rG,{x:m,y:v,scaleX:e.scale,scaleY:e.scale,children:(0,g.jsx)(rK,{name:"page-highlight",hideInExport:!0,x:-B/2-U,y:-B/2-U,width:f+B+2*U,height:p+B+2*U,stroke:D&&e.pages.length>1?l:a,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})}),(0,g.jsxs)(rG,{x:m+h*e.scale,y:v+h*e.scale,scaleX:e.scale,scaleY:e.scale,name:"page-abs-container",children:[(0,g.jsx)(rJ,{ref:w,onDragStart:n=>{n.evt?.altKey&&e.selectedElements.forEach(e=>{let n=e.clone({},{skipSelect:!0}),r=t.children.indexOf(e);t.setElementZIndex(n.id,r)}),e.history.startTransaction()},onDragEnd:()=>{e.history.endTransaction()},onTransformStart:()=>{e.history.startTransaction()},boundBoxFunc:(e,t)=>{let n=1>Math.abs(t.width)||1>Math.abs(t.height),r=1>Math.abs(e.width)||1>Math.abs(e.height);return n&&!r?e:t},onTransform:e=>{let t=w.current?.__getNodeRect();C({anchor:w.current?.getActiveAnchor(),x:t.x,y:t.y,rotation:t.rotation,width:t.width,height:t.height})},onTransformEnd:t=>{C({}),e.history.endTransaction()},visible:!e.isPlaying}),E&&E.map(({points:t,distance:n,box1:r,box2:i},o)=>(0,g.jsxs)(rG,{name:"distances-container",hideInExport:!0,listening:!1,children:[(0,g.jsx)(rK,{...r,stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),(0,g.jsx)(rK,{...i,stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),(0,g.jsx)(rY,{points:[t[0].x,t[0].y,t[1].x,t[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),(0,g.jsx)(rY,{points:[t[1].x,t[1].y,t[2].x,t[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),(0,g.jsxs)(rW,{x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2,offsetY:-10,scaleX:1/e.scale,scaleY:1/e.scale,children:[(0,g.jsx)("Tag",{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),(0,g.jsx)(rQ,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:le({unit:e.unit,dpi:e.dpi,px:n})})]})]},o)),t._rendering&&(0,g.jsxs)(rG,{children:[(0,g.jsx)(rK,{width:f,height:p,fill:"rgba(255,255,255,0.9)"}),(0,g.jsx)(rQ,{text:"Rendering...",fontSize:60,width:f,height:p,align:"center",verticalAlign:"middle"})]}),z&&(0,g.jsx)(z,{components:u,store:e,page:t,stageRef:x})]}),(0,g.jsx)(lc,{...O,store:e}),(0,g.jsx)(lu,{selection:j}),aQ.value&&(0,g.jsx)(rQ,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:n-170,y:r-18,onMouseEnter:e=>{e.target.getStage().container().style.cursor="pointer"},onMouseLeave:e=>{e.target.getStage().container().style.cursor=""},onTouchStart:e=>{e.cancelBubble=!0},onMouseDown:e=>{e.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),(0,g.jsx)(rG,{name:"line-guides"})]})}),(i??!0)&&D&&F&&(0,g.jsx)(F,{store:e,page:t,xPadding:m,yPadding:v})]})}),y=f("8NFma");let lg=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],lm=e=>lg.find(t=>e(t)>30)||1e4,lv=T(({store:e,width:t,height:n})=>{let r=s(y).useRef(null);if(!e.activePage)return null;let i=e.activePage;e.bleedVisible&&i.bleed;let o=i.computedWidth*e.scale,a=i.computedHeight*e.scale,l=(t-o)/2,u=lm(t=>a7({unitVal:t,dpi:e.dpi,unit:e.unit})*e.scale),c=a7({unitVal:u,dpi:e.dpi,unit:e.unit})*e.scale,d=Math.round(o/c)+1,h=Math.round(a/c)+1,f=ah(e.selectedShapes);return(0,g.jsxs)("div",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},ref:r,children:[(0,g.jsxs)("div",{style:{width:t+"px",height:"14px",position:"sticky",fontSize:"8px",lineHeight:"14px",top:"0px",left:"0px",color:"grey",borderBottom:"1px solid grey",backgroundColor:"#e8e8e8",overflow:"hidden"},children:[[...Array(d)].map((t,n)=>(0,g.jsx)("div",{style:{position:"absolute",left:l+n*c+"px",borderLeft:"1px solid grey",paddingLeft:"2px",width:c+"px"},children:"px"===e.unit||u>=1?Math.round(u*n):(u*n).toFixed(1)},n)),!!e.selectedShapes.length&&(0,g.jsx)("div",{style:{position:"absolute",left:l+f.x*e.scale+"px",height:"14px",width:f.width*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}})]}),e.pages.map((t,r)=>{let i=(n-t.computedHeight*e.scale)/2;return(0,g.jsxs)("div",{style:{left:"0px",width:"14px",height:n+"px",position:"sticky",fontSize:"8px",lineHeight:"14px",color:"grey",borderRight:"1px solid grey",backgroundColor:"#e8e8e8",overflow:"hidden"},children:[[...Array(h)].map((t,n)=>(0,g.jsx)("div",{style:{position:"absolute",left:"14px",top:i+n*c-14+"px",borderLeft:"1px solid grey",paddingLeft:"2px",transform:"rotate(90deg)",transformOrigin:"left top",width:c+"px",overflow:"hidden"},children:"px"===e.unit||u>=1?Math.round(u*n):(u*n).toFixed(1)},n)),e.selectedShapes[0]?.page===t&&(0,g.jsx)("div",{style:{position:"absolute",top:i+f.y*e.scale-14+"px",width:"14px",height:f.height*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}})]},t.id)})]})}),ly=[],lb="",lw="polotno_clipboard",lx=e=>{ly=e;try{localStorage.setItem(lw,JSON.stringify(e))}catch(e){}},l_=()=>{try{let e=localStorage.getItem(lw);if(e)return JSON.parse(e)}catch(e){}return ly};var b=f("2SBKn");let lE=(0,b.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",removeClip:"Remove clip",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width"},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"}}),lS=e=>e&&"object"==typeof e;(0,b.action)(e=>{!function e(t,n){Object.keys(n).forEach(r=>{let i=t[r],o=n[r];lS(o)&&lS(i)?e(i,o):t[r]=o})}(lE,e)});let lO={},lC=e=>{let t=function(e,t){var n,r=t.split("."),i=e;for(n=0;n<r.length;++n){if(void 0==i[r[n]])return;i=i[r[n]]}return i}(lE,e);if(void 0!==t)return t;lO[e]||(lO[e]=!0,console.warn(`Missing translation '${e}'`));let n=e.split("."),r=n[n.length-1]||" ";return r.charAt(0).toUpperCase()+r.slice(1)},lk=(e,t,n)=>Math.max(t,Math.min(n,e)),lP=`Polotno warning: <Workspace /> component can not automatically detect its size.
|