@krantho/studio 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/assets/AssistantPanel-B7HETGhh.js +8 -0
  2. package/dist/assets/GraphBrowser-DIjsu_2L.js +2 -0
  3. package/dist/assets/GraphCanvas-B1JM8f2x.js +1 -0
  4. package/dist/assets/{action-button-Co7fp7HS.js → action-button-DIrhqMRc.js} +1 -1
  5. package/dist/assets/{api-seo-2H6_VoWE.js → api-seo-Cjv4a9Y_.js} +1 -1
  6. package/dist/assets/{arduino-CEYAtK6G.js → arduino-DKR9_xyJ.js} +1 -1
  7. package/dist/assets/{arrow-down-CsgZZR1B.js → arrow-down-B5kfR2lG.js} +1 -1
  8. package/dist/assets/{arrow-left-DKjipJjb.js → arrow-left-7opbl8fu.js} +1 -1
  9. package/dist/assets/{auth-GRfs02w7.js → auth-CIpilSKF.js} +1 -1
  10. package/dist/assets/{c-C8PoWFx3.js → c-CEM0h_nK.js} +1 -1
  11. package/dist/assets/{circle-check-big-zoQrH4Hp.js → circle-check-big-DQjpuxcC.js} +1 -1
  12. package/dist/assets/{circle-dashed-Cu2MEHnb.js → circle-dashed-cuYrILNo.js} +1 -1
  13. package/dist/assets/{circle-x-DMb3ZtiK.js → circle-x-peGpq98w.js} +1 -1
  14. package/dist/assets/{clike-jjKDqbJf.js → clike-BlGBRct5.js} +1 -1
  15. package/dist/assets/{clock-CzpAlvS3.js → clock-DoBIVjZO.js} +1 -1
  16. package/dist/assets/collection-view-CUWLWvwR.js +5 -0
  17. package/dist/assets/{copy-DloNx7rC.js → copy-V85khWct.js} +1 -1
  18. package/dist/assets/{corner-down-right-D2cWjQTP.js → corner-down-right-BpwOGRFR.js} +1 -1
  19. package/dist/assets/{cpp-BNrDeSFM.js → cpp-C0nea612.js} +1 -1
  20. package/dist/assets/createLucideIcon-BklFHeMd.js +1 -0
  21. package/dist/assets/{csharp-C2EQRp-I.js → csharp-C430X67Y.js} +1 -1
  22. package/dist/assets/{data-table-D8BsE1pn.js → data-table-B1kqxrEw.js} +1 -1
  23. package/dist/assets/editor-page-jSK3xMkh.js +27 -0
  24. package/dist/assets/{empty-state-CU7q3Ypl.js → empty-state-CeUZocHx.js} +1 -1
  25. package/dist/assets/{export-helpers-B2KV_EB5.js → export-helpers-C_HVpJN9.js} +1 -1
  26. package/dist/assets/{external-link-BRKJTCZG.js → external-link-Dh7p8Ii6.js} +1 -1
  27. package/dist/assets/{fill-job-D41ra-DR.js → fill-job-B-Z4jnVQ.js} +1 -1
  28. package/dist/assets/{fill-run-view-DFeyjdsI.js → fill-run-view-Bx-nSvtd.js} +1 -1
  29. package/dist/assets/{findability-CUYOthYI.js → findability-BrhtZ2yD.js} +1 -1
  30. package/dist/assets/{format-pPdsDgeS.js → format-C3ZX9yGM.js} +1 -1
  31. package/dist/assets/{go-BTdFQSkQ.js → go-2ldyX7zA.js} +1 -1
  32. package/dist/assets/graph-config-BJA_ztYM.js +1 -0
  33. package/dist/assets/image-editor-CEzh5OFw.js +1 -0
  34. package/dist/assets/index-qiIlvPyv.js +2 -0
  35. package/dist/assets/{info-B69U-gXd.js → info-Cxkabti5.js} +1 -1
  36. package/dist/assets/{java-OEPW09uX.js → java-BaDy4FT-.js} +1 -1
  37. package/dist/assets/{javascript-DWFokqmn.js → javascript-DoKZVVG7.js} +1 -1
  38. package/dist/assets/{kotlin-lSpEPTBz.js → kotlin-aNSUnDDr.js} +1 -1
  39. package/dist/assets/{layers-BQ89qo5R.js → layers-0VWe0rKm.js} +1 -1
  40. package/dist/assets/{list-checks-DmMdd-uP.js → list-checks-BCEhMMVY.js} +1 -1
  41. package/dist/assets/live-markdown-editor-BGbJGFKJ.js +54 -0
  42. package/dist/assets/{markdown-D0Y7CUbI.js → markdown-ChIsYjIt.js} +1 -1
  43. package/dist/assets/{markup-Bfi2BWVm.js → markup-C09yLKTH.js} +1 -1
  44. package/dist/assets/{markup-templating-BkH2dBCn.js → markup-templating-DNhq-UOv.js} +1 -1
  45. package/dist/assets/media-page-B3Q4EH3m.js +1 -0
  46. package/dist/assets/{meter-mJxPk3I3.js → meter-ZOLJ0WhG.js} +1 -1
  47. package/dist/assets/{objectivec-Cv_qlwGW.js → objectivec-s2I4Tn1D.js} +1 -1
  48. package/dist/assets/{pen-line-CZkcVGBd.js → pen-line-B524Nue8.js} +1 -1
  49. package/dist/assets/{pencil-BHnNXVY1.js → pencil-xdGZtrO4.js} +1 -1
  50. package/dist/assets/{php-MrfIyKXK.js → php-B_6N-5RT.js} +1 -1
  51. package/dist/assets/pulse-page-HsxpGgEu.js +1 -0
  52. package/dist/assets/rolldown-runtime-COiEfhsA.js +1 -0
  53. package/dist/assets/{rotate-ccw-CjpQmti_.js → rotate-ccw-BgARBEK3.js} +1 -1
  54. package/dist/assets/ruby-C8GJZDTg.js +1 -0
  55. package/dist/assets/{save-kXwhieDK.js → save-ClSXW9cb.js} +1 -1
  56. package/dist/assets/{send-ib_sr-OU.js → send-kYpW5JED.js} +1 -1
  57. package/dist/assets/setup-page-DsYYpFrd.js +1 -0
  58. package/dist/assets/{site-XpqFn80l.js → site-BfbIKOk1.js} +1 -1
  59. package/dist/assets/site-model-CoSgHHeY.js +1 -0
  60. package/dist/assets/site-overview-BJNMesQZ.js +1 -0
  61. package/dist/assets/structure-page-ZD8c7Ukz.js +2 -0
  62. package/dist/assets/{trash-Cknp3eZ5.js → trash-DzRCm500.js} +1 -1
  63. package/dist/assets/triangle-exclamation-point-ttN5lZI0.js +1 -0
  64. package/dist/assets/{typescript-Brau3Puh.js → typescript-s_P45ayF.js} +1 -1
  65. package/dist/assets/{upload-BvBYjswd.js → upload-CaqQJaUr.js} +1 -1
  66. package/dist/assets/{use-drawer-actions-DChrztN2.js → use-drawer-actions-D-rIBvJ8.js} +1 -1
  67. package/dist/assets/{use-loaded-C3hBdQe0.js → use-loaded-DFUDFVFt.js} +1 -1
  68. package/dist/assets/{use-locale-versions-Bp4V9fN-.js → use-locale-versions-DHt-x8c_.js} +1 -1
  69. package/dist/assets/{vendor-diff-Dm2YfgXt.js → vendor-diff-DGCTJYJ4.js} +14 -14
  70. package/dist/assets/vendor-markdown-pd8vs9n-.js +74 -0
  71. package/dist/assets/{vendor-media-yY6fAUvp.js → vendor-media-DXSmPN_d.js} +1 -1
  72. package/dist/assets/vendor-react-CXaWJ_ii.js +15 -0
  73. package/dist/assets/{vendor-reactflow-5Qvgw90M.js → vendor-reactflow-CMKi7AEX.js} +1 -1
  74. package/dist/assets/vendor-router-B4czwg8X.js +1 -0
  75. package/dist/index.html +8 -8
  76. package/package.json +18 -18
  77. package/dist/assets/AssistantPanel-CzFfUizn.js +0 -8
  78. package/dist/assets/GraphBrowser-DvcHXw-i.js +0 -2
  79. package/dist/assets/GraphCanvas-Bq75rYgC.js +0 -1
  80. package/dist/assets/collection-view-BlqX2SDN.js +0 -5
  81. package/dist/assets/createLucideIcon-D_HN41p3.js +0 -1
  82. package/dist/assets/editor-page-C8G81B5n.js +0 -27
  83. package/dist/assets/graph-config-ZUe9BjGK.js +0 -1
  84. package/dist/assets/image-editor-Bmjrioxz.js +0 -1
  85. package/dist/assets/index-DVe5jFLX.js +0 -2
  86. package/dist/assets/live-markdown-editor-CTvxOTrh.js +0 -53
  87. package/dist/assets/media-page-DYRRse48.js +0 -1
  88. package/dist/assets/pulse-page-B44AnguJ.js +0 -1
  89. package/dist/assets/rolldown-runtime-Dd_uD5pT.js +0 -1
  90. package/dist/assets/ruby-DGkU311C.js +0 -1
  91. package/dist/assets/setup-page-x51U8px6.js +0 -1
  92. package/dist/assets/site-model-DX8WxTJg.js +0 -1
  93. package/dist/assets/site-overview--k6hNYk0.js +0 -1
  94. package/dist/assets/structure-page-BW1y8L1n.js +0 -2
  95. package/dist/assets/triangle-alert-C4yqbtOC.js +0 -1
  96. package/dist/assets/vendor-markdown-DlwjVoJi.js +0 -66
  97. package/dist/assets/vendor-react-DMqGe90A.js +0 -15
  98. package/dist/assets/vendor-router-DjV3D6zM.js +0 -1
