markdown-text-editor 1.9.2 → 1.9.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/dist/markdown-text-editor.es.js +13 -0
- package/dist/markdown-text-editor.es.js.map +1 -1
- package/dist/markdown-text-editor.min.js +6 -6
- package/dist/markdown-text-editor.min.js.map +1 -1
- package/dist/markdown-text-editor.umd.js +6 -6
- package/dist/markdown-text-editor.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +10 -0
|
@@ -67,13 +67,13 @@ ${e}</tr>
|
|
|
67
67
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${j(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?j(n,!0):this.parser.parseInline(r),o=M(e);if(o===null)return a;e=j(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+j(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=M(e);if(i===null)return j(n);e=i;let a=`<img src="${j(e)}" alt="${j(n)}"`;return t&&(a+=` title="${j(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:j(e.text)}},it=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},I=class e{options;renderer;textRenderer;constructor(e){this.options=e||t,this.options.renderer=this.options.renderer||new rt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new it}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},at=class{options;block;constructor(e){this.options=e||t}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?F.lex:F.lexInline}provideParser(e=this.block){return e?I.parse:I.parseInline}},ot=class{defaults=e();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=I;Renderer=rt;TextRenderer=it;Lexer=F;Tokenizer=nt;Hooks=at;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new rt(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new nt(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new at;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=at.passThroughHooks.has(n)?e=>{if(this.defaults.async&&at.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return F.lex(e,t??this.defaults)}parser(e,t){return I.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?F.lex:F.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?I.parse:I.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?F.lex:F.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?I.parse:I.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
68
68
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+j(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},st=new ot;function L(e,t){return st.parse(e,t)}L.options=L.setOptions=function(e){return st.setOptions(e),L.defaults=st.defaults,n(L.defaults),L},L.getDefaults=e,L.defaults=t;function ct(...e){return st.use(...e),L.defaults=st.defaults,n(L.defaults),L}L.use=ct,L.walkTokens=function(e,t){return st.walkTokens(e,t)},L.parseInline=st.parseInline,L.Parser=I,L.parser=I.parse,L.Renderer=rt,L.TextRenderer=it,L.Lexer=F,L.lexer=F.lex,L.Tokenizer=nt,L.Hooks=at,L.parse=L,L.options,L.setOptions,L.walkTokens,L.parseInline,I.parse,F.lex;function R(e,t){this.v=e,this.k=t}function lt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ut(e){if(Array.isArray(e))return e}function dt(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ft(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
69
69
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pt(e,t){return ut(e)||dt(e,t)||mt(e,t)||ft()}function mt(e,t){if(e){if(typeof e==`string`)return lt(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,t):void 0}}function ht(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof R;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}ht.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},ht.prototype.next=function(e){return this._invoke(`next`,e)},ht.prototype.throw=function(e){return this._invoke(`throw`,e)},ht.prototype.return=function(e){return this._invoke(`return`,e)};var gt=Object.entries,_t=Object.setPrototypeOf,vt=Object.isFrozen,yt=Object.getPrototypeOf,z=Object.getOwnPropertyDescriptor,B=Object.freeze,V=Object.seal,bt=Object.create,xt=typeof Reflect<`u`&&Reflect,St=xt.apply,Ct=xt.construct;B||=function(e){return e},V||=function(e){return e},St||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},Ct||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var H=K(Array.prototype.forEach);Array.prototype.indexOf;var wt=K(Array.prototype.lastIndexOf),Tt=K(Array.prototype.pop),Et=K(Array.prototype.push),Dt=K(Array.prototype.slice),Ot=K(Array.prototype.splice),kt=Array.isArray,At=Wt(Set),jt=K(Set.prototype.add),Mt=K(Set.prototype.has),Nt=K(String.prototype.toLowerCase),Pt=K(String.prototype.toString),Ft=K(String.prototype.match),It=K(String.prototype.replace),Lt=K(String.prototype.indexOf),Rt=K(String.prototype.trim),zt=K(Number.prototype.toString),Bt=K(Boolean.prototype.toString),Vt=typeof BigInt>`u`?null:K(BigInt.prototype.toString),Ht=typeof Symbol>`u`?null:K(Symbol.prototype.toString),U=K(Object.prototype.hasOwnProperty),Ut=K(Object.prototype.toString),W=K(RegExp.prototype.test),G=Wt(TypeError);function K(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return St(e,t,r)}}function Wt(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ct(e,n)}}function q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nt;if(_t&&_t(e,null),!kt(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(vt(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Gt(e){for(let t=0;t<e.length;t++)U(e,t)||(e[t]=null);return e}function J(e){let t=bt(null);for(let r of gt(e)){var n=pt(r,2);let i=n[0],a=n[1];U(e,i)&&(t[i]=kt(a)?Gt(a):a&&typeof a==`object`&&a.constructor===Object?J(a):a)}return t}function Kt(e){switch(typeof e){case`string`:return e;case`number`:return zt(e);case`boolean`:return Bt(e);case`bigint`:return Vt?Vt(e):`0`;case`symbol`:return Ht?Ht(e):`Symbol()`;case`undefined`:return Ut(e);case`function`:case`object`:{if(e===null)return Ut(e);let t=e,n=Y(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Ut(e)}return Ut(e)}default:return Ut(e)}}function Y(e,t){for(;e!==null;){let n=z(e,t);if(n){if(n.get)return K(n.get);if(typeof n.value==`function`)return K(n.value)}e=yt(e)}function n(){return null}return n}function qt(e,t){for(;e!==null;){let n=z(e,t);if(n)return n.get?K(n.get):null;e=yt(e)}return null}function Jt(e){try{return W(e,``),!0}catch{return!1}}var Yt=B(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Xt=B(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Zt=B([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Qt=B([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),$t=B(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),en=B([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),tn=B([`#text`]),nn=B(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),rn=B(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),an=B(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),on=B([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),sn=V(/{{[\w\W]*|^[\w\W]*}}/g),cn=V(/<%[\w\W]*|^[\w\W]*%>/g),ln=V(/\${[\w\W]*/g),un=V(/^data-[\-\w.\u00B7-\uFFFF]+$/),dn=V(/^aria-[\-\w]+$/),fn=V(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pn=V(/^(?:\w+script|data):/i),mn=V(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hn=V(/^html$/i),gn=V(/^[a-z][.\w]*(-[.\w]+)+$/i),_n=V(/<[/\w!]/g),vn=V(/<[/\w]/g),yn=V(/<\/no(script|embed|frames)/i),bn=V(/\/>/i),X={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},xn=B(q({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),Sn=function(){return typeof window>`u`?null:window},Cn=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},wn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Tn=function(e,t,n,r){return U(e,t)&&kt(e[t])?q(r.base?J(r.base):{},e[t],r.transform):n},En=function(e,t,n){let r=U(e,t)?e[t]:void 0;return r&&typeof r==`object`?J(r):n()};function Dn(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sn(),t=e=>Dn(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==X.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Y(d,`cloneNode`),p=Y(d,`remove`),m=Y(d,`removeAttributeNode`),ee=Y(d,`nextSibling`),te=Y(d,`childNodes`),h=Y(d,`parentNode`),g=Y(d,`shadowRoot`),ne=Y(d,`attributes`),re=o&&o.prototype?Y(o.prototype,`nodeType`):null,ie=o&&o.prototype?Y(o.prototype,`nodeName`):null,_=o&&o.prototype?Y(o.prototype,`ownerDocument`):null,v=function(e){return re?re(e):e.nodeType},ae=function(e){return ie?ie(e):e.nodeName},oe=qt(d,`namespaceURI`),se=function(e){return oe?oe(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let y,b=``,ce,le=!1,ue=0,de=function(){if(ue>0)throw G(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},fe=function(e){de(),ue++;try{return y.createHTML(e)}finally{ue--}},pe=function(e){de(),ue++;try{return y.createScriptURL(e)}finally{ue--}},me=function(){return le||=(ce=Cn(u,i),!0),ce},x=n,S=x.implementation,he=x.createNodeIterator,ge=x.createDocumentFragment,_e=x.getElementsByTagName,ve=r.importNode,C=wn();t.isSupported=typeof gt==`function`&&typeof h==`function`&&S&&S.createHTMLDocument!==void 0;let ye=sn,be=cn,xe=ln,Se=un,Ce=dn,we=pn,Te=mn,Ee=gn,De=fn,w=null,Oe=q({},[...Yt,...Xt,...Zt,...$t,...tn]),T=null,ke=q({},[...nn,...rn,...an,...on]),E=Object.seal(bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,je=null,D=Object.seal(bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Me=!0,Ne=!0,Pe=!1,Fe=!0,O=!1,Ie=!0,k=!1,Le=!1,Re=null,ze=null,Be=!1,A=!1,Ve=!1,He=!1,Ue=!0,We=!1,Ge=`user-content-`,Ke=!0,qe=!1,j=null,Je={},M=null,Ye=q({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),N=null,Xe=q({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ze=null,Qe=q({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),$e=`http://www.w3.org/1998/Math/MathML`,et=`http://www.w3.org/2000/svg`,P=`http://www.w3.org/1999/xhtml`,tt=P,nt=!1,F=null,rt=q({},[$e,et,P],Pt),it=B([`mi`,`mo`,`mn`,`ms`,`mtext`]),I=q({},it),at=B([`annotation-xml`]),ot=q({},at),st=q({},[`title`,`style`,`font`,`a`,`script`]),L=null,ct=[`application/xhtml+xml`,`text/html`],R=null,lt=null,ut=n.createElement(`form`),dt=function(e){return e instanceof RegExp||e instanceof Function},ft=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(lt&<===e)return;(!e||typeof e!=`object`)&&(e={}),e=J(e),L=ct.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,R=L===`application/xhtml+xml`?Pt:Nt,w=Tn(e,`ALLOWED_TAGS`,Oe,{transform:R}),T=Tn(e,`ALLOWED_ATTR`,ke,{transform:R}),F=Tn(e,`ALLOWED_NAMESPACES`,rt,{transform:Pt}),Ze=Tn(e,`ADD_URI_SAFE_ATTR`,Qe,{transform:R,base:Qe}),N=Tn(e,`ADD_DATA_URI_TAGS`,Xe,{transform:R,base:Xe}),M=Tn(e,`FORBID_CONTENTS`,Ye,{transform:R}),Ae=Tn(e,`FORBID_TAGS`,J({}),{transform:R}),je=Tn(e,`FORBID_ATTR`,J({}),{transform:R}),Je=U(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?J(e.USE_PROFILES):e.USE_PROFILES:!1,Me=e.ALLOW_ARIA_ATTR!==!1,Ne=e.ALLOW_DATA_ATTR!==!1,Pe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,O=e.SAFE_FOR_TEMPLATES||!1,Ie=e.SAFE_FOR_XML!==!1,k=e.WHOLE_DOCUMENT||!1,A=e.RETURN_DOM||!1,Ve=e.RETURN_DOM_FRAGMENT||!1,He=e.RETURN_TRUSTED_TYPE||!1,Be=e.FORCE_BODY||!1,Ue=e.SANITIZE_DOM!==!1,We=e.SANITIZE_NAMED_PROPS||!1,Ke=e.KEEP_CONTENT!==!1,qe=e.IN_PLACE||!1,De=Jt(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:fn,tt=typeof e.NAMESPACE==`string`?e.NAMESPACE:P,I=En(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>q({},it)),ot=En(e,`HTML_INTEGRATION_POINTS`,()=>q({},at));let t=En(e,`CUSTOM_ELEMENT_HANDLING`,()=>bt(null));if(E=bt(null),U(t,`tagNameCheck`)&&dt(t.tagNameCheck)&&(E.tagNameCheck=t.tagNameCheck),U(t,`attributeNameCheck`)&&dt(t.attributeNameCheck)&&(E.attributeNameCheck=t.attributeNameCheck),U(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(E.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),V(E),O&&(Ne=!1),Ve&&(A=!0),Je&&(w=q({},tn),T=bt(null),Je.html===!0&&(q(w,Yt),q(T,nn)),Je.svg===!0&&(q(w,Xt),q(T,rn),q(T,on)),Je.svgFilters===!0&&(q(w,Zt),q(T,rn),q(T,on)),Je.mathMl===!0&&(q(w,$t),q(T,an),q(T,on))),D.tagCheck=null,D.attributeCheck=null,U(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?D.tagCheck=e.ADD_TAGS:kt(e.ADD_TAGS)&&(w===Oe&&(w=J(w)),q(w,e.ADD_TAGS,R))),U(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?D.attributeCheck=e.ADD_ATTR:kt(e.ADD_ATTR)&&(T===ke&&(T=J(T)),q(T,e.ADD_ATTR,R))),U(e,`ADD_FORBID_CONTENTS`)&&kt(e.ADD_FORBID_CONTENTS)&&(M===Ye&&(M=J(M)),q(M,e.ADD_FORBID_CONTENTS,R)),Ke&&(w[`#text`]=!0),k&&q(w,[`html`,`head`,`body`]),w.table&&(q(w,[`tbody`]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw G(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw G(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=y;y=e.TRUSTED_TYPES_POLICY;try{b=fe(``)}catch(e){throw y=t,e}}else e.TRUSTED_TYPES_POLICY===null?(y=void 0,b=``):(y===void 0&&(y=me()),y&&typeof b==`string`&&(b=fe(``)));B&&B(e),lt=e},pt=q({},[...Xt,...Zt,...Qt]),mt=q({},[...$t,...en]),ht=function(e,t,n){return t.namespaceURI===P?e===`svg`:t.namespaceURI===$e?e===`svg`&&(n===`annotation-xml`||I[n]):!!pt[e]},_t=function(e,t,n){return t.namespaceURI===P?e===`math`:t.namespaceURI===et?e===`math`&&ot[n]:!!mt[e]},vt=function(e,t,n){return t.namespaceURI===et&&!ot[n]||t.namespaceURI===$e&&!I[n]?!1:!mt[e]&&(st[e]||!pt[e])},yt=function(e){let t=se(e),n=Nt(ae(e)),r=h(e),i,a;return r&&v(r)===X.element?(i={namespaceURI:se(r)},a=Nt(ae(r))):(i={namespaceURI:tt},a=`template`),F[t]?t===et?ht(n,i,a):t===$e?_t(n,i,a):t===P?vt(n,i,a):!!(L===`application/xhtml+xml`&&F[t]):!1},z=function(e){Et(t.removed,{element:e});try{h(e).removeChild(e)}catch{if(p(e),!h(e))throw G(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},xt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},St=function(e){Vt(e);let t=te(e);t&&H(Dt(t),e=>{try{p(e)}catch{}});let n=v(e)===X.element?ne(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&xt(e,r,i)}},Ct=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Et(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(A||Ve)try{z(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},zt=function(e){let t=ne(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||T[R(i)]||xt(e,r,i)}},Bt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&v(e)===X.element){let t=g(e);Q(t)&&r.push(t)}let i=te(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Vt=function(e){Bt(e,e=>{v(e)===X.element&&zt(e)})},Ht=function(e){let t=[];return Bt(e,e=>{t.push(e)},!0),t},Ut=function(e,t){let n=At();H(Ht(e),e=>{v(e)===X.element&&jt(n,e)}),H(t,e=>{v(e)===X.element&&!Mt(n,e)&&zt(e)})},K=function(e,n){let r=!1;return H(t.removed,t=>{t.element&&(r||=t.element===e,Vt(t.element))}),Ut(e,n),r},Wt=function(e,t){let n=j,r=null,i=()=>(r||(r=At(),H(t,e=>{jt(r,e)})),r);for(let t=0;;t++){let r=Ht(e),a=[e],o=!1;if(H(r,e=>{v(e)===X.documentFragment?Et(a,e):!o&&!Mt(n,e)&&(o=Mt(i(),e))}),!o)return;if(t>=8)throw G(`the tree kept changing during in-place sanitization; refusing to return it`);H(a,(t,n)=>{Gt(t,n>0,e,i())})}},Gt=function(e,t,n,r){let i=jn(e),a;for(;a=i.nextNode();)Mt(r,a)&&!Mt(j,a)&&(t&&$(C.uponSanitizeShadowNode,a,null),Hn(a,n),Yn(a,n),Q(a.content)&&Xn(a.content))},On=function(e){j&&jt(j,e)},Z=function(e,t){return Ie?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},kn=function(e){Ie&&Bt(e,e=>{let t=v(e);if(t===X.processingInstruction||t===X.comment&&W(vn,e.data)){try{p(e)}catch{}return!1}if(t===X.element){let t=e,n=R(ae(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Z(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},An=function(e){let t=null,r=null;if(Be)e=`<remove></remove>`+e;else{let t=Ft(e,/^[\r\n\t ]+/);r=t&&t[0]}L===`application/xhtml+xml`&&tt===P&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=y?fe(e):e;if(tt===P)try{t=new l().parseFromString(i,L)}catch{}if(!t||!t.documentElement){t=S.createDocument(tt,`template`,null);try{t.documentElement.innerHTML=nt?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),tt===P?_e.call(t,k?`html`:`body`)[0]:k?t.documentElement:a},jn=function(e){let t=_?_(e):e.ownerDocument;return he.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Mn=function(e){return e=It(e,ye,` `),e=It(e,be,` `),e=It(e,xe,` `),e},Nn=function(e){Pn(e);let t=e.querySelectorAll?.call(e,`template`);t&&H(t,e=>{Q(e.content)&&Nn(e.content)})},Pn=function(e){e.normalize();let t=_?_(e):e.ownerDocument,n=he.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Mn(r.data),r=n.nextNode()},Fn=function(e){let t=ie?ie(e):null;return typeof t!=`string`||R(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==ne(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==re(e)||e.childNodes!==te(e)},Q=function(e){if(!re||typeof e!=`object`||!e)return!1;try{return re(e)===X.documentFragment}catch{return!1}},In=function(e){if(!re||typeof e!=`object`||!e)return!1;try{return typeof re(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&H(e,e=>{e.call(t,n,r,lt)})}let Ln=function(e,t){return!!(Ie&&e.hasChildNodes()&&!In(e.firstElementChild)&&W(_n,e.textContent)&&W(_n,e.innerHTML)||Ie&&xn[t]&&v(e)===X.element&&se(e)===P&&(In(e.firstElementChild)||typeof e.textContent==`string`&&W(_n,e.textContent))||e.nodeType===X.processingInstruction||Ie&&e.nodeType===X.comment&&W(vn,e.data))},Rn=function(e,t){if(e instanceof RegExp)return W(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return!!e(t,...r)}return!1},zn=function(e,t,n){if(!Ae[t]&&Gn(t)&&Rn(E.tagNameCheck,t))return!1;if(Ke&&!M[t]&&!M[Nt(t)]){let t=h(e),r=te(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,ee(e))}}}return z(e),!0},Bn=function(e,t,n,r){return e.length===0?t:t===n||t===r?J(t):t},Vn=function(e,t){return e===t||h(e)!==null?!1:(qe&&Vt(e),!0)},Hn=function(e,n){if(On(e),$(C.beforeSanitizeElements,e,null),Vn(e,n))return!0;if(Fn(e))return z(e),!0;let r=R(ae(e));if(w=Bn(C.uponSanitizeElement,w,Oe,Re),$(C.uponSanitizeElement,e,{tagName:r,allowedTags:w}),Vn(e,n))return!0;if(Ln(e,r))return z(e),!0;if(Ae[r]||!(D.tagCheck instanceof Function&&D.tagCheck(r))&&!w[r]){let t=zn(e,r,n);return t===!1&&($(C.afterSanitizeElements,e,null),Vn(e,n))?!0:t}if(v(e)===X.element&&!yt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&W(yn,e.innerHTML))return z(e),!0;if(O&&e.nodeType===X.text){let n=Mn(e.textContent);e.textContent!==n&&(Et(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(C.afterSanitizeElements,e,null),Vn(e,n)},Un=function(e,t,r){if(je[t]||Z(t,e)||Ue&&(t===`id`||t===`name`)&&(r in n||r in ut))return!1;let i=T[t]||D.attributeCheck instanceof Function&&D.attributeCheck(t,e);return Ne&&W(Se,t)||Me&&W(Ce,t)?!0:i?Ze[t]||W(De,It(r,Te,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Lt(r,`data:`)===0&&N[e]||Pe&&!W(we,It(r,Te,``))?!0:!r:Gn(e)&&Rn(E.tagNameCheck,e)&&Rn(E.attributeNameCheck,t,e)||t===`is`&&E.allowCustomizedBuiltInElements&&Rn(E.tagNameCheck,r)},Wn=q({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Gn=function(e){return!Wn[Nt(e)]&&W(Ee,e)},Kn=function(e,t,n,r){if(y&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return fe(r);case`TrustedScriptURL`:return pe(r)}return r},qn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Fn(e)||(z(e),!1)}catch{return Ct(t,e),!1}},Jn=function(e,t){return Ie&&W(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:Nt(e)===`attributename`&&Ft(t,`href`)!==null},Yn=function(e,n){if($(C.beforeSanitizeAttributes,e,null),Vn(e,n))return;let r=e.attributes;if(!r||Fn(e))return;T=Bn(C.uponSanitizeAttribute,T,ke,ze);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:T,forceKeepAttr:void 0},a=r.length,o=R(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=R(s),d=l,f=s===`value`?d:Rt(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(C.uponSanitizeAttribute,e,i),f=i.attrValue,We&&(u===`id`||u===`name`)&&Lt(f,Ge)!==0&&(Ct(s,e,n),f=Ge+f,p=!0),Jn(s,f)){Ct(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){Ct(s,e,n);continue}if(!Fe&&W(bn,f)){Ct(s,e,n);continue}if(O&&(f=Mn(f)),!Un(o,u,f)){Ct(s,e,n);continue}f=Kn(o,u,c,f),f!==d&&qn(e,s,c,f)&&p&&Tt(t.removed)}}$(C.afterSanitizeAttributes,e,null),Vn(e,n)},Xn=function(e){let t=null,n=jn(e);for($(C.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(C.uponSanitizeShadowNode,t,null),Hn(t,e),Yn(t,e),Q(t.content)&&Xn(t.content),v(t)===X.element){let e=g(t);Q(e)&&(Zn(e),Xn(e))}O&&Pn(e),$(C.afterSanitizeShadowDOM,e,null)},Zn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Xn(e.shadow);continue}let n=e.node,r=v(n)===X.element,i=te(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=ie?ie(n):null;if(typeof e==`string`&&R(e)===`template`){let e=n.content;Q(e)&&t.push({node:e,shadow:null})}}if(r){let e=g(n);Q(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(nt=!e,nt&&(e=`<!-->`),typeof e!=`string`&&!In(e)&&(e=Kt(e),typeof e!=`string`))throw G(`dirty is not a string, aborting`);if(!t.isSupported)return e;Le?(w=Re,T=ze):ft(n),(C.uponSanitizeElement.length>0||C.uponSanitizeAttribute.length>0)&&(w=J(w)),C.uponSanitizeAttribute.length>0&&(T=J(T)),t.removed=[];let c=qe&&typeof e!=`string`&&In(e),l=[],u=j;if(c){kn(e);let t=ae(e);if(typeof t==`string`){let n=R(t);if(!w[n]||Ae[n])throw St(e),G(`root node is forbidden and cannot be sanitized in-place`)}if(Fn(e))throw St(e),G(`root node is clobbered and cannot be sanitized in-place`);l=Ht(e),j=At()}else if(In(e))i=An(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===X.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Zn(i);else{if(!A&&!O&&!k&&e.indexOf(`<`)===-1)return y&&He?fe(e):e;if(i=An(e),!i)return A?null:He?b:``}i&&Be&&z(i.firstChild);let d=c?e:i;try{c&&Zn(e);let t=jn(d);for(;o=t.nextNode();)Hn(o,d),Yn(o,d),Q(o.content)&&Xn(o.content);c&&Wt(e,l)}catch(t){throw c&&(St(e),K(e,l)),t}finally{j=u}if(c){if(K(e,l))throw G(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return O&&Nn(e),e}if(A){if(O&&Nn(i),Ve)for(s=ge.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(T.shadowroot||T.shadowrootmode)&&(s=ve.call(r,s,!0)),s}let f=k?i.outerHTML:i.innerHTML;return k&&w[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&W(hn,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
70
|
-
`+f),O&&(f=Mn(f)),y&&He?fe(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ft(e),Le=!0,Re=w,ze=T},t.clearConfig=function(){lt=null,Le=!1,Re=null,ze=null,y=ce,b=``},t.isValidAttribute=function(e,t,n){lt||ft({});let r=R(e),i=R(t);return typeof n==`string`&&(Jn(t,n)||!Fe&&W(bn,n))?!1:Un(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&U(C,e)&&Et(C[e],t)},t.removeHook=function(e,t){if(U(C,e)){if(t!==void 0){let n=wt(C[e],t);return n===-1?void 0:Ot(C[e],n,1)[0]}return Tt(C[e])}},t.removeHooks=function(e){U(C,e)&&(C[e]=[])},t.removeAllHooks=function(){C=wn()},t}var On=Dn(),Z=class{constructor(e,t){this.editor=e,this.defaultText=`${t} text`,this.button=this.createButton(),this.title=t}createButton(e){let t=document.createElement(`button`),n=this.title?`${this.title.replace(/ /g,`-`)}-btn`.toLowerCase():``;t.innerHTML=e;let r=t.querySelector(`svg`);if(r&&r.setAttribute(`aria-hidden`,`true`),t.type=`button`,t.title=this.title?this.editor.label(this.title):this.title,t.className=`markdown-btn ${n} fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost`,t.addEventListener(`click`,e=>this.applySyntax(e)),n==`preview-btn`){let e=document.createElement(`div`);return e.className=`fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-l fj:sticky fj:-right-2 fj:px-1.5`,e.appendChild(t),e}return t}},kn=class extends Z{constructor(e){super(e,`Bold`),this.button=this.createButton(`
|
|
70
|
+
`+f),O&&(f=Mn(f)),y&&He?fe(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ft(e),Le=!0,Re=w,ze=T},t.clearConfig=function(){lt=null,Le=!1,Re=null,ze=null,y=ce,b=``},t.isValidAttribute=function(e,t,n){lt||ft({});let r=R(e),i=R(t);return typeof n==`string`&&(Jn(t,n)||!Fe&&W(bn,n))?!1:Un(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&U(C,e)&&Et(C[e],t)},t.removeHook=function(e,t){if(U(C,e)){if(t!==void 0){let n=wt(C[e],t);return n===-1?void 0:Ot(C[e],n,1)[0]}return Tt(C[e])}},t.removeHooks=function(e){U(C,e)&&(C[e]=[])},t.removeAllHooks=function(){C=wn()},t}var On=Dn(),Z=class{constructor(e,t){this.editor=e,this.defaultText=`${t} text`,this.button=this.createButton(),this.title=t}trimSelection(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n,value:r}=e;if(t===n)return;let i=t,a=n;for(;i<a&&/\s/.test(r[i]);)i++;for(;a>i&&/\s/.test(r[a-1]);)a--;i!==a&&(i!==t||a!==n)&&e.setSelectionRange(i,a)}createButton(e){let t=document.createElement(`button`),n=this.title?`${this.title.replace(/ /g,`-`)}-btn`.toLowerCase():``;t.innerHTML=e;let r=t.querySelector(`svg`);if(r&&r.setAttribute(`aria-hidden`,`true`),t.type=`button`,t.title=this.title?this.editor.label(this.title):this.title,t.className=`markdown-btn ${n} fj:me-btn fj:me-btn-xs fj:me-btn-square fj:me-btn-ghost`,t.addEventListener(`click`,e=>this.applySyntax(e)),n==`preview-btn`){let e=document.createElement(`div`);return e.className=`fj:me-surface fj:me-surface-outline fj:border-base-soft fj:border-0 fj:border-l fj:sticky fj:-right-2 fj:px-1.5`,e.appendChild(t),e}return t}},kn=class extends Z{constructor(e){super(e,`Bold`),this.button=this.createButton(`
|
|
71
71
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 5h6a3.5 3.5 0 0 1 0 7h-6l0 -7" /><path d="M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" /></svg>
|
|
72
|
-
`)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`***`)&&i.endsWith(`***`))a=`*`+i.slice(3,-3)+`*`;else if(i.startsWith(`**`)&&i.endsWith(`**`))a=i.slice(2,-2);else if(r.substring(t-3,t)===`***`&&r.substring(n,n+3)===`***`){e.setSelectionRange(t-3,n+3),this.editor.insertText(`*${i}*`,1,1);return}else if(r.substring(t-2,t)===`**`&&r.substring(n,n+2)===`**`&&r[t-3]!==`*`&&r[n+2]!==`*`){e.setSelectionRange(t-2,n+2),this.editor.insertText(i,0,0);return}else a=`**${i||`Bold text`}**`,i||(o=2);this.editor.insertText(a,o,o)}},An=class extends Z{constructor(e){super(e,`Italic`),this.button=this.createButton(`
|
|
72
|
+
`)}applySyntax(){this.trimSelection();let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`***`)&&i.endsWith(`***`))a=`*`+i.slice(3,-3)+`*`;else if(i.startsWith(`**`)&&i.endsWith(`**`))a=i.slice(2,-2);else if(r.substring(t-3,t)===`***`&&r.substring(n,n+3)===`***`){e.setSelectionRange(t-3,n+3),this.editor.insertText(`*${i}*`,1,1);return}else if(r.substring(t-2,t)===`**`&&r.substring(n,n+2)===`**`&&r[t-3]!==`*`&&r[n+2]!==`*`){e.setSelectionRange(t-2,n+2),this.editor.insertText(i,0,0);return}else a=`**${i||`Bold text`}**`,i||(o=2);this.editor.insertText(a,o,o)}},An=class extends Z{constructor(e){super(e,`Italic`),this.button=this.createButton(`
|
|
73
73
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M11 5l6 0" /><path d="M7 19l6 0" /><path d="M14 5l-4 14" /></svg>
|
|
74
|
-
`)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`***`)&&i.endsWith(`***`))a=`**`+i.slice(3,-3)+`**`;else if(i.startsWith(`*`)&&i.endsWith(`*`)&&!i.startsWith(`**`))a=i.slice(1,-1);else if(r.substring(t-3,t)===`***`&&r.substring(n,n+3)===`***`){e.setSelectionRange(t-3,n+3),this.editor.insertText(`**${i}**`,2,2);return}else if(r[t-1]===`*`&&r[n]===`*`&&r[t-2]!==`*`&&r[n+1]!==`*`){e.setSelectionRange(t-1,n+1),this.editor.insertText(i,0,0);return}else a=`*${i||`Italic text`}*`,i||(o=1);this.editor.insertText(a,o,o)}},jn=class extends Z{constructor(e){super(e,`Strikethrough`),this.button=this.createButton(`
|
|
74
|
+
`)}applySyntax(){this.trimSelection();let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`***`)&&i.endsWith(`***`))a=`**`+i.slice(3,-3)+`**`;else if(i.startsWith(`*`)&&i.endsWith(`*`)&&!i.startsWith(`**`))a=i.slice(1,-1);else if(r.substring(t-3,t)===`***`&&r.substring(n,n+3)===`***`){e.setSelectionRange(t-3,n+3),this.editor.insertText(`**${i}**`,2,2);return}else if(r[t-1]===`*`&&r[n]===`*`&&r[t-2]!==`*`&&r[n+1]!==`*`){e.setSelectionRange(t-1,n+1),this.editor.insertText(i,0,0);return}else a=`*${i||`Italic text`}*`,i||(o=1);this.editor.insertText(a,o,o)}},jn=class extends Z{constructor(e){super(e,`Strikethrough`),this.button=this.createButton(`
|
|
75
75
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0" /><path d="M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5" /></svg>
|
|
76
|
-
`)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`~~`)&&i.endsWith(`~~`))a=i.slice(2,-2);else if(r.substring(t-2,t)===`~~`&&r.substring(n,n+2)===`~~`){e.setSelectionRange(t-2,n+2),this.editor.insertText(i,0,0);return}else a=`~~${i||`Strikethrough text`}~~`,o=2;this.editor.insertText(a,o,o)}},Mn=class extends Z{constructor(e){super(e,`Unordered list`),this.button=this.createButton(`
|
|
76
|
+
`)}applySyntax(){this.trimSelection();let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`~~`)&&i.endsWith(`~~`))a=i.slice(2,-2);else if(r.substring(t-2,t)===`~~`&&r.substring(n,n+2)===`~~`){e.setSelectionRange(t-2,n+2),this.editor.insertText(i,0,0);return}else a=`~~${i||`Strikethrough text`}~~`,o=2;this.editor.insertText(a,o,o)}},Mn=class extends Z{constructor(e){super(e,`Unordered list`),this.button=this.createButton(`
|
|
77
77
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l11 0" /><path d="M9 12l11 0" /><path d="M9 18l11 0" /><path d="M5 6l0 .01" /><path d="M5 12l0 .01" /><path d="M5 18l0 .01" /></svg>
|
|
78
78
|
`)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n),a=``,o=0;if(i.startsWith(`- `))a=i.slice(2);else if(r.substring(t-2,t)===`- `){e.setSelectionRange(t-2,n),this.editor.insertText(i,0,0);return}else a=`- ${i||`Unordered list`}`,o=2;this.editor.insertText(a,o)}},Nn=class extends Z{constructor(e){super(e,`Ordered list`),this.button=this.createButton(`
|
|
79
79
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M11 6h9" /><path d="M11 12h9" /><path d="M12 18h8" /><path d="M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" /><path d="M6 10v-6l-2 2" /></svg>
|
|
@@ -91,7 +91,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
91
91
|
</dialog>
|
|
92
92
|
`;i.querySelector(`.markdown-modal`)||i.insertAdjacentHTML(`beforeend`,a);let o=i.querySelector(`.markdown-modal`);return o.addEventListener(`close`,()=>o.remove()),o.showModal(),o}var $=class extends Z{constructor(e){super(e,`Link`),this.button=this.createButton(`
|
|
93
93
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 15l6 -6" /><path d="M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464" /><path d="M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463" /></svg>
|
|
94
|
-
`)}applySyntax(e){let t=this.editor,n=t.usertextarea,{selectionStart:r,selectionEnd:i}=n,a=n.value,o=a.substring(0,r),s=a.substring(i);if(o.endsWith(`[`)&&/^\]\([^)]+\)/.test(s)){let e=s.match(/^\]\(([^)]+)\)/);e&&(r=o.length-1,i+=e[0].length,n.setSelectionRange(r,i))}let c=a.substring(r,i),l=c&&c.match(/^\[([^\]]+)\]\(([^)]+)\)$/),u=l?l[1]:c,d=l?l[2]:``,f=In(e,`fj:max-w-sm`,`
|
|
94
|
+
`)}applySyntax(e){this.trimSelection();let t=this.editor,n=t.usertextarea,{selectionStart:r,selectionEnd:i}=n,a=n.value,o=a.substring(0,r),s=a.substring(i);if(o.endsWith(`[`)&&/^\]\([^)]+\)/.test(s)){let e=s.match(/^\]\(([^)]+)\)/);e&&(r=o.length-1,i+=e[0].length,n.setSelectionRange(r,i))}let c=a.substring(r,i),l=c&&c.match(/^\[([^\]]+)\]\(([^)]+)\)$/),u=l?l[1]:c,d=l?l[2]:``,f=In(e,`fj:max-w-sm`,`
|
|
95
95
|
<div class="fj:flex fj:justify-between fj:items-center fj:gap-3">
|
|
96
96
|
<div class="fj:font-medium">${this.editor.label(`Link`)}</div>
|
|
97
97
|
<button type="button" class="modal-close-btn fj:me-btn fj:me-btn-ghost fj:me-btn-xs fj:me-btn-circle" aria-label="${this.editor.label(`Close`)}">
|
|
@@ -135,7 +135,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
135
135
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M20 6l-7 0" /><path d="M20 12l-9 0" /><path d="M20 18l-7 0" /><path d="M8 8l-4 4l4 4" /></svg>
|
|
136
136
|
`)}applySyntax(e){let t=this.editor.indentManager;t&&(t.outdent(),this.editor.render())}},Wn=class extends Z{constructor(e){super(e,`Code`),this.button=this.createButton(`
|
|
137
137
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 8l-4 4l4 4" /><path d="M17 8l4 4l-4 4" /><path d="M14 4l-4 16" /></svg>
|
|
138
|
-
`)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n);if(i.startsWith("`")&&i.endsWith("`")){this.editor.insertText(i.slice(1,-1),0,0);return}if(r[t-1]==="`"&&r[n]==="`"){e.setSelectionRange(t-1,n+1),this.editor.insertText(i,0,0);return}let a=`\`${i||`code`}\``;this.editor.insertText(a,1,1)}},Gn=class extends Z{constructor(e){super(e,`Code Block`),this.button=this.createButton(`
|
|
138
|
+
`)}applySyntax(){this.trimSelection();let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value,i=r.substring(t,n);if(i.startsWith("`")&&i.endsWith("`")){this.editor.insertText(i.slice(1,-1),0,0);return}if(r[t-1]==="`"&&r[n]==="`"){e.setSelectionRange(t-1,n+1),this.editor.insertText(i,0,0);return}let a=`\`${i||`code`}\``;this.editor.insertText(a,1,1)}},Gn=class extends Z{constructor(e){super(e,`Code Block`),this.button=this.createButton(`
|
|
139
139
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M8 9l3 3l-3 3" /><path d="M13 15l3 0" /><rect x="3" y="4" width="18" height="16" rx="2" /></svg>
|
|
140
140
|
`)}applySyntax(){let e=this.editor.usertextarea,{selectionStart:t,selectionEnd:n}=e,r=e.value.substring(t,n);if(r.startsWith("```")&&r.endsWith("```")&&r.length>6){let e=r.replace(/^```\w*\n?/,``).replace(/\n?```$/,``);this.editor.insertText(e,0,0);return}let i=`\`\`\`\n${r||`code`}\n\`\`\``;this.editor.insertText(i,4,4)}},Kn=class extends Z{constructor(e){super(e,`Horizontal Rule`),this.button=this.createButton(`
|
|
141
141
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12l16 0" stroke-width="3"/><path d="M4 7l6 0" /><path d="M4 17l6 0" /><path d="M14 7l6 0" /><path d="M14 17l6 0" /></svg>
|