@@ -0,0 +1,74 @@
1
+ function e(e,t){this.v=e,this.k=t}function t(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 n(e){if(Array.isArray(e))return e}function r(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 i(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(e,t){return n(e)||r(e,t)||o(e,t)||i()}function o(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function s(t){var n,r;function i(n,r){try{var o=t[n](r),s=o.value,c=s instanceof e;Promise.resolve(c?s.v:s).then(function(e){if(c){var r=n===`return`&&s.k?n:`next`;if(!s.k||e.done)return i(r,e);e=t[r](e).value}a(!!o.done,e)},function(e){i(`throw`,e)})}catch(e){a(2,e)}}function a(e,t){e===2?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof t.return!=`function`&&(this.return=void 0)}s.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},s.prototype.next=function(e){return this._invoke(`next`,e)},s.prototype.throw=function(e){return this._invoke(`throw`,e)},s.prototype.return=function(e){return this._invoke(`return`,e)};var c=Object.entries,l=Object.setPrototypeOf,u=Object.isFrozen,d=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor,p=Object.freeze,m=Object.seal,h=Object.create,ee=typeof Reflect<`u`&&Reflect,te=ee.apply,ne=ee.construct;p||=function(e){return e},m||=function(e){return e},te||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ne||=function(e){return new e(...[...arguments].slice(1))};var g=b(Array.prototype.forEach);Array.prototype.indexOf;var re=b(Array.prototype.lastIndexOf),ie=b(Array.prototype.pop),ae=b(Array.prototype.push),oe=b(Array.prototype.slice),se=b(Array.prototype.splice),ce=Array.isArray,le=Ce(Set),ue=b(Set.prototype.add),de=b(Set.prototype.has),fe=b(String.prototype.toLowerCase),pe=b(String.prototype.toString),me=b(String.prototype.match),he=b(String.prototype.replace),ge=b(String.prototype.indexOf),_e=b(String.prototype.trim),ve=b(Number.prototype.toString),ye=b(Boolean.prototype.toString),be=typeof BigInt>`u`?null:b(BigInt.prototype.toString),xe=typeof Symbol>`u`?null:b(Symbol.prototype.toString),_=b(Object.prototype.hasOwnProperty),Se=b(Object.prototype.toString),v=b(RegExp.prototype.test),y=Ce(TypeError);function b(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return te(e,t,n)}}function Ce(e){return function(){return ne(e,[...arguments])}}function x(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fe;if(l&&l(e,null),!ce(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(u(t)||(t[r]=e),i=e)}e[i]=!0}return e}function we(e){for(let t=0;t<e.length;t++)_(e,t)||(e[t]=null);return e}function S(e){let t=h(null);for(let r of c(e)){var n=a(r,2);let i=n[0],o=n[1];_(e,i)&&(t[i]=ce(o)?we(o):o&&typeof o==`object`&&o.constructor===Object?S(o):o)}return t}function Te(e){switch(typeof e){case`string`:return e;case`number`:return ve(e);case`boolean`:return ye(e);case`bigint`:return be?be(e):`0`;case`symbol`:return xe?xe(e):`Symbol()`;case`undefined`:return Se(e);case`function`:case`object`:{if(e===null)return Se(e);let t=e,n=C(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Se(e)}return Se(e)}default:return Se(e)}}function C(e,t){for(;e!==null;){let n=f(e,t);if(n){if(n.get)return b(n.get);if(typeof n.value==`function`)return b(n.value)}e=d(e)}function n(){return null}return n}function Ee(e,t){for(;e!==null;){let n=f(e,t);if(n)return n.get?b(n.get):null;e=d(e)}return null}function De(e){try{return v(e,``),!0}catch{return!1}}var Oe=p(`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(`.`)),ke=p(`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(`.`)),Ae=p([`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`]),je=p([`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`]),Me=p(`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(`.`)),Ne=p([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Pe=p([`#text`]),Fe=p(`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(`.`)),Ie=p(`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(`.`)),Le=p(`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(`.`)),Re=p([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),ze=m(/{{[\w\W]*|^[\w\W]*}}/g),Be=m(/<%[\w\W]*|^[\w\W]*%>/g),Ve=m(/\${[\w\W]*/g),He=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ue=m(/^aria-[\-\w]+$/),We=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ge=m(/^(?:\w+script|data):/i),Ke=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qe=m(/^html$/i),Je=m(/^[a-z][.\w]*(-[.\w]+)+$/i),Ye=m(/<[/\w!]/g),Xe=m(/<[/\w]/g),Ze=m(/<\/no(script|embed|frames)/i),Qe=m(/\/>/i),w={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},$e=p(x({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),et=function(){return typeof window>`u`?null:window},tt=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}},nt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},rt=function(e,t,n,r){return _(e,t)&&ce(e[t])?x(r.base?S(r.base):{},e[t],r.transform):n},it=function(e,t,n){let r=_(e,t)?e[t]:void 0;return r&&typeof r==`object`?S(r):n()};function at(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:et(),t=e=>at(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==w.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,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,d=e.trustedTypes,f=s.prototype,ee=C(f,`cloneNode`),te=C(f,`remove`),ne=C(f,`removeAttributeNode`),ve=C(f,`nextSibling`),ye=C(f,`childNodes`),be=C(f,`parentNode`),xe=C(f,`shadowRoot`),Se=C(f,`attributes`),b=o&&o.prototype?C(o.prototype,`nodeType`):null,Ce=o&&o.prototype?C(o.prototype,`nodeName`):null,we=o&&o.prototype?C(o.prototype,`ownerDocument`):null,T=function(e){return b?b(e):e.nodeType},ot=function(e){return Ce?Ce(e):e.nodeName},E=Ee(f,`namespaceURI`),st=function(e){return E?E(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let D,O=``,k,ct=!1,A=0,lt=function(){if(A>0)throw y(`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.`)},ut=function(e){lt(),A++;try{return D.createHTML(e)}finally{A--}},dt=function(e){lt(),A++;try{return D.createScriptURL(e)}finally{A--}},ft=function(){return ct||=(k=tt(d,i),!0),k},pt=n,mt=pt.implementation,ht=pt.createNodeIterator,gt=pt.createDocumentFragment,_t=pt.getElementsByTagName,vt=r.importNode,j=nt();t.isSupported=typeof c==`function`&&typeof be==`function`&&mt&&mt.createHTMLDocument!==void 0;let yt=ze,bt=Be,xt=Ve,St=He,Ct=Ue,wt=Ge,Tt=Ke,Et=Je,Dt=We,M=null,Ot=x({},[...Oe,...ke,...Ae,...Me,...Pe]),N=null,kt=x({},[...Fe,...Ie,...Le,...Re]),P=Object.seal(h(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}})),At=null,jt=null,F=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),I=!0,L=!0,Mt=!1,Nt=!0,R=!1,z=!0,B=!1,Pt=!1,Ft=null,It=null,Lt=!1,Rt=!1,zt=!1,Bt=!1,Vt=!0,Ht=!1,Ut=`user-content-`,Wt=!0,Gt=!1,V=null,Kt={},H=null,qt=x({},`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(`.`)),Jt=null,Yt=x({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Xt=null,Zt=x({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Qt=`http://www.w3.org/1998/Math/MathML`,$t=`http://www.w3.org/2000/svg`,U=`http://www.w3.org/1999/xhtml`,en=U,tn=!1,nn=null,rn=x({},[Qt,$t,U],pe),an=p([`mi`,`mo`,`mn`,`ms`,`mtext`]),on=x({},an),sn=p([`annotation-xml`]),cn=x({},sn),ln=x({},[`title`,`style`,`font`,`a`,`script`]),un=null,dn=[`application/xhtml+xml`,`text/html`],W=null,fn=null,pn=n.createElement(`form`),G=function(e){return e instanceof RegExp||e instanceof Function},mn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(fn&&fn===e)return;e&&typeof e==`object`||(e={}),e=S(e),un=dn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,W=un===`application/xhtml+xml`?pe:fe,M=rt(e,`ALLOWED_TAGS`,Ot,{transform:W}),N=rt(e,`ALLOWED_ATTR`,kt,{transform:W}),nn=rt(e,`ALLOWED_NAMESPACES`,rn,{transform:pe}),Xt=rt(e,`ADD_URI_SAFE_ATTR`,Zt,{transform:W,base:Zt}),Jt=rt(e,`ADD_DATA_URI_TAGS`,Yt,{transform:W,base:Yt}),H=rt(e,`FORBID_CONTENTS`,qt,{transform:W}),At=rt(e,`FORBID_TAGS`,S({}),{transform:W}),jt=rt(e,`FORBID_ATTR`,S({}),{transform:W}),Kt=_(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?S(e.USE_PROFILES):e.USE_PROFILES:!1,I=e.ALLOW_ARIA_ATTR!==!1,L=e.ALLOW_DATA_ATTR!==!1,Mt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Nt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,R=e.SAFE_FOR_TEMPLATES||!1,z=e.SAFE_FOR_XML!==!1,B=e.WHOLE_DOCUMENT||!1,Rt=e.RETURN_DOM||!1,zt=e.RETURN_DOM_FRAGMENT||!1,Bt=e.RETURN_TRUSTED_TYPE||!1,Lt=e.FORCE_BODY||!1,Vt=e.SANITIZE_DOM!==!1,Ht=e.SANITIZE_NAMED_PROPS||!1,Wt=e.KEEP_CONTENT!==!1,Gt=e.IN_PLACE||!1,Dt=De(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:We,en=typeof e.NAMESPACE==`string`?e.NAMESPACE:U,on=it(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>x({},an)),cn=it(e,`HTML_INTEGRATION_POINTS`,()=>x({},sn));let t=it(e,`CUSTOM_ELEMENT_HANDLING`,()=>h(null));if(P=h(null),_(t,`tagNameCheck`)&&G(t.tagNameCheck)&&(P.tagNameCheck=t.tagNameCheck),_(t,`attributeNameCheck`)&&G(t.attributeNameCheck)&&(P.attributeNameCheck=t.attributeNameCheck),_(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(P.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),m(P),R&&(L=!1),zt&&(Rt=!0),Kt&&(M=x({},Pe),N=h(null),Kt.html===!0&&(x(M,Oe),x(N,Fe)),Kt.svg===!0&&(x(M,ke),x(N,Ie),x(N,Re)),Kt.svgFilters===!0&&(x(M,Ae),x(N,Ie),x(N,Re)),Kt.mathMl===!0&&(x(M,Me),x(N,Le),x(N,Re))),F.tagCheck=null,F.attributeCheck=null,_(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?F.tagCheck=e.ADD_TAGS:ce(e.ADD_TAGS)&&(M===Ot&&(M=S(M)),x(M,e.ADD_TAGS,W))),_(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?F.attributeCheck=e.ADD_ATTR:ce(e.ADD_ATTR)&&(N===kt&&(N=S(N)),x(N,e.ADD_ATTR,W))),_(e,`ADD_FORBID_CONTENTS`)&&ce(e.ADD_FORBID_CONTENTS)&&(H===qt&&(H=S(H)),x(H,e.ADD_FORBID_CONTENTS,W)),Wt&&(M[`#text`]=!0),B&&x(M,[`html`,`head`,`body`]),M.table&&(x(M,[`tbody`]),delete At.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw y(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw y(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=D;D=e.TRUSTED_TYPES_POLICY;try{O=ut(``)}catch(e){throw D=t,e}}else e.TRUSTED_TYPES_POLICY===null?(D=void 0,O=``):(D===void 0&&(D=ft()),D&&typeof O==`string`&&(O=ut(``)));p&&p(e),fn=e},hn=x({},[...ke,...Ae,...je]),gn=x({},[...Me,...Ne]),K=function(e,t,n){return t.namespaceURI===U?e===`svg`:t.namespaceURI===Qt?e===`svg`&&(n===`annotation-xml`||on[n]):!!hn[e]},_n=function(e,t,n){return t.namespaceURI===U?e===`math`:t.namespaceURI===$t?e===`math`&&cn[n]:!!gn[e]},vn=function(e,t,n){return t.namespaceURI===$t&&!cn[n]||t.namespaceURI===Qt&&!on[n]?!1:!gn[e]&&(ln[e]||!hn[e])},yn=function(e){let t=st(e),n=fe(ot(e)),r=be(e),i,a;return r&&T(r)===w.element?(i={namespaceURI:st(r)},a=fe(ot(r))):(i={namespaceURI:en},a=`template`),nn[t]?t===$t?K(n,i,a):t===Qt?_n(n,i,a):t===U?vn(n,i,a):!!(un===`application/xhtml+xml`&&nn[t]):!1},q=function(e){ae(t.removed,{element:e});try{be(e).removeChild(e)}catch{if(te(e),!be(e))throw y(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},bn=function(e,t,n){try{ne(e,t)}catch{try{e.removeAttribute(n)}catch{}}},xn=function(e){Tn(e);let t=ye(e);t&&g(oe(t),e=>{try{te(e)}catch{}});let n=T(e)===w.element?Se(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&bn(e,r,i)}},Sn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}ae(t.removed,{attribute:r||null,from:n});try{r?ne(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Rt||zt)try{q(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Cn=function(e){let t=Se(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||N[W(i)]||bn(e,r,i)}},wn=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&&T(e)===w.element){let t=xe(e);Fn(t)&&r.push(t)}let i=ye(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Tn=function(e){wn(e,e=>{T(e)===w.element&&Cn(e)})},En=function(e){let t=[];return wn(e,e=>{t.push(e)},!0),t},Dn=function(e,t){let n=le();g(En(e),e=>{T(e)===w.element&&ue(n,e)}),g(t,e=>{T(e)===w.element&&!de(n,e)&&Cn(e)})},On=function(e,n){let r=!1;return g(t.removed,t=>{t.element&&(r||=t.element===e,Tn(t.element))}),Dn(e,n),r},kn=function(e,t){let n=V,r=null,i=()=>(r||(r=le(),g(t,e=>{ue(r,e)})),r);for(let t=0;;t++){let r=En(e),a=[e],o=!1;if(g(r,e=>{T(e)===w.documentFragment?ae(a,e):!o&&!de(n,e)&&(o=de(i(),e))}),!o)return;if(t>=8)throw y(`the tree kept changing during in-place sanitization; refusing to return it`);g(a,(t,n)=>{J(t,n>0,e,i())})}},J=function(e,t,n,r){let i=X(e),a;for(;a=i.nextNode();)de(r,a)&&!de(V,a)&&(t&&$(j.uponSanitizeShadowNode,a,null),Hn(a,n),Yn(a,n),Fn(a.content)&&Xn(a.content))},An=function(e){V&&ue(V,e)},jn=function(e,t){return z?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Y=function(e){z&&wn(e,e=>{let t=T(e);if(t===w.processingInstruction||t===w.comment&&v(Xe,e.data)){try{te(e)}catch{}return!1}if(t===w.element){let t=e,n=W(ot(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&jn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Mn=function(e){let t=null,r=null;if(Lt)e=`<remove></remove>`+e;else{let t=me(e,/^[\r\n\t ]+/);r=t&&t[0]}un===`application/xhtml+xml`&&en===U&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=D?ut(e):e;if(en===U)try{t=new u().parseFromString(i,un)}catch{}if(!t||!t.documentElement){t=mt.createDocument(en,`template`,null);try{t.documentElement.innerHTML=tn?O:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),en===U?_t.call(t,B?`html`:`body`)[0]:B?t.documentElement:a},X=function(e){let t=we?we(e):e.ownerDocument;return ht.call(t||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Nn=function(e){return e=he(e,yt,` `),e=he(e,bt,` `),e=he(e,xt,` `),e},Z=function(e){Q(e);let t=e.querySelectorAll?.call(e,`template`);t&&g(t,e=>{Fn(e.content)&&Z(e.content)})},Q=function(e){e.normalize();let t=we?we(e):e.ownerDocument,n=ht.call(t||e,e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Nn(r.data),r=n.nextNode()},Pn=function(e){let t=Ce?Ce(e):null;return typeof t!=`string`||W(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==Se(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!==b(e)||e.childNodes!==ye(e)},Fn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===w.documentFragment}catch{return!1}},In=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&g(e,e=>{e.call(t,n,r,fn)})}let Ln=function(e,t){return!!(z&&e.hasChildNodes()&&!In(e.firstElementChild)&&v(Ye,e.textContent)&&v(Ye,e.innerHTML)||z&&$e[t]&&T(e)===w.element&&st(e)===U&&(In(e.firstElementChild)||typeof e.textContent==`string`&&v(Ye,e.textContent))||e.nodeType===w.processingInstruction||z&&e.nodeType===w.comment&&v(Xe,e.data))},Rn=function(e,t){return e instanceof RegExp?v(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},zn=function(e,t,n){if(!At[t]&&Gn(t)&&Rn(P.tagNameCheck,t))return!1;if(Wt&&!H[t]&&!H[fe(t)]){let t=be(e),r=ye(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?ee(r[a],!0):r[a];t.insertBefore(i,ve(e))}}}return q(e),!0},Bn=function(e,t,n,r){return e.length===0?t:t===n||t===r?S(t):t},Vn=function(e,t){return e===t||be(e)!==null?!1:(Gt&&Tn(e),!0)},Hn=function(e,n){if(An(e),$(j.beforeSanitizeElements,e,null),Vn(e,n))return!0;if(Pn(e))return q(e),!0;let r=W(ot(e));if(M=Bn(j.uponSanitizeElement,M,Ot,Ft),$(j.uponSanitizeElement,e,{tagName:r,allowedTags:M}),Vn(e,n))return!0;if(Ln(e,r))return q(e),!0;if(At[r]||!(F.tagCheck instanceof Function&&F.tagCheck(r))&&!M[r]){let t=zn(e,r,n);return t===!1&&($(j.afterSanitizeElements,e,null),Vn(e,n))?!0:t}if(T(e)===w.element&&!yn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&v(Ze,e.innerHTML))return q(e),!0;if(R&&e.nodeType===w.text){let n=Nn(e.textContent);e.textContent!==n&&(ae(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(j.afterSanitizeElements,e,null),Vn(e,n)},Un=function(e,t,r){if(jt[t]||jn(t,e)||Vt&&(t===`id`||t===`name`)&&(r in n||r in pn))return!1;let i=N[t]||F.attributeCheck instanceof Function&&F.attributeCheck(t,e);return L&&v(St,t)||I&&v(Ct,t)?!0:i?Xt[t]||v(Dt,he(r,Tt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ge(r,`data:`)===0&&Jt[e]||Mt&&!v(wt,he(r,Tt,``))?!0:!r:Gn(e)&&Rn(P.tagNameCheck,e)&&Rn(P.attributeNameCheck,t,e)||t===`is`&&P.allowCustomizedBuiltInElements&&Rn(P.tagNameCheck,r)},Wn=x({},[`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[fe(e)]&&v(Et,e)},Kn=function(e,t,n,r){if(D&&typeof d==`object`&&typeof d.getAttributeType==`function`&&!n)switch(d.getAttributeType(e,t)){case`TrustedHTML`:return ut(r);case`TrustedScriptURL`:return dt(r)}return r},qn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Pn(e)||(q(e),!1)}catch{return Sn(t,e),!1}},Jn=function(e,t){return z&&v(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:fe(e)===`attributename`&&me(t,`href`)!==null},Yn=function(e,n){if($(j.beforeSanitizeAttributes,e,null),Vn(e,n))return;let r=e.attributes;if(!r||Pn(e))return;N=Bn(j.uponSanitizeAttribute,N,kt,It);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:N,forceKeepAttr:void 0},a=r.length,o=W(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=W(s),d=l,f=s===`value`?d:_e(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(j.uponSanitizeAttribute,e,i),f=i.attrValue,Ht&&(u===`id`||u===`name`)&&ge(f,Ut)!==0&&(Sn(s,e,n),f=Ut+f,p=!0),Jn(s,f)?Sn(s,e,n):i.forceKeepAttr||(i.keepAttr?!Nt&&v(Qe,f)?Sn(s,e,n):(R&&(f=Nn(f)),Un(o,u,f)?(f=Kn(o,u,c,f),f!==d&&qn(e,s,c,f)&&p&&ie(t.removed)):Sn(s,e,n)):Sn(s,e,n))}$(j.afterSanitizeAttributes,e,null),Vn(e,n)},Xn=function(e){let t=null,n=X(e);for($(j.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(j.uponSanitizeShadowNode,t,null),Hn(t,e),Yn(t,e),Fn(t.content)&&Xn(t.content),T(t)===w.element){let e=xe(t);Fn(e)&&(Zn(e),Xn(e))}R&&Q(e),$(j.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=T(n)===w.element,i=ye(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=Ce?Ce(n):null;if(typeof e==`string`&&W(e)===`template`){let e=n.content;Fn(e)&&t.push({node:e,shadow:null})}}if(r){let e=xe(n);Fn(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(tn=!e,tn&&(e=`<!-->`),typeof e!=`string`&&!In(e)&&(e=Te(e),typeof e!=`string`))throw y(`dirty is not a string, aborting`);if(!t.isSupported)return e;Pt?(M=Ft,N=It):mn(n),(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&(M=S(M)),j.uponSanitizeAttribute.length>0&&(N=S(N)),t.removed=[];let c=Gt&&typeof e!=`string`&&In(e),l=[],u=V;if(c){Y(e);let t=ot(e);if(typeof t==`string`){let n=W(t);if(!M[n]||At[n])throw xn(e),y(`root node is forbidden and cannot be sanitized in-place`)}if(Pn(e))throw xn(e),y(`root node is clobbered and cannot be sanitized in-place`);l=En(e),V=le()}else if(In(e))i=Mn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===w.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Zn(i);else{if(!Rt&&!R&&!B&&e.indexOf(`<`)===-1)return D&&Bt?ut(e):e;if(i=Mn(e),!i)return Rt?null:Bt?O:``}i&&Lt&&q(i.firstChild);let d=c?e:i;try{c&&Zn(e);let t=X(d);for(;o=t.nextNode();)Hn(o,d),Yn(o,d),Fn(o.content)&&Xn(o.content);c&&kn(e,l)}catch(t){throw c&&(xn(e),On(e,l)),t}finally{V=u}if(c){if(On(e,l))throw y(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return R&&Z(e),e}if(Rt){if(R&&Z(i),zt)for(s=gt.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(N.shadowroot||N.shadowrootmode)&&(s=vt.call(r,s,!0)),s}let f=B?i.outerHTML:i.innerHTML;return B&&M[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&v(qe,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
+ `+f),R&&(f=Nn(f)),D&&Bt?ut(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};mn(e),Pt=!0,Ft=M,It=N},t.clearConfig=function(){fn=null,Pt=!1,Ft=null,It=null,D=k,O=``},t.isValidAttribute=function(e,t,n){fn||mn({});let r=W(e),i=W(t);return typeof n==`string`&&(Jn(t,n)||!Nt&&v(Qe,n))?!1:Un(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&_(j,e)&&ae(j[e],t)},t.removeHook=function(e,t){if(_(j,e)){if(t!==void 0){let n=re(j[e],t);return n===-1?void 0:se(j[e],n,1)[0]}return ie(j[e])}},t.removeHooks=function(e){_(j,e)&&(j[e]=[])},t.removeAllHooks=function(){j=nt()},t}var T=at();function ot(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var E=ot();function st(e){E=e}var D={exec:()=>null};function O(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function k(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(A.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ct=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),A={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:O(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:O(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:O(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:O(e=>RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:O(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:O(e=>RegExp(`^ {0,${e}}(?:</?(?:${St})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:O(e=>RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},lt=/^(?:[ \t]*(?:\n|$))+/,ut=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,dt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,ft=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ht=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,gt=k(ht).replace(/bull/g,mt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),_t=k(ht).replace(/bull/g,mt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),vt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,j=/^[^\n]+/,yt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,bt=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,yt).replace(`title`,/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),xt=k(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,mt).getRegex(),St=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Ct=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wt=k(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Ct).replace(`tag`,St).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Tt=e=>k(vt).replace(`hr`,ft).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,St).getRegex(),Et=Tt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Dt=Tt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),M={blockquote:k(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Dt).getRegex(),code:ut,def:bt,fences:dt,heading:pt,hr:ft,html:wt,lheading:gt,list:xt,newline:lt,paragraph:Et,table:D,text:j},Ot=k(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,ft).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,St).getRegex(),N={...M,lheading:_t,table:Ot,paragraph:k(vt).replace(`hr`,ft).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Ot).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,St).getRegex()},kt={...M,html:k(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace(`comment`,Ct).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:D,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(vt).replace(`hr`,ft).replace(`heading`,` *#{1,6} *[^
4
+ ]`).replace(`lheading`,gt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},P=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,At=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,jt=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,F=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,I=/[\p{P}\p{S}]/u,L=/[\s\p{P}\p{S}]/u,Mt=/[^\s\p{P}\p{S}]/u,Nt=k(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,L).getRegex(),R=/[\p{Pi}\p{Ps}"']/u,z=/(?!~)[\p{P}\p{S}]/u,B=/(?!~)[\s\p{P}\p{S}]/u,Pt=/(?:[^\s\p{P}\p{S}]|~)/u,Ft=k(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ct?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),It=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Lt=k(It,`u`).replace(/punct/g,I).getRegex(),Rt=k(It,`u`).replace(/punct/g,z).getRegex(),zt=k(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,R).replace(/punct/g,I).getRegex(),Bt=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Vt=k(Bt,`gu`).replace(/notPunctSpace/g,Mt).replace(/punctSpace/g,L).replace(/punct/g,I).getRegex(),Ht=k(Bt,`gu`).replace(/notPunctSpace/g,Pt).replace(/punctSpace/g,B).replace(/punct/g,z).getRegex(),Ut=k(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Mt).replace(/punctSpace/g,L).replace(/punct/g,I).getRegex(),Wt=k(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Mt).replace(/punctSpace/g,L).replace(/punct/g,I).getRegex(),Gt=k(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Mt).replace(/punctSpace/g,L).replace(/punct/g,I).getRegex(),V=k(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,I).getRegex(),Kt=k(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Mt).replace(/punctSpace/g,L).replace(/punct/g,I).getRegex(),H=k(/\\(punct)/,`gu`).replace(/punct/g,I).getRegex(),qt=k(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,I).getRegex(),Jt=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Yt=k(Ct).replace(`(?:-->|$)`,`-->`).getRegex(),Xt=k(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Yt).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zt=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Qt=k(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Zt).getRegex(),$t=k(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,Qt).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),U=k(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Qt).replace(`ref`,yt).getRegex(),en=k(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,yt).getRegex(),tn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,nn=k(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Zt).getRegex(),rn=k(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,k(/^!?\[(label)\]\[(ref)\]/).replace(`label`,nn).replace(`ref`,tn).getRegex()).replace(`nolink`,k(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,tn).getRegex()).getRegex(),an=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,on=k(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),sn={_backpedal:D,anyPunctuation:H,anyPunctuationOutsideCode:qt,autolink:Jt,blockSkip:Ft,br:jt,code:At,del:D,delLDelim:D,delRDelim:D,emStrongLDelim:Lt,emStrongRDelimAst:Vt,emStrongRDelimUnd:Wt,escape:P,link:$t,nolink:en,punctuation:Nt,reflink:U,reflinkSearch:rn,tag:Xt,text:F,url:D},cn={...sn,emStrongLDelim:zt,emStrongRDelimAst:Ut,emStrongRDelimUnd:Gt,link:k(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Qt).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Qt).getRegex()},ln={...sn,emStrongRDelimAst:Ht,emStrongLDelim:Rt,delLDelim:V,delRDelim:Kt,url:k(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,on).replace(`protocol`,an).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:k(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,an).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace(`wwwStart`,ct?`(?<![^\\s*_~(])www\\.`:`www\\.`).getRegex()},un={...ln,br:k(jt).replace(`{2,}`,`*`).getRegex(),text:k(ln.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},dn={normal:M,gfm:N,pedantic:kt},W={normal:sn,gfm:ln,breaks:un,pedantic:cn},fn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},pn=e=>fn[e];function G(e,t){if(t){if(A.escapeTest.test(e))return e.replace(A.escapeReplace,pn)}else if(A.escapeTestNoEncode.test(e))return e.replace(A.escapeReplaceNoEncode,pn);return e}function mn(e){return A.numericCharacterReference.test(e)?e.replace(A.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&amp;`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&amp;`:String.fromCodePoint(r)}):e}function hn(e){try{e=encodeURI(e).replace(A.percentDecode,`%`)}catch{return null}return e}function gn(e,t){let n=e.replace(A.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(A.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(A.slashPipe,`|`);return n}function K(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function _n(e){let t=e.split(`
5
+ `),n=t.length-1;for(;n>=0&&A.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
6
+ `)}function vn(e){return e.trim().replace(A.multipleSpaceGlobal,` `).toLowerCase().toUpperCase().toLowerCase()}function yn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var q=new WeakMap;function bn(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let i=0;i<r;i++){let a=e[i];if(a!==`*`&&a!==`_`&&a!==`~`)continue;let o=i===0?`
7
+ `:e[i-1],s=i+1;for(;s<r&&e[s]===a;)s++;o!==` `&&o!==` `&&o!==`
8
+ `&&o!==`\r`&&o!==`\f`&&(a===`~`?n=i:t[a]=i),i=s-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function xn(e,t){let n=bn(t),r=q.get(e);r?r.push(n):q.set(e,[n])}function Sn(e){let t=q.get(e);t&&(t.pop(),t.length===0&&q.delete(e))}function Cn(e,t,n){let r=q.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:bn(t).lastPossibleEmStrongCloserIndex[n]}function wn(e,t){let n=q.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:bn(t).lastPossibleDelCloserIndex}function Tn(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function En(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function Dn(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
9
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
10
+ `)}function On(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var kn=class{options;rules;lexer;constructor(e){this.options=e||E}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:_n(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Dn(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=K(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:K(t[0],`
11
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:K(t[0],`
12
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=K(t[0],`
13
+ `).split(`
14
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
15
+ `),c=s.replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>t+Tn(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,`
16
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
17
+ ${s}`:s,r=r?`${r}
18
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`||u?.type===`table`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
19
+ `),o=t.raw+`
20
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
21
+ `).length:0,d=l?e.slice(0,-l):e;if(d.length>0&&(n=`${n}
22
+ ${d.join(`
23
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text,e=e.slice(d.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if(u?.type===`list`){let t=u,a=t.raw+`
24
+ `+e.join(`
25
+ `),o=this.list(a);i[i.length-1]=o;let s=o.raw.length>t.raw.length?a.slice(t.raw.length+1,o.raw.length).split(`
26
+ `).length:0;if(s>0){let t=e.slice(0,s).join(`
27
+ `);n=`${n}
28
+ ${t}`,r=`${r}
29
+ ${t}`}e=e.slice(s)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type===`text`&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
30
+ `,1)[0],d=t[1].length,f=this.options.pedantic?Tn(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>Tn(e,d)),p=e.split(`
31
+ `,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(h):this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h),c=!1;for(;e;){let l=e.split(`
32
+ `,1)[0],u;if(p=l,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),u=p):u=p.replace(this.rules.other.leadingSpaceTab,e=>Tn(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(u.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
33
+ `+u.slice(h),c=!1;else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||o.test(f)||n.test(f))break;if(!this.options.pedantic&&!c){let e=f.replace(this.rules.other.nestedContainerMarkers,``);if(this.rules.block.fences.test(e)||this.rules.block.heading.test(e)||this.rules.block.hr.test(e))break}let e=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(p)&&this.rules.block.lheading.test(`${f}
34
+ ${p}`)?` ${u.replace(/^ {0,3}/,``)}`:p;a+=`
35
+ `+e,c=!0}m=!p.trim(),e=e.substring(l.length+1),f=u.slice(h)}}let ee=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(ee)&&(c=!0)),o.items.push({type:`list_item`,raw:ee,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=_n(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&yn(t[2],`()`)!==-1)return;let e=vn(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:K(t[0],`
36
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=gn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
37
+ `):[],a={type:`table`,raw:K(t[0],`
38
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(gn(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:K(t[0],`
39
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
40
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&On(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=K(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=yn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=K(t[0].slice(0,-1),`\\`);if((t[0].length-i.length)%2==0)return;let a=t[2],o=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(a);e&&(a=e[1],o=e[3])}else o=t[3]?t[3].slice(1,-1):``;return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(a=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a.slice(1):a.slice(1,-1)),En(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,`$1`),title:o&&o.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&On(e,n[1],r,this.rules))return;let i=t[vn(n[2]||n[1])];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return En(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],a=n===i,o=t.length-e.length,s=o;for(;!this.options.pedantic&&s>0&&t[s-1]===i;)s--;let c=[...t.slice(Math.max(0,s-2),s)].at(-1)??``,l=c===`*`||c===`_`||!!this.rules.inline.punctuation.exec(c);s<o&&(n=c);let u=s<o?l:n===`*`||n===`_`||!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||``;if(!d||!n||u){let n=[...r[0]].length-1,u,f,p=n,m=0,h=o-s+n,ee=!this.options.pedantic&&!!c.trim()&&(!!d||i===`*`&&!l);if(i!==`*`&&i!==`_`)return;let te=i===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,ne=Cn(this,t,i),g=t.length-e.length+n;if(ne<g)return;t=t.slice(-1*e.length+n);let re=ne-g;for(te.lastIndex=0;(r=te.exec(t))!==null&&!(r.index>re);){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;if(f=[...u].length,r[3]||r[4]){p+=f;continue}if(r[5]||r[6]||ee){if(a&&(r[5]||r[6]))break;if(h%3&&!((h+f)%3)){m+=f;continue}}if(p-=f,p>0)continue;f=Math.min(f,f+p+m);let t=[...r[0]][0].length,i=e.slice(0,n+r.index+t+f);if(Math.min(n,f)%2){let e=i.slice(1,-1);return{type:`em`,raw:i,text:e,tokens:this.lexer.inlineTokens(e)}}let o=i.slice(2,-2);return{type:`strong`,raw:i,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim,c=wn(this,t),l=t.length-e.length+n;if(c<l)return;t=t.slice(-1*e.length+n);let u=c-l;for(s.lastIndex=0;(r=s.exec(t))!==null&&!(r.index>u);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:mn(t[0]),escaped:e}}}},J=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||E,this.options.tokenizer=this.options.tokenizer||new kn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:A,block:dn.normal,inline:W.normal};this.options.pedantic?(t.block=dn.pedantic,t.inline=W.pedantic):this.options.gfm&&(t.block=dn.gfm,t.inline=this.options.breaks?W.breaks:W.gfm),this.tokenizer.rules=t}static get rules(){return{block:dn,inline:W}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(A.carriageReturn,`
41
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this;let r=this.state.lastToken;this.options.pedantic&&(e=e.replace(A.tabCharGlobal,` `).replace(A.spaceLine,``));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}this.state.lastToken=t.at(-1);let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
42
+ `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
43
+ `)?``:`
44
+ `)+r.raw,n.text+=`
45
+ `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
46
+ `)?``:`
47
+ `)+r.raw,n.text+=`
48
+ `+r.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let i=t.at(-1);n&&i?.type===`paragraph`?(i.raw+=(i.raw.endsWith(`
49
+ `)?``:`
50
+ `)+r.raw,i.text+=`
51
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(r),n=a.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
52
+ `)?``:`
53
+ `)+r.raw,n.text+=`
54
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,vn(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes(`*`)||e.includes(`_`)||e.includes(`~`)||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==kn.prototype.emStrong||this.tokenizer.del!==kn.prototype.del?this.#r(e):e;xn(this.tokenizer,n);try{return this.#t(e,n,t)}finally{Sn(this.tokenizer)}}#t(e,t,n){let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(t=>(o=t.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);o.type===`text`&&t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}if((o=this.tokenizer.emStrong(e,t,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,t,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let{blockSkip:t,tag:n,autolink:r}=this.tokenizer.rules.inline,i=``,a=0,o;for(t.lastIndex=0;o=t.exec(e);){let s=o.index+(o[2]?o[2].length:0),c=o.index+o[0].length;if(e.charAt(s)===`<`){let i=e.slice(s),a=n.exec(i)||r.exec(i);if(!a){t.lastIndex=s+1;continue}c=s+a[0].length,t.lastIndex=c}i+=e.slice(a,s)+`[`+`a`.repeat(c-s-2)+`]`,a=c}return i+e.slice(a)}#r(e){let t=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,vn(t.slice(r+1,-1))))return t;if(r>1&&t.charAt(0)!==`!`){let i=t.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,n)+`][`+`a`.repeat(t.length-r-2)+`]`}return`[`+`a`.repeat(t.length-2)+`]`};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),t=this.#n(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},An=class{options;parser;constructor(e){this.options=e||E}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(A.notSpaceStart)?.[0],i=e?e.replace(A.endingNewline,``)+`
55
+ `:``;return r?`<pre><code class="language-`+G(r)+`">`+(n?i:G(i,!0))+`</code></pre>
56
+ `:`<pre><code>`+(n?i:G(i,!0))+`</code></pre>
57
+ `}blockquote({tokens:e}){return`<blockquote>
58
+ ${this.parser.parse(e)}</blockquote>
59
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
60
+ `}hr(e){return`<hr>
61
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
62
+ `+r+`</`+i+`>
63
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
64
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
65
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
66
+ <thead>
67
+ `+t+`</thead>
68
+ `+r+`</table>
69
+ `}tablerow({text:e}){return`<tr>
70
+ ${e}</tr>
71
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
72
+ `}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>${G(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?G(n,!0):this.parser.parseInline(r),o=hn(e);if(o===null)return a;e=G(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+G(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=hn(e);if(i===null)return G(n);e=i;let a=`<img src="${G(e)}" alt="${G(n)}"`;return t&&(a+=` title="${G(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:G(e.text)}},jn=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`
73
+ `}checkbox({raw:e}){return e}},Y=class e{options;renderer;textRenderer;constructor(e){this.options=e||E,this.options.renderer=this.options.renderer||new An,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jn,this.textRenderer.parser=this}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===!1?``: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===!1?``: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}},Mn=class{options;block;constructor(e){this.options=e||E}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?J.lex:J.lexInline}provideParser(e=this.block){return e?Y.parse:Y.parseInline}};function X(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var Nn=class{defaults=ot();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Y;Renderer=An;TextRenderer=jn;Lexer=J;Tokenizer=kn;Hooks=Mn;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(X(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)X(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)X(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;X(n,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);X(n,this.walkTokens(i,t))}):e.tokens&&X(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};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 An(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===!1?``:n??``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new kn(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 Mn;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]=Mn.passThroughHooks.has(n)?e=>{if(t.options.async&&Mn.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(t.options.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 X(n,r.call(this,e)),t&&X(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return J.lex(e,t??this.defaults)}parser(e,t){return Y.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?J.lex:J.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?Y.parse:Y.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?J.lex:J.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?Y.parse:Y.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+=`
74
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+G(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},Z=new Nn;function Q(e,t){return Z.parse(e,t)}Q.options=Q.setOptions=function(e){return Z.setOptions(e),Q.defaults=Z.defaults,st(Q.defaults),Q},Q.getDefaults=ot,Q.defaults=E;function Pn(...e){return Z.use(...e),Q.defaults=Z.defaults,st(Q.defaults),Q}Q.use=Pn,Q.walkTokens=function(e,t){return Z.walkTokens(e,t)},Q.parseInline=Z.parseInline,Q.Parser=Y,Q.parser=Y.parse,Q.Renderer=An,Q.TextRenderer=jn,Q.Lexer=J,Q.lexer=J.lex,Q.Tokenizer=kn,Q.Hooks=Mn,Q.parse=Q,Q.options,Q.setOptions,Q.walkTokens,Q.parseInline,Y.parse,J.lex;export{Q as n,T as r,Nn as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{s as t}from"./vendor-diff-Dm2YfgXt.js";var n=e(t(),1),r={x:0,y:0,width:0,height:0,unit:`px`},i=(e,t,n)=>Math.min(Math.max(e,t),n),a=(...e)=>e.filter(e=>e&&typeof e==`string`).join(` `),o=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function s(e,t,n){return e.unit===`%`?{...r,...e,unit:`%`}:{unit:`%`,x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function c(e,t,n){return!e.unit||e.unit===`px`?{...r,...e,unit:`px`}:{unit:`px`,x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}}function l(e,t,n,r,i,a=0,o=0,s=r,c=i){let l={...e},u=Math.min(a,r),d=Math.min(o,i),f=Math.min(s,r),p=Math.min(c,i);t&&(t>1?(u=o?o*t:u,d=u/t,f=s*t):(d=a?a/t:d,u=d*t,p=c/t)),l.y<0&&(l.height=Math.max(l.height+l.y,d),l.y=0),l.x<0&&(l.width=Math.max(l.width+l.x,u),l.x=0);let m=r-(l.x+l.width);m<0&&(l.x=Math.min(l.x,r-u),l.width+=m);let h=i-(l.y+l.height);if(h<0&&(l.y=Math.min(l.y,i-d),l.height+=h),l.width<u&&((n===`sw`||n==`nw`)&&(l.x-=u-l.width),l.width=u),l.height<d&&((n===`nw`||n==`ne`)&&(l.y-=d-l.height),l.height=d),l.width>f&&((n===`sw`||n==`nw`)&&(l.x-=f-l.width),l.width=f),l.height>p&&((n===`nw`||n==`ne`)&&(l.y-=p-l.height),l.height=p),t){let e=l.width/l.height;if(e<t){let e=Math.max(l.width/t,d);(n===`nw`||n==`ne`)&&(l.y-=e-l.height),l.height=e}else if(e>t){let e=Math.max(l.height*t,u);(n===`sw`||n==`nw`)&&(l.x-=e-l.width),l.width=e}}return l}function u(e,t,n,r){let i={...e};return t===`ArrowLeft`?r===`nw`?(i.x-=n,i.y-=n,i.width+=n,i.height+=n):r===`w`?(i.x-=n,i.width+=n):r===`sw`?(i.x-=n,i.width+=n,i.height+=n):r===`ne`?(i.y+=n,i.width-=n,i.height-=n):r===`e`?i.width-=n:r===`se`&&(i.width-=n,i.height-=n):t===`ArrowRight`&&(r===`nw`?(i.x+=n,i.y+=n,i.width-=n,i.height-=n):r===`w`?(i.x+=n,i.width-=n):r===`sw`?(i.x+=n,i.width-=n,i.height-=n):r===`ne`?(i.y-=n,i.width+=n,i.height+=n):r===`e`?i.width+=n:r===`se`&&(i.width+=n,i.height+=n)),t===`ArrowUp`?r===`nw`?(i.x-=n,i.y-=n,i.width+=n,i.height+=n):r===`n`?(i.y-=n,i.height+=n):r===`ne`?(i.y-=n,i.width+=n,i.height+=n):r===`sw`?(i.x+=n,i.width-=n,i.height-=n):r===`s`?i.height-=n:r===`se`&&(i.width-=n,i.height-=n):t===`ArrowDown`&&(r===`nw`?(i.x+=n,i.y+=n,i.width-=n,i.height-=n):r===`n`?(i.y+=n,i.height-=n):r===`ne`?(i.y+=n,i.width-=n,i.height-=n):r===`sw`?(i.x-=n,i.width+=n,i.height+=n):r===`s`?i.height+=n:r===`se`&&(i.width+=n,i.height+=n)),i}var d={capture:!0,passive:!1},f=0,p=class e extends n.PureComponent{static xOrds=[`e`,`w`];static yOrds=[`n`,`s`];static xyOrds=[`nw`,`ne`,`se`,`sw`];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:`Use the arrow keys to move the crop selection area`,nwDragHandle:`Use the arrow keys to move the north west drag handle to change the crop selection area`,nDragHandle:`Use the up and down arrow keys to move the north drag handle to change the crop selection area`,neDragHandle:`Use the arrow keys to move the north east drag handle to change the crop selection area`,eDragHandle:`Use the up and down arrow keys to move the east drag handle to change the crop selection area`,seDragHandle:`Use the arrow keys to move the south east drag handle to change the crop selection area`,sDragHandle:`Use the up and down arrow keys to move the south drag handle to change the crop selection area`,swDragHandle:`Use the arrow keys to move the south west drag handle to change the crop selection area`,wDragHandle:`Use the up and down arrow keys to move the west drag handle to change the crop selection area`}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,n.createRef)();mediaRef=(0,n.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${f++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:n,width:r,height:i}=e.getBoundingClientRect();return{x:t,y:n,width:r,height:i}}componentDidUpdate(e){let{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){let{width:e,height:r}=this.getBox();e&&r&&n(c(t,e,r),s(t,e,r))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener(`pointermove`,this.onDocPointerMove,d),this.document.addEventListener(`pointerup`,this.onDocPointerDone,d),this.document.addEventListener(`pointercancel`,this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener(`pointermove`,this.onDocPointerMove,d),this.document.removeEventListener(`pointerup`,this.onDocPointerDone,d),this.document.removeEventListener(`pointercancel`,this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:n}=this.props,r=this.getBox();if(!t)return;let i=c(t,r.width,r.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=!!a,s=e.clientX,l=e.clientY,u=i.x,d=i.y;if(a){let t=e.clientX-r.x,n=e.clientY-r.y,o=0,c=0;a===`ne`||a==`e`?(o=t-(i.x+i.width),c=n-i.y,u=i.x,d=i.y+i.height):a===`se`||a===`s`?(o=t-(i.x+i.width),c=n-(i.y+i.height),u=i.x,d=i.y):a===`sw`||a==`w`?(o=t-i.x,c=n-(i.y+i.height),u=i.x+i.width,d=i.y):(a===`nw`||a==`n`)&&(o=t-i.x,c=n-i.y,u=i.x+i.width,d=i.y+i.height),s=u+r.x+o,l=d+r.y+c}this.evData={startClientX:s,startClientY:l,startCropX:u,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:o,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:n,locked:r,keepSelection:i,onChange:a}=this.props,o=this.getBox();if(n||r||i&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-o.x,u=e.clientY-o.y,d={unit:`px`,x:l,y:u,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:u,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(c(d,o.width,o.height),s(d,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let{crop:t,disabled:n,onChange:r,onDragStart:i}=this.props,a=this.getBox();if(n||!t||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,i&&i(e));let{evData:l}=this;l.clientX=e.clientX,l.clientY=e.clientY;let u;u=l.isResize?this.resizeCrop():this.dragCrop(),o(t,u)||r(c(u,a.width,a.height),s(u,a.width,a.height))};onComponentKeyDown=t=>{let{crop:n,disabled:r,onChange:a,onComplete:o}=this.props;if(r)return;let l=t.key,u=!1;if(!n)return;let d=this.getBox(),f=this.makePixelCrop(d),p=(navigator.platform.match(`Mac`)?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if(l===`ArrowLeft`?(f.x-=p,u=!0):l===`ArrowRight`?(f.x+=p,u=!0):l===`ArrowUp`?(f.y-=p,u=!0):l===`ArrowDown`&&(f.y+=p,u=!0),u){t.cancelable&&t.preventDefault(),f.x=i(f.x,0,d.width-f.width),f.y=i(f.y,0,d.height-f.height);let e=c(f,d.width,d.height),n=s(f,d.width,d.height);a(e,n),o&&o(e,n)}};onHandlerKeyDown=(t,n)=>{let{aspect:r=0,crop:i,disabled:a,minWidth:d=0,minHeight:f=0,maxWidth:p,maxHeight:m,onChange:h,onComplete:g}=this.props,_=this.getBox();if(a||!i)return;if(t.key===`ArrowUp`||t.key===`ArrowDown`||t.key===`ArrowLeft`||t.key===`ArrowRight`)t.stopPropagation(),t.preventDefault();else return;let v=(navigator.platform.match(`Mac`)?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,y=l(u(c(i,_.width,_.height),t.key,v,n),r,n,_.width,_.height,d,f,p,m);if(!o(i,y)){let e=s(y,_.width,_.height);h(y,e),g&&g(y,e)}};onDocPointerDone=e=>{let{crop:t,disabled:n,onComplete:r,onDragEnd:i}=this.props,a=this.getBox();this.unbindDocMove(),!n&&t&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),r&&r(c(t,a.width,a.height),s(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),n=this.makePixelCrop(t),r=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return n.x=i(e.startCropX+r,0,t.width-n.width),n.y=i(e.startCropY+a,0,t.height-n.height),n}getPointRegion(e,t,n,r){let{evData:i}=this,a=i.clientX-e.x,o=i.clientY-e.y,s;s=r&&t?t===`nw`||t===`n`||t===`ne`:o<i.startCropY;let c;return c=n&&t?t===`nw`||t===`w`||t===`sw`:a<i.startCropX,c?s?`nw`:`sw`:s?`ne`:`se`}resolveMinDimensions(e,t,n=0,r=0){let i=Math.min(n,e.width),a=Math.min(r,e.height);return!t||!i&&!a?[i,a]:t>1?i?[i,i/t]:[a*t,a]:a?[a*t,a]:[i,i/t]}resizeCrop(){let{evData:t}=this,{aspect:n=0,maxWidth:r,maxHeight:a}=this.props,o=this.getBox(),[s,c]=this.resolveMinDimensions(o,n,this.props.minWidth,this.props.minHeight),u=this.makePixelCrop(o),d=this.getPointRegion(o,t.ord,s,c),f=t.ord||d,p=t.clientX-t.startClientX,m=t.clientY-t.startClientY;(s&&f===`nw`||f===`w`||f===`sw`)&&(p=Math.min(p,-s)),(c&&f===`nw`||f===`n`||f===`ne`)&&(m=Math.min(m,-c));let h={unit:`px`,x:0,y:0,width:0,height:0};d===`ne`?(h.x=t.startCropX,h.width=p,n?(h.height=h.width/n,h.y=t.startCropY-h.height):(h.height=Math.abs(m),h.y=t.startCropY-h.height)):d===`se`?(h.x=t.startCropX,h.y=t.startCropY,h.width=p,h.height=n?h.width/n:m):d===`sw`?(h.x=t.startCropX+p,h.y=t.startCropY,h.width=Math.abs(p),h.height=n?h.width/n:m):d===`nw`&&(h.x=t.startCropX+p,h.width=Math.abs(p),n?(h.height=h.width/n,h.y=t.startCropY-h.height):(h.height=Math.abs(m),h.y=t.startCropY+m));let g=l(h,n,d,o.width,o.height,s,c,r,a);return n||e.xyOrds.indexOf(f)>-1?u=g:e.xOrds.indexOf(f)>-1?(u.x=g.x,u.width=g.width):e.yOrds.indexOf(f)>-1&&(u.y=g.y,u.height=g.height),u.x=i(u.x,0,o.width-u.width),u.y=i(u.y,0,o.height-u.height),u}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:i,renderSelectionAddon:a,ruleOfThirds:o,crop:s}=this.props,c=this.getCropStyle();if(s)return n.createElement(`div`,{style:c,className:`ReactCrop__crop-selection`,onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:`group`},!r&&!i&&n.createElement(`div`,{className:`ReactCrop__drag-elements`,onFocus:this.onDragFocus},n.createElement(`div`,{className:`ReactCrop__drag-bar ord-n`,"data-ord":`n`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-e`,"data-ord":`e`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-s`,"data-ord":`s`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-w`,"data-ord":`w`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-nw`,"data-ord":`nw`,tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`nw`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-n`,"data-ord":`n`,tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`n`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-ne`,"data-ord":`ne`,tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`ne`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-e`,"data-ord":`e`,tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`e`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-se`,"data-ord":`se`,tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`se`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-s`,"data-ord":`s`,tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`s`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-sw`,"data-ord":`sw`,tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`sw`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-w`,"data-ord":`w`,tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`w`),role:`button`})),a&&n.createElement(`div`,{className:`ReactCrop__selection-addon`,onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&n.createElement(n.Fragment,null,n.createElement(`div`,{className:`ReactCrop__rule-of-thirds-hz`}),n.createElement(`div`,{className:`ReactCrop__rule-of-thirds-vt`})))}makePixelCrop(e){return c({...r,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:i,crop:o,disabled:s,locked:c,style:l,ruleOfThirds:u}=this.props,{cropIsActive:d,newCropIsBeingDrawn:f}=this.state,p=o?this.renderCropSelection():null,m=a(`ReactCrop`,i,d&&`ReactCrop--active`,s&&`ReactCrop--disabled`,c&&`ReactCrop--locked`,f&&`ReactCrop--new-crop`,o&&e&&`ReactCrop--fixed-aspect`,o&&r&&`ReactCrop--circular-crop`,o&&u&&`ReactCrop--rule-of-thirds`,!this.dragStarted&&o&&!o.width&&!o.height&&`ReactCrop--invisible-crop`,r&&`ReactCrop--no-animate`);return n.createElement(`div`,{ref:this.componentRef,className:m,style:l},n.createElement(`div`,{ref:this.mediaRef,className:`ReactCrop__child-wrapper`,onPointerDown:this.onComponentPointerDown},t),o?n.createElement(`svg`,{className:`ReactCrop__crop-mask`,width:`100%`,height:`100%`},n.createElement(`defs`,null,n.createElement(`mask`,{id:`hole-${this.instanceId}`},n.createElement(`rect`,{width:`100%`,height:`100%`,fill:`white`}),r?n.createElement(`ellipse`,{cx:`${o.x+o.width/2}${o.unit}`,cy:`${o.y+o.height/2}${o.unit}`,rx:`${o.width/2}${o.unit}`,ry:`${o.height/2}${o.unit}`,fill:`black`}):n.createElement(`rect`,{x:`${o.x}${o.unit}`,y:`${o.y}${o.unit}`,width:`${o.width}${o.unit}`,height:`${o.height}${o.unit}`,fill:`black`}))),n.createElement(`rect`,{fill:`black`,fillOpacity:.5,width:`100%`,height:`100%`,mask:`url(#hole-${this.instanceId})`})):void 0,p)}};export{p as t};
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{s as t}from"./vendor-diff-DGCTJYJ4.js";var n=e(t(),1),r={x:0,y:0,width:0,height:0,unit:`px`},i=(e,t,n)=>Math.min(Math.max(e,t),n),a=(...e)=>e.filter(e=>e&&typeof e==`string`).join(` `),o=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function s(e,t,n){return e.unit===`%`?{...r,...e,unit:`%`}:{unit:`%`,x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function c(e,t,n){return!e.unit||e.unit===`px`?{...r,...e,unit:`px`}:{unit:`px`,x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}}function l(e,t,n,r,i,a=0,o=0,s=r,c=i){let l={...e},u=Math.min(a,r),d=Math.min(o,i),f=Math.min(s,r),p=Math.min(c,i);t&&(t>1?(u=o?o*t:u,d=u/t,f=s*t):(d=a?a/t:d,u=d*t,p=c/t)),l.y<0&&(l.height=Math.max(l.height+l.y,d),l.y=0),l.x<0&&(l.width=Math.max(l.width+l.x,u),l.x=0);let m=r-(l.x+l.width);m<0&&(l.x=Math.min(l.x,r-u),l.width+=m);let h=i-(l.y+l.height);if(h<0&&(l.y=Math.min(l.y,i-d),l.height+=h),l.width<u&&((n===`sw`||n==`nw`)&&(l.x-=u-l.width),l.width=u),l.height<d&&((n===`nw`||n==`ne`)&&(l.y-=d-l.height),l.height=d),l.width>f&&((n===`sw`||n==`nw`)&&(l.x-=f-l.width),l.width=f),l.height>p&&((n===`nw`||n==`ne`)&&(l.y-=p-l.height),l.height=p),t){let e=l.width/l.height;if(e<t){let e=Math.max(l.width/t,d);(n===`nw`||n==`ne`)&&(l.y-=e-l.height),l.height=e}else if(e>t){let e=Math.max(l.height*t,u);(n===`sw`||n==`nw`)&&(l.x-=e-l.width),l.width=e}}return l}function u(e,t,n,r){let i={...e};return t===`ArrowLeft`?r===`nw`?(i.x-=n,i.y-=n,i.width+=n,i.height+=n):r===`w`?(i.x-=n,i.width+=n):r===`sw`?(i.x-=n,i.width+=n,i.height+=n):r===`ne`?(i.y+=n,i.width-=n,i.height-=n):r===`e`?i.width-=n:r===`se`&&(i.width-=n,i.height-=n):t===`ArrowRight`&&(r===`nw`?(i.x+=n,i.y+=n,i.width-=n,i.height-=n):r===`w`?(i.x+=n,i.width-=n):r===`sw`?(i.x+=n,i.width-=n,i.height-=n):r===`ne`?(i.y-=n,i.width+=n,i.height+=n):r===`e`?i.width+=n:r===`se`&&(i.width+=n,i.height+=n)),t===`ArrowUp`?r===`nw`?(i.x-=n,i.y-=n,i.width+=n,i.height+=n):r===`n`?(i.y-=n,i.height+=n):r===`ne`?(i.y-=n,i.width+=n,i.height+=n):r===`sw`?(i.x+=n,i.width-=n,i.height-=n):r===`s`?i.height-=n:r===`se`&&(i.width-=n,i.height-=n):t===`ArrowDown`&&(r===`nw`?(i.x+=n,i.y+=n,i.width-=n,i.height-=n):r===`n`?(i.y+=n,i.height-=n):r===`ne`?(i.y+=n,i.width-=n,i.height-=n):r===`sw`?(i.x-=n,i.width+=n,i.height+=n):r===`s`?i.height+=n:r===`se`&&(i.width+=n,i.height+=n)),i}var d={capture:!0,passive:!1},f=0,p=class e extends n.PureComponent{static xOrds=[`e`,`w`];static yOrds=[`n`,`s`];static xyOrds=[`nw`,`ne`,`se`,`sw`];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:`Use the arrow keys to move the crop selection area`,nwDragHandle:`Use the arrow keys to move the north west drag handle to change the crop selection area`,nDragHandle:`Use the up and down arrow keys to move the north drag handle to change the crop selection area`,neDragHandle:`Use the arrow keys to move the north east drag handle to change the crop selection area`,eDragHandle:`Use the up and down arrow keys to move the east drag handle to change the crop selection area`,seDragHandle:`Use the arrow keys to move the south east drag handle to change the crop selection area`,sDragHandle:`Use the up and down arrow keys to move the south drag handle to change the crop selection area`,swDragHandle:`Use the arrow keys to move the south west drag handle to change the crop selection area`,wDragHandle:`Use the up and down arrow keys to move the west drag handle to change the crop selection area`}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,n.createRef)();mediaRef=(0,n.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${f++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:n,width:r,height:i}=e.getBoundingClientRect();return{x:t,y:n,width:r,height:i}}componentDidUpdate(e){let{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){let{width:e,height:r}=this.getBox();e&&r&&n(c(t,e,r),s(t,e,r))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener(`pointermove`,this.onDocPointerMove,d),this.document.addEventListener(`pointerup`,this.onDocPointerDone,d),this.document.addEventListener(`pointercancel`,this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener(`pointermove`,this.onDocPointerMove,d),this.document.removeEventListener(`pointerup`,this.onDocPointerDone,d),this.document.removeEventListener(`pointercancel`,this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:n}=this.props,r=this.getBox();if(!t)return;let i=c(t,r.width,r.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=!!a,s=e.clientX,l=e.clientY,u=i.x,d=i.y;if(a){let t=e.clientX-r.x,n=e.clientY-r.y,o=0,c=0;a===`ne`||a==`e`?(o=t-(i.x+i.width),c=n-i.y,u=i.x,d=i.y+i.height):a===`se`||a===`s`?(o=t-(i.x+i.width),c=n-(i.y+i.height),u=i.x,d=i.y):a===`sw`||a==`w`?(o=t-i.x,c=n-(i.y+i.height),u=i.x+i.width,d=i.y):(a===`nw`||a==`n`)&&(o=t-i.x,c=n-i.y,u=i.x+i.width,d=i.y+i.height),s=u+r.x+o,l=d+r.y+c}this.evData={startClientX:s,startClientY:l,startCropX:u,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:o,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:n,locked:r,keepSelection:i,onChange:a}=this.props,o=this.getBox();if(n||r||i&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-o.x,u=e.clientY-o.y,d={unit:`px`,x:l,y:u,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:u,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(c(d,o.width,o.height),s(d,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let{crop:t,disabled:n,onChange:r,onDragStart:i}=this.props,a=this.getBox();if(n||!t||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,i&&i(e));let{evData:l}=this;l.clientX=e.clientX,l.clientY=e.clientY;let u;u=l.isResize?this.resizeCrop():this.dragCrop(),o(t,u)||r(c(u,a.width,a.height),s(u,a.width,a.height))};onComponentKeyDown=t=>{let{crop:n,disabled:r,onChange:a,onComplete:o}=this.props;if(r)return;let l=t.key,u=!1;if(!n)return;let d=this.getBox(),f=this.makePixelCrop(d),p=(navigator.platform.match(`Mac`)?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if(l===`ArrowLeft`?(f.x-=p,u=!0):l===`ArrowRight`?(f.x+=p,u=!0):l===`ArrowUp`?(f.y-=p,u=!0):l===`ArrowDown`&&(f.y+=p,u=!0),u){t.cancelable&&t.preventDefault(),f.x=i(f.x,0,d.width-f.width),f.y=i(f.y,0,d.height-f.height);let e=c(f,d.width,d.height),n=s(f,d.width,d.height);a(e,n),o&&o(e,n)}};onHandlerKeyDown=(t,n)=>{let{aspect:r=0,crop:i,disabled:a,minWidth:d=0,minHeight:f=0,maxWidth:p,maxHeight:m,onChange:h,onComplete:g}=this.props,_=this.getBox();if(a||!i)return;if(t.key===`ArrowUp`||t.key===`ArrowDown`||t.key===`ArrowLeft`||t.key===`ArrowRight`)t.stopPropagation(),t.preventDefault();else return;let v=(navigator.platform.match(`Mac`)?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,y=l(u(c(i,_.width,_.height),t.key,v,n),r,n,_.width,_.height,d,f,p,m);if(!o(i,y)){let e=s(y,_.width,_.height);h(y,e),g&&g(y,e)}};onDocPointerDone=e=>{let{crop:t,disabled:n,onComplete:r,onDragEnd:i}=this.props,a=this.getBox();this.unbindDocMove(),!n&&t&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),r&&r(c(t,a.width,a.height),s(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),n=this.makePixelCrop(t),r=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return n.x=i(e.startCropX+r,0,t.width-n.width),n.y=i(e.startCropY+a,0,t.height-n.height),n}getPointRegion(e,t,n,r){let{evData:i}=this,a=i.clientX-e.x,o=i.clientY-e.y,s;s=r&&t?t===`nw`||t===`n`||t===`ne`:o<i.startCropY;let c;return c=n&&t?t===`nw`||t===`w`||t===`sw`:a<i.startCropX,c?s?`nw`:`sw`:s?`ne`:`se`}resolveMinDimensions(e,t,n=0,r=0){let i=Math.min(n,e.width),a=Math.min(r,e.height);return!t||!i&&!a?[i,a]:t>1?i?[i,i/t]:[a*t,a]:a?[a*t,a]:[i,i/t]}resizeCrop(){let{evData:t}=this,{aspect:n=0,maxWidth:r,maxHeight:a}=this.props,o=this.getBox(),[s,c]=this.resolveMinDimensions(o,n,this.props.minWidth,this.props.minHeight),u=this.makePixelCrop(o),d=this.getPointRegion(o,t.ord,s,c),f=t.ord||d,p=t.clientX-t.startClientX,m=t.clientY-t.startClientY;(s&&f===`nw`||f===`w`||f===`sw`)&&(p=Math.min(p,-s)),(c&&f===`nw`||f===`n`||f===`ne`)&&(m=Math.min(m,-c));let h={unit:`px`,x:0,y:0,width:0,height:0};d===`ne`?(h.x=t.startCropX,h.width=p,n?(h.height=h.width/n,h.y=t.startCropY-h.height):(h.height=Math.abs(m),h.y=t.startCropY-h.height)):d===`se`?(h.x=t.startCropX,h.y=t.startCropY,h.width=p,h.height=n?h.width/n:m):d===`sw`?(h.x=t.startCropX+p,h.y=t.startCropY,h.width=Math.abs(p),h.height=n?h.width/n:m):d===`nw`&&(h.x=t.startCropX+p,h.width=Math.abs(p),n?(h.height=h.width/n,h.y=t.startCropY-h.height):(h.height=Math.abs(m),h.y=t.startCropY+m));let g=l(h,n,d,o.width,o.height,s,c,r,a);return n||e.xyOrds.indexOf(f)>-1?u=g:e.xOrds.indexOf(f)>-1?(u.x=g.x,u.width=g.width):e.yOrds.indexOf(f)>-1&&(u.y=g.y,u.height=g.height),u.x=i(u.x,0,o.width-u.width),u.y=i(u.y,0,o.height-u.height),u}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:i,renderSelectionAddon:a,ruleOfThirds:o,crop:s}=this.props,c=this.getCropStyle();if(s)return n.createElement(`div`,{style:c,className:`ReactCrop__crop-selection`,onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:`group`},!r&&!i&&n.createElement(`div`,{className:`ReactCrop__drag-elements`,onFocus:this.onDragFocus},n.createElement(`div`,{className:`ReactCrop__drag-bar ord-n`,"data-ord":`n`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-e`,"data-ord":`e`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-s`,"data-ord":`s`}),n.createElement(`div`,{className:`ReactCrop__drag-bar ord-w`,"data-ord":`w`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-nw`,"data-ord":`nw`,tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`nw`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-n`,"data-ord":`n`,tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`n`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-ne`,"data-ord":`ne`,tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`ne`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-e`,"data-ord":`e`,tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`e`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-se`,"data-ord":`se`,tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`se`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-s`,"data-ord":`s`,tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`s`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-sw`,"data-ord":`sw`,tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`sw`),role:`button`}),n.createElement(`div`,{className:`ReactCrop__drag-handle ord-w`,"data-ord":`w`,tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,`w`),role:`button`})),a&&n.createElement(`div`,{className:`ReactCrop__selection-addon`,onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&n.createElement(n.Fragment,null,n.createElement(`div`,{className:`ReactCrop__rule-of-thirds-hz`}),n.createElement(`div`,{className:`ReactCrop__rule-of-thirds-vt`})))}makePixelCrop(e){return c({...r,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:i,crop:o,disabled:s,locked:c,style:l,ruleOfThirds:u}=this.props,{cropIsActive:d,newCropIsBeingDrawn:f}=this.state,p=o?this.renderCropSelection():null,m=a(`ReactCrop`,i,d&&`ReactCrop--active`,s&&`ReactCrop--disabled`,c&&`ReactCrop--locked`,f&&`ReactCrop--new-crop`,o&&e&&`ReactCrop--fixed-aspect`,o&&r&&`ReactCrop--circular-crop`,o&&u&&`ReactCrop--rule-of-thirds`,!this.dragStarted&&o&&!o.width&&!o.height&&`ReactCrop--invisible-crop`,r&&`ReactCrop--no-animate`);return n.createElement(`div`,{ref:this.componentRef,className:m,style:l},n.createElement(`div`,{ref:this.mediaRef,className:`ReactCrop__child-wrapper`,onPointerDown:this.onComponentPointerDown},t),o?n.createElement(`svg`,{className:`ReactCrop__crop-mask`,width:`100%`,height:`100%`},n.createElement(`defs`,null,n.createElement(`mask`,{id:`hole-${this.instanceId}`},n.createElement(`rect`,{width:`100%`,height:`100%`,fill:`white`}),r?n.createElement(`ellipse`,{cx:`${o.x+o.width/2}${o.unit}`,cy:`${o.y+o.height/2}${o.unit}`,rx:`${o.width/2}${o.unit}`,ry:`${o.height/2}${o.unit}`,fill:`black`}):n.createElement(`rect`,{x:`${o.x}${o.unit}`,y:`${o.y}${o.unit}`,width:`${o.width}${o.unit}`,height:`${o.height}${o.unit}`,fill:`black`}))),n.createElement(`rect`,{fill:`black`,fillOpacity:.5,width:`100%`,height:`100%`,mask:`url(#hole-${this.instanceId})`})):void 0,p)}};export{p as t};